Search in sources :

Example 1 with ProcessEngineConfiguration

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());
}
Also used : ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration) StandaloneProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration) StandaloneProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration) HashMap(java.util.HashMap)

Example 2 with ProcessEngineConfiguration

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
    }
}
Also used : ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration) StandaloneProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration) StandaloneProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration) HashMap(java.util.HashMap)

Example 3 with ProcessEngineConfiguration

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());
}
Also used : ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration) JobExecutor(org.camunda.bpm.engine.impl.jobexecutor.JobExecutor) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest) Test(org.junit.Test)

Example 4 with ProcessEngineConfiguration

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());
}
Also used : ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration)

Example 5 with ProcessEngineConfiguration

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);
}
Also used : ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration)

Aggregations

ProcessEngineConfiguration (org.camunda.bpm.engine.ProcessEngineConfiguration)8 HashMap (java.util.HashMap)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 StandaloneProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration)2 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)1 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)1 Test (org.junit.Test)1