use of org.camunda.bpm.engine.management.DeploymentStatistics in project camunda-bpm-platform by camunda.
the class DeploymentStatisticsQueryTest method testQueryByIncidentsWithFailedTimerStartEvent.
@Deployment(resources = "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testFailedTimerStartEvent.bpmn20.xml")
public void testQueryByIncidentsWithFailedTimerStartEvent() {
executeAvailableJobs();
List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeIncidents().list();
assertEquals(1, statistics.size());
DeploymentStatistics result = statistics.get(0);
// there is no running instance
assertEquals(0, result.getInstances());
List<IncidentStatistics> incidentStatistics = result.getIncidentStatistics();
// but there is one incident for the failed timer job
assertEquals(1, incidentStatistics.size());
IncidentStatistics incidentStatistic = incidentStatistics.get(0);
assertEquals(1, incidentStatistic.getIncidentCount());
assertEquals(Incident.FAILED_JOB_HANDLER_TYPE, incidentStatistic.getIncidentType());
}
use of org.camunda.bpm.engine.management.DeploymentStatistics in project camunda-bpm-platform by camunda.
the class DeploymentStatisticsQueryTest method testDeploymentStatisticsQueryWithFailedJobs.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml", "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testStatisticsQueryWithFailedJobs.bpmn20.xml" })
public void testDeploymentStatisticsQueryWithFailedJobs() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("fail", true);
runtimeService.startProcessInstanceByKey("MIExampleProcess");
runtimeService.startProcessInstanceByKey("ExampleProcess", parameters);
executeAvailableJobs();
List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeFailedJobs().list();
DeploymentStatistics result = statistics.get(0);
Assert.assertEquals(1, result.getFailedJobs());
}
use of org.camunda.bpm.engine.management.DeploymentStatistics in project camunda-bpm-platform by camunda.
the class DeploymentStatisticsQueryTest method testDeploymentStatisticsQueryWithoutRunningInstances.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml", "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testParallelGatewayStatisticsQuery.bpmn20.xml" })
public void testDeploymentStatisticsQueryWithoutRunningInstances() {
List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeFailedJobs().list();
Assert.assertEquals(1, statistics.size());
DeploymentStatistics result = statistics.get(0);
Assert.assertEquals(0, result.getInstances());
Assert.assertEquals(0, result.getFailedJobs());
}
use of org.camunda.bpm.engine.management.DeploymentStatistics in project camunda-bpm-platform by camunda.
the class DeploymentStatisticsQueryTest method testDeploymentStatisticsQueryWithIncidents.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml", "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testStatisticsQueryWithFailedJobs.bpmn20.xml" })
public void testDeploymentStatisticsQueryWithIncidents() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("fail", true);
runtimeService.startProcessInstanceByKey("MIExampleProcess");
runtimeService.startProcessInstanceByKey("ExampleProcess", parameters);
executeAvailableJobs();
List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeIncidents().list();
assertFalse(statistics.isEmpty());
assertEquals(1, statistics.size());
DeploymentStatistics result = statistics.get(0);
List<IncidentStatistics> incidentStatistics = result.getIncidentStatistics();
assertFalse(incidentStatistics.isEmpty());
assertEquals(1, incidentStatistics.size());
IncidentStatistics incident = incidentStatistics.get(0);
assertEquals(Incident.FAILED_JOB_HANDLER_TYPE, incident.getIncidentType());
assertEquals(1, incident.getIncidentCount());
}
use of org.camunda.bpm.engine.management.DeploymentStatistics in project camunda-bpm-platform by camunda.
the class DeploymentStatisticsQueryTest method testDeploymentStatisticsQueryWithTwoIncidentsAndOneFailedJobs.
@Test
@Deployment(resources = "org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testCallActivityWithIncidentsWithoutFailedJobs.bpmn20.xml")
public void testDeploymentStatisticsQueryWithTwoIncidentsAndOneFailedJobs() {
runtimeService.startProcessInstanceByKey("callExampleSubProcess");
executeAvailableJobs();
List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeIncidents().includeFailedJobs().list();
assertFalse(statistics.isEmpty());
assertEquals(1, statistics.size());
DeploymentStatistics result = statistics.get(0);
// has one failed job
Assert.assertEquals(1, result.getFailedJobs());
List<IncidentStatistics> incidentStatistics = result.getIncidentStatistics();
assertFalse(incidentStatistics.isEmpty());
assertEquals(1, incidentStatistics.size());
IncidentStatistics incident = incidentStatistics.get(0);
assertEquals(Incident.FAILED_JOB_HANDLER_TYPE, incident.getIncidentType());
// ...but two incidents
assertEquals(2, incident.getIncidentCount());
}
Aggregations