Search in sources :

Example 26 with DeploymentQuery

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

the class MultiTenancyDeploymentCmdsTenantCheckTest method redeployForTheSameAuthenticatedTenant.

@Test
public void redeployForTheSameAuthenticatedTenant() {
    Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    repositoryService.createDeployment().addDeploymentResources(deploymentOne.getId()).tenantId(TENANT_ONE).deploy();
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertThat(query.count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 27 with DeploymentQuery

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

the class ConcurrentDeploymentTest method testDuplicateFiltering.

/**
 * @see https://app.camunda.com/jira/browse/CAM-2128
 */
public void testDuplicateFiltering() throws InterruptedException {
    deployOnTwoConcurrentThreads(createDeploymentBuilder().enableDuplicateFiltering(false), createDeploymentBuilder().enableDuplicateFiltering(false));
    // ensure that although both transactions were run concurrently, only one deployment was constructed.
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
    assertThat(deploymentQuery.count(), is(1L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery)

Example 28 with DeploymentQuery

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

the class TestWarDeploymentWithMultiplePasAsSubdeployment4 method assertProcessDeployed.

protected void assertProcessDeployed(String processKey, String expectedDeploymentName) {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionKey(processKey).singleResult();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentId(processDefinition.getDeploymentId());
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition)

Example 29 with DeploymentQuery

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

the class TestWarDeploymentWithMultiplePasAsSubdeployment3 method assertProcessDeployed.

protected void assertProcessDeployed(String processKey, String expectedDeploymentName) {
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionKey(processKey).singleResult();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentId(processDefinition.getDeploymentId());
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition)

Example 30 with DeploymentQuery

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

the class MultiTenancyDeploymentQueryTest method testQueryByTenantIds.

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

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