return "org/mule/test/integration/routing/outbound/chaining-router-properties-propagation-config.xml";
}
public void testPropertiesPropagation() throws Exception
{
FunctionalTestComponent hop1 = getFunctionalTestComponent("hop1Service");
FunctionalTestComponent hop2 = getFunctionalTestComponent("hop2Service");
assertNotNull(hop1);
final AtomicBoolean hop1made = new AtomicBoolean(false);
EventCallback callback1 = new EventCallback()
{
public void eventReceived(final MuleEventContext context, final Object component) throws Exception
{
assertTrue(hop1made.compareAndSet(false, true));
FunctionalTestComponent ftc = (FunctionalTestComponent) component;
ftc.setReturnData("Hop1 ACK");
}
};
final AtomicBoolean hop2made = new AtomicBoolean(false);
EventCallback callback2 = new EventCallback()
{
public void eventReceived(final MuleEventContext context, final Object component) throws Exception
{
MuleMessage msg = context.getMessage();
assertTrue(hop2made.compareAndSet(false, true));
// this is a service callback, props are on the inbound
assertEquals("Property not propagated from the first hop.", "hop1", msg.getInboundProperty("TICKET"));
FunctionalTestComponent ftc = (FunctionalTestComponent) component;
ftc.setReturnData(msg.getPayload() + " Hop2 ACK");
}
};
hop1.setEventCallback(callback1);
hop2.setEventCallback(callback2);