use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByInvalidIncidentId.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneFailingServiceProcess.bpmn20.xml" })
public void testQueryByInvalidIncidentId() {
startProcessInstance(PROCESS_DEFINITION_KEY);
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
assertEquals(0, query.incidentId("invalid").list().size());
assertEquals(0, query.incidentId("invalid").count());
try {
query.incidentId(null);
fail("It was possible to set a null value as incidentId.");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByConfiguration.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneFailingServiceProcess.bpmn20.xml" })
public void testQueryByConfiguration() {
startProcessInstance(PROCESS_DEFINITION_KEY);
String configuration = managementService.createJobQuery().singleResult().getId();
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery().configuration(configuration);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByInvalidProcessDefinitionId.
@Test
public void testQueryByInvalidProcessDefinitionId() {
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
assertEquals(0, query.processDefinitionId("invalid").list().size());
assertEquals(0, query.processDefinitionId("invalid").count());
try {
query.processDefinitionId(null);
fail("It was possible to set a null value as processDefinitionId.");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByJobDefinitionId.
@Test
public void testQueryByJobDefinitionId() {
String processDefinitionId1 = testHelper.deployAndGetDefinition(FAILING_SERVICE_TASK_MODEL).getId();
String processDefinitionId2 = testHelper.deployAndGetDefinition(FAILING_SERVICE_TASK_MODEL).getId();
runtimeService.startProcessInstanceById(processDefinitionId1);
runtimeService.startProcessInstanceById(processDefinitionId2);
testHelper.executeAvailableJobs();
String jobDefinitionId1 = managementService.createJobQuery().processDefinitionId(processDefinitionId1).singleResult().getJobDefinitionId();
String jobDefinitionId2 = managementService.createJobQuery().processDefinitionId(processDefinitionId2).singleResult().getJobDefinitionId();
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery().jobDefinitionIdIn(jobDefinitionId1, jobDefinitionId2);
assertEquals(2, query.list().size());
assertEquals(2, query.count());
query = historyService.createHistoricIncidentQuery().jobDefinitionIdIn(jobDefinitionId1);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
query = historyService.createHistoricIncidentQuery().jobDefinitionIdIn(jobDefinitionId2);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentQueryTest method testQueryByUnknownJobDefinitionId.
@Test
public void testQueryByUnknownJobDefinitionId() {
String processDefinitionId = testHelper.deployAndGetDefinition(FAILING_SERVICE_TASK_MODEL).getId();
runtimeService.startProcessInstanceById(processDefinitionId);
testHelper.executeAvailableJobs();
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery().jobDefinitionIdIn("unknown");
assertEquals(0, query.list().size());
assertEquals(0, query.count());
}
Aggregations