protected void sendTestData(int iterations) throws Exception
{
OutboundEndpoint ep = muleContext.getRegistry().lookupEndpointBuilder("client").buildOutboundEndpoint();
AxisMessageDispatcher client = new AxisMessageDispatcher(ep);
client.initialise();
for (int i = 0; i < iterations; i++)
{
MuleMessage msg = new DefaultMuleMessage("testPayload", muleContext);
msg.addOutboundAttachment("testAttachment", new DataHandler(new StringDataSource("foo")));
DefaultMuleSession session = new DefaultMuleSession(msg, ((AbstractConnector) ep.getConnector()).getSessionHandler(), muleContext);
DefaultMuleEvent event = new DefaultMuleEvent(msg, getTestInboundEndpoint("test://test"), session);
MuleMessage result = client.process(event).getMessage();
assertNotNull(result);
assertNotNull(result.getPayload());
assertEquals(result.getPayloadAsString(), "Done");
callbackCount++;
}