示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemWithEnginesAndPropertiesXml() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemWithEnginesAndPropertiesXml()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_AND_PROPERTIES);

            KernelServices   services  = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
            ServiceContainer container = services.Container;


            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultEngineService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__default"));
            ServiceController <object> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__default"));

            assertNotNull("process engine controller for engine __default is installed ", defaultEngineService);

            ManagedProcessEngineMetadata metadata = ((MscManagedProcessEngineController)defaultEngineService.Service).ProcessEngineMetadata;
            IDictionary <string, string> configurationProperties = metadata.ConfigurationProperties;

            assertEquals("default", configurationProperties["job-name"]);
            assertEquals("default", configurationProperties["job-acquisition"]);
            assertEquals("default", configurationProperties["job-acquisition-name"]);

            IDictionary <string, string> foxLegacyProperties = metadata.FoxLegacyProperties;

            assertTrue(foxLegacyProperties.Count == 0);

            assertNotNull("process engine controller for engine __test is installed ", container.getService(ServiceNames.forManagedProcessEngine("__test")));
            assertNotNull("process engine controller for engine __emptyPropertiesTag is installed ", container.getService(ServiceNames.forManagedProcessEngine("__emptyPropertiesTag")));
            assertNotNull("process engine controller for engine __noPropertiesTag is installed ", container.getService(ServiceNames.forManagedProcessEngine("__noPropertiesTag")));
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemXml() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemXml()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_PROCESS_ENGINES_ELEMENT_ONLY);

            KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

            ServiceContainer container = services.Container;

            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemXmlWithEnginePropertiesPluginsAndJobExecutorWithExpressions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemXmlWithEnginePropertiesPluginsAndJobExecutorWithExpressions()
        {
            System.Properties.putAll(EXPRESSION_PROPERTIES);
            try
            {
                string           subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_PROPERTIES_PLUGINS_AND_JOB_EXECUTOR_WITH_EXPRESSIONS);
                KernelServices   services     = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
                ServiceContainer container    = services.Container;

                assertNotNull("platform service should be installed", container.getRequiredService(PLATFORM_SERVICE_NAME));
                assertNotNull("process engine service should be bound in JNDI", container.getRequiredService(processEngineServiceBindingServiceName));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultEngineService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__test"));
                ServiceController <object> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__test"));

                assertNotNull("process engine controller for engine __test is installed ", defaultEngineService);

                ManagedProcessEngineMetadata metadata = ((MscManagedProcessEngineController)defaultEngineService.Service).ProcessEngineMetadata;
                IDictionary <string, string> configurationProperties = metadata.ConfigurationProperties;
                assertEquals("default", configurationProperties["job-acquisition-name"]);

                IDictionary <string, string> foxLegacyProperties = metadata.FoxLegacyProperties;
                assertTrue(foxLegacyProperties.Count == 0);

                assertNotNull("process engine controller for engine __test is installed ", container.getRequiredService(ServiceNames.forManagedProcessEngine("__test")));

                // check we have parsed the plugin configurations
                IList <ProcessEnginePluginXml> pluginConfigurations = metadata.PluginConfigurations;

                assertEquals(1, pluginConfigurations.Count);

                ProcessEnginePluginXml processEnginePluginXml = pluginConfigurations[0];
                assertEquals("org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin", processEnginePluginXml.PluginClass);
                IDictionary <string, string> processEnginePluginXmlProperties = processEnginePluginXml.Properties;
                assertEquals("abc", processEnginePluginXmlProperties["test"]);
                assertEquals("123", processEnginePluginXmlProperties["number"]);
                assertEquals("true", processEnginePluginXmlProperties["bool"]);

                string persistedSubsystemXml = services.PersistedSubsystemXml;
                compareXml(null, subsystemXml, persistedSubsystemXml);
            }
            finally
            {
                foreach (string key in EXPRESSION_PROPERTIES.Keys)
                {
                    System.clearProperty(key);
                }
            }
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testJobAcquisitionStrategyOptional() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testJobAcquisitionStrategyOptional()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_JOB_EXECUTOR_WITHOUT_ACQUISITION_STRATEGY);
            //    System.out.println(normalizeXML(subsystemXml));
            KernelServices   services  = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
            ServiceContainer container = services.Container;

            //    container.dumpServices();

            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

            assertNotNull("platform jobexecutor service should be installed", container.getService(PLATFORM_JOBEXECUTOR_SERVICE_NAME));
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemWithEnginesXml() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemWithEnginesXml()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES);

            KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();


            ServiceContainer container = services.Container;

            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

            assertNotNull("process engine controller for engine __default is installed ", container.getService(ServiceNames.forManagedProcessEngine("__default")));
            assertNotNull("process engine controller for engine __test is installed ", container.getService(ServiceNames.forManagedProcessEngine("__test")));
        }
