use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class HistoryServiceAsyncOperationsTest method cleanBatch.
@After
public void cleanBatch() {
Batch batch = managementService.createBatchQuery().singleResult();
if (batch != null) {
managementService.deleteBatch(batch.getId(), true);
}
HistoricBatch historicBatch = historyService.createHistoricBatchQuery().singleResult();
if (historicBatch != null) {
historyService.deleteHistoricBatch(historicBatch.getId());
}
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchModificationAuthorizationTest method cleanBatch.
@After
public void cleanBatch() {
Batch batch = engineRule.getManagementService().createBatchQuery().singleResult();
if (batch != null) {
engineRule.getManagementService().deleteBatch(batch.getId(), true);
}
HistoricBatch historicBatch = engineRule.getHistoryService().createHistoricBatchQuery().singleResult();
if (historicBatch != null) {
engineRule.getHistoryService().deleteHistoricBatch(historicBatch.getId());
}
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchModificationHistoryTest method testDeleteHistoricBatch.
@Test
public void testDeleteHistoricBatch() {
ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
Batch batch = helper.startTransitionAsync("process1", 1, "seq", processDefinition.getId());
helper.executeSeedJob(batch);
helper.executeJobs(batch);
helper.executeMonitorJob(batch);
// when
HistoricBatch historicBatch = helper.getHistoricBatch(batch);
rule.getHistoryService().deleteHistoricBatch(historicBatch.getId());
// then the historic batch was removed and all job logs
assertNull(helper.getHistoricBatch(batch));
assertTrue(helper.getHistoricSeedJobLog(batch).isEmpty());
assertTrue(helper.getHistoricMonitorJobLog(batch).isEmpty());
assertTrue(helper.getHistoricBatchJobLog(batch).isEmpty());
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchMigrationHistoryTest method testHistoricBatchCompletion.
@Test
public void testHistoricBatchCompletion() {
Batch batch = helper.migrateProcessInstancesAsync(1);
helper.executeSeedJob(batch);
helper.executeJobs(batch);
Date endDate = helper.addSecondsToClock(12);
// when
helper.executeMonitorJob(batch);
// then the historic batch has an end time set
HistoricBatch historicBatch = helper.getHistoricBatch(batch);
assertNotNull(historicBatch);
assertEquals(endDate, historicBatch.getEndTime());
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchMigrationHistoryTest method testHistoricBatchCreation.
@Test
public void testHistoricBatchCreation() {
// when
Batch batch = helper.migrateProcessInstancesAsync(10);
// then a historic batch was created
HistoricBatch historicBatch = helper.getHistoricBatch(batch);
assertNotNull(historicBatch);
assertEquals(batch.getId(), historicBatch.getId());
assertEquals(batch.getType(), historicBatch.getType());
assertEquals(batch.getTotalJobs(), historicBatch.getTotalJobs());
assertEquals(batch.getBatchJobsPerSeed(), historicBatch.getBatchJobsPerSeed());
assertEquals(batch.getInvocationsPerBatchJob(), historicBatch.getInvocationsPerBatchJob());
assertEquals(batch.getSeedJobDefinitionId(), historicBatch.getSeedJobDefinitionId());
assertEquals(batch.getMonitorJobDefinitionId(), historicBatch.getMonitorJobDefinitionId());
assertEquals(batch.getBatchJobDefinitionId(), historicBatch.getBatchJobDefinitionId());
assertEquals(START_DATE, historicBatch.getStartTime());
assertNull(historicBatch.getEndTime());
}
Aggregations