1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.jbpm;
12
13 import org.mule.tck.junit4.AbstractMuleTestCase;
14
15 import org.junit.Test;
16
17 import static org.junit.Assert.assertEquals;
18 import static org.junit.Assert.assertNotNull;
19 import static org.junit.Assert.assertTrue;
20
21
22
23
24 public class JbpmUnitTestCase extends AbstractMuleTestCase
25 {
26 @Test
27 public void testDeployAndRun() throws Exception
28 {
29 Jbpm jbpm = new Jbpm();
30 jbpm.initialise();
31
32
33 jbpm.deployProcess("simple-process.jpdl.xml");
34
35
36 Object process = jbpm.startProcess("simple", null, null);
37 assertNotNull(process);
38 Object processId = jbpm.getId(process);
39
40
41 process = jbpm.lookupProcess(processId);
42 assertNotNull(process);
43 assertEquals("dummyState", jbpm.getState(process));
44
45
46 process = jbpm.advanceProcess(processId);
47
48
49 assertNotNull(process);
50 assertTrue(jbpm.hasEnded(process));
51
52 jbpm.dispose();
53 }
54 }