countDown.attempt(5000);
assertEquals("Undelivered messages for count: " + numberOfMessages, 0, countDown.currentCount());
}
protected void sendSomeMessagesReusingTheSameMessageAndCheckTheyAreAllReceived(int numberOfMessages) throws JMSException, InterruptedException {
countDown = new CountDown(numberOfMessages);
// send messages
TextMessage message = session.createTextMessage();
for (int i = 0; i < numberOfMessages; i++) {
message.setText("This is message: " + i);