use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class CamelVariableTransferTest method testCamelPropertiesAll.
// check that at least all properties are passed from camel to activiti when copyVariablesFromProperties=true is simply true
@Deployment
public void testCamelPropertiesAll() throws Exception {
ProducerTemplate tpl = camelContext.createProducerTemplate();
Exchange exchange = camelContext.getEndpoint("direct:startAllProperties").createExchange();
tpl.send("direct:startAllProperties", exchange);
assertNotNull(taskService);
assertNotNull(runtimeService);
assertEquals(1, taskService.createTaskQuery().count());
Task task = taskService.createTaskQuery().singleResult();
assertNotNull(task);
Map<String, Object> variables = runtimeService.getVariables(task.getExecutionId());
assertEquals("sampleValueForProperty1", variables.get("property1"));
assertEquals("sampleValueForProperty2", variables.get("property2"));
assertEquals("sampleValueForProperty3", variables.get("property3"));
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class CamelVariableTransferTest method testCamelHeadersAll.
@Deployment(resources = { "org/activiti/camel/variables/CamelVariableTransferTest.testCamelPropertiesAll.bpmn20.xml" })
public void testCamelHeadersAll() throws Exception {
ProducerTemplate tpl = camelContext.createProducerTemplate();
Exchange exchange = camelContext.getEndpoint("direct:startAllProperties").createExchange();
tpl.send("direct:startAllProperties", exchange);
assertNotNull(taskService);
assertNotNull(runtimeService);
assertEquals(1, taskService.createTaskQuery().count());
Task task = taskService.createTaskQuery().singleResult();
assertNotNull(task);
Map<String, Object> variables = runtimeService.getVariables(task.getExecutionId());
assertEquals("sampleValueForProperty1", variables.get("property1"));
assertEquals("sampleValueForProperty2", variables.get("property2"));
assertEquals("sampleValueForProperty3", variables.get("property3"));
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class AsyncPingTest method testRunProcess.
@Deployment(resources = { "process/asyncPing.bpmn20.xml" })
public void testRunProcess() throws Exception {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("asyncPingProcess");
List<Execution> executionList = runtimeService.createExecutionQuery().list();
Assert.assertEquals(1, executionList.size());
managementService.executeJob(managementService.createJobQuery().processInstanceId(processInstance.getId()).singleResult().getId());
Thread.sleep(1500);
executionList = runtimeService.createExecutionQuery().list();
Assert.assertEquals(0, executionList.size());
Assert.assertEquals(0, runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).count());
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class AsyncProcessTest method testRunProcess.
@Deployment(resources = { "process/async.bpmn20.xml" })
public void testRunProcess() throws Exception {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("asyncCamelProcess");
List<Execution> executionList = runtimeService.createExecutionQuery().list();
assertEquals(3, executionList.size());
Thread.sleep(4000);
assertEquals(0, runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).count());
}
use of org.activiti.engine.test.Deployment in project Activiti by Activiti.
the class CustomContextTest method testRunProcess.
@Deployment(resources = { "process/custom.bpmn20.xml" })
public void testRunProcess() throws Exception {
CamelContext ctx = applicationContext.getBean(CamelContext.class);
ProducerTemplate tpl = ctx.createProducerTemplate();
service1.expectedBodiesReceived("ala");
Exchange exchange = ctx.getEndpoint("direct:start").createExchange();
exchange.getIn().setBody(Collections.singletonMap("var1", "ala"));
tpl.send("direct:start", exchange);
String instanceId = (String) exchange.getProperty("PROCESS_ID_PROPERTY");
tpl.sendBodyAndProperty("direct:receive", null, ActivitiProducer.PROCESS_ID_PROPERTY, instanceId);
assertProcessEnded(instanceId);
service1.assertIsSatisfied();
@SuppressWarnings("rawtypes") Map m = service2.getExchanges().get(0).getIn().getBody(Map.class);
assertEquals("ala", m.get("var1"));
assertEquals("var2", m.get("var2"));
}
Aggregations