Skip to content
Snippets Groups Projects
Commit 8e36ac2c authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

added Assertions

parent 4ca71e8c
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,7 @@ public final class Merger<T> extends AbstractStage {
if (set.size() == this.getInputPorts().length) {
signal.trigger(this);
// this.outputPort.sendSignal(signal);
this.outputPort.sendSignal(signal);
signalMap.remove(signal.getClass());
}
} else {
......
package teetime.stage;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.Map;
import org.junit.Test;
......@@ -10,17 +11,17 @@ import teetime.stage.util.CountingMap;
public class WordCountingTest {
@Test
@Test(timeout = 3000)
public void test1() {
WordCountingConfiguration wcc = new WordCountingConfiguration(3, new File("src/test/resources/data/output.txt"), new File(
int threads = 2;
WordCountingConfiguration wcc = new WordCountingConfiguration(threads, new File("src/test/resources/data/output.txt"), new File(
"src/test/resources/data/output.txt"));
Analysis analysis = new Analysis(wcc);
analysis.start();
CountingMap<String> map = wcc.getResult();
for (Map.Entry<String, Integer> entry : map.entrySet())
{
System.out.println(entry.getKey() + " " + entry.getValue());
}
assertEquals(new Integer(54), map.get("diam"));
assertEquals(new Integer(8), map.get("tation"));
assertEquals(new Integer(4), map.get("cum"));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment