use of org.camunda.bpm.application.ProcessApplicationDeploymentInfo in project camunda-bpm-platform by camunda.
the class TestWarDeploymentResumePreviousOff method testDeployProcessArchive.
@Test
@OperateOnDeployment(value = PA2)
public void testDeployProcessArchive() {
Assert.assertNotNull(processEngine);
RepositoryService repositoryService = processEngine.getRepositoryService();
long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();
Assert.assertEquals(2, count);
// validate registrations:
ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService();
Set<String> processApplicationNames = processApplicationService.getProcessApplicationNames();
for (String paName : processApplicationNames) {
ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(paName);
List<ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.getDeploymentInfo();
if (deploymentInfo.size() == 2) {
Assert.fail("Previous version of the deployment must not be resumed");
}
}
}
use of org.camunda.bpm.application.ProcessApplicationDeploymentInfo in project camunda-bpm-platform by camunda.
the class IndependentJobExecutionTest method testDeploymentRegistration.
@OperateOnDeployment("pa1")
@Test
public void testDeploymentRegistration() {
Set<String> registeredDeploymentsForEngine1 = engine1.getManagementService().getRegisteredDeployments();
Set<String> registeredDeploymentsForDefaultEngine = processEngine.getManagementService().getRegisteredDeployments();
ProcessApplicationInfo pa1Info = getProcessApplicationDeploymentInfo("pa1");
List<ProcessApplicationDeploymentInfo> pa1DeploymentInfo = pa1Info.getDeploymentInfo();
Assert.assertEquals(1, pa1DeploymentInfo.size());
Assert.assertTrue(registeredDeploymentsForEngine1.contains(pa1DeploymentInfo.get(0).getDeploymentId()));
ProcessApplicationInfo pa2Info = getProcessApplicationDeploymentInfo("pa2");
List<ProcessApplicationDeploymentInfo> pa2DeploymentInfo = pa2Info.getDeploymentInfo();
Assert.assertEquals(1, pa2DeploymentInfo.size());
Assert.assertTrue(registeredDeploymentsForDefaultEngine.contains(pa2DeploymentInfo.get(0).getDeploymentId()));
}
use of org.camunda.bpm.application.ProcessApplicationDeploymentInfo in project camunda-bpm-platform by camunda.
the class TestWarDeploymentResumePreviousOnDeploymentName method testDeployProcessArchive.
@Test
@OperateOnDeployment(value = PA2)
public void testDeployProcessArchive() {
assertThat(processEngine, is(notNullValue()));
RepositoryService repositoryService = processEngine.getRepositoryService();
// since we have two processes deployed for PA2 we gotta check that both are present
long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();
assertThat(count, is(1L));
count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testProcess").count();
assertThat(count, is(1L));
// validate registrations:
ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService();
Set<String> processApplicationNames = processApplicationService.getProcessApplicationNames();
// we have two PAs, one from the first deployment and one from the second
// and only one (the second) is allowed to have two deployments
boolean resumedRegistrationFound = false;
for (String paName : processApplicationNames) {
ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(paName);
List<ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.getDeploymentInfo();
if (deploymentInfo.size() == 2) {
if (resumedRegistrationFound) {
fail("Cannot have two registrations");
}
resumedRegistrationFound = true;
}
}
assertThat("Previous version of the deployment was not resumed", resumedRegistrationFound, is(true));
}
use of org.camunda.bpm.application.ProcessApplicationDeploymentInfo in project camunda-bpm-platform by camunda.
the class TestWarDeploymentResumePreviousOnProcessDefinitionKey method testDeployProcessArchive.
@Test
@OperateOnDeployment(value = PA2)
public void testDeployProcessArchive() {
assertThat(processEngine, is(notNullValue()));
RepositoryService repositoryService = processEngine.getRepositoryService();
long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();
assertThat(count, is(2L));
// validate registrations:
ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService();
Set<String> processApplicationNames = processApplicationService.getProcessApplicationNames();
// we have two PAs, one from the first deployment and one from the second and only one (the second) is allowed to have two deployments
boolean resumedRegistrationFound = false;
for (String paName : processApplicationNames) {
ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(paName);
List<ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.getDeploymentInfo();
if (deploymentInfo.size() == 2) {
if (resumedRegistrationFound) {
fail("Cannot have two registrations");
}
resumedRegistrationFound = true;
}
}
assertThat("Previous version of the deployment was not resumed", resumedRegistrationFound, is(true));
}
Aggregations