You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2016/08/29 21:05:45 UTC

activemq git commit: Fix NPE case so a meaningful error is reported on failure.

Repository: activemq
Updated Branches:
  refs/heads/master b9fad53fc -> de4f4e406


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

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/de4f4e40
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/de4f4e40
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/de4f4e40

Branch: refs/heads/master
Commit: de4f4e406fa9182d705c52c3dc32e762572e45fc
Parents: b9fad53
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Aug 29 17:05:21 2016 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Aug 29 17:05:21 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/ZeroPrefetchConsumerTest.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/de4f4e40/activemq-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
index d4cecab..effe5fd 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
@@ -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 {
-        connection.close();
+        try {
+            connection.close();
+        } catch (Exception ex) {}
+
         super.tearDown();
     }
 
     protected Queue createQueue() {
         return new ActiveMQQueue(getDestinationString() + "?consumer.prefetchSize=0");
     }
-
 }