use of org.camunda.bpm.engine.ProcessEngineConfiguration in project camunda-bpm-platform by camunda.
the class PropertyHelperTest method testProcessEngineConfigurationProperties.
/**
* Assert that String, int and boolean properties can be set.
*/
public void testProcessEngineConfigurationProperties() {
ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration();
Map<String, String> propertiesToSet = new HashMap<String, String>();
propertiesToSet.put(JOB_EXECUTOR_DEPLOYMENT_AWARE_PROP, "true");
propertiesToSet.put(JOB_EXECUTOR_PREFER_TIMER_JOBS, "true");
propertiesToSet.put(JOB_EXECUTOR_ACQUIRE_BY_DUE_DATE, "true");
propertiesToSet.put(MAIL_SERVER_PORT_PROP, "42");
propertiesToSet.put(JDBC_URL_PROP, "someUrl");
PropertyHelper.applyProperties(engineConfiguration, propertiesToSet);
Assert.assertTrue(engineConfiguration.isJobExecutorDeploymentAware());
Assert.assertTrue(engineConfiguration.isJobExecutorPreferTimerJobs());
Assert.assertTrue(engineConfiguration.isJobExecutorAcquireByDueDate());
Assert.assertEquals(42, engineConfiguration.getMailServerPort());
Assert.assertEquals("someUrl", engineConfiguration.getJdbcUrl());
}
use of org.camunda.bpm.engine.ProcessEngineConfiguration in project camunda-bpm-platform by camunda.
the class PropertyHelperTest method testNonExistingPropertyForProcessEngineConfiguration.
public void testNonExistingPropertyForProcessEngineConfiguration() {
ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration();
Map<String, String> propertiesToSet = new HashMap<String, String>();
propertiesToSet.put("aNonExistingProperty", "someValue");
try {
PropertyHelper.applyProperties(engineConfiguration, propertiesToSet);
Assert.fail();
} catch (Exception e) {
// happy path
}
}
use of org.camunda.bpm.engine.ProcessEngineConfiguration in project camunda-bpm-platform by camunda.
the class TestJobExecutorActivateFalse_JBOSS method shouldNotActiateJobExecutor.
@Test
public void shouldNotActiateJobExecutor() {
ProcessEngine processEngine = processEngineService.getProcessEngine("jobExecutorActivate-FALSE-engine");
ProcessEngineConfiguration configuration = processEngine.getProcessEngineConfiguration();
JobExecutor jobExecutor = ((ProcessEngineConfigurationImpl) configuration).getJobExecutor();
assertFalse(jobExecutor.isActive());
processEngine = processEngineService.getProcessEngine("jobExecutorActivate-UNDEFINED-engine");
configuration = processEngine.getProcessEngineConfiguration();
jobExecutor = ((ProcessEngineConfigurationImpl) configuration).getJobExecutor();
assertTrue(jobExecutor.isActive());
}
use of org.camunda.bpm.engine.ProcessEngineConfiguration in project camunda-bpm-platform by camunda.
the class ProcessEngineInitializationTest method testDefaultRetries.
public void testDefaultRetries() {
ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/standalone/initialization/defaultretries.camunda.cfg.xml");
assertEquals(JobEntity.DEFAULT_RETRIES, configuration.getDefaultNumberOfRetries());
}
use of org.camunda.bpm.engine.ProcessEngineConfiguration in project camunda-bpm-platform by camunda.
the class MockedProcessEngineProvider method mockProcessEngineConfiguration.
protected void mockProcessEngineConfiguration(ProcessEngine engine) {
ProcessEngineConfiguration configuration = mock(ProcessEngineConfiguration.class);
when(configuration.getValueTypeResolver()).thenReturn(mockValueTypeResolver());
when(engine.getProcessEngineConfiguration()).thenReturn(configuration);
}
Aggregations