Search in sources :

Example 1 with JobQuery

use of org.activiti.engine.runtime.JobQuery in project Activiti by Activiti.

the class JobQueryTest method testQueryByExecutionId.

public void testQueryByExecutionId() {
    Job job = managementService.createJobQuery().processInstanceId(processInstanceIdOne).singleResult();
    JobQuery query = managementService.createJobQuery().executionId(job.getExecutionId());
    assertEquals(query.singleResult().getId(), job.getId());
    verifyQueryResults(query, 1);
}
Also used : JobQuery(org.activiti.engine.runtime.JobQuery) Job(org.activiti.engine.runtime.Job)

Example 2 with JobQuery

use of org.activiti.engine.runtime.JobQuery in project Activiti by Activiti.

the class JobQueryTest method testQueryByOnlyMessages.

public void testQueryByOnlyMessages() {
    JobQuery query = managementService.createJobQuery().messages();
    verifyQueryResults(query, 1);
}
Also used : JobQuery(org.activiti.engine.runtime.JobQuery)

Example 3 with JobQuery

use of org.activiti.engine.runtime.JobQuery in project Activiti by Activiti.

the class JobQueryTest method testQueryByOnlyTimers.

public void testQueryByOnlyTimers() {
    JobQuery query = managementService.createJobQuery().timers();
    verifyQueryResults(query, 3);
}
Also used : JobQuery(org.activiti.engine.runtime.JobQuery)

Example 4 with JobQuery

use of org.activiti.engine.runtime.JobQuery in project Activiti by Activiti.

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 (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) JobQuery(org.activiti.engine.runtime.JobQuery)

Example 5 with JobQuery

use of org.activiti.engine.runtime.JobQuery in project Activiti by Activiti.

the class JobQueryTest method testQueryByNoCriteria.

public void testQueryByNoCriteria() {
    JobQuery query = managementService.createJobQuery();
    verifyQueryResults(query, 4);
}
Also used : JobQuery(org.activiti.engine.runtime.JobQuery)

Aggregations

JobQuery (org.activiti.engine.runtime.JobQuery)39 Deployment (org.activiti.engine.test.Deployment)20 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)17 Date (java.util.Date)15 Job (org.activiti.engine.runtime.Job)9 Task (org.activiti.engine.task.Task)5 HashMap (java.util.HashMap)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 SimpleDateFormat (java.text.SimpleDateFormat)2 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)2 Execution (org.activiti.engine.runtime.Execution)2 ProcessInstanceQuery (org.activiti.engine.runtime.ProcessInstanceQuery)2 Test (org.junit.Test)2 InOrder (org.mockito.InOrder)2 ArrayList (java.util.ArrayList)1 HistoricProcessInstanceQuery (org.activiti.engine.history.HistoricProcessInstanceQuery)1