mockendpoint4 = RouterTestUtils.getMockEndpoint(endpoint4);
mockendpoint5 = RouterTestUtils.getMockEndpoint(endpoint5);
mockendpoint6 = RouterTestUtils.getMockEndpoint(endpoint6);
// setup async splitter
asyncXmlSplitter = new XmlMessageSplitter();
asyncXmlSplitter.setValidateSchema(true);
asyncXmlSplitter.setExternalSchemaLocation("purchase-order.xsd");
asyncXmlSplitter.setMuleContext(muleContext);
// The xml document declares a default namespace, thus
// we need to workaround it by specifying it both in
// the namespaces and in the splitExpression
Map namespaces = new HashMap();
namespaces.put("e", "http://www.example.com");
asyncXmlSplitter.setSplitExpression("/e:purchaseOrder/e:items/e:item");
asyncXmlSplitter.setNamespaces(namespaces);
asyncXmlSplitter.addRoute((OutboundEndpoint) mockendpoint1.proxy());
asyncXmlSplitter.addRoute((OutboundEndpoint) mockendpoint2.proxy());
asyncXmlSplitter.addRoute((OutboundEndpoint) mockendpoint3.proxy());
// setup sync splitter
syncXmlSplitter = new XmlMessageSplitter();
syncXmlSplitter.setMuleContext(muleContext);
syncXmlSplitter.setValidateSchema(true);
syncXmlSplitter.setExternalSchemaLocation("purchase-order.xsd");
syncXmlSplitter.setSplitExpression("/e:purchaseOrder/e:items/e:item");