return "org/mule/test/integration/spring/events/async/mule-events-example-async-app-context.xml";
}
public void testReceivingASubscriptionEvent() throws Exception
{
OrderManagerBean subscriptionBean = (OrderManagerBean) muleContext.getRegistry().lookupObject(
"orderManagerBean");
assertNotNull(subscriptionBean);
// when an event is received by 'testEventBean1' this callback will be
// invoked
EventCallback callback = new EventCallback()
{
public void eventReceived(MuleEventContext context, Object o) throws Exception
{
eventCount.incrementAndGet();
}
};
subscriptionBean.setEventCallback(callback);
MuleClient client = new MuleClient(muleContext);
Order order = new Order("Sausage and Mash");
client.send("jms://orders.queue", order, null);
Thread.sleep(1000);