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
This commit is contained in:
Michael Andre Pearce 2017-08-01 08:39:34 +01:00 committed by Clebert Suconic
parent 42dbd02bda
commit 776ec0b9fd
3 changed files with 7 additions and 1 deletions

View File

@ -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;
}

View File

@ -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"));

View File

@ -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"/>