public void testDelegatingJobAsProperty() throws Exception
{
FunctionalTestComponent component = (FunctionalTestComponent) getComponent("scheduledService");
assertNotNull(component);
CountdownCallback count = new CountdownCallback(1);
component.setEventCallback(count);
Map<String, Object> props = new HashMap<String, Object>();
ScheduledDispatchJobConfig jobConfig = new ScheduledDispatchJobConfig();
jobConfig.setMuleContext(muleContext);
jobConfig.setEndpointRef("vm://quartz.in");
props.put(QuartzConnector.PROPERTY_JOB_CONFIG, jobConfig);
MuleClient client = muleContext.getClient();
client.dispatch("vm://quartz.scheduler1", NullPayload.getInstance(), props);
assertTrue(count.await(7000));
// now that the scheduler sent the event, null out the event callback to avoid CountdownCallback
// report more messages than requested during shutdown of the test/Mule server
component.setEventCallback(null);
}