示例#6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemXmlPlatformPlugins() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemXmlPlatformPlugins()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_PROCESS_ENGINES_ELEMENT_ONLY);

            KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

            ServiceContainer container = services.Container;
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> serviceController = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forBpmPlatformPlugins());
            ServiceController <object> serviceController = container.getService(ServiceNames.forBpmPlatformPlugins());

            assertNotNull(serviceController);
            object platformPlugins = serviceController.Value;

            assertTrue(platformPlugins is BpmPlatformPlugins);
            assertNotNull(platformPlugins);
            IList <BpmPlatformPlugin> plugins = ((BpmPlatformPlugins)platformPlugins).Plugins;

            assertEquals(1, plugins.Count);
            assertTrue(plugins[0] is ExampleBpmPlatformPlugin);
        }
示例#7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemXmlWithEnginesAndJobExecutor() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemXmlWithEnginesAndJobExecutor()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_PROCESS_ENGINES_AND_JOB_EXECUTOR);
            //    System.out.println(normalizeXML(subsystemXml));
            KernelServices   services  = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
            ServiceContainer container = services.Container;

            //    container.dumpServices();

            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("platform jobexecutor service should be installed", container.getService(PLATFORM_JOBEXECUTOR_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

            assertNotNull("process engine controller for engine __default is installed ", container.getService(ServiceNames.forManagedProcessEngine("__default")));
            assertNotNull("process engine controller for engine __test is installed ", container.getService(ServiceNames.forManagedProcessEngine("__test")));


            string persistedSubsystemXml = services.PersistedSubsystemXml;

            //    System.out.println(persistedSubsystemXml);
            compareXml(null, subsystemXml, persistedSubsystemXml);
        }
示例#8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemWithJobExecutorAndPropertiesXml() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemWithJobExecutorAndPropertiesXml()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_JOB_EXECUTOR_AND_PROPERTIES);

            KernelServices   services  = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
            ServiceContainer container = services.Container;

            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

            assertNotNull("platform jobexecutor service should be installed", container.getService(PLATFORM_JOBEXECUTOR_SERVICE_NAME));

            // "default" job acquisition ///////////////////////////////////////////////////////////
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultJobAcquisitionService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forMscRuntimeContainerJobExecutorService("default"));
            ServiceController <object> defaultJobAcquisitionService = container.getService(ServiceNames.forMscRuntimeContainerJobExecutorService("default"));

            assertNotNull("platform job acquisition service 'default' should be installed", defaultJobAcquisitionService);

            object value = defaultJobAcquisitionService.Value;

            assertNotNull(value);
            assertTrue(value is JobExecutor);

            JobExecutor defaultJobExecutor = (JobExecutor)value;

            assertEquals(300000, defaultJobExecutor.LockTimeInMillis);
            assertEquals(5000, defaultJobExecutor.WaitTimeInMillis);
            assertEquals(3, defaultJobExecutor.MaxJobsPerAcquisition);

            // "anders" job acquisition /////////////////////////////////////////////////////////
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> andersJobAcquisitionService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forMscRuntimeContainerJobExecutorService("anders"));
            ServiceController <object> andersJobAcquisitionService = container.getService(ServiceNames.forMscRuntimeContainerJobExecutorService("anders"));

            assertNotNull("platform job acquisition service 'anders' should be installed", andersJobAcquisitionService);

            value = andersJobAcquisitionService.Value;
            assertNotNull(value);
            assertTrue(value is JobExecutor);

            JobExecutor andersJobExecutor = (JobExecutor)value;

            assertEquals(600000, andersJobExecutor.LockTimeInMillis);
            assertEquals(10000, andersJobExecutor.WaitTimeInMillis);
            assertEquals(5, andersJobExecutor.MaxJobsPerAcquisition);

            // "mixed" job acquisition /////////////////////////////////////////////////////////
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> mixedJobAcquisitionService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forMscRuntimeContainerJobExecutorService("mixed"));
            ServiceController <object> mixedJobAcquisitionService = container.getService(ServiceNames.forMscRuntimeContainerJobExecutorService("mixed"));

            assertNotNull("platform job acquisition service 'mixed' should be installed", mixedJobAcquisitionService);

            value = mixedJobAcquisitionService.Value;
            assertNotNull(value);
            assertTrue(value is JobExecutor);

            JobExecutor mixedJobExecutor = (JobExecutor)value;

            assertEquals(500000, mixedJobExecutor.LockTimeInMillis);
            // default values
            assertEquals(5000, mixedJobExecutor.WaitTimeInMillis);
            assertEquals(3, mixedJobExecutor.MaxJobsPerAcquisition);
        }
