Repository: activemq-artemis
Updated Branches:
  refs/heads/master cd47873f2 -> b36569d82


ARTEMIS-977 - record id of address not set on journal reload

https://issues.apache.org/jira/browse/ARTEMIS-977


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

Branch: refs/heads/master
Commit: a243e0559f4bc4768fc7af356a1153837ac4f3de
Parents: cd47873
Author: Andy Taylor <[email protected]>
Authored: Fri Feb 17 11:20:51 2017 +0000
Committer: Clebert Suconic <[email protected]>
Committed: Mon Feb 20 09:17:45 2017 -0500

----------------------------------------------------------------------
 .../server/impl/PostOfficeJournalLoader.java    |  1 +
 .../management/ActiveMQServerControlTest.java   | 23 ++++++++++++++++++++
 2 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a243e055/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
index 3290b6f..005a994 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
@@ -178,6 +178,7 @@ public class PostOfficeJournalLoader implements 
JournalLoader {
          addressBindingInfosMap.put(addressBindingInfo.getId(), 
addressBindingInfo);
 
          AddressInfo addressInfo = new 
AddressInfo(addressBindingInfo.getName()).setRoutingTypes(addressBindingInfo.getRoutingTypes());
+         addressInfo.setId(addressBindingInfo.getId());
          postOffice.addAddressInfo(addressInfo);
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a243e055/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index 16c19d5..75b7832 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -412,6 +412,29 @@ public class ActiveMQServerControlTest extends 
ManagementTestBase {
    }
 
    @Test
+   public void testGetAddressDeletedFromJournal() throws Exception {
+      SimpleString address = RandomUtil.randomSimpleString();
+      SimpleString name = RandomUtil.randomSimpleString();
+
+      ActiveMQServerControl serverControl = createManagementControl();
+
+      // due to replication, there can be another queue created for replicating
+      // management operations
+
+      
Assert.assertFalse(ActiveMQServerControlTest.contains(address.toString(), 
serverControl.getAddressNames()));
+      serverControl.createAddress(address.toString(), "ANYCAST");
+      Assert.assertTrue(ActiveMQServerControlTest.contains(address.toString(), 
serverControl.getAddressNames()));
+
+      restartServer();
+
+      serverControl.deleteAddress(address.toString());
+
+      restartServer();
+
+      
Assert.assertFalse(ActiveMQServerControlTest.contains(address.toString(), 
serverControl.getAddressNames()));
+   }
+
+   @Test
    public void testMessageCounterMaxDayCount() throws Exception {
       ActiveMQServerControl serverControl = createManagementControl();
 

Reply via email to