use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class SpringTransactionIntegrationTest method testTransactionRollbackInServiceTask.
@Deployment
public void testTransactionRollbackInServiceTask() throws Exception {
runtimeService.startProcessInstanceByKey("txRollbackServiceTask");
waitForJobExecutorToProcessAllJobs(WAIT_TIME_MILLIS);
Job job = managementService.createJobQuery().singleResult();
assertNotNull(job);
assertEquals(0, job.getRetries());
assertEquals("Transaction rolled back because it has been marked as rollback-only", job.getExceptionMessage());
String stacktrace = managementService.getJobExceptionStacktrace(job.getId());
assertNotNull(stacktrace);
assertTrue("unexpected stacktrace, was <" + stacktrace + ">", stacktrace.contains("Transaction rolled back because it has been marked as rollback-only"));
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class SpringTransactionIntegrationTest method testTransactionRollbackInServiceTaskWithCustomRetryCycle.
@Deployment
public void testTransactionRollbackInServiceTaskWithCustomRetryCycle() throws Exception {
runtimeService.startProcessInstanceByKey("txRollbackServiceTaskWithCustomRetryCycle");
waitForJobExecutorToProcessAllJobs(WAIT_TIME_MILLIS);
Job job = managementService.createJobQuery().singleResult();
assertNotNull(job);
assertEquals(0, job.getRetries());
assertEquals("Transaction rolled back because it has been marked as rollback-only", job.getExceptionMessage());
String stacktrace = managementService.getJobExceptionStacktrace(job.getId());
assertNotNull(stacktrace);
assertTrue("unexpected stacktrace, was <" + stacktrace + ">", stacktrace.contains("Transaction rolled back because it has been marked as rollback-only"));
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class SpringTransactionIntegrationTest method testErrorPropagationOnExceptionInTransaction.
@Deployment(resources = { "org/camunda/bpm/engine/spring/test/transaction/SpringTransactionIntegrationTest.testErrorPropagationOnExceptionInTransaction.bpmn20.xml", "org/camunda/bpm/engine/spring/test/transaction/SpringTransactionIntegrationTest.throwExceptionProcess.bpmn20.xml" })
public void testErrorPropagationOnExceptionInTransaction() {
runtimeService.startProcessInstanceByKey("process");
waitForJobExecutorToProcessAllJobs(WAIT_TIME_MILLIS);
Incident incident = runtimeService.createIncidentQuery().activityId("servicetask").singleResult();
assertThat(incident.getIncidentMessage(), is("error"));
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class SpringJobExecutorTest method testRollbackJobExecutorPath.
@Deployment(resources = { "org/camunda/bpm/engine/spring/test/components/SpringTimersProcess.bpmn20.xml", "org/camunda/bpm/engine/spring/test/components/SpringJobExecutorRollBack.bpmn20.xml" })
public void testRollbackJobExecutorPath() throws Exception {
// shutdown job executor first, otherwise waitForJobExecutorToProcessAllJobs will not actually start it....
processEngineConfiguration.getJobExecutor().shutdown();
ProcessInstance instance = runtimeService.startProcessInstanceByKey("errorProcess1");
assertNotNull(instance);
waitForJobExecutorToProcessAllJobs(10000);
List<Task> activeTasks = taskService.createTaskQuery().processInstanceId(instance.getId()).list();
assertTrue(activeTasks.size() == 1);
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class DelegationAuthorizationTest method testCustomStartFormHandlerExecutesQuery.
@Deployment
public void testCustomStartFormHandlerExecutesQuery() {
// given
startProcessInstancesByKey(DEFAULT_PROCESS_KEY, 5);
String processDefinitionId = selectProcessDefinitionByKey(DEFAULT_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, DEFAULT_PROCESS_KEY, userId, READ);
// when
StartFormData startFormData = formService.getStartFormData(processDefinitionId);
// then
assertNotNull(startFormData);
assertNotNull(MyDelegationService.CURRENT_AUTHENTICATION);
assertEquals(userId, MyDelegationService.CURRENT_AUTHENTICATION.getUserId());
assertEquals(Long.valueOf(5), MyDelegationService.INSTANCES_COUNT);
}
Aggregations