Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void performOperationStepWithDefaultProperties()
        public virtual void performOperationStepWithDefaultProperties()
        {
            IDictionary <string, string> properties = new Dictionary <string, string>();

            jobExecutorXml.Properties = properties;
            step.performOperationStep(deploymentOperation);

            PlatformService <JmxManagedThreadPool> service = container.getService(ObjectNameForExecutor);
            ThreadPoolExecutor executor = service.Value.ThreadPoolExecutor;

            //since no jobs will start, remaining capacity is sufficent to check the size
            assertThat(executor.Queue.remainingCapacity(), @is(3));
            assertThat(executor.CorePoolSize, @is(3));
            assertThat(executor.MaximumPoolSize, @is(10));
            assertThat(executor.getKeepAliveTime(TimeUnit.MILLISECONDS), @is(0L));
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void performOperationStepWithPropertiesInXml()
        public virtual void performOperationStepWithPropertiesInXml()
        {
            IDictionary <string, string> properties = new Dictionary <string, string>();
            string queueSize     = "5";
            string corePoolSize  = "12";
            string maxPoolSize   = "20";
            string keepAliveTime = "100";

            properties[org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml_Fields.CORE_POOL_SIZE]  = corePoolSize;
            properties[org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml_Fields.KEEP_ALIVE_TIME] = keepAliveTime;
            properties[org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml_Fields.MAX_POOL_SIZE]   = maxPoolSize;
            properties[org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml_Fields.QUEUE_SIZE]      = queueSize;
            jobExecutorXml.Properties = properties;
            step.performOperationStep(deploymentOperation);

            PlatformService <JmxManagedThreadPool> service = container.getService(ObjectNameForExecutor);
            ThreadPoolExecutor executor = service.Value.ThreadPoolExecutor;

            //since no jobs will start, remaining capacity is sufficent to check the size
            assertThat(executor.Queue.remainingCapacity(), @is(int.Parse(queueSize)));
            assertThat(executor.CorePoolSize, @is(int.Parse(corePoolSize)));
            assertThat(executor.MaximumPoolSize, @is(int.Parse(maxPoolSize)));
            assertThat(executor.getKeepAliveTime(TimeUnit.MILLISECONDS), @is(long.Parse(keepAliveTime)));
        }