activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [4/5] activemq-artemis git commit: ARTEMIS-1416 Fixing testsuite
Date Sat, 04 Nov 2017 03:51:20 GMT
ARTEMIS-1416 Fixing testsuite


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

Branch: refs/heads/master
Commit: 559a704818bf91af0a3ea92cfccead3e62c30238
Parents: 0e9b39c
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Fri Nov 3 18:25:07 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Fri Nov 3 18:27:42 2017 -0400

----------------------------------------------------------------------
 .../core/protocol/core/ServerSessionPacketHandler.java    |  2 +-
 .../activemq/artemis/core/server/BindingQueryResult.java  | 10 ++++++++++
 .../artemis/core/server/impl/ActiveMQServerImpl.java      |  6 ++++--
 .../amqp/BrokerDefinedAnycastConsumerTest.java            |  7 +++++++
 4 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/559a7048/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
index 8f3c5be..75ef071 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
@@ -446,7 +446,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
                      if (!queueNames.isEmpty()) {
                         final List<SimpleString> convertedQueueNames = request.convertQueueNames(clientVersion,
queueNames);
                         if (convertedQueueNames != queueNames) {
-                           result = new BindingQueryResult(result.isExists(), convertedQueueNames,
result.isAutoCreateQueues(), result.isAutoCreateAddresses(), result.isDefaultPurgeOnNoConsumers(),
result.getDefaultMaxConsumers());
+                           result = new BindingQueryResult(result.isExists(), result.getAddressInfo(),
convertedQueueNames, result.isAutoCreateQueues(), result.isAutoCreateAddresses(), result.isDefaultPurgeOnNoConsumers(),
result.getDefaultMaxConsumers());
                         }
                      }
                   }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/559a7048/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
index 7eed31f..7f340b1 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
@@ -19,6 +19,7 @@ package org.apache.activemq.artemis.core.server;
 import java.util.List;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 
 public class BindingQueryResult {
 
@@ -34,12 +35,17 @@ public class BindingQueryResult {
 
    private int defaultMaxConsumers;
 
+   private final AddressInfo addressInfo;
+
    public BindingQueryResult(final boolean exists,
+                             final AddressInfo addressInfo,
                              final List<SimpleString> queueNames,
                              final boolean autoCreateQueues,
                              final boolean autoCreateAddresses,
                              final boolean defaultPurgeOnNoConsumers,
                              final int defaultMaxConsumers) {
+      this.addressInfo = addressInfo;
+
       this.exists = exists;
 
       this.queueNames = queueNames;
@@ -57,6 +63,10 @@ public class BindingQueryResult {
       return exists;
    }
 
+   public AddressInfo getAddressInfo() {
+      return addressInfo;
+   }
+
    public boolean isAutoCreateQueues() {
       return autoCreateQueues;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/559a7048/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 587cff9..8077ae9 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -852,7 +852,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       SimpleString bindAddress = new SimpleString(realAddress);
       if (managementService != null) {
          if (bindAddress.equals(managementService.getManagementAddress())) {
-            return new BindingQueryResult(true, names, autoCreateQeueus, autoCreateAddresses,
defaultPurgeOnNoConsumers, defaultMaxConsumers);
+            return new BindingQueryResult(true, null, names, autoCreateQeueus, autoCreateAddresses,
defaultPurgeOnNoConsumers, defaultMaxConsumers);
          }
       }
 
@@ -868,7 +868,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          }
       }
 
-      return new BindingQueryResult(getAddressInfo(bindAddress) != null, names, autoCreateQeueus,
autoCreateAddresses, defaultPurgeOnNoConsumers, defaultMaxConsumers);
+      AddressInfo info = getAddressInfo(bindAddress);
+
+      return new BindingQueryResult(info != null, info, names, autoCreateQeueus, autoCreateAddresses,
defaultPurgeOnNoConsumers, defaultMaxConsumers);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/559a7048/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java
index e10c73d..7f0fdd8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/BrokerDefinedAnycastConsumerTest.java
@@ -40,6 +40,11 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport
 {
    SimpleString queue1 = new SimpleString("queue1");
    SimpleString queue2 = new SimpleString("queue2");
 
+   @Override
+   protected boolean isAutoCreateQueues() {
+      return false;
+   }
+
    @Test(timeout = 60000)
    public void testConsumeFromSingleQueueOnAddressSameName() throws Exception {
       server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
@@ -187,6 +192,8 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport
 {
 
    @Test(timeout = 60000)
    public void testConsumeWhenNoAddressCreatedAutoCreate() throws Exception {
+      // This test needs auto-create.. for that just clear the settings and use defaults
+      server.getAddressSettingsRepository().clear();
       AddressSettings settings = new AddressSettings();
       settings.setAutoCreateAddresses(true);
       server.getAddressSettingsRepository().addMatch(address.toString(), settings);


Mime
View raw message