Skip to content

Commit

Permalink
Added missing string test source class
Browse files Browse the repository at this point in the history
  • Loading branch information
delas committed Mar 25, 2022
1 parent 4dd3cfc commit 622484c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/beamline/sources/StringTestSource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package beamline.sources;

import beamline.events.BEvent;

public class StringTestSource extends BeamlineAbstractSource {

private static final long serialVersionUID = 7657971352128040279L;
private String[] traces;

public StringTestSource(String...traces) {
this.traces = traces;
}

@Override
public void run(SourceContext<BEvent> ctx) throws Exception {
for (int j = 0; j < traces.length; j++) {
for (int i = 0; i < traces[j].length(); i++) {
ctx.collect(BEvent.create("test-process", traces[j].substring(i, i+1), "case-"+j));
}
}
}
}

0 comments on commit 622484c

Please sign in to comment.