Search in sources :

Example 51 with ScenarioUnderTest

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

the class AsyncParallelMultiInstanceScenarioTest method testInitAsyncBeforeSubprocessJobDefinition.

/**
 * Note: this test is not really isolated since the job
 * definition is migrated when the process definition is accessed the first time.
 * This might happen already before this test case is executed.
 */
@Test
@ScenarioUnderTest("initAsyncBeforeSubprocess.4")
public void testInitAsyncBeforeSubprocessJobDefinition() {
    // when the process is redeployed into the cache (instantiation should trigger that)
    rule.getRuntimeService().startProcessInstanceByKey("AsyncBeforeParallelMultiInstanceSubprocess");
    // then the old job definition referencing "miSubProcess" has been migrated
    JobDefinition asyncJobDefinition = rule.jobDefinitionQuery().singleResult();
    Assert.assertEquals("miSubProcess#multiInstanceBody", asyncJobDefinition.getActivityId());
}
Also used : JobDefinition(org.camunda.bpm.engine.management.JobDefinition) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 52 with ScenarioUnderTest

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

the class AsyncParallelMultiInstanceScenarioTest method testInitAsyncBeforeTaskJobDefinition.

/**
 * Note: this test is not really isolated since the job
 * definition is migrated when the process definition is accessed the first time.
 * This might happen already before this test case is executed.
 */
@Test
@ScenarioUnderTest("initAsyncBeforeTask.4")
public void testInitAsyncBeforeTaskJobDefinition() {
    // when the process is redeployed into the cache (instantiation should trigger that)
    rule.getRuntimeService().startProcessInstanceByKey("AsyncBeforeParallelMultiInstanceTask");
    // then the old job definition referencing "miSubProcess" has been migrated
    JobDefinition asyncJobDefinition = rule.jobDefinitionQuery().singleResult();
    Assert.assertEquals("miTask#multiInstanceBody", asyncJobDefinition.getActivityId());
}
Also used : JobDefinition(org.camunda.bpm.engine.management.JobDefinition) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 53 with ScenarioUnderTest

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

the class AsyncParallelMultiInstanceScenarioTest method testInitAsyncBeforeSubprocessDeletion.

@Test
@ScenarioUnderTest("initAsyncBeforeSubprocess.3")
public void testInitAsyncBeforeSubprocessDeletion() {
    // 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 54 with ScenarioUnderTest

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

the class MultiInstanceReceiveTaskScenarioTest method testInitSequentialActivityInstanceTree.

@Test
@ScenarioUnderTest("initSequential.2")
public void testInitSequentialActivityInstanceTree() {
    // 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").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 55 with ScenarioUnderTest

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

the class MultiInstanceReceiveTaskScenarioTest method testInitParallelMigration.

@Test
@Ignore("CAM-6408")
@ScenarioUnderTest("initParallel.4")
public void testInitParallelMigration() {
    // given
    ProcessInstance instance = rule.processInstance();
    MigrationPlan migrationPlan = rule.getRuntimeService().createMigrationPlan(instance.getProcessDefinitionId(), instance.getProcessDefinitionId()).mapEqualActivities().build();
    // when
    rule.getRuntimeService().newMigration(migrationPlan).processInstanceIds(instance.getId()).execute();
    // then the receive task messages can be correlated
    rule.messageCorrelation("Message").correlateAll();
    rule.assertScenarioEnded();
}
Also used : MigrationPlan(org.camunda.bpm.engine.migration.MigrationPlan) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Ignore(org.junit.Ignore) 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