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

updated tests to the new api

parent 3dd89605
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ public abstract class ConfigurationContext extends Configuration { ...@@ -66,7 +66,7 @@ public abstract class ConfigurationContext extends Configuration {
*/ */
@Override @Override
protected final void addThreadableStage(final Stage stage) { protected final void addThreadableStage(final Stage stage) {
if (this.threadableStages.add(stage)) { if (!this.threadableStages.add(stage)) {
LOGGER.warn("Stage " + stage.getId() + " was already marked as threadable stage."); LOGGER.warn("Stage " + stage.getId() + " was already marked as threadable stage.");
} }
} }
......
...@@ -47,8 +47,5 @@ public class CipherConfiguration extends ConfigurationContext { ...@@ -47,8 +47,5 @@ public class CipherConfiguration extends ConfigurationContext {
connectPorts(decomp.getOutputPort(), decrypt.getInputPort()); connectPorts(decomp.getOutputPort(), decrypt.getInputPort());
connectPorts(decrypt.getOutputPort(), writer.getInputPort()); connectPorts(decrypt.getOutputPort(), writer.getInputPort());
// this.getFiniteProducerStages().add(init);
this.addThreadableStage(init);
} }
} }
...@@ -50,7 +50,6 @@ public class TokenizerConfiguration extends ConfigurationContext { ...@@ -50,7 +50,6 @@ public class TokenizerConfiguration extends ConfigurationContext {
connectPorts(b2s.getOutputPort(), tokenizer.getInputPort()); connectPorts(b2s.getOutputPort(), tokenizer.getInputPort());
connectPorts(tokenizer.getOutputPort(), this.counter.getInputPort()); connectPorts(tokenizer.getOutputPort(), this.counter.getInputPort());
this.addThreadableStage(init);
} }
public int getTokenCount() { public int getTokenCount() {
......
...@@ -77,7 +77,6 @@ public class ExecutionTest { ...@@ -77,7 +77,6 @@ public class ExecutionTest {
final InitialElementProducer<String> init = new InitialElementProducer<String>("Hello"); final InitialElementProducer<String> init = new InitialElementProducer<String>("Hello");
delay = new DelayAndTerminate(DELAY_IN_MS); delay = new DelayAndTerminate(DELAY_IN_MS);
connectPorts(init.getOutputPort(), delay.getInputPort()); connectPorts(init.getOutputPort(), delay.getInputPort());
addThreadableStage(init);
} }
} }
...@@ -118,7 +117,6 @@ public class ExecutionTest { ...@@ -118,7 +117,6 @@ public class ExecutionTest {
public AnalysisTestConfig(final boolean inter) { public AnalysisTestConfig(final boolean inter) {
connectPorts(init.getOutputPort(), sink.getInputPort()); connectPorts(init.getOutputPort(), sink.getInputPort());
addThreadableStage(init);
if (inter) { if (inter) {
addThreadableStage(sink); addThreadableStage(sink);
} }
...@@ -145,7 +143,6 @@ public class ExecutionTest { ...@@ -145,7 +143,6 @@ public class ExecutionTest {
connectPorts(init.getOutputPort(), iof.getInputPort()); connectPorts(init.getOutputPort(), iof.getInputPort());
connectPorts(iof.getMatchedOutputPort(), sink.getInputPort()); connectPorts(iof.getMatchedOutputPort(), sink.getInputPort());
connectPorts(init.createOutputPort(), sink.createInputPort()); connectPorts(init.createOutputPort(), sink.createInputPort());
addThreadableStage(init);
addThreadableStage(iof); addThreadableStage(iof);
} }
} }
......
...@@ -61,7 +61,6 @@ public class StageTest { ...@@ -61,7 +61,6 @@ public class StageTest {
init = new InitialElementProducer<String>("Hello"); init = new InitialElementProducer<String>("Hello");
delay = new DelayAndTerminate(0); delay = new DelayAndTerminate(0);
connectPorts(init.getOutputPort(), delay.getInputPort()); connectPorts(init.getOutputPort(), delay.getInputPort());
addThreadableStage(init);
} }
} }
......
...@@ -91,7 +91,6 @@ public class TraversorTest { ...@@ -91,7 +91,6 @@ public class TraversorTest {
connectPorts(merger.getOutputPort(), result.getInputPort()); connectPorts(merger.getOutputPort(), result.getInputPort());
// Add the first and last part to the threadable stages // Add the first and last part to the threadable stages
addThreadableStage(init);
addThreadableStage(merger); addThreadableStage(merger);
} }
......
...@@ -32,6 +32,6 @@ public class ExceptionTestConfiguration extends ConfigurationContext { ...@@ -32,6 +32,6 @@ public class ExceptionTestConfiguration extends ConfigurationContext {
// this.addThreadableStage(new ExceptionTestStage()); // this.addThreadableStage(new ExceptionTestStage());
this.addThreadableStage(second); this.addThreadableStage(second);
// this.addThreadableStage(third); this.addThreadableStage(third);
} }
} }
...@@ -29,8 +29,8 @@ import java.util.List; ...@@ -29,8 +29,8 @@ import java.util.List;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.framework.Execution;
import teetime.framework.ConfigurationContext; import teetime.framework.ConfigurationContext;
import teetime.framework.Execution;
import teetime.framework.ExecutionException; import teetime.framework.ExecutionException;
import teetime.util.Pair; import teetime.util.Pair;
...@@ -134,7 +134,6 @@ public class InstanceOfFilterTest { ...@@ -134,7 +134,6 @@ public class InstanceOfFilterTest {
connectPorts(instanceOfFilter.getMatchedOutputPort(), clazzCollector.getInputPort()); connectPorts(instanceOfFilter.getMatchedOutputPort(), clazzCollector.getInputPort());
connectPorts(instanceOfFilter.getMismatchedOutputPort(), mismatchedCollector.getInputPort()); connectPorts(instanceOfFilter.getMismatchedOutputPort(), mismatchedCollector.getInputPort());
addThreadableStage(elementProducer);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment