Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment(value=PA2) public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            assertThat(processEngine, @is(notNullValue()));
            RepositoryService repositoryService = processEngine.RepositoryService;
            long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();

            assertThat(count, @is(2L));

            // validate registrations:
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;
            ISet <string>             processApplicationNames   = processApplicationService.ProcessApplicationNames;
            // 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
            bool resumedRegistrationFound = false;

            foreach (string paName in processApplicationNames)
            {
                ProcessApplicationInfo processApplicationInfo           = processApplicationService.getProcessApplicationInfo(paName);
                IList <ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.DeploymentInfo;
                if (deploymentInfo.Count == 2)
                {
                    if (resumedRegistrationFound)
                    {
                        fail("Cannot have two registrations");
                    }
                    resumedRegistrationFound = true;
                }
            }
            assertThat("Previous version of the deployment was not resumed", resumedRegistrationFound, @is(true));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment(value=PA2) public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            Assert.assertNotNull(processEngine);
            RepositoryService repositoryService = processEngine.RepositoryService;
            long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();

            Assert.assertEquals(1, count);

            // validate registrations:
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;
            ISet <string>             processApplicationNames   = processApplicationService.ProcessApplicationNames;
            bool resumedRegistrationFound = false;

            foreach (string paName in processApplicationNames)
            {
                ProcessApplicationInfo processApplicationInfo           = processApplicationService.getProcessApplicationInfo(paName);
                IList <ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.DeploymentInfo;
                if (deploymentInfo.Count == 2)
                {
                    if (resumedRegistrationFound)
                    {
                        Assert.fail("Cannot have two registrations");
                    }
                    resumedRegistrationFound = true;
                }
            }
            Assert.assertTrue("Previous version of the deployment was not resumed", resumedRegistrationFound);
        }
Ejemplo n.º 3
0
        private ProcessApplicationInfo getProcessApplicationDeploymentInfo(string applicationName)
        {
            ProcessApplicationInfo processApplicationInfo = BpmPlatform.ProcessApplicationService.getProcessApplicationInfo(applicationName);

            if (processApplicationInfo == null)
            {
                processApplicationInfo = BpmPlatform.ProcessApplicationService.getProcessApplicationInfo("/" + applicationName);
            }
            return(processApplicationInfo);
        }
Ejemplo n.º 4
0
        public static IList <ProcessEngine> getProcessEngines(DeploymentOperation operationContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
            PlatformServiceContainer serviceContainer = operationContext.ServiceContainer;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.application.ProcessApplicationInfo processApplicationInfo = getProcessApplicationInfo(operationContext);
            ProcessApplicationInfo processApplicationInfo = getProcessApplicationInfo(operationContext);

            IList <ProcessEngine> processEngines = new List <ProcessEngine>();

            foreach (ProcessApplicationDeploymentInfo deploymentInfo in processApplicationInfo.DeploymentInfo)
            {
                string processEngineName = deploymentInfo.ProcessEngineName;
                processEngines.Add((ProcessEngine)serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName));
            }

            return(processEngines);
        }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @OperateOnDeployment("pa1") @Test public void testDeploymentRegistration()
        public virtual void testDeploymentRegistration()
        {
            ISet <string> registeredDeploymentsForEngine1       = engine1.ManagementService.RegisteredDeployments;
            ISet <string> registeredDeploymentsForDefaultEngine = processEngine.ManagementService.RegisteredDeployments;

            ProcessApplicationInfo pa1Info = getProcessApplicationDeploymentInfo("pa1");

            IList <ProcessApplicationDeploymentInfo> pa1DeploymentInfo = pa1Info.DeploymentInfo;

            Assert.assertEquals(1, pa1DeploymentInfo.Count);
            Assert.assertTrue(registeredDeploymentsForEngine1.Contains(pa1DeploymentInfo[0].DeploymentId));

            ProcessApplicationInfo pa2Info = getProcessApplicationDeploymentInfo("pa2");

            IList <ProcessApplicationDeploymentInfo> pa2DeploymentInfo = pa2Info.DeploymentInfo;

            Assert.assertEquals(1, pa2DeploymentInfo.Count);
            Assert.assertTrue(registeredDeploymentsForDefaultEngine.Contains(pa2DeploymentInfo[0].DeploymentId));
        }
Ejemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment("test1") public void testProcessApplicationsDeployed()
        public virtual void testProcessApplicationsDeployed()
        {
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;

            ISet <string> processApplicationNames = processApplicationService.ProcessApplicationNames;

            // check if the new applications are deployed with allowed names
//JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'retainAll' method:
            processApplicationNames.retainAll(Arrays.asList(new string [] { "test1", "test2", "/test1", "/test2" }));

            Assert.assertEquals(2, processApplicationNames.Count);

            foreach (string appName in processApplicationNames)
            {
                ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(appName);

                Assert.assertNotNull(processApplicationInfo);
                Assert.assertNotNull(processApplicationInfo.Name);
                Assert.assertEquals(1, processApplicationInfo.DeploymentInfo.Count);
            }
        }
Ejemplo n.º 7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @PostDeploy public void injectDefaultEngine(org.camunda.bpm.engine.ProcessEngine processEngine, java.util.List<org.camunda.bpm.engine.ProcessEngine> processEngines, org.camunda.bpm.application.ProcessApplicationInfo processApplicationInfo)
        public virtual void injectDefaultEngine(ProcessEngine processEngine, IList <ProcessEngine> processEngines, ProcessApplicationInfo processApplicationInfo)
        {
            PostDeployInjectApp.processEngine          = processEngine;
            PostDeployInjectApp.processEngines         = processEngines;
            PostDeployInjectApp.processApplicationInfo = processApplicationInfo;
        }