use of org.camunda.bpm.engine.test.bpmn.executionlistener.RecorderExecutionListener.RecordedEvent in project camunda-bpm-platform by camunda.
the class ExecutionListenerTest method testExecutionListenerOnTerminateEndEvent.
@Test
@Deployment
public void testExecutionListenerOnTerminateEndEvent() {
RecorderExecutionListener.clear();
runtimeService.startProcessInstanceByKey("oneTaskProcess");
Task task = taskService.createTaskQuery().singleResult();
taskService.complete(task.getId());
List<RecordedEvent> recordedEvents = RecorderExecutionListener.getRecordedEvents();
assertEquals(2, recordedEvents.size());
assertEquals("start", recordedEvents.get(0).getEventName());
assertEquals("end", recordedEvents.get(1).getEventName());
}
use of org.camunda.bpm.engine.test.bpmn.executionlistener.RecorderExecutionListener.RecordedEvent in project camunda-bpm-platform by camunda.
the class ExecutionListenerTest method testOnBoundaryEvents.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/executionlistener/ExecutionListenerTest.testOnBoundaryEvents.bpmn20.xml" })
public void testOnBoundaryEvents() {
RecorderExecutionListener.clear();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process");
Job firstTimer = managementService.createJobQuery().timers().singleResult();
managementService.executeJob(firstTimer.getId());
Job secondTimer = managementService.createJobQuery().timers().singleResult();
managementService.executeJob(secondTimer.getId());
assertProcessEnded(processInstance.getId());
List<RecordedEvent> recordedEvents = RecorderExecutionListener.getRecordedEvents();
assertEquals(2, recordedEvents.size());
assertEquals("timer1", recordedEvents.get(0).getActivityId());
assertEquals("start boundary listener", recordedEvents.get(0).getParameter());
assertEquals("start", recordedEvents.get(0).getEventName());
assertThat(recordedEvents.get(0).isCanceled(), is(false));
assertEquals("timer2", recordedEvents.get(1).getActivityId());
assertEquals("end boundary listener", recordedEvents.get(1).getParameter());
assertEquals("end", recordedEvents.get(1).getEventName());
assertThat(recordedEvents.get(1).isCanceled(), is(false));
}
use of org.camunda.bpm.engine.test.bpmn.executionlistener.RecorderExecutionListener.RecordedEvent in project camunda-bpm-platform by camunda.
the class ExecutionListenerTest method testServiceTaskExecutionListenerCall.
@Test
public void testServiceTaskExecutionListenerCall() {
testHelper.deploy(PROCESS_SERVICE_TASK_WITH_EXECUTION_START_LISTENER);
runtimeService.startProcessInstanceByKey("Process");
Task task = taskService.createTaskQuery().taskDefinitionKey("userTask1").singleResult();
taskService.complete(task.getId());
assertEquals(0, taskService.createTaskQuery().list().size());
List<RecordedEvent> recordedEvents = RecorderExecutionListener.getRecordedEvents();
assertEquals(1, recordedEvents.size());
assertEquals("endEvent", recordedEvents.get(0).getActivityId());
}
use of org.camunda.bpm.engine.test.bpmn.executionlistener.RecorderExecutionListener.RecordedEvent in project camunda-bpm-platform by camunda.
the class ExecutionListenerTest method testServiceTaskExecutionListenerCallAndSubProcess.
@Test
public void testServiceTaskExecutionListenerCallAndSubProcess() {
testHelper.deploy(PROCESS_SERVICE_TASK_WITH_EXECUTION_START_LISTENER_AND_SUB_PROCESS);
runtimeService.startProcessInstanceByKey("Process");
Task task = taskService.createTaskQuery().taskDefinitionKey("userTask").singleResult();
taskService.complete(task.getId());
assertEquals(1, taskService.createTaskQuery().list().size());
List<RecordedEvent> recordedEvents = RecorderExecutionListener.getRecordedEvents();
assertEquals(4, recordedEvents.size());
assertEquals("startSubProcess", recordedEvents.get(0).getActivityId());
assertEquals("subProcessTask", recordedEvents.get(1).getActivityId());
assertEquals("sendTask", recordedEvents.get(2).getActivityId());
assertEquals("endEvent", recordedEvents.get(3).getActivityId());
}
use of org.camunda.bpm.engine.test.bpmn.executionlistener.RecorderExecutionListener.RecordedEvent in project camunda-bpm-platform by camunda.
the class ExecutionListenerTest method testServiceTaskTwoExecutionListenerCall.
@Test
public void testServiceTaskTwoExecutionListenerCall() {
testHelper.deploy(PROCESS_SERVICE_TASK_WITH_TWO_EXECUTION_START_LISTENER);
runtimeService.startProcessInstanceByKey("Process");
Task task = taskService.createTaskQuery().taskDefinitionKey("userTask1").singleResult();
taskService.complete(task.getId());
assertEquals(0, taskService.createTaskQuery().list().size());
List<RecordedEvent> recordedEvents = RecorderExecutionListener.getRecordedEvents();
assertEquals(2, recordedEvents.size());
assertEquals("sendTask", recordedEvents.get(0).getActivityId());
assertEquals("endEvent", recordedEvents.get(1).getActivityId());
}
Aggregations