use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationAndNullDeploymentSourceAwareDuplicateFilter.
public void testProcessApplicationAndNullDeploymentSourceAwareDuplicateFilter() {
// 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).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
// then
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testSameDeploymentSourceAwareDuplicateFilter.
public void testSameDeploymentSourceAwareDuplicateFilter() {
// 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("cockpit").addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("my-deployment").source("cockpit").addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
// then
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testNotNullAndNullDeploymentSourceShouldDeployNewVersion.
public void testNotNullAndNullDeploymentSourceShouldDeployNewVersion() {
// 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("my-source1").addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
// then
assertEquals(2, processDefinitionQuery.count());
assertEquals(2, deploymentQuery.count());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testDeploymentSourceShouldNotBeNull.
public void testDeploymentSourceShouldNotBeNull() {
String key = "process";
BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
Deployment deployment1 = repositoryService.createDeployment().name("first-deployment-without-a-source").source("my-first-deployment-source").addModelInstance("process.bpmn", model).deploy();
assertEquals("my-first-deployment-source", deploymentQuery.deploymentName("first-deployment-without-a-source").singleResult().getSource());
Deployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("second-deployment-with-a-source").source("my-second-deployment-source").addModelInstance("process.bpmn", model).deploy();
assertEquals("my-second-deployment-source", deploymentQuery.deploymentName("second-deployment-with-a-source").singleResult().getSource());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testDifferentDeploymentSourceShouldDeployNewVersion.
public void testDifferentDeploymentSourceShouldDeployNewVersion() {
// 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("my-source1").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);
}
Aggregations