mirror of https://github.com/apache/activemq.git
Fix NPE case so a meaningful error is reported on failure.
This commit is contained in:
parent
b9fad53fc6
commit
de4f4e406f
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue