Search in sources :

Example 21 with JobExecutor

use of org.camunda.bpm.engine.impl.jobexecutor.JobExecutor in project camunda-bpm-platform by camunda.

the class PropertyHelperTest method testJobExecutorConfigurationProperties.

public void testJobExecutorConfigurationProperties() {
    // given
    JobExecutor jobExecutor = new DefaultJobExecutor();
    Map<String, String> propertiesToSet = new HashMap<String, String>();
    propertiesToSet.put(MAX_JOBS_PER_ACQUISITION, Integer.toString(Integer.MAX_VALUE));
    propertiesToSet.put(MAX_WAIT, Long.toString(Long.MAX_VALUE));
    propertiesToSet.put(WAIT_INCREASE_FACTOR, Float.toString(Float.MAX_VALUE));
    propertiesToSet.put(BACKOFF_TIME_IN_MILLIS, Integer.toString(Integer.MAX_VALUE));
    // when
    PropertyHelper.applyProperties(jobExecutor, propertiesToSet);
    // then
    Assert.assertEquals(Integer.MAX_VALUE, jobExecutor.getMaxJobsPerAcquisition());
    Assert.assertEquals(Long.MAX_VALUE, jobExecutor.getMaxWait());
    Assert.assertEquals(Float.MAX_VALUE, jobExecutor.getWaitIncreaseFactor(), 0.0001d);
    Assert.assertEquals(Integer.MAX_VALUE, jobExecutor.getBackoffTimeInMillis());
}
Also used : DefaultJobExecutor(org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor) HashMap(java.util.HashMap) JobExecutor(org.camunda.bpm.engine.impl.jobexecutor.JobExecutor) DefaultJobExecutor(org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor)

Aggregations

JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)21 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)6 AcquireJobsCmd (org.camunda.bpm.engine.impl.cmd.AcquireJobsCmd)6 Timer (java.util.Timer)5 CommandExecutor (org.camunda.bpm.engine.impl.interceptor.CommandExecutor)5 AcquiredJobs (org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs)4 Test (org.junit.Test)4 Date (java.util.Date)3 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)3 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)3 Job (org.camunda.bpm.engine.runtime.Job)3 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)3 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)2 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)2 ProcessEngineConfiguration (org.camunda.bpm.engine.ProcessEngineConfiguration)2 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)2 HashMap (java.util.HashMap)1