use of teetime.framework.Traverser in project TeeTime by teetime-framework.
the class IntraStageCollectorTest method testVisitedStages.
@Test
public void testVisitedStages() {
TestConfiguration config = new TestConfiguration();
IntraStageCollector collector = new IntraStageCollector(config.init);
Traverser traversor = new Traverser(collector);
traversor.traverse(config.init);
assertThat(collector.getIntraStages(), containsInAnyOrder(config.init, config.f2b, config.distributor));
}
use of teetime.framework.Traverser in project TeeTime by teetime-framework.
the class A2InvalidThreadAssignmentCheck method check.
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
public void check() {
int color = DEFAULT_COLOR;
ObjectIntMap<AbstractStage> colors = new ObjectIntHashMap<AbstractStage>();
ThreadPainter threadPainter = new ThreadPainter();
Traverser traverser = new Traverser(threadPainter);
for (AbstractStage threadableStage : threadableStages) {
color++;
colors.put(threadableStage, color);
threadPainter.reset(colors, color, threadableStages);
traverser.traverse(threadableStage);
}
}
use of teetime.framework.Traverser in project TeeTime by teetime-framework.
the class NextActiveStageShouldTerminate method isMet.
@Override
public boolean isMet() {
// traverse at runtime (!) until another active (consumer) stage was found
Traverser traverser = new Traverser(visitor, alwaysFalseCondition);
traverser.traverse(stage);
InputPort<?> inputPortOfActiveStage = visitor.getActiveConsumerStageInputPort();
AbstractStage activeStage = inputPortOfActiveStage.getOwningStage();
for (InputPort<?> inputPort : StageFacade.INSTANCE.getInputPorts(activeStage)) {
if (inputPort != inputPortOfActiveStage && !inputPort.isClosed()) {
return false;
}
}
return true;
}
use of teetime.framework.Traverser in project TeeTime by teetime-framework.
the class A1ThreadableStageCollectorTest method testVisit.
@Test
public void testVisit() throws Exception {
TestConfiguration config = new TestConfiguration();
Collection<AbstractStage> startStages = ConfigurationFacade.INSTANCE.getStartStages(config);
A1ThreadableStageCollector stageCollector = new A1ThreadableStageCollector();
Traverser traversor = new Traverser(stageCollector);
for (AbstractStage startStage : startStages) {
traversor.traverse(startStage);
}
Set<AbstractStage> newThreadableStages = stageCollector.getThreadableStages();
assertThat(newThreadableStages, hasSize(4));
}
Aggregations