* Test.
*/
public void sendMessageAfter() throws Exception {
ProcessDefinitionDirectory procDefDir = null;
ProcessDirectory procDir = null;
Channel chan = null;
try {
procDefDir = workflowService.processDefinitionDirectory();
procDir = workflowService.processDirectory();
ProcessMgr pmgr = procDefDir.processMgr
("chabacc", "chabacc_test_receiver");
WfProcess process
= pmgr.createProcess(new DefaultRequester (workflowService));
chan = workflowService.getChannel(process, "test_channel");
WfActivity recAct = null;
for (Iterator i = process.steps().iterator(); i.hasNext();) {
recAct = (WfActivity)i.next ();
if (recAct.name().equals("Receive")) {
break;
}
}
assertTrue (recAct != null);
process.start();
assertTrue (stateReached (recAct, "open.running"));
Thread.sleep (500);
Map pd = new HashMap ();
pd.put ("message", "Hello world!");
chan.sendMessage(pd);
assertTrue (stateReached (recAct, "closed.completed"));
pd = process.processContext();
assertTrue ("Hello world!".equals(pd.get("lastMessage")));
assertTrue (stateReached (process, "closed.completed"));
procDir.removeProcess(process);