configurePattern(router);
activateComponent(router, "router");
}
public void testInOnlySync() throws Exception {
ReceiverComponent rec1 = activateReceiver("target1");
ReceiverComponent rec2 = activateReceiver("target2");
ReceiverComponent rec3 = activateReceiver("target3");
tm.begin();
InOnly me = client.createInOnlyExchange();
me.setService(new QName("router"));
me.getInMessage().setContent(createSource("<hello id='1' />"));
client.sendSync(me);
assertEquals(ExchangeStatus.DONE, me.getStatus());
rec1.getMessageList().assertMessagesReceived(1);
rec2.getMessageList().assertMessagesReceived(0);
rec3.getMessageList().assertMessagesReceived(0);
rec1.getMessageList().flushMessages();
rec2.getMessageList().flushMessages();
rec3.getMessageList().flushMessages();
me = client.createInOnlyExchange();
me.setService(new QName("router"));
me.getInMessage().setContent(createSource("<hello id='2' />"));
client.sendSync(me);
assertEquals(ExchangeStatus.DONE, me.getStatus());
rec1.getMessageList().assertMessagesReceived(0);
rec2.getMessageList().assertMessagesReceived(1);
rec3.getMessageList().assertMessagesReceived(0);
rec1.getMessageList().flushMessages();
rec2.getMessageList().flushMessages();
rec3.getMessageList().flushMessages();
me = client.createInOnlyExchange();
me.setService(new QName("router"));
me.getInMessage().setContent(createSource("<hello id='3' />"));
client.sendSync(me);
assertEquals(ExchangeStatus.DONE, me.getStatus());
rec1.getMessageList().assertMessagesReceived(0);
rec2.getMessageList().assertMessagesReceived(0);
rec3.getMessageList().assertMessagesReceived(1);
tm.commit();
}