Search in sources :

Example 61 with ScenarioUnderTest

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

the class ParallelMultiInstanceScenarioTest method testInitNonInterruptingBoundaryEventCompletionCase3.

@Test
@ScenarioUnderTest("initNonInterruptingBoundaryEvent.3")
public void testInitNonInterruptingBoundaryEventCompletionCase3() {
    // given
    List<Task> subProcessTasks = rule.taskQuery().taskDefinitionKey("subProcessTask").list();
    Task afterBoundaryTask = rule.taskQuery().taskDefinitionKey("afterBoundaryTask").singleResult();
    // when the first instance and the other two instances are completed
    rule.getTaskService().complete(subProcessTasks.get(0).getId());
    rule.getTaskService().complete(afterBoundaryTask.getId());
    rule.getTaskService().complete(subProcessTasks.get(1).getId());
    rule.getTaskService().complete(subProcessTasks.get(2).getId());
    // then
    rule.assertScenarioEnded();
}
Also used : Task(org.camunda.bpm.engine.task.Task) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 62 with ScenarioUnderTest

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

the class ParallelMultiInstanceScenarioTest method testInitNonInterruptingBoundaryEventDeletion.

@Test
@ScenarioUnderTest("initNonInterruptingBoundaryEvent.5")
public void testInitNonInterruptingBoundaryEventDeletion() {
    // given
    ProcessInstance instance = rule.processInstance();
    // when
    rule.getRuntimeService().deleteProcessInstance(instance.getId(), null);
    // then
    rule.assertScenarioEnded();
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 63 with ScenarioUnderTest

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

the class ParallelMultiInstanceScenarioTest method testInitNonInterruptingBoundaryEventThrowError.

@Test
@ScenarioUnderTest("initNonInterruptingBoundaryEvent.6")
public void testInitNonInterruptingBoundaryEventThrowError() {
    // given
    ProcessInstance instance = rule.processInstance();
    Task miSubprocessTask = rule.taskQuery().taskDefinitionKey("subProcessTask").list().get(0);
    Task afterBoundaryTask = rule.taskQuery().taskDefinitionKey("afterBoundaryTask").singleResult();
    // when
    rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.ERROR_INDICATOR_VARIABLE, true);
    rule.getTaskService().complete(miSubprocessTask.getId());
    // then
    Assert.assertEquals(2, rule.taskQuery().count());
    Task escalatedTask = rule.taskQuery().taskDefinitionKey("escalatedTask").singleResult();
    Assert.assertNotNull(escalatedTask);
    // and
    rule.getTaskService().complete(escalatedTask.getId());
    rule.getTaskService().complete(afterBoundaryTask.getId());
    rule.assertScenarioEnded();
}
Also used : Task(org.camunda.bpm.engine.task.Task) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 64 with ScenarioUnderTest

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

the class OneScopeTaskScenarioTest method testInitPlainActivityInstance.

@Test
@ScenarioUnderTest("init.plain.1")
public void testInitPlainActivityInstance() {
    // given
    ProcessInstance instance = rule.processInstance();
    // when
    ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
    // then
    Assert.assertNotNull(activityInstance);
    assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("task").done());
}
Also used : ActivityInstance(org.camunda.bpm.engine.runtime.ActivityInstance) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 65 with ScenarioUnderTest

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

the class ParallelScopeTasksScenarioTest method testInitPlainActivityInstance.

@Test
@ScenarioUnderTest("init.plain.1")
public void testInitPlainActivityInstance() {
    // given
    ProcessInstance instance = rule.processInstance();
    // when
    ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
    // then
    Assert.assertNotNull(activityInstance);
    assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("task1").activity("task2").done());
}
Also used : ActivityInstance(org.camunda.bpm.engine.runtime.ActivityInstance) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Aggregations

ScenarioUnderTest (org.camunda.bpm.qa.upgrade.ScenarioUnderTest)314 Test (org.junit.Test)311 Task (org.camunda.bpm.engine.task.Task)190 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)183 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)80 ThrowBpmnErrorDelegateException (org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException)19 Job (org.camunda.bpm.engine.runtime.Job)14 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)6 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)4 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)4 Ignore (org.junit.Ignore)4 HistoricActivityInstance (org.camunda.bpm.engine.history.HistoricActivityInstance)3 HistoricTaskInstanceQuery (org.camunda.bpm.engine.history.HistoricTaskInstanceQuery)3 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)3 CaseSentryPartEntity (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity)3 MigrationPlan (org.camunda.bpm.engine.migration.MigrationPlan)2 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)2 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)2 Execution (org.camunda.bpm.engine.runtime.Execution)2 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)2