activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1313 getAddresses in PostOfficeImpl does not correctly return all addresses
Date Wed, 02 Aug 2017 16:50:41 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 42dbd02bd -> 2eada40fb


ARTEMIS-1313 getAddresses in PostOfficeImpl does not correctly return all addresses

Fix so that getAddresses uses addressInfoMap instead of the mappings so that addresses without
queues also are returned

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

Branch: refs/heads/master
Commit: 776ec0b9fd70f91c3f99b2606a14f3d7de2284fa
Parents: 42dbd02
Author: Michael Andre Pearce <Michael.Andre.Pearce@me.com>
Authored: Tue Aug 1 08:39:34 2017 +0100
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Aug 2 12:50:34 2017 -0400

----------------------------------------------------------------------
 .../artemis/core/postoffice/impl/SimpleAddressManager.java       | 2 +-
 .../activemq/artemis/tests/integration/jms/RedeployTest.java     | 2 ++
 .../src/test/resources/reload-address-queues.xml                 | 4 ++++
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/776ec0b9/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
index 347ac15..5a8164f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
@@ -169,7 +169,7 @@ public class SimpleAddressManager implements AddressManager {
    @Override
    public Set<SimpleString> getAddresses() {
       Set<SimpleString> addresses = new HashSet<>();
-      addresses.addAll(mappings.keySet());
+      addresses.addAll(addressInfoMap.keySet());
       return addresses;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/776ec0b9/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
index 4260287..da50ac2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java
@@ -136,6 +136,7 @@ public class RedeployTest extends ActiveMQTestBase {
 
       try {
          latch.await(10, TimeUnit.SECONDS);
+         Assert.assertNotNull(getAddressInfo(embeddedJMS, "config_test_address_removal_no_queue"));
          Assert.assertNotNull(getAddressInfo(embeddedJMS, "config_test_address_removal"));
          Assert.assertNotNull(getAddressInfo(embeddedJMS, "config_test_queue_removal"));
          Assert.assertTrue(listQueuesNamesForAddress(embeddedJMS, "config_test_queue_removal").contains("config_test_queue_removal_queue_1"));
@@ -153,6 +154,7 @@ public class RedeployTest extends ActiveMQTestBase {
          embeddedJMS.getActiveMQServer().getReloadManager().setTick(tick);
          latch.await(10, TimeUnit.SECONDS);
 
+         Assert.assertNull(getAddressInfo(embeddedJMS, "config_test_address_removal_no_queue"));
          Assert.assertNull(getAddressInfo(embeddedJMS, "config_test_address_removal"));
          Assert.assertNotNull(getAddressInfo(embeddedJMS, "config_test_queue_removal"));
          Assert.assertTrue(listQueuesNamesForAddress(embeddedJMS, "config_test_queue_removal").contains("config_test_queue_removal_queue_1"));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/776ec0b9/tests/integration-tests/src/test/resources/reload-address-queues.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/reload-address-queues.xml b/tests/integration-tests/src/test/resources/reload-address-queues.xml
index e9b42be..8fd2e9e 100644
--- a/tests/integration-tests/src/test/resources/reload-address-queues.xml
+++ b/tests/integration-tests/src/test/resources/reload-address-queues.xml
@@ -127,6 +127,10 @@ under the License.
                <queue name="config_test_address_removal_queue"/>
             </multicast>
          </address>
+         <address name="config_test_address_removal_no_queue">
+            <multicast>
+            </multicast>
+         </address>
          <address name="permanent_test_queue_removal">
             <multicast>
                <queue name="permanent_test_queue_removal_queue_1"/>


Mime
View raw message