new QName("drools"), "endpoint");
endpoint.setRuleBaseResource(new ClassPathResource("router.drl"));
drools.setEndpoints(new DroolsEndpoint[] {endpoint });
jbi.activateComponent(drools, "servicemix-drools");
ReceiverComponent r1 = new ReceiverComponent(new QName("target1"), "endpoint");
ReceiverComponent r2 = new ReceiverComponent(new QName("target2"), "endpoint");
ReceiverComponent r3 = new ReceiverComponent(new QName("target3"), "endpoint");
jbi.activateComponent(r1, "receiver1");
jbi.activateComponent(r2, "receiver2");
jbi.activateComponent(r3, "receiver3");
jbi.start();
InOnly me = client.createInOnlyExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='0' />"));
client.sendSync(me);
assertEquals(ExchangeStatus.ERROR, me.getStatus());
me = client.createInOnlyExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='1' />"));
client.sendSync(me);
me = client.createInOnlyExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='2' />"));
client.sendSync(me);
me = client.createInOnlyExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='3' />"));
me.getInMessage().setProperty("prop", Boolean.TRUE);
client.sendSync(me);
me = client.createInOnlyExchange();
me.setService(new QName("drools"));
me.getInMessage().setContent(new StringSource("<test id='4' />"));
client.sendSync(me);
assertEquals(ExchangeStatus.ERROR, me.getStatus());
r1.getMessageList().assertMessagesReceived(1);
r2.getMessageList().assertMessagesReceived(1);
r3.getMessageList().assertMessagesReceived(1);
Thread.sleep(50);
}