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());
}
Aggregations