Search in sources :

Example 6 with ProcessApplicationDeploymentInfo

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");
        }
    }
}
Also used : ProcessApplicationDeploymentInfo(org.camunda.bpm.application.ProcessApplicationDeploymentInfo) ProcessApplicationService(org.camunda.bpm.ProcessApplicationService) ProcessApplicationInfo(org.camunda.bpm.application.ProcessApplicationInfo) RepositoryService(org.camunda.bpm.engine.RepositoryService) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Example 7 with ProcessApplicationDeploymentInfo

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()));
}
Also used : ProcessApplicationDeploymentInfo(org.camunda.bpm.application.ProcessApplicationDeploymentInfo) ProcessApplicationInfo(org.camunda.bpm.application.ProcessApplicationInfo) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest) Test(org.junit.Test)

Example 8 with ProcessApplicationDeploymentInfo

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));
}
Also used : ProcessApplicationDeploymentInfo(org.camunda.bpm.application.ProcessApplicationDeploymentInfo) ProcessApplicationService(org.camunda.bpm.ProcessApplicationService) ProcessApplicationInfo(org.camunda.bpm.application.ProcessApplicationInfo) RepositoryService(org.camunda.bpm.engine.RepositoryService) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Example 9 with ProcessApplicationDeploymentInfo

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));
}
Also used : ProcessApplicationDeploymentInfo(org.camunda.bpm.application.ProcessApplicationDeploymentInfo) ProcessApplicationService(org.camunda.bpm.ProcessApplicationService) ProcessApplicationInfo(org.camunda.bpm.application.ProcessApplicationInfo) RepositoryService(org.camunda.bpm.engine.RepositoryService) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Aggregations

ProcessApplicationDeploymentInfo (org.camunda.bpm.application.ProcessApplicationDeploymentInfo)9 ProcessApplicationInfo (org.camunda.bpm.application.ProcessApplicationInfo)7 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)6 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)6 Test (org.junit.Test)6 ProcessApplicationService (org.camunda.bpm.ProcessApplicationService)5 RepositoryService (org.camunda.bpm.engine.RepositoryService)5 ArrayList (java.util.ArrayList)3 ProcessApplicationDeploymentInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationDeploymentInfoImpl)2 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 ProcessApplicationInterface (org.camunda.bpm.application.ProcessApplicationInterface)1 DeployedProcessArchive (org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive)1 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)1 ComponentView (org.jboss.as.ee.component.ComponentView)1 ManagedReference (org.jboss.as.naming.ManagedReference)1 ServiceName (org.jboss.msc.service.ServiceName)1 StartException (org.jboss.msc.service.StartException)1