configurePattern(aggregator);
activateComponent(aggregator, "aggregator");
}
protected NormalizedMessage testRun(boolean[] msgs) throws Exception {
ReceiverComponent rec = activateReceiver("target");
int nbMessages = 3;
String corrId = Long.toString(System.currentTimeMillis());
for (int i = 0; i < 3; i++) {
if (msgs == null || msgs[i]) {
InOnly me = client.createInOnlyExchange();
me.setService(new QName("aggregator"));
me.getInMessage().setContent(createSource("<hello id='" + i + "' />"));
me.getInMessage().setProperty(AbstractSplitter.SPLITTER_COUNT, new Integer(nbMessages));
me.getInMessage().setProperty(AbstractSplitter.SPLITTER_INDEX, new Integer(i));
me.getInMessage().setProperty(AbstractSplitter.SPLITTER_CORRID, corrId);
client.send(me);
}
}
rec.getMessageList().assertMessagesReceived(1);
return (NormalizedMessage) rec.getMessageList().flushMessages().get(0);
}