Package org.hive2hive.core.processes.framework.decorators

Examples of org.hive2hive.core.processes.framework.decorators.AsyncComponent.await()


    // succeeding process
    SequentialProcess process = new SequentialProcess();
    process.add(new BusySucceedingStep());
    AsyncComponent asyncProcess = new AsyncComponent(process);
    asyncProcess.start();
    asyncProcess.await();
    if (asyncProcess.getState() != ProcessState.SUCCEEDED)
      fail("Busy process should have finished. Await() did not block.");
    TestUtil.wait(TestUtil.DEFAULT_WAITING_TIME);
    assertTrue(asyncProcess.getState() == ProcessState.SUCCEEDED);
   
View Full Code Here


    // failing process
    SequentialProcess process2 = new SequentialProcess();
    process2.add(new BusyFailingStep());
    AsyncComponent asyncProcess2 = new AsyncComponent(process2);
    asyncProcess2.start();
    asyncProcess2.await();
    if (asyncProcess2.getState() != ProcessState.FAILED)
      fail("Busy process should have finished. Await() did not block.");
    TestUtil.wait(TestUtil.DEFAULT_WAITING_TIME);
    assertTrue(asyncProcess2.getState() == ProcessState.FAILED);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.