activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: add some logging to diagnose ci failure
Date Thu, 04 May 2017 09:23:25 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 18d05ba5e -> 2b3f0e595


add some logging to diagnose ci failure


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

Branch: refs/heads/master
Commit: 2b3f0e5958998258fef51fa81308e08dc73c0423
Parents: 18d05ba
Author: gtully <gary.tully@gmail.com>
Authored: Thu May 4 10:23:13 2017 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Thu May 4 10:23:13 2017 +0100

----------------------------------------------------------------------
 .../activemq/transport/mqtt/MQTTTest.java       | 33 +++++++++++---------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/2b3f0e59/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
----------------------------------------------------------------------
diff --git a/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
b/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
index 791e798..ce585a5 100644
--- a/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
+++ b/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java
@@ -1671,24 +1671,29 @@ public class MQTTTest extends MQTTTestSupport {
         }
         connectionSub.disconnect();
 
-        for (int j = 0; j < numberOfRuns; j++) {
+        try {
+            for (int j = 0; j < numberOfRuns; j++) {
 
-            for (int i = 0; i < messagesPerRun; ++i) {
-                connectionPub.publish(topics[0].name().toString(), payload, QoS.AT_LEAST_ONCE,
false);
-            }
+                for (int i = 0; i < messagesPerRun; ++i) {
+                    connectionPub.publish(topics[0].name().toString(), payload, QoS.AT_LEAST_ONCE,
false);
+                }
 
-            connectionSub = mqttSub.blockingConnection();
-            connectionSub.connect();
-            connectionSub.subscribe(topics);
+                connectionSub = mqttSub.blockingConnection();
+                connectionSub.connect();
+                connectionSub.subscribe(topics);
 
-            for (int i = 0; i < messagesPerRun; ++i) {
-                Message message = connectionSub.receive(5, TimeUnit.SECONDS);
-                assertNotNull(message);
-                received++;
-                assertTrue(Arrays.equals(payload, message.getPayload()));
-                message.ack();
+                for (int i = 0; i < messagesPerRun; ++i) {
+                    Message message = connectionSub.receive(5, TimeUnit.SECONDS);
+                    assertNotNull(message);
+                    received++;
+                    assertTrue(Arrays.equals(payload, message.getPayload()));
+                    message.ack();
+                }
+                connectionSub.disconnect();
             }
-            connectionSub.disconnect();
+        } catch (Exception exception) {
+            LOG.error("unexpected exception", exception);
+            exception.printStackTrace();
         }
         assertEquals("Should have received " + (messagesPerRun * (numberOfRuns + 1)) + "
messages", (messagesPerRun * (numberOfRuns + 1)), received);
     }


Mime
View raw message