Search in sources :

Example 1 with JobExecutorXmlImpl

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

the class StartManagedThreadPoolStepTest method setUp.

@Before
public void setUp() {
    step = new StartManagedThreadPoolStep();
    deploymentOperation = new DeploymentOperation("name", container, Collections.<DeploymentOperationStep>emptyList());
    jobExecutorXml = new JobExecutorXmlImpl();
    bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutorXml, Collections.<ProcessEngineXml>emptyList());
    deploymentOperation.addAttachment(Attachments.BPM_PLATFORM_XML, bpmPlatformXml);
}
Also used : ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) JobExecutorXmlImpl(org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl) DeploymentOperationStep(org.camunda.bpm.container.impl.spi.DeploymentOperationStep) DeploymentOperation(org.camunda.bpm.container.impl.spi.DeploymentOperation) BpmPlatformXmlImpl(org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl) Before(org.junit.Before)

Example 2 with JobExecutorXmlImpl

use of org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl 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 3 with JobExecutorXmlImpl

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

the class PlatformJobExecutorActivateTest method defineJobExecutor.

private JobExecutorXmlImpl defineJobExecutor() {
    JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl();
    jobAcquisition.setProperties(new HashMap<String, String>());
    jobAcquisition.setName(ACQUISITION_NAME);
    JobExecutorXmlImpl jobExecutorXml = new JobExecutorXmlImpl();
    jobExecutorXml.setProperties(new HashMap<String, String>());
    jobExecutorXml.setJobAcquisitions(Collections.<JobAcquisitionXml>singletonList(jobAcquisition));
    return jobExecutorXml;
}
Also used : JobExecutorXmlImpl(org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl) JobAcquisitionXmlImpl(org.camunda.bpm.container.impl.metadata.JobAcquisitionXmlImpl)

Example 4 with JobExecutorXmlImpl

use of org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl 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)

Aggregations

JobExecutorXmlImpl (org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl)4 BpmPlatformXmlImpl (org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl)3 ProcessEngineXmlImpl (org.camunda.bpm.container.impl.metadata.ProcessEngineXmlImpl)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)2 Test (org.junit.Test)2 JobAcquisitionXmlImpl (org.camunda.bpm.container.impl.metadata.JobAcquisitionXmlImpl)1 ProcessEngineXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)1 DeploymentOperation (org.camunda.bpm.container.impl.spi.DeploymentOperation)1 DeploymentOperationStep (org.camunda.bpm.container.impl.spi.DeploymentOperationStep)1 Before (org.junit.Before)1