KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > service > exe > StartListenerTest


1 package org.jbpm.bpel.service.exe;
2
3 import org.jbpm.bpel.def.BpelDefinition;
4 import org.jbpm.bpel.service.def.Receiver;
5
6 /**
7  * @author Alejandro Guízar
8  * @version $Revision: 1.4 $ $Date: 2005/05/07 00:03:43 $
9  */

10 public class StartListenerTest extends RequestListenerTest {
11   
12   private static final int RECEPTION_COUNT = 5;
13
14   protected RequestListener createListener(BpelDefinition process, Receiver receiver) {
15     return new StartListener(receiver);
16   }
17   
18   public void testMultipleReception() throws Exception JavaDoc {
19     listener.receiveRequest(messagerSession);
20     // start listeners should process any number of requests
21
for (int i = 0; i < RECEPTION_COUNT; i++) {
22       // send a request message
23
sendRequest();
24       // wait until the listener receives the message
25
synchronized (listener) {
26         listener.wait();
27       }
28       // assertions
29
assertReception();
30     }
31   }
32 }
33
Popular Tags