Search in sources :

Example 56 with ScenarioUnderTest

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

the class MultiInstanceReceiveTaskScenarioTest method testInitParallelActivityInstanceTree.

@Test
@ScenarioUnderTest("initParallel.2")
public void testInitParallelActivityInstanceTree() {
    // given
    ProcessInstance instance = rule.processInstance();
    // when
    ActivityInstance activityInstance = rule.getRuntimeService().getActivityInstance(instance.getId());
    // then
    Assert.assertNotNull(activityInstance);
    assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.getProcessDefinitionId()).activity("miReceiveTask").activity("miReceiveTask").activity("miReceiveTask").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 57 with ScenarioUnderTest

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

the class MultiInstanceReceiveTaskScenarioTest method testInitParallelDeletion.

@Test
@ScenarioUnderTest("initParallel.3")
public void testInitParallelDeletion() {
    // 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 58 with ScenarioUnderTest

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

the class MultiInstanceReceiveTaskScenarioTest method testInitSequentialDeletion.

@Test
@ScenarioUnderTest("initSequential.3")
public void testInitSequentialDeletion() {
    // 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 59 with ScenarioUnderTest

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

the class ParallelMultiInstanceScenarioTest method testInitNonInterruptingBoundaryEventCompletionCase1.

@Test
@ScenarioUnderTest("initNonInterruptingBoundaryEvent.1")
public void testInitNonInterruptingBoundaryEventCompletionCase1() {
    // given
    List<Task> subProcessTasks = rule.taskQuery().taskDefinitionKey("subProcessTask").list();
    Task afterBoundaryTask = rule.taskQuery().taskDefinitionKey("afterBoundaryTask").singleResult();
    // when all instances are completed
    for (Task subProcessTask : subProcessTasks) {
        rule.getTaskService().complete(subProcessTask.getId());
    }
    // and
    rule.getTaskService().complete(afterBoundaryTask.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 60 with ScenarioUnderTest

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

the class ParallelMultiInstanceScenarioTest method testInitNonInterruptingBoundaryEventCompletionCase2.

@Test
@ScenarioUnderTest("initNonInterruptingBoundaryEvent.2")
public void testInitNonInterruptingBoundaryEventCompletionCase2() {
    // given
    List<Task> subProcessTasks = rule.taskQuery().taskDefinitionKey("subProcessTask").list();
    Task afterBoundaryTask = rule.taskQuery().taskDefinitionKey("afterBoundaryTask").singleResult();
    // when
    rule.getTaskService().complete(afterBoundaryTask.getId());
    for (Task subProcessTask : subProcessTasks) {
        rule.getTaskService().complete(subProcessTask.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)

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