You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/08/19 16:40:39 UTC

[2/3] activemq-artemis git commit: NO-JIRA fixing MQTT Test

NO-JIRA fixing MQTT Test


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

Branch: refs/heads/master
Commit: 2033ee8c43279358e13530f0d168c7b415465f25
Parents: ce6942a
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Aug 18 16:36:03 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Aug 18 22:58:52 2017 -0400

----------------------------------------------------------------------
 .../mqtt/imported/MQTTInterceptorPropertiesTest.java  | 14 ++++++++++++--
 .../integration/mqtt/imported/MQTTTestSupport.java    |  9 +++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2033ee8c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java
index 375e2f2..2600952 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.tests.integration.mqtt.imported;
 
 import io.netty.handler.codec.mqtt.MqttFixedHeader;
 import io.netty.handler.codec.mqtt.MqttMessage;
+import io.netty.handler.codec.mqtt.MqttPublishMessage;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager;
 import org.apache.activemq.artemis.core.protocol.mqtt.MQTTInterceptor;
@@ -96,7 +97,12 @@ public class MQTTInterceptorPropertiesTest extends MQTTTestSupport {
          @Override
          public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException {
             System.out.println("incoming");
-            return checkMessageProperties(packet, expectedProperties);
+            if (packet.getClass() == MqttPublishMessage.class) {
+               return checkMessageProperties(packet, expectedProperties);
+            } else {
+               return true;
+            }
+
          }
       };
 
@@ -104,7 +110,11 @@ public class MQTTInterceptorPropertiesTest extends MQTTTestSupport {
          @Override
          public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException {
             System.out.println("outgoing");
-            return checkMessageProperties(packet, expectedProperties);
+            if (packet.getClass() == MqttPublishMessage.class) {
+               return checkMessageProperties(packet, expectedProperties);
+            } else {
+               return true;
+            }
          }
       };
       server.getRemotingService().addIncomingInterceptor(incomingInterceptor);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2033ee8c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
index a45f06d..bac2e37 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
@@ -34,6 +34,7 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import io.netty.handler.codec.mqtt.MqttMessage;
+import io.netty.handler.codec.mqtt.MqttPublishMessage;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -369,7 +370,9 @@ public class MQTTTestSupport extends ActiveMQTestBase {
 
       @Override
       public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException {
-         messageCount++;
+         if (packet.getClass() == MqttPublishMessage.class) {
+            messageCount++;
+         }
          return true;
       }
 
@@ -388,7 +391,9 @@ public class MQTTTestSupport extends ActiveMQTestBase {
 
       @Override
       public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException {
-         messageCount++;
+         if (packet.getClass() == MqttPublishMessage.class) {
+            messageCount++;
+         }
          return true;
       }