assertEquals(message, receivedMessages.get(0));
node2.shutdown();
}
public void testMultipleMessages() throws Exception {
Node node2 = createNodeAndWait();
node.setListener(createListAddListener());
int numberOfMessages = 100;
for (int i = 0; i < numberOfMessages; i++) {
if (numberOfMessages % 2 == 0) {
node.broadcast(new Integer(i));
} else {
node2.broadcast(new Integer(i));
}
}
node2.shutdown();
assertEquals(100, receivedMessages.size());
for (int i = 0; i < numberOfMessages; i++) {
assertEquals(new Integer(i), receivedMessages.get(i));
}
}