1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.quartz;
12
13 import org.mule.module.client.MuleClient;
14 import org.mule.tck.FunctionalTestCase;
15 import org.mule.tck.functional.CountdownCallback;
16 import org.mule.tck.functional.FunctionalTestComponent;
17
18 public class QuartzReceiveAndDispatchJobTestCase extends FunctionalTestCase
19 {
20 protected String getConfigResources()
21 {
22 return "quartz-receive-dispatch.xml";
23 }
24
25 public void testMuleClientReceiveAndDispatchJob() throws Exception
26 {
27 FunctionalTestComponent component = (FunctionalTestComponent)getComponent("scheduledService");
28 assertNotNull(component);
29 CountdownCallback count = new CountdownCallback(3);
30 component.setEventCallback(count);
31
32 new MuleClient().send("vm://event.queue", "quartz test", null);
33 new MuleClient().send("vm://event.queue", "quartz test", null);
34 new MuleClient().send("vm://event.queue", "quartz test", null);
35
36 new MuleClient().send("vm://quartz.scheduler", "test", null);
37 assertTrue(count.await(5000));
38 }
39 }