ARTEMIS-1851 avoid exception in isReplicaSync()

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

Branch: refs/heads/master
Commit: ecb9d462cedc2aea002cb49c6cecd4b80c5f93e2
Parents: 82b5871
Author: Justin Bertram <[email protected]>
Authored: Thu May 10 10:44:30 2018 -0500
Committer: Clebert Suconic <[email protected]>
Committed: Fri May 11 12:11:52 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java   | 2 +-
 .../tests/integration/management/ActiveMQServerControlTest.java | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ecb9d462/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 3a2e91c..cb31b00 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
@@ -946,7 +946,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       } else if (activation instanceof SharedNothingBackupActivation) {
          return ((SharedNothingBackupActivation) 
activation).isRemoteBackupUpToDate();
       } else {
-         throw ActiveMQMessageBundle.BUNDLE.methodNotApplicable();
+         return false;
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ecb9d462/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 d290ec2..cdf7a08 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
@@ -180,6 +180,11 @@ public class ActiveMQServerControlTest extends 
ManagementTestBase {
    }
 
    @Test
+   public void testIsReplicaSync() throws Exception {
+      Assert.assertFalse(createManagementControl().isReplicaSync());
+   }
+
+   @Test
    public void testGetConnectorsAsJSON() throws Exception {
       ActiveMQServerControl serverControl = createManagementControl();
 

Reply via email to