1
2
3
4
5
6
7 package org.mule.transport.quartz;
8
9 import org.mule.tck.functional.CountdownCallback;
10 import org.mule.tck.functional.FunctionalTestComponent;
11 import org.mule.tck.junit4.FunctionalTestCase;
12
13 import org.junit.Test;
14
15 import static org.junit.Assert.assertNotNull;
16 import static org.junit.Assert.assertTrue;
17
18 public class QuartzFunctionalTestCase extends FunctionalTestCase
19 {
20
21 @Override
22 protected String getConfigResources()
23 {
24 return "quartz-functional-test.xml";
25 }
26
27 @Test
28 public void testMuleReceiverJob() throws Exception
29 {
30 FunctionalTestComponent component = (FunctionalTestComponent) getComponent("quartzService1");
31 assertNotNull(component);
32 CountdownCallback count1 = new CountdownCallback(4);
33 component.setEventCallback(count1);
34
35 component = (FunctionalTestComponent) getComponent("quartzService2");
36 assertNotNull(component);
37 CountdownCallback count2 = new CountdownCallback(2);
38 component.setEventCallback(count2);
39
40
41
42
43 assertTrue("Count 1 timed out: expected 0, value is: " + count1.getCount(), count1.await(60000));
44 assertTrue("Count 2 timed out: expected 0, value is: " + count2.getCount(), count2.await(5000));
45 }
46
47 }