protected void verifyBooleanParameterQueryInvocations() { verify(mockedQuery).creationLog(); verify(mockedQuery).failureLog(); verify(mockedQuery).successLog(); verify(mockedQuery).deletionLog(); verify(mockedQuery).list(); }
@Override public void execute(PerfTestRunContext context) { long failedJobs = processEngine.getHistoryService().createHistoricJobLogQuery().failureLog().count(); long createdJobs = processEngine.getHistoryService().createHistoricJobLogQuery().creationLog().count(); long successfulJobs = processEngine.getHistoryService().createHistoricJobLogQuery().successLog().count(); System.out.println("Number of created jobs: " + createdJobs); System.out.println("Number of failed jobs: " + failedJobs); System.out.println("Number of successful jobs: " + successfulJobs); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testQueryBySuccessLog() { runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); String jobId = managementService.createJobQuery().singleResult().getId(); managementService.executeJob(jobId); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().successLog(); verifyQueryResults(query, 1); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuationWithLongId.bpmn20.xml"}) public void testSuccessfulHistoricJobLogEntryStoredForLongActivityId() { runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); Job job = managementService .createJobQuery() .singleResult(); managementService.executeJob(job.getId()); HistoricJobLog historicJob = historyService .createHistoricJobLogQuery() .successLog() .singleResult(); assertNotNull(historicJob); assertEquals("serviceTaskIdIsReallyLongAndItShouldBeMoreThan64CharsSoItWill" + "BlowAnyActivityIdColumnWhereSizeIs64OrLessSoWeAlignItTo255LikeEverywhereElse", historicJob.getActivityId()); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testSuccessfulJobEvent() { // given runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); String jobId = managementService.createJobQuery().singleResult().getId(); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId); HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog(); HistoricJobLogQuery succeededQuery = historyService.createHistoricJobLogQuery().jobId(jobId).successLog(); // there exists one historic job log entry assertEquals(1, query.count()); assertEquals(1, createdQuery.count()); assertEquals(0, succeededQuery.count()); // when managementService.executeJob(jobId); // then assertEquals(2, query.count()); assertEquals(1, createdQuery.count()); assertEquals(1, succeededQuery.count()); HistoricJobLog createdJobLogEntry = createdQuery.singleResult(); assertEquals(3, createdJobLogEntry.getJobRetries()); HistoricJobLog succeededJobLogEntry = succeededQuery.singleResult(); assertEquals(3, succeededJobLogEntry.getJobRetries()); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testSuccessfulJobEventExecutedByJobExecutor() { // given runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); String jobId = managementService.createJobQuery().singleResult().getId(); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId); HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog(); HistoricJobLogQuery succeededQuery = historyService.createHistoricJobLogQuery().jobId(jobId).successLog(); // there exists one historic job log entry assertEquals(1, query.count()); assertEquals(1, createdQuery.count()); assertEquals(0, succeededQuery.count()); // when executeAvailableJobs(); // then assertEquals(2, query.count()); assertEquals(1, createdQuery.count()); assertEquals(1, succeededQuery.count()); HistoricJobLog createdJobLogEntry = createdQuery.singleResult(); assertEquals(3, createdJobLogEntry.getJobRetries()); HistoricJobLog succeededJobLogEntry = succeededQuery.singleResult(); assertEquals(3, succeededJobLogEntry.getJobRetries()); }
.createHistoricJobLogQuery() .jobId(jobId) .successLog() .singleResult(); assertNotNull(historicJob);
HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog(); HistoricJobLogQuery failedQuery = historyService.createHistoricJobLogQuery().jobId(jobId).failureLog().orderByJobRetries().desc(); HistoricJobLogQuery succeededQuery = historyService.createHistoricJobLogQuery().jobId(jobId).successLog();
HistoricJobLogQuery serviceTask1CreatedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).creationLog(); HistoricJobLogQuery serviceTask1DeletedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).deletionLog(); HistoricJobLogQuery serviceTask1SuccessfulQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).successLog(); HistoricJobLogQuery serviceTask2CreatedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).creationLog(); HistoricJobLogQuery serviceTask2DeletedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).deletionLog(); HistoricJobLogQuery serviceTask2SuccessfulQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).successLog();
HistoricJobLogQuery serviceTask1CreatedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).creationLog(); HistoricJobLogQuery serviceTask1DeletedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).deletionLog(); HistoricJobLogQuery serviceTask1SuccessfulQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).successLog(); HistoricJobLogQuery serviceTask2CreatedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).creationLog(); HistoricJobLogQuery serviceTask2DeletedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).deletionLog(); HistoricJobLogQuery serviceTask2SuccessfulQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).successLog();
.successLog() .singleResult(); assertNotNull(historicJob);
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testQueryBySuccessLog() { runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); String jobId = managementService.createJobQuery().singleResult().getId(); managementService.executeJob(jobId); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().successLog(); verifyQueryResults(query, 1); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuationWithLongId.bpmn20.xml"}) public void testSuccessfulHistoricJobLogEntryStoredForLongActivityId() { runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); Job job = managementService .createJobQuery() .singleResult(); managementService.executeJob(job.getId()); HistoricJobLog historicJob = historyService .createHistoricJobLogQuery() .successLog() .singleResult(); assertNotNull(historicJob); assertEquals("serviceTaskIdIsReallyLongAndItShouldBeMoreThan64CharsSoItWill" + "BlowAnyActivityIdColumnWhereSizeIs64OrLessSoWeAlignItTo255LikeEverywhereElse", historicJob.getActivityId()); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testSuccessfulJobEvent() { // given runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); String jobId = managementService.createJobQuery().singleResult().getId(); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId); HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog(); HistoricJobLogQuery succeededQuery = historyService.createHistoricJobLogQuery().jobId(jobId).successLog(); // there exists one historic job log entry assertEquals(1, query.count()); assertEquals(1, createdQuery.count()); assertEquals(0, succeededQuery.count()); // when managementService.executeJob(jobId); // then assertEquals(2, query.count()); assertEquals(1, createdQuery.count()); assertEquals(1, succeededQuery.count()); HistoricJobLog createdJobLogEntry = createdQuery.singleResult(); assertEquals(3, createdJobLogEntry.getJobRetries()); HistoricJobLog succeededJobLogEntry = succeededQuery.singleResult(); assertEquals(3, succeededJobLogEntry.getJobRetries()); }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testSuccessfulJobEventExecutedByJobExecutor() { // given runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false)); String jobId = managementService.createJobQuery().singleResult().getId(); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId); HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog(); HistoricJobLogQuery succeededQuery = historyService.createHistoricJobLogQuery().jobId(jobId).successLog(); // there exists one historic job log entry assertEquals(1, query.count()); assertEquals(1, createdQuery.count()); assertEquals(0, succeededQuery.count()); // when executeAvailableJobs(); // then assertEquals(2, query.count()); assertEquals(1, createdQuery.count()); assertEquals(1, succeededQuery.count()); HistoricJobLog createdJobLogEntry = createdQuery.singleResult(); assertEquals(3, createdJobLogEntry.getJobRetries()); HistoricJobLog succeededJobLogEntry = succeededQuery.singleResult(); assertEquals(3, succeededJobLogEntry.getJobRetries()); }
.createHistoricJobLogQuery() .jobId(jobId) .successLog() .singleResult(); assertNotNull(historicJob);
HistoricJobLogQuery serviceTask1CreatedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).creationLog(); HistoricJobLogQuery serviceTask1DeletedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).deletionLog(); HistoricJobLogQuery serviceTask1SuccessfulQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask1JobId).successLog(); HistoricJobLogQuery serviceTask2CreatedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).creationLog(); HistoricJobLogQuery serviceTask2DeletedQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).deletionLog(); HistoricJobLogQuery serviceTask2SuccessfulQuery = historyService.createHistoricJobLogQuery().jobId(serviceTask2JobId).successLog();
.successLog() .singleResult(); assertNotNull(historicJob);