use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByInvalidExecutionId.
public void testQueryByInvalidExecutionId() {
JobQuery query = managementService.createJobQuery().executionId("invalid");
verifyQueryResults(query, 0);
try {
managementService.createJobQuery().executionId(null).list();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByExecutable.
public void testQueryByExecutable() {
// all jobs should be executable at t3 + 1hour.1second
ClockUtil.setCurrentTime(new Date(timerThreeFireTime.getTime() + ONE_SECOND));
JobQuery query = managementService.createJobQuery().executable();
verifyQueryResults(query, 4);
// Setting retries of one job to 0, makes it non-executable
setRetries(processInstanceIdOne, 0);
verifyQueryResults(query, 3);
// Setting the clock before the start of the process instance, makes none of the jobs executable
ClockUtil.setCurrentTime(testStartTime);
// 1, since a message is always executable when retries > 0
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByDuedateCombinations.
public void testQueryByDuedateCombinations() {
JobQuery query = managementService.createJobQuery().duedateHigherThan(testStartTime).duedateLowerThan(new Date(timerThreeFireTime.getTime() + ONE_SECOND));
verifyQueryResults(query, 3);
query = managementService.createJobQuery().duedateHigherThan(new Date(timerThreeFireTime.getTime() + ONE_SECOND)).duedateLowerThan(testStartTime);
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByInvalidProcessDefinitionId.
public void testQueryByInvalidProcessDefinitionId() {
JobQuery query = managementService.createJobQuery().processDefinitionId("invalid");
verifyQueryResults(query, 0);
try {
managementService.createJobQuery().processDefinitionId(null).list();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByProcessDefinitionId.
public void testQueryByProcessDefinitionId() {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().list().get(0);
JobQuery query = managementService.createJobQuery().processDefinitionId(processDefinition.getId());
verifyQueryResults(query, 3);
}
Aggregations