Search in sources :

Example 76 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class TestResourceName method testResourceName.

@Test
public void testResourceName() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
    ProcessDefinition definition = query.processDefinitionKey("process-0").singleResult();
    Assert.assertEquals("process0.bpmn", definition.getResourceName());
    definition = query.processDefinitionKey("process-1").singleResult();
    Assert.assertEquals("processes/process1.bpmn", definition.getResourceName());
    definition = query.processDefinitionKey("process-2").singleResult();
    Assert.assertEquals("process2.bpmn", definition.getResourceName());
    definition = query.processDefinitionKey("process-3").singleResult();
    Assert.assertEquals("subDirectory/process3.bpmn", definition.getResourceName());
    definition = query.processDefinitionKey("process-4").singleResult();
    Assert.assertEquals("process4.bpmn", definition.getResourceName());
    definition = query.processDefinitionKey("process-5").singleResult();
    Assert.assertEquals("subDirectory/process5.bpmn", definition.getResourceName());
}
Also used : ProcessDefinitionQuery(org.camunda.bpm.engine.repository.ProcessDefinitionQuery) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) RepositoryService(org.camunda.bpm.engine.RepositoryService) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Example 77 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class TestPaAsEjbJar method testPaAsEjbModule.

@Test
public void testPaAsEjbModule() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    runtimeService.startProcessInstanceByKey("paAsEjbJar-process");
    Assert.assertEquals(1, runtimeService.createProcessInstanceQuery().count());
    waitForJobExecutorToProcessAllJobs();
    Assert.assertEquals(0, runtimeService.createProcessInstanceQuery().count());
}
Also used : ProcessEngine(org.camunda.bpm.engine.ProcessEngine) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Example 78 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class NestedParallelNonInterruptingEventSubprocessScenario method completeSubprocessTask.

@DescribesScenario("init.innerTask")
@ExtendsScenario("init")
@Times(5)
public static ScenarioSetup completeSubprocessTask() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            Task task = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).taskDefinitionKey("innerTask").singleResult();
            engine.getTaskService().complete(task.getId());
        }
    };
}
Also used : Task(org.camunda.bpm.engine.task.Task) ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times) ExtendsScenario(org.camunda.bpm.qa.upgrade.ExtendsScenario)

Example 79 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class TestProcessEngineJndiBinding_JBOSS method testDefaultProcessEngineBindingCreated.

@Test
public void testDefaultProcessEngineBindingCreated() {
    try {
        ProcessEngine processEngine = InitialContext.doLookup("java:global/camunda-bpm-platform/process-engine/default");
        Assert.assertNotNull("Process engine must not be null", processEngine);
    } catch (Exception e) {
        Assert.fail("Process Engine not bound in JNDI.");
    }
}
Also used : ProcessEngine(org.camunda.bpm.engine.ProcessEngine) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest) Test(org.junit.Test)

Example 80 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine 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)

Aggregations

ProcessEngine (org.camunda.bpm.engine.ProcessEngine)162 DescribesScenario (org.camunda.bpm.qa.upgrade.DescribesScenario)60 ScenarioSetup (org.camunda.bpm.qa.upgrade.ScenarioSetup)60 Task (org.camunda.bpm.engine.task.Task)52 Times (org.camunda.bpm.qa.upgrade.Times)52 Test (org.junit.Test)26 ExtendsScenario (org.camunda.bpm.qa.upgrade.ExtendsScenario)18 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)17 ArrayList (java.util.ArrayList)16 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)15 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)14 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)14 RepositoryService (org.camunda.bpm.engine.RepositoryService)13 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)7 StandaloneInMemProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)6 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 Job (org.camunda.bpm.engine.runtime.Job)5 Connection (java.sql.Connection)4 CaseService (org.camunda.bpm.engine.CaseService)4 StandaloneProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration)4