aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/templates
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/TestSO.java6
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java12
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java9
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java4
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java4
5 files changed, 22 insertions, 13 deletions
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/TestSO.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/TestSO.java
index 08f73f4bc..249c76d43 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/TestSO.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/TestSO.java
@@ -66,6 +66,12 @@ public class TestSO {
private static final Logger log = LoggerFactory.getLogger(TestSO.class);
+ static{
+ /* Set environment properties */
+ Util.setAAIProps();
+ Util.setSOProps();
+ }
+
@BeforeClass
public static void setUpSimulator() {
try {
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java
index 715b8f795..f8f906867 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java
@@ -50,6 +50,7 @@ import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.controlloop.policy.guard.ControlLoopGuard;
import org.onap.policy.drools.http.server.HttpServletServer;
import org.onap.policy.drools.impl.PolicyEngineJUnitImpl;
+import org.onap.policy.drools.system.PolicyEngine;
import org.onap.policy.guard.PolicyGuardYamlToXacml;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -264,5 +265,16 @@ public final class Util {
}
return kieSession;
}
+
+ public static void setAAIProps(){
+ PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
+ PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
+ PolicyEngine.manager.setEnvironmentProperty("aai.password", "AAI");
+ }
+ public static void setSOProps(){
+ PolicyEngine.manager.setEnvironmentProperty("so.url", "http://localhost:6667");
+ PolicyEngine.manager.setEnvironmentProperty("so.username", "SO");
+ PolicyEngine.manager.setEnvironmentProperty("so.password", "SO");
+ }
}
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java
index 419ab63a0..b350570ba 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java
@@ -61,13 +61,8 @@ public class VDNSControlLoopTest {
static {
/* Set environment properties */
- PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
- PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
- PolicyEngine.manager.setEnvironmentProperty("aai.password", "AAI");
-
- PolicyEngine.manager.setEnvironmentProperty("so.url", "http://localhost:6667");
- PolicyEngine.manager.setEnvironmentProperty("so.username", "SO");
- PolicyEngine.manager.setEnvironmentProperty("so.password", "SO");
+ Util.setAAIProps();
+ Util.setSOProps();
}
@BeforeClass
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java
index 29fdc195a..bdcf4bc7d 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java
@@ -72,9 +72,7 @@ public class VFCControlLoopTest {
static {
/* Set environment properties */
- PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
- PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
- PolicyEngine.manager.setEnvironmentProperty("aai.password", "AAI");
+ Util.setAAIProps();
PolicyEngine.manager.setEnvironmentProperty("vfc.url", "http://localhost:6668");
PolicyEngine.manager.setEnvironmentProperty("vfc.username", "VFC");
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java
index 453354dba..dc2047d35 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java
@@ -59,9 +59,7 @@ public class VFWControlLoopTest {
static {
/* Set environment properties */
- PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
- PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
- PolicyEngine.manager.setEnvironmentProperty("aai.password", "AAI");
+ Util.setAAIProps();
}
@BeforeClass