Skip to content
Snippets Groups Projects
Commit 3ae8c9bf authored by Christian Wulf's avatar Christian Wulf
Browse files

added assertion for exceptions

parent 075746c1
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ import static org.junit.Assert.assertThat;
import static teetime.framework.test.StageTester.test;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.junit.Before;
......@@ -32,6 +33,7 @@ import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.SingleElementPipeFactory;
import teetime.stage.CollectorSink;
import teetime.stage.InitialElementProducer;
import teetime.util.Pair;
/**
* @author Nils Christian Ehmke
......@@ -84,11 +86,13 @@ public class MergerTest {
mergerUnderTest = new Merger<Integer>(new RoundRobinStrategy());
List<Integer> outputList = new ArrayList<Integer>();
test(mergerUnderTest)
Collection<Pair<Thread, Throwable>> exceptions = test(mergerUnderTest)
.and().send(1, 2, 3).to(mergerUnderTest.getNewInputPort())
.and().send(4, 5, 6).to(mergerUnderTest.getNewInputPort())
.and().receive(outputList).from(mergerUnderTest.getOutputPort()).start();
.and().receive(outputList).from(mergerUnderTest.getOutputPort())
.start();
assertThat(exceptions, is(empty()));
assertThat(outputList, is(not(empty())));
assertThat(outputList, contains(1, 4, 2, 5, 3, 6));
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment