Search in sources :

Example 21 with AbstractStage

use of teetime.framework.AbstractStage 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));
}
Also used : Traverser(teetime.framework.Traverser) TestConfiguration(teetime.framework.TestConfiguration) AbstractStage(teetime.framework.AbstractStage) Test(org.junit.Test)

Example 22 with AbstractStage

use of teetime.framework.AbstractStage in project TeeTime by teetime-framework.

the class PrioritizedTaskPoolTest method skipDeepestStageLevel.

@Test
public void skipDeepestStageLevel() throws Exception {
    threadPool.scheduleStage(producer);
    threadPool.scheduleStage(counter4);
    AbstractStage nextStage = threadPool.removeNextStage(3);
    assertThat(nextStage, is(producer));
}
Also used : AbstractStage(teetime.framework.AbstractStage) Test(org.junit.Test)

Example 23 with AbstractStage

use of teetime.framework.AbstractStage in project TeeTime by teetime-framework.

the class PrioritizedTaskPoolTest method nextStageIsDeepStageLevel.

@Test
public void nextStageIsDeepStageLevel() throws Exception {
    threadPool.scheduleStage(producer);
    boolean scheduled = threadPool.scheduleStage(counter4);
    assertThat(scheduled, is(true));
    AbstractStage nextStage = threadPool.removeNextStage();
    assertThat(nextStage, is(counter4));
}
Also used : AbstractStage(teetime.framework.AbstractStage) Test(org.junit.Test)

Aggregations

AbstractStage (teetime.framework.AbstractStage)23 Test (org.junit.Test)9 Traverser (teetime.framework.Traverser)3 StateChange (teetime.framework.performancelogging.StateChange)3 ObjectIntHashMap (com.carrotsearch.hppc.ObjectIntHashMap)1 Logger (org.slf4j.Logger)1 InstantiationPipe (teetime.framework.InstantiationPipe)1 TestConfiguration (teetime.framework.TestConfiguration)1 StageActivationState (teetime.framework.performancelogging.StateChange.StageActivationState)1 CollectorSink (teetime.stage.CollectorSink)1 InitialElementProducer (teetime.stage.InitialElementProducer)1 CreatePortActionDistributor (teetime.stage.basic.distributor.dynamic.CreatePortActionDistributor)1 CreatePortActionMerger (teetime.stage.basic.merger.dynamic.CreatePortActionMerger)1