activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuconic <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1071: Add a test for MQTT will message with n...
Date Thu, 09 Mar 2017 14:05:41 GMT
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1071#discussion_r105169899
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java
---
    @@ -1067,6 +1067,43 @@ public boolean isSatisfied() throws Exception {
     
     
        @Test(timeout = 60 * 1000)
    +   public void testWillMessageIsReceivedWithNonRetain() throws Exception {
    +      getServer().createQueue(SimpleString.toSimpleString("will"), RoutingType.MULTICAST,
SimpleString.toSimpleString("will"), null, true, false);
    +
    +      MQTT mqtt = createMQTTConnection("1", false);
    +      mqtt.setKeepAlive((short) 1);
    +      mqtt.setWillMessage("test message with non-retain");
    +      mqtt.setWillTopic("will");
    +      mqtt.setWillQos(QoS.AT_LEAST_ONCE);
    +      mqtt.setWillRetain(false);
    +
    +      final BlockingConnection connection = mqtt.blockingConnection();
    +      connection.connect();
    +      Wait.waitFor(new Wait.Condition() {
    +         @Override
    +         public boolean isSatisfied() throws Exception {
    +            return connection.isConnected();
    +         }
    +      });
    +
    +      // kill transport
    +      connection.kill();
    +
    +      Thread.sleep(10000);
    --- End diff --
    
    We should rather have a Wait clause here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message