public ProcessApplicationInfo getProcessApplicationInfo(String processApplicationName) { return processApplicationServiceDelegate.getProcessApplicationInfo(processApplicationName); }
private ProcessApplicationInfo getProcessApplicationDeploymentInfo(String applicationName) { ProcessApplicationInfo processApplicationInfo = BpmPlatform.getProcessApplicationService().getProcessApplicationInfo(applicationName); if (processApplicationInfo == null) { processApplicationInfo = BpmPlatform.getProcessApplicationService().getProcessApplicationInfo("/" + applicationName); } return processApplicationInfo; }
@Before public void setUpRuntimeData() { ProcessDefinition mockDefinition = MockProvider.createMockDefinition(); setUpRuntimeDataForDefinition(mockDefinition); managementServiceMock = mock(ManagementService.class); when(processEngine.getManagementService()).thenReturn(managementServiceMock); when(managementServiceMock.getProcessApplicationForDeployment(MockProvider.EXAMPLE_DEPLOYMENT_ID)).thenReturn(MockProvider.EXAMPLE_PROCESS_APPLICATION_NAME); // replace the runtime container delegate & process application service with a mock ProcessApplicationService processApplicationService = mock(ProcessApplicationService.class); ProcessApplicationInfo appMock = MockProvider.createMockProcessApplicationInfo(); when(processApplicationService.getProcessApplicationInfo(MockProvider.EXAMPLE_PROCESS_APPLICATION_NAME)).thenReturn(appMock); RuntimeContainerDelegate delegate = mock(RuntimeContainerDelegate.class); when(delegate.getProcessApplicationService()).thenReturn(processApplicationService); RuntimeContainerDelegate.INSTANCE.set(delegate); }
@Test public void shouldDeployApp() { Assert.assertNotNull(BpmPlatform.getProcessApplicationService() .getProcessApplicationInfo(PaDataformatAndPostDeployApp.PA_NAME)); }
@Test public void test() { ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService(); Assert.assertNotNull(processApplicationService.getProcessApplicationInfo("pa")); }
public static String getApplicationPathForDeployment(ProcessEngine engine, String deploymentId) { // get the name of the process application that made the deployment String processApplicationName = null; IdentityService identityService = engine.getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); try { identityService.clearAuthentication(); processApplicationName = engine.getManagementService().getProcessApplicationForDeployment(deploymentId); } finally { identityService.setAuthentication(currentAuthentication); } if (processApplicationName == null) { // no a process application deployment return null; } else { ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService(); ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(processApplicationName); return processApplicationInfo.getProperties().get(ProcessApplicationInfo.PROP_SERVLET_CONTEXT_PATH); } } }
public static String getApplicationPathForDeployment(ProcessEngine engine, String deploymentId) { // get the name of the process application that made the deployment String processApplicationName = null; IdentityService identityService = engine.getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); try { identityService.clearAuthentication(); processApplicationName = engine.getManagementService().getProcessApplicationForDeployment(deploymentId); } finally { identityService.setAuthentication(currentAuthentication); } if (processApplicationName == null) { // no a process application deployment return null; } else { ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService(); ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(processApplicationName); return processApplicationInfo.getProperties().get(ProcessApplicationInfo.PROP_SERVLET_CONTEXT_PATH); } } }
when(processApplicationService.getProcessApplicationInfo(MockProvider.EXAMPLE_PROCESS_APPLICATION_NAME)).thenReturn(appMock);
@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 ProcessApplicationInfo getProcessApplicationInfo(String processApplicationName) { return processApplicationServiceDelegate.getProcessApplicationInfo(processApplicationName); }
@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)); } }
ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(paName); List<ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.getDeploymentInfo(); if (deploymentInfo.size() == 2) {
when(processApplicationService.getProcessApplicationInfo(MockProvider.EXAMPLE_PROCESS_APPLICATION_NAME)).thenReturn(appMock);
@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 static String getApplicationPathForDeployment(ProcessEngine engine, String deploymentId) { // get the name of the process application that made the deployment String processApplicationName = null; IdentityService identityService = engine.getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); try { identityService.clearAuthentication(); processApplicationName = engine.getManagementService().getProcessApplicationForDeployment(deploymentId); } finally { identityService.setAuthentication(currentAuthentication); } if (processApplicationName == null) { // no a process application deployment return null; } else { ProcessApplicationService processApplicationService = BpmPlatform.getProcessApplicationService(); ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(processApplicationName); return processApplicationInfo.getProperties().get(ProcessApplicationInfo.PROP_SERVLET_CONTEXT_PATH); } } }