@Test public void testDeploymentStatisticsQueryCountAndPaging() { org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment() .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml") .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testParallelGatewayStatisticsQuery.bpmn20.xml") .deploy(); runtimeService.startProcessInstanceByKey("MIExampleProcess"); runtimeService.startProcessInstanceByKey("ParGatewayExampleProcess"); org.camunda.bpm.engine.repository.Deployment anotherDeployment = repositoryService.createDeployment() .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml") .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testParallelGatewayStatisticsQuery.bpmn20.xml") .deploy(); runtimeService.startProcessInstanceByKey("MIExampleProcess"); runtimeService.startProcessInstanceByKey("ParGatewayExampleProcess"); long count = managementService.createDeploymentStatisticsQuery().includeFailedJobs().count(); Assert.assertEquals(2, count); List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeFailedJobs().listPage(0, 1); Assert.assertEquals(1, statistics.size()); repositoryService.deleteDeployment(deployment.getId(), true); repositoryService.deleteDeployment(anotherDeployment.getId(), true); }
@Test public void testDeploymentStatisticsQueryCountAndPaging() { org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment() .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml") .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testParallelGatewayStatisticsQuery.bpmn20.xml") .deploy(); runtimeService.startProcessInstanceByKey("MIExampleProcess"); runtimeService.startProcessInstanceByKey("ParGatewayExampleProcess"); org.camunda.bpm.engine.repository.Deployment anotherDeployment = repositoryService.createDeployment() .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testMultiInstanceStatisticsQuery.bpmn20.xml") .addClasspathResource("org/camunda/bpm/engine/test/api/mgmt/StatisticsTest.testParallelGatewayStatisticsQuery.bpmn20.xml") .deploy(); runtimeService.startProcessInstanceByKey("MIExampleProcess"); runtimeService.startProcessInstanceByKey("ParGatewayExampleProcess"); long count = managementService.createDeploymentStatisticsQuery().includeFailedJobs().count(); Assert.assertEquals(2, count); List<DeploymentStatistics> statistics = managementService.createDeploymentStatisticsQuery().includeFailedJobs().listPage(0, 1); Assert.assertEquals(1, statistics.size()); repositoryService.deleteDeployment(deployment.getId(), true); repositoryService.deleteDeployment(anotherDeployment.getId(), true); }