Search in sources :

Example 1 with ProcessEngineXmlImpl

use of org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl in project camunda-bpm-platform by camunda.

the class PlatformJobExecutorActivateTest method shouldAutoActivateIfNoPropertySet.

@Test
public void shouldAutoActivateIfNoPropertySet() {
    // given
    JobExecutorXmlImpl jobExecutorXml = defineJobExecutor();
    ProcessEngineXmlImpl processEngineXml = defineProcessEngine();
    BpmPlatformXmlImpl bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutorXml, Collections.<ProcessEngineXml>singletonList(processEngineXml));
    // when
    deployPlatform(bpmPlatformXml);
    try {
        ProcessEngine processEngine = getProcessEngine(ENGINE_NAME);
        ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
        // then
        assertEquals(true, processEngineConfiguration.getJobExecutor().isActive());
    } finally {
        undeployPlatform();
    }
}
Also used : ProcessEngineXmlImpl(org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl) JobExecutorXmlImpl(org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl) BpmPlatformXmlImpl(org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) Test(org.junit.Test)

Example 2 with ProcessEngineXmlImpl

use of org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl in project camunda-bpm-platform by camunda.

the class PlatformJobExecutorActivateTest method shouldNotAutoActivateIfConfigured.

@Test
public void shouldNotAutoActivateIfConfigured() {
    // given
    JobExecutorXmlImpl jobExecutorXml = defineJobExecutor();
    ProcessEngineXmlImpl processEngineXml = defineProcessEngine();
    // activate set to false
    processEngineXml.getProperties().put("jobExecutorActivate", "false");
    BpmPlatformXmlImpl bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutorXml, Collections.<ProcessEngineXml>singletonList(processEngineXml));
    // when
    deployPlatform(bpmPlatformXml);
    try {
        ProcessEngine processEngine = getProcessEngine(ENGINE_NAME);
        ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
        // then
        assertEquals(false, processEngineConfiguration.getJobExecutor().isActive());
    } finally {
        undeployPlatform();
    }
}
Also used : ProcessEngineXmlImpl(org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl) JobExecutorXmlImpl(org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl) BpmPlatformXmlImpl(org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) Test(org.junit.Test)

Example 3 with ProcessEngineXmlImpl

use of org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl in project camunda-bpm-platform by camunda.

the class PlatformJobExecutorActivateTest method defineProcessEngine.

private ProcessEngineXmlImpl defineProcessEngine() {
    ProcessEngineXmlImpl processEngineXml = new ProcessEngineXmlImpl();
    HashMap<String, String> properties = new HashMap<String, String>();
    properties.put("jdbcUrl", "jdbc:h2:mem:PlatformJobExecutorActivateTest-db");
    processEngineXml.setProperties(properties);
    processEngineXml.setPlugins(new ArrayList<ProcessEnginePluginXml>());
    processEngineXml.setName(ENGINE_NAME);
    processEngineXml.setJobAcquisitionName(ACQUISITION_NAME);
    processEngineXml.setConfigurationClass(StandaloneInMemProcessEngineConfiguration.class.getName());
    processEngineXml.setDefault(true);
    return processEngineXml;
}
Also used : ProcessEngineXmlImpl(org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl) ProcessEnginePluginXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEnginePluginXml) HashMap(java.util.HashMap) StandaloneInMemProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)

Aggregations

ProcessEngineXmlImpl (org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl)3 BpmPlatformXmlImpl (org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl)2 JobExecutorXmlImpl (org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)2 Test (org.junit.Test)2 HashMap (java.util.HashMap)1 ProcessEnginePluginXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEnginePluginXml)1 StandaloneInMemProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)1