use of org.camunda.bpm.engine.batch.BatchStatistics in project camunda-bpm-platform by camunda.
the class BatchStatisticsQueryTest method testStatisticsRetriedFailedJobs.
@Test
public void testStatisticsRetriedFailedJobs() {
// given
Batch batch = helper.createMigrationBatchWithSize(3);
// when
helper.completeSeedJobs(batch);
helper.failExecutionJobs(batch, 3);
// then
BatchStatistics batchStatistics = managementService.createBatchStatisticsQuery().singleResult();
assertEquals(3, batchStatistics.getTotalJobs());
assertEquals(3, batchStatistics.getJobsCreated());
assertEquals(3, batchStatistics.getRemainingJobs());
assertEquals(0, batchStatistics.getCompletedJobs());
assertEquals(3, batchStatistics.getFailedJobs());
// when
helper.setRetries(batch, 3, 1);
helper.completeJobs(batch, 3);
// then
batchStatistics = managementService.createBatchStatisticsQuery().singleResult();
assertEquals(3, batchStatistics.getTotalJobs());
assertEquals(3, batchStatistics.getJobsCreated());
assertEquals(0, batchStatistics.getRemainingJobs());
assertEquals(3, batchStatistics.getCompletedJobs());
assertEquals(0, batchStatistics.getFailedJobs());
}
use of org.camunda.bpm.engine.batch.BatchStatistics in project camunda-bpm-platform by camunda.
the class BatchStatisticsQueryTest method testStatisticsActivate.
@Test
public void testStatisticsActivate() {
// given
Batch batch = helper.migrateProcessInstancesAsync(1);
managementService.suspendBatchById(batch.getId());
// when
managementService.activateBatchById(batch.getId());
// then
BatchStatistics batchStatistics = managementService.createBatchStatisticsQuery().batchId(batch.getId()).singleResult();
assertFalse(batchStatistics.isSuspended());
}
use of org.camunda.bpm.engine.batch.BatchStatistics in project camunda-bpm-platform by camunda.
the class BatchStatisticsQueryTest method testStatisticsOneCompletedJob.
@Test
public void testStatisticsOneCompletedJob() {
// given
Batch batch = helper.createMigrationBatchWithSize(3);
// when
helper.completeSeedJobs(batch);
helper.completeJobs(batch, 1);
// then
BatchStatistics batchStatistics = managementService.createBatchStatisticsQuery().singleResult();
assertEquals(3, batchStatistics.getTotalJobs());
assertEquals(3, batchStatistics.getJobsCreated());
assertEquals(2, batchStatistics.getRemainingJobs());
assertEquals(1, batchStatistics.getCompletedJobs());
assertEquals(0, batchStatistics.getFailedJobs());
}
use of org.camunda.bpm.engine.batch.BatchStatistics in project camunda-bpm-platform by camunda.
the class BatchStatisticsQueryTest method testStatisticsWithNotAllGeneratedAndAlreadyCompletedAndFailedJobs.
@Test
public void testStatisticsWithNotAllGeneratedAndAlreadyCompletedAndFailedJobs() {
// given
Batch batch = helper.createMigrationBatchWithSize(13);
// when
helper.executeJob(helper.getSeedJob(batch));
helper.completeJobs(batch, 2);
helper.failExecutionJobs(batch, 2);
// then
BatchStatistics batchStatistics = managementService.createBatchStatisticsQuery().singleResult();
assertEquals(13, batchStatistics.getTotalJobs());
assertEquals(10, batchStatistics.getJobsCreated());
assertEquals(11, batchStatistics.getRemainingJobs());
assertEquals(2, batchStatistics.getCompletedJobs());
assertEquals(2, batchStatistics.getFailedJobs());
}
use of org.camunda.bpm.engine.batch.BatchStatistics in project camunda-bpm-platform by camunda.
the class BatchStatisticsQueryTest method testStatisticsMostExecutionJobsGenerated.
@Test
public void testStatisticsMostExecutionJobsGenerated() {
// given
Batch batch = helper.createMigrationBatchWithSize(13);
// when
helper.executeJob(helper.getSeedJob(batch));
// then
BatchStatistics batchStatistics = managementService.createBatchStatisticsQuery().singleResult();
assertEquals(13, batchStatistics.getTotalJobs());
assertEquals(10, batchStatistics.getJobsCreated());
assertEquals(13, batchStatistics.getRemainingJobs());
assertEquals(0, batchStatistics.getCompletedJobs());
assertEquals(0, batchStatistics.getFailedJobs());
}
Aggregations