private void confirmBrokerHasMessages(final int startIndex, final int endIndex) throws Exception
{
Connection con = getConnection();
Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
con.start();
Destination destination = session.createQueue(getTestQueueName());
MessageConsumer consumer = session.createConsumer(destination);
for (int i = startIndex; i < endIndex; i++)
{
Message msg = consumer.receive(RECEIVE_TIMEOUT);
assertNotNull("Message " + i + " not received", msg);