1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.bpm.jbpm;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.transport.bpm.BPMS;
16 import org.mule.util.NumberUtils;
17
18
19
20
21
22
23 public class MessagingJbpmTestCase extends AbstractJbpmTestCase
24 {
25
26 protected String getConfigResources()
27 {
28 return "jbpm-functional-test.xml";
29 }
30
31 public void testSendMessageProcess() throws Exception
32 {
33
34 ((Jbpm)bpms).deployProcess("message-process.xml");
35
36 MuleMessage response;
37 Object process;
38 BPMS bpms = connector.getBpms();
39 MuleClient client = new MuleClient();
40 try
41 {
42
43 response = client.send("bpm://message", "data", null);
44 process = response.getPayload();
45
46 long processId = NumberUtils.toLong(bpms.getId(process));
47
48 assertFalse(processId == -1);
49 assertEquals("sendMessage", bpms.getState(process));
50
51
52 response = client.send("bpm://message/" + processId, "data", null);
53 process = response.getPayload();
54
55
56 assertTrue(bpms.hasEnded(process));
57 }
58 finally
59 {
60 client.dispose();
61 }
62 }
63 }