1   /*
2    * $Id: QuartzDispatchJobTestCase.java 12017 2008-06-12 09:04:04Z rossmason $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
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 QuartzDispatchJobTestCase extends FunctionalTestCase
19  {
20      protected String getConfigResources()
21      {
22          return "quartz-dispatch.xml";
23      }
24  
25      public void testMuleClientDispatchJob() 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://quartz.scheduler", "quartz test", null);
33          assertTrue(count.await(5000));
34      }
35  }