jbi.activateComponent(m2, "mock2");
jbi.activateComponent(m3, "mock3");
jbi.start();
InOut me = client.createInOutExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='0' />"));
client.sendSync(me);
assertNotNull(me.getFault());
client.done(me);
me = client.createInOutExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='1' />"));
client.sendSync(me);
Element e = new SourceTransformer().toDOMElement(me.getOutMessage());
assertEquals("target1", e.getLocalName());
client.done(me);
me = client.createInOutExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='2' />"));
client.sendSync(me);
e = new SourceTransformer().toDOMElement(me.getOutMessage());
assertEquals("target2", e.getLocalName());
client.done(me);
me = client.createInOutExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='3' />"));
me.getInMessage().setProperty("prop", Boolean.TRUE);
client.sendSync(me);
e = new SourceTransformer().toDOMElement(me.getOutMessage());
assertEquals("target3", e.getLocalName());
client.done(me);
me = client.createInOutExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='4' />"));
client.sendSync(me);
assertEquals(ExchangeStatus.ERROR, me.getStatus());
Thread.sleep(50);
}