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

added test for new functionality in AnalysisConfiguration

parent 7ac290da
No related branches found
No related tags found
No related merge requests found
package teetime.framework;
import org.junit.Assert;
import org.junit.Test;
import teetime.stage.Clock;
import teetime.stage.Counter;
import teetime.stage.InitialElementProducer;
public class AnalysisConfigurationTest {
@Test
public void test1() {
AnalysisConfiguration config = new AnalysisConfiguration();
// Consumer -> BY_SIGNAL
Counter<String> counter = new Counter<String>();
config.addThreadableStage(counter);
// Infinite producer -> BY_INTERRUPT
Clock clock = new Clock();
config.addThreadableStage(clock);
// Finite Producer -> BY_SELF_DECISION
InitialElementProducer<Integer> producer = new InitialElementProducer<Integer>(1, 2, 3, 4);
config.addThreadableStage(producer);
config.init();
Assert.assertEquals(counter, config.getConsumerStages().toArray()[0]);
Assert.assertEquals(clock, config.getInfiniteProducerStages().toArray()[0]);
Assert.assertEquals(producer, config.getFiniteProducerStages().toArray()[0]);
}
}
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