You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2017/08/16 10:33:00 UTC

qpid-broker-j git commit: NO-JIRA: [Java System Tests] Add extra logging to LiveQueueOperationsTest to understand an client related exception on the AMQP 1.0 profile

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 1c26b4543 -> a10f3063b


NO-JIRA: [Java System Tests] Add extra logging to LiveQueueOperationsTest to understand an client related exception on the AMQP 1.0 profile


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/a10f3063
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/a10f3063
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/a10f3063

Branch: refs/heads/master
Commit: a10f3063b0047de8b84b48386b5efa2fd52d81d6
Parents: 1c26b45
Author: Keith Wall <kw...@apache.org>
Authored: Wed Aug 16 11:31:58 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Wed Aug 16 11:32:06 2017 +0100

----------------------------------------------------------------------
 .../server/queue/LiveQueueOperationsTest.java   | 41 ++++++++++----------
 1 file changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a10f3063/systests/src/test/java/org/apache/qpid/server/queue/LiveQueueOperationsTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/server/queue/LiveQueueOperationsTest.java b/systests/src/test/java/org/apache/qpid/server/queue/LiveQueueOperationsTest.java
index af28f00..21ee47b 100644
--- a/systests/src/test/java/org/apache/qpid/server/queue/LiveQueueOperationsTest.java
+++ b/systests/src/test/java/org/apache/qpid/server/queue/LiveQueueOperationsTest.java
@@ -27,12 +27,13 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
 import javax.jms.Connection;
-import javax.jms.Message;
 import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
 import javax.jms.Queue;
 import javax.jms.Session;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.qpid.client.RejectBehaviour;
 import org.apache.qpid.configuration.ClientProperties;
 import org.apache.qpid.systest.rest.RestTestHelper;
@@ -41,6 +42,7 @@ import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class LiveQueueOperationsTest extends QpidBrokerTestCase
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(LiveQueueOperationsTest.class);
 
     private static final int MAX_DELIVERY_COUNT = 2;
 
@@ -78,22 +80,19 @@ public class LiveQueueOperationsTest extends QpidBrokerTestCase
 
         final CountDownLatch clearQueueLatch = new CountDownLatch(10);
         final AtomicReference<Throwable> throwableAtomicReference = new AtomicReference<>();
-        consumer.setMessageListener(new MessageListener()
-        {
-            @Override
-            public void onMessage(final Message message)
-            {
-                try
-                {
-                    clearQueueLatch.countDown();
-                    session.rollback();
-                }
-                catch (Throwable t)
-                {
-                    throwableAtomicReference.set(t);
-                }
-            }
-        });
+        consumer.setMessageListener(message ->
+                                    {
+                                        try
+                                        {
+                                            clearQueueLatch.countDown();
+                                            session.rollback();
+                                        }
+                                        catch (Throwable t)
+                                        {
+                                            LOGGER.error("Unexpected exception from rollback", t);
+                                            throwableAtomicReference.set(t);
+                                        }
+                                    });
 
 
         boolean ready = clearQueueLatch.await(30, TimeUnit.SECONDS);
@@ -123,12 +122,14 @@ public class LiveQueueOperationsTest extends QpidBrokerTestCase
         queueDepthMessages = (int) statistics.get("queueDepthMessages");
         assertEquals("Unexpected queue depth after consumer close", 0, queueDepthMessages);
 
-        assertNull("Unexpected exception thrown", throwableAtomicReference.get());
+        assertEquals("Unexpected exception thrown", null, throwableAtomicReference.get());
     }
 
     private Map<String, Object> getStatistics(final RestTestHelper restTestHelper, final String objectUrl) throws Exception
     {
         Map<String, Object> object = restTestHelper.getJsonAsSingletonList(objectUrl);
-        return (Map<String, Object>) object.get("statistics");
+        @SuppressWarnings("unchecked")
+        Map<String, Object> statistics = (Map<String, Object>) object.get("statistics");
+        return statistics;
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org