Search in sources :

Example 31 with DeploymentQuery

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

the class MultiTenancyDeploymentQueryTest method testQueryByTenantId.

public void testQueryByTenantId() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_ONE);
    assertThat(query.count(), is(1L));
    query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_TWO);
    assertThat(query.count(), is(1L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 32 with DeploymentQuery

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

the class DeploymentQueryTest method testQueryByInvalidDeploymentId.

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

Example 33 with DeploymentQuery

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

the class DeploymentQueryTest method testQueryByInvalidSource.

public void testQueryByInvalidSource() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentSource("invalid");
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 34 with DeploymentQuery

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

the class DeploymentQueryTest method testQueryByNullSource.

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

Example 35 with DeploymentQuery

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

the class ProcessApplicationDeploymentTest method testNullAndNotNullDeploymentSourceShouldDeployNewVersion.

public void testNullAndNotNullDeploymentSourceShouldDeployNewVersion() {
    // given
    String key = "process";
    String name = "my-deployment";
    BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
    ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key);
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentName(name);
    // when
    ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
    assertEquals(1, processDefinitionQuery.count());
    assertEquals(1, deploymentQuery.count());
    ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(name).source("my-source2").addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
    // then
    assertEquals(2, processDefinitionQuery.count());
    assertEquals(2, deploymentQuery.count());
    deleteDeployments(deployment1, deployment2);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) ProcessDefinitionQuery(org.camunda.bpm.engine.repository.ProcessDefinitionQuery) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

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