use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class InterruptingEventSubprocessScenarioTest method testActivityInstanceTree.
@Test
@ScenarioUnderTest("init.2")
public void testActivityInstanceTree() {
// given
ProcessInstance instance = rule.processInstance();
// when
ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
// then
Assert.assertNotNull(activityInstance);
assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("eventSubProcessTask").done());
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest 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());
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitCompletionCase1.
@Test
@ScenarioUnderTest("init.1")
public void testInitCompletionCase1() {
// given
Task innerTask = rule.taskQuery().taskDefinitionKey("innerTask").singleResult();
Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();
// when
rule.getTaskService().complete(innerTask.getId());
rule.getTaskService().complete(eventSubprocessTask.getId());
// then
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitTask1Deletion.
@Test
@ScenarioUnderTest("init.innerTask.3")
public void testInitTask1Deletion() {
// given
ProcessInstance instance = rule.processInstance();
// when
rule.getRuntimeService().deleteProcessInstance(instance.getId(), null);
// then
rule.assertScenarioEnded();
}
use of org.camunda.bpm.qa.upgrade.ScenarioUnderTest in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitThrowUnhandledException.
@Test
@ScenarioUnderTest("init.6")
public void testInitThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.getTaskService().complete(eventSubprocessTask.getId());
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
Aggregations