public Set<String> getProcessApplicationNames() { return processApplicationServiceDelegate.getProcessApplicationNames(); }
@Test public void testProcessApplicationName() { Set<String> paNames = BpmPlatform.getProcessApplicationService().getProcessApplicationNames(); Assert.assertEquals(1, paNames.size()); Assert.assertTrue(paNames.contains(CustomNameServletPA.NAME)); } }
@Test @OperateOnDeployment("checkDeployment") public void testNoProcessApplicationIsDeployed() { Set<String> registeredPAs = BpmPlatform.getProcessApplicationService().getProcessApplicationNames(); Assert.assertTrue(registeredPAs.isEmpty()); } }
public void testDeployProcessApplicationWithNameAttribute() { TestApplicationWithCustomName pa = new TestApplicationWithCustomName(); pa.deploy(); Set<String> deployedPAs = runtimeContainerDelegate.getProcessApplicationService().getProcessApplicationNames(); assertEquals(1, deployedPAs.size()); assertTrue(deployedPAs.contains(TestApplicationWithCustomName.NAME)); pa.undeploy(); }
@Test @OperateOnDeployment("test1") public void testProcessApplicationsDeployed() { ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService(); Set<String> processApplicationNames = processApplicationService.getProcessApplicationNames(); // check if the new applications are deployed with allowed names processApplicationNames.retainAll(Arrays.asList(new String [] {"test1", "test2", "/test1", "/test2"})); Assert.assertEquals(2, processApplicationNames.size()); for (String appName : processApplicationNames) { ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(appName); Assert.assertNotNull(processApplicationInfo); Assert.assertNotNull(processApplicationInfo.getName()); Assert.assertEquals(1, processApplicationInfo.getDeploymentInfo().size()); } }
public Set<String> getProcessApplicationNames() { return processApplicationServiceDelegate.getProcessApplicationNames(); }
@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)); } }
Set<String> processApplicationNames = processApplicationService.getProcessApplicationNames();
@Test public void testDeployProcessArchive() { Assert.assertNotNull(processEngine); RepositoryService repositoryService = processEngine.getRepositoryService(); List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery() .processDefinitionKey("testDeployProcessArchive") .list(); Assert.assertEquals(1, processDefinitions.size()); org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeploymentQuery() .deploymentId(processDefinitions.get(0).getDeploymentId()) .singleResult(); Set<String> registeredProcessApplications = BpmPlatform.getProcessApplicationService().getProcessApplicationNames(); boolean containsProcessApplication = false; // the process application name is used as name for the db deployment for (String appName : registeredProcessApplications) { if (appName.equals(deployment.getName())) { containsProcessApplication = true; } } assertTrue(containsProcessApplication); // manually delete process definition here (to clean up) repositoryService.deleteDeployment(deployment.getId(), true); }
@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"); } } }
@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(); boolean resumedRegistrationFound = false; for (String paName : processApplicationNames) { ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(paName); List<ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.getDeploymentInfo(); if(deploymentInfo.size() == 2) { if(resumedRegistrationFound) { Assert.fail("Cannot have two registrations"); } resumedRegistrationFound = true; } } Assert.assertTrue("Previous version of the deployment was not resumed", resumedRegistrationFound); }
@Test @OperateOnDeployment(value=PA2) public void testDeployProcessArchive() { Assert.assertNotNull(processEngine); RepositoryService repositoryService = processEngine.getRepositoryService(); long count = repositoryService.createProcessDefinitionQuery() .processDefinitionKey("testDeployProcessArchive") .count(); Assert.assertEquals(1, count); // validate registrations: ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService(); Set<String> processApplicationNames = processApplicationService.getProcessApplicationNames(); boolean resumedRegistrationFound = false; for (String paName : processApplicationNames) { ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(paName); List<ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.getDeploymentInfo(); if(deploymentInfo.size() == 2) { if(resumedRegistrationFound) { Assert.fail("Cannot have two registrations"); } resumedRegistrationFound = true; } } Assert.assertTrue("Previous version of the deployment was not resumed", resumedRegistrationFound); }
public void testDeployProcessApplicationWithNameAttribute() { TestApplicationWithCustomName pa = new TestApplicationWithCustomName(); pa.deploy(); Set<String> deployedPAs = runtimeContainerDelegate.getProcessApplicationService().getProcessApplicationNames(); assertEquals(1, deployedPAs.size()); assertTrue(deployedPAs.contains(TestApplicationWithCustomName.NAME)); pa.undeploy(); }