Search in sources :

Example 16 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentQueryTest method testQueryByDeploymentId.

public void testQueryByDeploymentId() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId(deploymentOneId);
    assertNotNull(query.singleResult());
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 17 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentQueryTest method testQueryByNameLike.

public void testQueryByNameLike() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("%camunda%");
    assertEquals(2, query.list().size());
    assertEquals(2, query.count());
    query = repositoryService.createDeploymentQuery().deploymentNameLike("%two\\_%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertEquals("org/camunda/bpm/engine/test/repository/two_.bpmn20.xml", query.singleResult().getName());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 18 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentQueryTest method testQueryByName.

public void testQueryByName() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("org/camunda/bpm/engine/test/repository/two_.bpmn20.xml");
    assertNotNull(query.singleResult());
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 19 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentQueryTest method testQueryBySource.

public void testQueryBySource() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentSource(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE);
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 20 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class DeploymentQueryTest method testQueryByInvalidNameLike.

public void testQueryByInvalidNameLike() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("invalid");
    assertNull(query.singleResult());
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
    try {
        repositoryService.createDeploymentQuery().deploymentNameLike(null);
        fail();
    } catch (ProcessEngineException e) {
    }
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)58 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)13 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)13 Deployment (org.camunda.bpm.engine.repository.Deployment)11 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)8 Test (org.junit.Test)7 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)4