aboutsummaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/test/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'feature-lifecycle/src/test/java/org/onap')
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java21
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java8
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateTerminatedTest.java6
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java6
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java4
5 files changed, 23 insertions, 22 deletions
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java
index 3a3434ac..e82eb42b 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java
@@ -27,8 +27,9 @@ import java.util.Properties;
import lombok.Getter;
import lombok.NonNull;
import org.kie.api.builder.ReleaseId;
-import org.onap.policy.drools.properties.DroolsProperties;
+import org.onap.policy.drools.properties.DroolsPropertyConstants;
import org.onap.policy.drools.system.PolicyController;
+import org.onap.policy.drools.system.PolicyControllerConstants;
import org.onap.policy.drools.util.KieUtils;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
@@ -75,27 +76,27 @@ public class ControllerSupport {
Properties controllerProps = new Properties();
- controllerProps.put(DroolsProperties.PROPERTY_CONTROLLER_NAME, name);
- controllerProps.put(DroolsProperties.PROPERTY_CONTROLLER_POLICY_TYPES, getPolicyType());
- controllerProps.put(DroolsProperties.RULES_GROUPID, coordinates.getGroupId());
- controllerProps.put(DroolsProperties.RULES_ARTIFACTID, coordinates.getArtifactId());
- controllerProps.put(DroolsProperties.RULES_VERSION, coordinates.getVersion());
+ controllerProps.put(DroolsPropertyConstants.PROPERTY_CONTROLLER_NAME, name);
+ controllerProps.put(DroolsPropertyConstants.PROPERTY_CONTROLLER_POLICY_TYPES, getPolicyType());
+ controllerProps.put(DroolsPropertyConstants.RULES_GROUPID, coordinates.getGroupId());
+ controllerProps.put(DroolsPropertyConstants.RULES_ARTIFACTID, coordinates.getArtifactId());
+ controllerProps.put(DroolsPropertyConstants.RULES_VERSION, coordinates.getVersion());
- return PolicyController.factory.build(name, controllerProps);
+ return PolicyControllerConstants.getFactory().build(name, controllerProps);
}
/**
* Destroy the echo controller.
*/
public void destroyController() {
- PolicyController.factory.destroy(name);
+ PolicyControllerConstants.getFactory().destroy(name);
}
/**
* Get controller.
*/
public PolicyController getController() {
- return PolicyController.factory.get(name);
+ return PolicyControllerConstants.getFactory().get(name);
}
/**
@@ -109,7 +110,7 @@ public class ControllerSupport {
* Get facts.
*/
public <T> List<T> getFacts(Class<T> clazz) {
- return PolicyController.factory.get(name)
+ return PolicyControllerConstants.getFactory().get(name)
.getDrools()
.facts(SESSION_NAME, clazz);
}
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java
index 25cce3a9..8ac47e55 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateRunningTest.java
@@ -25,7 +25,7 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.onap.policy.drools.persistence.SystemPersistence;
+import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.drools.utils.logging.LoggerUtil;
public abstract class LifecycleStateRunningTest {
@@ -42,7 +42,7 @@ public abstract class LifecycleStateRunningTest {
LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO");
LoggerUtil.setLevel("org.onap.policy.common.endpoints", "WARN");
LoggerUtil.setLevel("org.onap.policy.drools", "INFO");
- SystemPersistence.manager.setConfigurationDir("target/test-classes");
+ SystemPersistenceConstants.getManager().setConfigurationDir("target/test-classes");
controllerSupport.createController();
}
@@ -52,11 +52,11 @@ public abstract class LifecycleStateRunningTest {
@AfterClass
public static void tearDown() {
try {
- Files.deleteIfExists(Paths.get(SystemPersistence.manager.getConfigurationPath().toString(),
+ Files.deleteIfExists(Paths.get(SystemPersistenceConstants.getManager().getConfigurationPath().toString(),
CONTROLLER_NAME + "-controller.properties.bak"));
} catch (IOException e) {
;
}
- SystemPersistence.manager.setConfigurationDir(null);
+ SystemPersistenceConstants.getManager().setConfigurationDir(null);
}
}
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateTerminatedTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateTerminatedTest.java
index 50c4f1a7..353525d6 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateTerminatedTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateTerminatedTest.java
@@ -33,7 +33,7 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.utils.network.NetworkUtil;
-import org.onap.policy.drools.persistence.SystemPersistence;
+import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.drools.utils.logging.LoggerUtil;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
@@ -47,13 +47,13 @@ public class LifecycleStateTerminatedTest {
@BeforeClass
public static void setUp() {
- SystemPersistence.manager.setConfigurationDir("src/test/resources");
+ SystemPersistenceConstants.getManager().setConfigurationDir("src/test/resources");
LoggerUtil.setLevel("org.onap.policy.common.endpoints", "WARN");
}
@AfterClass
public static void tearDown() {
- SystemPersistence.manager.setConfigurationDir(null);
+ SystemPersistenceConstants.getManager().setConfigurationDir(null);
}
@Test
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java
index 01efca32..14da6ab0 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Java6Assertions.assertThatThrownBy;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.drools.persistence.SystemPersistence;
+import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
@@ -39,12 +39,12 @@ public abstract class LifecycleStateUnsupportedTest {
@BeforeClass
public static void setUp() {
- SystemPersistence.manager.setConfigurationDir("src/test/resources");
+ SystemPersistenceConstants.getManager().setConfigurationDir("src/test/resources");
}
@AfterClass
public static void tearDown() {
- SystemPersistence.manager.setConfigurationDir(null);
+ SystemPersistenceConstants.getManager().setConfigurationDir(null);
}
public LifecycleStateUnsupportedTest(LifecycleState state) {
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
index 92269167..da7435f3 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
@@ -33,7 +33,7 @@ import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.utils.network.NetworkUtil;
-import org.onap.policy.drools.persistence.SystemPersistence;
+import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.models.pdp.enums.PdpState;
/**
@@ -49,7 +49,7 @@ public class RestLifecycleManagerTest {
HttpServletServerFactoryInstance.getServerFactory().destroy();
HttpClientFactoryInstance.getClientFactory().destroy();
- SystemPersistence.manager.setConfigurationDir("target/test-classes");
+ SystemPersistenceConstants.getManager().setConfigurationDir("target/test-classes");
HttpClientFactoryInstance.getClientFactory().build(
BusTopicParams.builder()