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 2019/07/19 21:51:20 UTC

[activemq-artemis] branch master updated: NO-JIRA Simple test fixes

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 200b3e1  NO-JIRA Simple test fixes
200b3e1 is described below

commit 200b3e10333f149b5d13446b1bae72dbac8dc95f
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri Jul 19 17:51:04 2019 -0400

    NO-JIRA Simple test fixes
---
 .../artemis/core/remoting/impl/netty/TransportConstants.java   | 10 +++++-----
 .../artemis/tests/integration/amqp/AmqpMessageRoutingTest.java |  5 +++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java
index 54b2061..5b06415 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java
@@ -300,13 +300,13 @@ public class TransportConstants {
    public static final int DEFAULT_SHUTDOWN_TIMEOUT = parseDefaultVariable("DEFAULT_SHUTDOWN_TIMEOUT", 3_000);
 
    private static int parseDefaultVariable(String variableName, int defaultValue) {
-      String variable = System.getProperty(TransportConstants.class.getName() + "." + variableName);
-      if (variable != null) {
-         try {
+      try {
+         String variable = System.getProperty(TransportConstants.class.getName() + "." + variableName);
+         if (variable != null) {
             return Integer.parseInt(variable);
-         } catch (Throwable ignored) {
-            logger.debug(ignored);
          }
+      } catch (Throwable ignored) {
+         logger.debug(ignored);
       }
 
       return defaultValue;
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java
index 33a7371..92d1787 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java
@@ -28,6 +28,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.apache.activemq.artemis.utils.Wait;
 import org.junit.Test;
 
 public class AmqpMessageRoutingTest extends JMSClientTestSupport {
@@ -100,8 +101,8 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
 
       sendMessages("multicast://" + addressA, 1);
 
-      assertEquals(0, server.locateQueue(SimpleString.toSimpleString(queueA)).getMessageCount());
-      assertEquals(2, server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount());
+      Wait.assertEquals(0, server.locateQueue(SimpleString.toSimpleString(queueA))::getMessageCount);
+      Wait.assertEquals(2, () -> (server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount()));
    }
 
    @Test(timeout = 60000)