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

added a test for correct start and termination

parent 172f33e6
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,16 @@ public class RunnableConsumerStageTest { ...@@ -54,6 +54,16 @@ public class RunnableConsumerStageTest {
thread.join(); thread.join();
} }
@Test
public void testCorrectStartAndTerminatation() throws Exception {
RunnableConsumerStageTestConfiguration configuration = new RunnableConsumerStageTestConfiguration(0, 1, 2, 3, 5);
final Analysis analysis = new Analysis(configuration);
start(analysis);
assertEquals(5, configuration.getCollectedElements().size());
}
// @Test // @Test
// public void testWaitingInfinitely() throws Exception { // public void testWaitingInfinitely() throws Exception {
// WaitStrategyConfiguration waitStrategyConfiguration = new WaitStrategyConfiguration(300, 42); // WaitStrategyConfiguration waitStrategyConfiguration = new WaitStrategyConfiguration(300, 42);
......
...@@ -16,7 +16,9 @@ public class RunnableConsumerStageTestConfiguration extends AnalysisConfiguratio ...@@ -16,7 +16,9 @@ public class RunnableConsumerStageTestConfiguration extends AnalysisConfiguratio
public RunnableConsumerStageTestConfiguration(final Integer... inputElements) { public RunnableConsumerStageTestConfiguration(final Integer... inputElements) {
InitialElementProducer<Integer> producer = new InitialElementProducer<Integer>(inputElements); InitialElementProducer<Integer> producer = new InitialElementProducer<Integer>(inputElements);
// addThreadableStage(producer); if (inputElements.length > 0) {
addThreadableStage(producer);
}
CollectorSink<Integer> collectorSink = new CollectorSink<Integer>(collectedElements); CollectorSink<Integer> collectorSink = new CollectorSink<Integer>(collectedElements);
addThreadableStage(collectorSink); addThreadableStage(collectorSink);
......
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