diff options
author | waqas.ikram <waqas.ikram@ericsson.com> | 2018-07-10 11:52:12 +0100 |
---|---|---|
committer | waqas.ikram <waqas.ikram@ericsson.com> | 2018-07-10 13:49:59 +0100 |
commit | 6bf1aa0b408e0e4201d9002ca5c13095b98e7e46 (patch) | |
tree | d626d687d8e797ac62f4e366866e807ba1321b90 /context/context-test-utils | |
parent | 678fa2fdf50d1d6b97ef3dea1bdaf6302d3839f4 (diff) |
Adding executor integration tests
Change-Id: I292315164fbfb3650f6d21ede6edb264a7fd8ee3
Issue-ID: POLICY-865
Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
Diffstat (limited to 'context/context-test-utils')
3 files changed, 11 insertions, 2 deletions
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java index a400bc79a..b62364e9d 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java @@ -113,6 +113,8 @@ public class ConcurrentContext { executorService.awaitTermination(10, TimeUnit.MINUTES); } catch (final InterruptedException interruptedException) { LOGGER.error("Exception while waiting for threads to finish", interruptedException); + // restore the interrupt status + Thread.currentThread().interrupt(); } LOGGER.info("Shutting down now ..."); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java index b76b00840..e2a6b0da0 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java @@ -119,6 +119,8 @@ public final class ConcurrentContextJVM { executorService.awaitTermination(10, TimeUnit.MINUTES); } catch (final InterruptedException interruptedException) { LOGGER.error("Exception while waiting for threads to finish", interruptedException); + // restore the interrupt status + Thread.currentThread().interrupt(); } LOGGER.debug("threads finished, end value is {}", lTypeAlbum.get("testValue")); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java index ac1e951d5..2bf304ec8 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.TimeZone; @@ -51,8 +52,12 @@ public class Constants { public static final String TEST_POLICY_CONTEXT_ITEM = TestPolicyContextItem.class.getName(); public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("Europe/Dublin"); - public static AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = {new AxArtifactKey("testC-top", VERSION), - new AxArtifactKey("testC-next", VERSION), new AxArtifactKey("testC-bot", VERSION)}; + private static final AxArtifactKey KEY = new AxArtifactKey("testC-top", VERSION); + private static final AxArtifactKey KEY3 = new AxArtifactKey("testC-bot", VERSION); + private static final AxArtifactKey KEY2 = new AxArtifactKey("testC-next", VERSION); + + private static final AxArtifactKey[] AX_ARTIFACT_KEYS = {KEY, KEY2, KEY3}; + public static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = AX_ARTIFACT_KEYS; private Constants() {} |