use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentNoChanges.
public void testProcessApplicationDeploymentNoChanges() {
// create initial deployment
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addClasspathResource("org/camunda/bpm/engine/test/api/repository/version1.bpmn20.xml").deploy();
assertThatOneProcessIsDeployed();
// deploy update with no changes:
deployment = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(false).addClasspathResource("org/camunda/bpm/engine/test/api/repository/version1.bpmn20.xml").deploy();
// no changes
assertThatOneProcessIsDeployed();
ProcessApplicationRegistration registration = deployment.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(1, deploymentIds.size());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment);
}
use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentResumePreviousVersions.
public void testProcessApplicationDeploymentResumePreviousVersions() {
// create initial deployment
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addClasspathResource("org/camunda/bpm/engine/test/api/repository/version1.bpmn20.xml").deploy();
assertThatOneProcessIsDeployed();
// deploy update with changes:
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(false).resumePreviousVersions().addClasspathResource("org/camunda/bpm/engine/test/api/repository/version2.bpmn20.xml").deploy();
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionVersion().asc().list();
// now there are 2 process definitions deployed
assertEquals(1, processDefinitions.get(0).getVersion());
assertEquals(2, processDefinitions.get(1).getVersion());
// old deployment was resumed
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(2, deploymentIds.size());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment1, deployment2);
}
Aggregations