private void doSendMessages(int files, int poolSize, final String endpointURI, String resourceURI) throws Exception {
MockEndpoint mockJSON = getMockEndpoint("mock:json");
MockEndpoint mockXML = getMockEndpoint("mock:xml");
mockJSON.expectedMessageCount(files);
mockXML.expectedMessageCount(files);
InputStream inStream = getClass().getClassLoader().getResourceAsStream(resourceURI);
final String in = context.getTypeConverter().convertTo(String.class, inStream);
ExecutorService executor = Executors.newFixedThreadPool(poolSize);