use of org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParse method parseJobExecutor.
/**
* parse a <code><job-executor .../></code> element and add it to the list of parsed elements
*/
protected void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml) {
List<JobAcquisitionXml> jobAcquisitions = new ArrayList<JobAcquisitionXml>();
Map<String, String> properties = new HashMap<String, String>();
for (Element childElement : element.elements()) {
if (JOB_ACQUISITION.equals(childElement.getTagName())) {
parseJobAcquisition(childElement, jobAcquisitions);
} else if (PROPERTIES.equals(childElement.getTagName())) {
parseProperties(childElement, properties);
}
}
jobExecutorXml.setJobAcquisitions(jobAcquisitions);
jobExecutorXml.setProperties(properties);
}
use of org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlNoEngine.
public void testParseBpmPlatformXmlNoEngine() {
BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_no_engine.xml")).execute().getBpmPlatformXml();
assertNotNull(bpmPlatformXml);
assertNotNull(bpmPlatformXml.getJobExecutor());
assertEquals(0, bpmPlatformXml.getProcessEngines().size());
JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
assertEquals(1, jobExecutorXml.getJobAcquisitions().size());
JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.getJobAcquisitions().get(0);
assertEquals("default", jobAcquisitionXml.getName());
assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.getJobExecutorClassName());
assertEquals(2, jobAcquisitionXml.getProperties().size());
}
use of org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlOneEngine.
public void testParseBpmPlatformXmlOneEngine() {
BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_one_engine.xml")).execute().getBpmPlatformXml();
assertNotNull(bpmPlatformXml);
assertNotNull(bpmPlatformXml.getJobExecutor());
assertEquals(1, bpmPlatformXml.getProcessEngines().size());
JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
assertEquals(1, jobExecutorXml.getJobAcquisitions().size());
assertThat(jobExecutorXml.getProperties().size(), is(2));
JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.getJobAcquisitions().get(0);
assertEquals("default", jobAcquisitionXml.getName());
assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.getJobExecutorClassName());
assertEquals(2, jobAcquisitionXml.getProperties().size());
ProcessEngineXml engineXml = bpmPlatformXml.getProcessEngines().get(0);
assertEquals("engine1", engineXml.getName());
assertEquals("default", engineXml.getJobAcquisitionName());
Map<String, String> properties = engineXml.getProperties();
assertNotNull(properties);
assertEquals(0, properties.size());
List<ProcessEnginePluginXml> plugins = engineXml.getPlugins();
assertNotNull(plugins);
assertEquals(0, plugins.size());
}
Aggregations