Search in sources :

Example 1 with CompleteTaskThread

use of org.camunda.bpm.qa.upgrade.util.CompleteTaskThread in project camunda-bpm-platform by camunda.

the class NestedInterruptingEventSubprocessParallelScenarioTest method testInitSynchronization.

@Test
@ScenarioUnderTest("init.1")
public void testInitSynchronization() {
    // given
    Task eventSubProcessTask1 = rule.taskQuery().taskDefinitionKey("innerEventSubProcessTask1").singleResult();
    Task eventSubProcessTask2 = rule.taskQuery().taskDefinitionKey("innerEventSubProcessTask2").singleResult();
    // when
    CompleteTaskThread completeTaskThread1 = new CompleteTaskThread(eventSubProcessTask1.getId(), (ProcessEngineConfigurationImpl) rule.getProcessEngine().getProcessEngineConfiguration());
    CompleteTaskThread completeTaskThread2 = new CompleteTaskThread(eventSubProcessTask2.getId(), (ProcessEngineConfigurationImpl) rule.getProcessEngine().getProcessEngineConfiguration());
    completeTaskThread1.startAndWaitUntilControlIsReturned();
    completeTaskThread2.startAndWaitUntilControlIsReturned();
    completeTaskThread1.proceedAndWaitTillDone();
    completeTaskThread2.proceedAndWaitTillDone();
    // then
    Assert.assertNull(completeTaskThread1.getException());
    Assert.assertNotNull(completeTaskThread2.getException());
}
Also used : Task(org.camunda.bpm.engine.task.Task) CompleteTaskThread(org.camunda.bpm.qa.upgrade.util.CompleteTaskThread) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Aggregations

Task (org.camunda.bpm.engine.task.Task)1 ScenarioUnderTest (org.camunda.bpm.qa.upgrade.ScenarioUnderTest)1 CompleteTaskThread (org.camunda.bpm.qa.upgrade.util.CompleteTaskThread)1 Test (org.junit.Test)1