summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates/template.demo/src/test')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java2
-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/VCPEControlLoopTest.java12
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java2
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java6
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java4
6 files changed, 21 insertions, 17 deletions
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java
index a6a4d3fc6..77a1ac063 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java
@@ -76,7 +76,7 @@ public class ControlLoopXacmlGuardTest {
@BeforeClass
public static void setPUProp(){
System.setProperty(OPSHISTPUPROP, "TestOperationsHistoryPU");
- Util.setTestGuardProps();
+ Util.setGuardProps();
}
@AfterClass
public static void restorePUProp(){
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 df10714b9..66a72bc2b 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
@@ -275,18 +275,26 @@ public final class Util {
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");
}
- public static void setTestGuardProps(){
+
+ public static void setGuardProps(){
PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_URL, "http://localhost:6669/pdp/api/getDecision");
PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_USER, "python");
PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_PASS, "test");
PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_CLIENT_USER, "python");
PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_CLIENT_PASS, "test");
PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_ENV, "TEST");
+ }
+
+ public static void setVFCProps() {
+ PolicyEngine.manager.setEnvironmentProperty("vfc.url", "http://localhost:6668");
+ PolicyEngine.manager.setEnvironmentProperty("vfc.username", "VFC");
+ PolicyEngine.manager.setEnvironmentProperty("vfc.password", "VFC");
}
-
+
}
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java
index 9743f8808..d43537b80 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java
@@ -45,7 +45,6 @@ import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.controlloop.policy.TargetType;
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.PolicyGuard;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,13 +59,8 @@ public class VCPEControlLoopTest {
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("guard.url", "http://localhost:6669/pdp/api/getDecision");
- PolicyEngine.manager.setEnvironmentProperty("guard.username", "GUARD");
- PolicyEngine.manager.setEnvironmentProperty("guard.password", "GUARD");
+ Util.setAAIProps();
+ Util.setGuardProps();
}
@BeforeClass
@@ -198,7 +192,7 @@ public class VCPEControlLoopTest {
* See if Guard permits this action, if it does
* not then the test should fail
*/
- if (((VirtualControlLoopNotification)obj).message.contains("Guard result: PERMIT")) {
+ if (((VirtualControlLoopNotification)obj).message.contains("PERMIT")) {
/*
* A notification should be sent out of the Policy
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 a8a4bf398..0b0cb6d1f 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,6 +61,7 @@ public class VDNSControlLoopTest {
/* Set environment properties */
Util.setAAIProps();
Util.setSOProps();
+ Util.setGuardProps();
}
@BeforeClass
@@ -68,6 +69,7 @@ public class VDNSControlLoopTest {
try {
Util.buildAaiSim();
Util.buildSoSim();
+ Util.buildGuardSim();
} catch (Exception e) {
fail(e.getMessage());
}
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 a4845693c..fbe9129bd 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
@@ -59,10 +59,8 @@ public class VFCControlLoopTest {
static {
/* Set environment properties */
Util.setAAIProps();
-
- PolicyEngine.manager.setEnvironmentProperty("vfc.url", "http://localhost:6668");
- PolicyEngine.manager.setEnvironmentProperty("vfc.username", "VFC");
- PolicyEngine.manager.setEnvironmentProperty("vfc.password", "VFC");
+ Util.setVFCProps();
+ Util.setGuardProps();
}
@BeforeClass
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 a63344d35..2569768f9 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
@@ -62,12 +62,14 @@ public class VFWControlLoopTest {
static {
/* Set environment properties */
Util.setAAIProps();
+ Util.setGuardProps();
}
@BeforeClass
public static void setUpSimulator() {
try {
Util.buildAaiSim();
+ Util.buildGuardSim();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -192,7 +194,7 @@ public class VFWControlLoopTest {
* See if Guard permits this action, if it does
* not then the test should fail
*/
- if (((VirtualControlLoopNotification)obj).message.contains("Guard result: Permit")) {
+ if (((VirtualControlLoopNotification)obj).message.contains("PERMIT")) {
/*
* Obtain the ControlLoopNoticiation, it should be of type operation