Esempio n. 1
0
        public virtual void testParseBpmPlatformXmlOneEngine()
        {
            BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_one_engine.xml")).execute().BpmPlatformXml;

            assertNotNull(bpmPlatformXml);
            assertNotNull(bpmPlatformXml.JobExecutor);
            assertEquals(1, bpmPlatformXml.ProcessEngines.Count);

            JobExecutorXml jobExecutorXml = bpmPlatformXml.JobExecutor;

            assertEquals(1, jobExecutorXml.JobAcquisitions.Count);
            assertThat(jobExecutorXml.Properties.Count, @is(2));

            JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.JobAcquisitions[0];

            assertEquals("default", jobAcquisitionXml.Name);
            assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.JobExecutorClassName);

            assertEquals(2, jobAcquisitionXml.Properties.Count);

            ProcessEngineXml engineXml = bpmPlatformXml.ProcessEngines[0];

            assertEquals("engine1", engineXml.Name);
            assertEquals("default", engineXml.JobAcquisitionName);

            IDictionary <string, string> properties = engineXml.Properties;

            assertNotNull(properties);
            assertEquals(0, properties.Count);

            IList <ProcessEnginePluginXml> plugins = engineXml.Plugins;

            assertNotNull(plugins);
            assertEquals(0, plugins.Count);
        }
Esempio n. 2
0
        private JobExecutorXml getJobExecutorXml(DeploymentOperation operationContext)
        {
            BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(Attachments.BPM_PLATFORM_XML);
            JobExecutorXml jobExecutorXml = bpmPlatformXml.JobExecutor;

            return(jobExecutorXml);
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void setUp()
        {
            step = new StartManagedThreadPoolStep();
            deploymentOperation = new DeploymentOperation("name", container, System.Linq.Enumerable.Empty <DeploymentOperationStep> ());
            jobExecutorXml      = new JobExecutorXmlImpl();
            bpmPlatformXml      = new BpmPlatformXmlImpl(jobExecutorXml, System.Linq.Enumerable.Empty <ProcessEngineXml>());
            deploymentOperation.addAttachment(Attachments.BPM_PLATFORM_XML, bpmPlatformXml);
        }
Esempio n. 4
0
        protected internal override IList <ProcessEngineXml> getProcessEnginesXmls(DeploymentOperation operationContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.metadata.spi.BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(BPM_PLATFORM_XML);
            BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(BPM_PLATFORM_XML);

            return(bpmPlatformXml.ProcessEngines);
        }
Esempio n. 5
0
        public override void performOperationStep(DeploymentOperation operationContext)
        {
            URL bpmPlatformXmlSource = getBpmPlatformXmlStream(operationContext);

            ensureNotNull("Unable to find bpm-platform.xml. This file is necessary for deploying the camunda BPM platform", "bpmPlatformXmlSource", bpmPlatformXmlSource);

            // parse the bpm platform xml
            BpmPlatformXml bpmPlatformXml = (new BpmPlatformXmlParser()).createParse().sourceUrl(bpmPlatformXmlSource).execute().BpmPlatformXml;

            // attach to operation context
            operationContext.addAttachment(Attachments.BPM_PLATFORM_XML, bpmPlatformXml);
        }
Esempio n. 6
0
        public override void performOperationStep(DeploymentOperation operationContext)
        {
            BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(Attachments.BPM_PLATFORM_XML);

            checkConfiguration(bpmPlatformXml.JobExecutor);

//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;

            serviceContainer.startService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_EXECUTOR, new JcaExecutorServiceDelegate(executorService));
        }
Esempio n. 7
0
        public virtual void testParseBpmPlatformXmlMultipleEnginePlugins()
        {
            BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_multiple_engine_plugins.xml")).execute().BpmPlatformXml;

            assertNotNull(bpmPlatformXml);
            assertEquals(1, bpmPlatformXml.ProcessEngines.Count);

            ProcessEngineXml engineXml = bpmPlatformXml.ProcessEngines[0];

            assertEquals("engine1", engineXml.Name);
            assertEquals("default", engineXml.JobAcquisitionName);

            IList <ProcessEnginePluginXml> plugins = engineXml.Plugins;

            assertEquals(2, plugins.Count);
        }
Esempio n. 8
0
        public virtual void testParseBpmPlatformXmlNoEngine()
        {
            BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_no_engine.xml")).execute().BpmPlatformXml;

            assertNotNull(bpmPlatformXml);
            assertNotNull(bpmPlatformXml.JobExecutor);
            assertEquals(0, bpmPlatformXml.ProcessEngines.Count);

            JobExecutorXml jobExecutorXml = bpmPlatformXml.JobExecutor;

            assertEquals(1, jobExecutorXml.JobAcquisitions.Count);

            JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.JobAcquisitions[0];

            assertEquals("default", jobAcquisitionXml.Name);
            assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.JobExecutorClassName);

            assertEquals(2, jobAcquisitionXml.Properties.Count);
        }
Esempio n. 9
0
        public virtual void testParseProcessesXmlAntStyleProperties()
        {
            BpmPlatformXml platformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_ant_style_properties.xml")).execute().BpmPlatformXml;

            assertNotNull(platformXml);

            ProcessEngineXml engineXml = platformXml.ProcessEngines[0];

            assertEquals(1, engineXml.Plugins.Count);
            ProcessEnginePluginXml pluginXml = engineXml.Plugins[0];

            IDictionary <string, string> properties = pluginXml.Properties;

            assertEquals(2, properties.Count);

            // these two system properties are guaranteed to be set
            assertEquals(System.getProperty("java.version"), properties["prop1"]);
            assertEquals("prefix-" + System.getProperty("os.name"), properties["prop2"]);
        }
Esempio n. 10
0
        /// <summary>
        /// We know this is a <code>&lt;bpm-platform ../&gt;</code> element </summary>
        protected internal override void parseRootElement()
        {
            JobExecutorXmlImpl       jobExecutor    = new JobExecutorXmlImpl();
            IList <ProcessEngineXml> processEngines = new List <ProcessEngineXml>();

            foreach (Element element in rootElement.elements())
            {
                if (JOB_EXECUTOR.Equals(element.TagName))
                {
                    parseJobExecutor(element, jobExecutor);
                }
                else if (PROCESS_ENGINE.Equals(element.TagName))
                {
                    parseProcessEngine(element, processEngines);
                }
            }

            bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutor, processEngines);
        }
Esempio n. 11
0
        public virtual void testParseBpmPlatformXmlEnginePlugin()
        {
            BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_engine_plugin.xml")).execute().BpmPlatformXml;

            assertNotNull(bpmPlatformXml);
            assertEquals(1, bpmPlatformXml.ProcessEngines.Count);

            ProcessEngineXml engineXml = bpmPlatformXml.ProcessEngines[0];

            assertEquals("engine1", engineXml.Name);
            assertEquals("default", engineXml.JobAcquisitionName);

            IList <ProcessEnginePluginXml> plugins = engineXml.Plugins;

            assertEquals(1, plugins.Count);

            ProcessEnginePluginXml plugin1 = plugins[0];

            assertNotNull(plugin1);

            assertEquals("org.camunda.bpm.MyAwesomePlugin", plugin1.PluginClass);

            IDictionary <string, string> properties = plugin1.Properties;

            assertNotNull(properties);
            assertEquals(2, properties.Count);

            string val1 = properties["prop1"];

            assertNotNull(val1);
            assertEquals("val1", val1);

            string val2 = properties["prop2"];

            assertNotNull(val2);
            assertEquals("val2", val2);
        }