Search in sources :

Example 36 with JobDefinitionQuery

use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.

the class JobDefinitionQueryTest method testQueryByInvalidDefinitionKey.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/JobDefinitionQueryTest.testBase.bpmn" })
public void testQueryByInvalidDefinitionKey() {
    JobDefinitionQuery query = managementService.createJobDefinitionQuery().processDefinitionKey("invalid");
    verifyQueryResults(query, 0);
    try {
        managementService.createJobDefinitionQuery().processDefinitionKey(null);
        fail("A ProcessEngineExcpetion was expected.");
    } catch (ProcessEngineException e) {
    }
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 37 with JobDefinitionQuery

use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.

the class JobDefinitionQueryTest method testQueryByInvalidJobConfiguration.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/JobDefinitionQueryTest.testBase.bpmn" })
public void testQueryByInvalidJobConfiguration() {
    JobDefinitionQuery query = managementService.createJobDefinitionQuery().jobConfiguration("invalid");
    verifyQueryResults(query, 0);
    try {
        managementService.createJobDefinitionQuery().jobConfiguration(null);
        fail("A ProcessEngineExcpetion was expected.");
    } catch (ProcessEngineException e) {
    }
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 38 with JobDefinitionQuery

use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.

the class JobDefinitionQueryTest method testQueryByInvalidActivityId.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/JobDefinitionQueryTest.testBase.bpmn" })
public void testQueryByInvalidActivityId() {
    JobDefinitionQuery query = managementService.createJobDefinitionQuery().activityIdIn("invalid");
    verifyQueryResults(query, 0);
    try {
        managementService.createJobDefinitionQuery().activityIdIn(null);
        fail("A ProcessEngineExcpetion was expected.");
    } catch (ProcessEngineException e) {
    }
    try {
        managementService.createJobDefinitionQuery().activityIdIn((String) null);
        fail("A ProcessEngineExcpetion was expected.");
    } catch (ProcessEngineException e) {
    }
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 39 with JobDefinitionQuery

use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.

the class JobDefinitionQueryTest method testQueryByActivityId.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/JobDefinitionQueryTest.testBase.bpmn" })
public void testQueryByActivityId() {
    JobDefinitionQuery query = managementService.createJobDefinitionQuery().activityIdIn("ServiceTask_1");
    verifyQueryResults(query, 1);
    query = managementService.createJobDefinitionQuery().activityIdIn("ServiceTask_1", "BoundaryEvent_1");
    verifyQueryResults(query, 2);
    query = managementService.createJobDefinitionQuery().activityIdIn("ServiceTask_1", "BoundaryEvent_1", "StartEvent_1");
    verifyQueryResults(query, 3);
    query = managementService.createJobDefinitionQuery().activityIdIn("ServiceTask_1", "BoundaryEvent_1", "StartEvent_1", "IntermediateCatchEvent_1");
    verifyQueryResults(query, 4);
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 40 with JobDefinitionQuery

use of org.camunda.bpm.engine.management.JobDefinitionQuery in project camunda-bpm-platform by camunda.

the class JobDefinitionQueryTest method testQueryByProcessDefinitionId.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/JobDefinitionQueryTest.testBase.bpmn" })
public void testQueryByProcessDefinitionId() {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
    JobDefinitionQuery query = managementService.createJobDefinitionQuery().processDefinitionId(processDefinition.getId());
    verifyQueryResults(query, 4);
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)163 Deployment (org.camunda.bpm.engine.test.Deployment)89 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)88 HashMap (java.util.HashMap)86 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)86 Job (org.camunda.bpm.engine.runtime.Job)78 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)54 Test (org.junit.Test)31 Date (java.util.Date)12 InputStream (java.io.InputStream)10 Deployment (org.camunda.bpm.engine.repository.Deployment)10 DeploymentBuilder (org.camunda.bpm.engine.repository.DeploymentBuilder)10 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)6 ArrayList (java.util.ArrayList)2 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 JobDefinitionDto (org.camunda.bpm.engine.rest.dto.management.JobDefinitionDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 Matchers.anyString (org.mockito.Matchers.anyString)1