示例#9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemWithEnginesPropertiesPlugins() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemWithEnginesPropertiesPlugins()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_PROPERTIES_PLUGINS);

            KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

            ServiceContainer container = services.Container;

            assertNotNull("platform service should be installed", container.getRequiredService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getRequiredService(processEngineServiceBindingServiceName));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultEngineService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__default"));
            ServiceController <object> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__default"));

            assertNotNull("process engine controller for engine __default is installed ", defaultEngineService);

            ManagedProcessEngineMetadata metadata = ((MscManagedProcessEngineController)defaultEngineService.Service).ProcessEngineMetadata;
            IDictionary <string, string> configurationProperties = metadata.ConfigurationProperties;

            assertEquals("default", configurationProperties["job-name"]);
            assertEquals("default", configurationProperties["job-acquisition"]);
            assertEquals("default", configurationProperties["job-acquisition-name"]);

            IDictionary <string, string> foxLegacyProperties = metadata.FoxLegacyProperties;

            assertTrue(foxLegacyProperties.Count == 0);

            assertNotNull("process engine controller for engine __default is installed ", container.getRequiredService(ServiceNames.forManagedProcessEngine("__default")));
            assertNotNull("process engine controller for engine __test is installed ", container.getRequiredService(ServiceNames.forManagedProcessEngine("__test")));

            // check we have parsed the plugin configurations
            metadata = ((MscManagedProcessEngineController)container.getRequiredService(ServiceNames.forManagedProcessEngine("__test")).Service).ProcessEngineMetadata;
            IList <ProcessEnginePluginXml> pluginConfigurations = metadata.PluginConfigurations;

            ProcessEnginePluginXml processEnginePluginXml = pluginConfigurations[0];

            assertEquals("org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin", processEnginePluginXml.PluginClass);
            IDictionary <string, string> processEnginePluginXmlProperties = processEnginePluginXml.Properties;

            assertEquals("abc", processEnginePluginXmlProperties["test"]);
            assertEquals("123", processEnginePluginXmlProperties["number"]);
            assertEquals("true", processEnginePluginXmlProperties["bool"]);

            processEnginePluginXml = pluginConfigurations[1];
            assertEquals("org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin", processEnginePluginXml.PluginClass);
            processEnginePluginXmlProperties = processEnginePluginXml.Properties;
            assertEquals("cba", processEnginePluginXmlProperties["test"]);
            assertEquals("321", processEnginePluginXmlProperties["number"]);
            assertEquals("false", processEnginePluginXmlProperties["bool"]);

            // test correct subsystem removal
            assertRemoveSubsystemResources(services);
            try
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> service = container.getRequiredService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__default"));
                ServiceController <object> service = container.getRequiredService(ServiceNames.forManagedProcessEngine("__default"));
                fail("Service '" + service.Name + "' should have been removed.");
            }
            catch (Exception)
            {
                // nop
            }
            try
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> service = container.getRequiredService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__test"));
                ServiceController <object> service = container.getRequiredService(ServiceNames.forManagedProcessEngine("__test"));
                fail("Service '" + service.Name + "' should have been removed.");
            }
            catch (Exception)
            {
                // nop
            }
        }