diff options
author | waqas.ikram <waqas.ikram@ericsson.com> | 2018-07-06 16:37:36 +0100 |
---|---|---|
committer | waqas.ikram <waqas.ikram@ericsson.com> | 2018-07-09 14:07:58 +0100 |
commit | dba5999ebf16a85a996f1f5502c2c154ac3f38b2 (patch) | |
tree | 189c48972b92213ae7b853ce6c100f52a196635b /testsuites/integration/integration-context-test/src/test/java | |
parent | dcf8f703fdd07161c86231ecc4af0f25872a45f4 (diff) |
Fixing Multi JVM Tests and sonar bugs
Change-Id: I02df58695b44d5768410a0eaccb090cda7eb85ba
Issue-ID: POLICY-865
Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
Diffstat (limited to 'testsuites/integration/integration-context-test/src/test/java')
-rw-r--r-- | testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/plugins/context/test/locking/TestConcurrentContext.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/plugins/context/test/locking/TestConcurrentContext.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/plugins/context/test/locking/TestConcurrentContext.java index 7a3a29cc1..e2c2de97a 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/plugins/context/test/locking/TestConcurrentContext.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/plugins/context/test/locking/TestConcurrentContext.java @@ -48,6 +48,7 @@ import org.onap.policy.apex.context.test.locking.ConcurrentContext; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; import org.onap.policy.apex.model.basicmodel.service.ParameterService; +import org.onap.policy.apex.model.utilities.ResourceUtils; import org.onap.policy.apex.plugins.context.distribution.hazelcast.HazelcastContextDistributor; import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanContextDistributor; import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanDistributorParameters; @@ -65,6 +66,11 @@ import com.hazelcast.config.Config; * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TestConcurrentContext { + private static final String HAZELCAST_CONFIG = "hazelcast.config"; + + private static final String JAVA_NET_PREFER_IPV4_STACK = "java.net.preferIPv4Stack"; + private static final String HAZELCAST_XML_FILE = "src/test/resources/hazelcast/hazelcast.xml"; + // Logger for this class private static final XLogger logger = XLoggerFactory.getXLogger(TestConcurrentContext.class); @@ -89,8 +95,9 @@ public class TestConcurrentContext { @BeforeClass public static void configure() throws Exception { - System.setProperty("java.net.preferIPv4Stack", "true"); - System.setProperty("hazelcast.config", "src/test/resources/hazelcast/hazelcast.xml"); + System.setProperty(JAVA_NET_PREFER_IPV4_STACK, "true"); + final String hazelCastfileLocation = ResourceUtils.getFilePath4Resource(HAZELCAST_XML_FILE); + System.setProperty(HAZELCAST_CONFIG, hazelCastfileLocation); // The JGroups IP address must be set to a real (not loopback) IP address for Infinispan to // work. IN order to ensure that all |