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