From f150fe50954b38cd1f17f6c0ce014301b8f745aa Mon Sep 17 00:00:00 2001 From: franz1981 Date: Tue, 7 Sep 2021 07:11:14 +0200 Subject: [PATCH] NO-JIRA Fix HAPolicyConfigurationTest::PrimaryReplicationTest NPE on assert --- .../impl/HAPolicyConfigurationTest.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java index 4dc63779b0..73a4f21c0a 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.core.config.Configuration; @@ -245,9 +244,32 @@ public class HAPolicyConfigurationTest extends ActiveMQTestBase { } @Override - public MutableLong getMutableLong(String mutableLongId) throws InterruptedException, ExecutionException, TimeoutException { - // TODO - return null; + public MutableLong getMutableLong(String mutableLongId) { + // use a lock file - but with a prefix + return new MutableLong() { + + private long value = 0; + + @Override + public String getMutableLongId() { + return mutableLongId; + } + + @Override + public long get() { + return value; + } + + @Override + public void set(long value) { + this.value = value; + } + + @Override + public void close() { + + } + }; } @Override