@Test
public void testXQueryRouting() throws Exception {
_testKit.removeService("HelloService");
_testKit.removeService("GoodbyeService");
MockHandler helloService = _testKit.registerInOnlyService("HelloService");
MockHandler goodbyeService = _testKit.registerInOnlyService("GoodbyeService");
greet.sendInOnly(REQUEST_HELLO);
greet.sendInOnly(REQUEST_GOODBYE);
Thread.sleep(1000);
LinkedBlockingQueue<Exchange> helloReceived = helloService.getMessages();
Assert.assertNotNull(helloReceived);
Exchange helloExchange = helloReceived.iterator().next();
Assert.assertTrue(helloExchange.getMessage().getContent(String.class).matches(".*Douglas.*"));
LinkedBlockingQueue<Exchange> goodbyeReceived = goodbyeService.getMessages();
Assert.assertNotNull(goodbyeReceived);
Exchange goodbyeExchange = goodbyeReceived.iterator().next();
Assert.assertTrue(goodbyeExchange.getMessage().getContent(String.class).matches(".*Garfield.*"));
}