summaryrefslogtreecommitdiffstats
path: root/context
diff options
context:
space:
mode:
Diffstat (limited to 'context')
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java2
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java2
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java9
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() {}