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