Fix NPE case so a meaningful error is reported on failure.

This commit is contained in:
Timothy Bish 2016-08-29 17:05:21 -04:00
parent b9fad53fc6
commit de4f4e406f
1 changed files with 5 additions and 2 deletions

View File

@ -336,6 +336,7 @@ public class ZeroPrefetchConsumerTest extends EmbeddedBrokerTestSupport {
MessageConsumer consumer = session.createConsumer(brokerZeroQueue);
TextMessage answer = (TextMessage)consumer.receive(5000);
assertNotNull("Consumer should have read a message", answer);
assertEquals("Should have received a message!", answer.getText(), "Msg1");
}
@ -393,12 +394,14 @@ public class ZeroPrefetchConsumerTest extends EmbeddedBrokerTestSupport {
@Override
protected void tearDown() throws Exception {
try {
connection.close();
} catch (Exception ex) {}
super.tearDown();
}
protected Queue createQueue() {
return new ActiveMQQueue(getDestinationString() + "?consumer.prefetchSize=0");
}
}