Search in sources :

Example 6 with DefaultChainContext

use of com.qlangtech.tis.exec.impl.DefaultChainContext in project tis by qlangtech.

the class TestReactor method testSequentialOrdering.

public void testSequentialOrdering() throws Exception {
    DefaultChainContext chainContext = TestIndexSwapTaskflowLauncher.createDumpAndJoinChainContext();
    TISReactor tisReactor = new TISReactor(chainContext, taskMap);
    Reactor s = tisReactor.buildSession("->a ->b a,b->c");
    // Reactor s = buildSession("->t1->m1 m1->t2->m2 m2->t3->", (session, id) ->
    // System.out.println(id));
    assertEquals(3, s.size());
    tisReactor.execute(Executors.newCachedThreadPool(), s, new ReactorListener() {
    });
    System.out.println("last");
    for (String taskname : Lists.newArrayList("a", "b", "c")) {
        Assert.assertNotNull("taskname:" + taskname + " shall have execute", successToken.get(taskname));
        Assert.assertTrue("taskname:" + taskname + " shall have execute", successToken.get(taskname));
    }
// assertEqualsIgnoreNewlineStyle(
// "Started t1\nEnded t1\nAttained m1\nStarted t2\nEnded t2\nAttained
// m2\nStarted t3\nEnded t3\n", sw);
}
Also used : DefaultChainContext(com.qlangtech.tis.exec.impl.DefaultChainContext) Reactor(org.jvnet.hudson.reactor.Reactor) ReactorListener(org.jvnet.hudson.reactor.ReactorListener)

Aggregations

DefaultChainContext (com.qlangtech.tis.exec.impl.DefaultChainContext)6 ExecutePhaseRange (com.qlangtech.tis.exec.ExecutePhaseRange)2 TestParamContext (com.qlangtech.tis.fullbuild.taskflow.TestParamContext)2 ExecResult (com.qlangtech.tis.assemble.ExecResult)1 ExecuteResult (com.qlangtech.tis.exec.ExecuteResult)1 IDumpTable (com.qlangtech.tis.fullbuild.indexbuild.IDumpTable)1 ITabPartition (com.qlangtech.tis.fullbuild.indexbuild.ITabPartition)1 PhaseStatusCollection (com.qlangtech.tis.fullbuild.phasestatus.PhaseStatusCollection)1 DumpPhaseStatus (com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus)1 HttpExecContext (com.qlangtech.tis.fullbuild.servlet.impl.HttpExecContext)1 IParamContext (com.qlangtech.tis.order.center.IParamContext)1 TabPartitions (com.qlangtech.tis.sql.parser.TabPartitions)1 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 Reactor (org.jvnet.hudson.reactor.Reactor)1 ReactorListener (org.jvnet.hudson.reactor.ReactorListener)1