summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates/template.demo')
-rw-r--r--controlloop/templates/template.demo/pom.xml10
-rw-r--r--controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl10
-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/VCPEControlLoopTest.java4
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java12
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java12
6 files changed, 36 insertions, 14 deletions
diff --git a/controlloop/templates/template.demo/pom.xml b/controlloop/templates/template.demo/pom.xml
index 69c2da80e..c07934207 100644
--- a/controlloop/templates/template.demo/pom.xml
+++ b/controlloop/templates/template.demo/pom.xml
@@ -204,10 +204,10 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.drools-pdp</groupId>
- <artifactId>policy-management</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
+ <groupId>org.onap.policy.drools-pdp</groupId>
+ <artifactId>policy-management</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl b/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl
index b506d8910..64101ac56 100644
--- a/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl
+++ b/controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl
@@ -507,10 +507,12 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED"
switch ($operation.policy.getActor()){
case "APPC":
-
- if (request instanceof Request || request instanceof LCMRequestWrapper) {
- Engine.deliver("UEB", "APPC-CL", request);
- }
+ if (request instanceof Request) {
+ Engine.deliver("UEB", "APPC-CL", request);
+ }
+ else if (request instanceof LCMRequestWrapper) {
+ Engine.deliver("UEB", "APPC-LCM-READ", request);
+ }
break;
case "SO":
// at this point the AAI named query request should have already been made, the response recieved and used
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 5fe2f6222..02066d66a 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
@@ -242,7 +242,7 @@ public class ControlLoopXacmlGuardTest {
Thread.sleep(2*1000);
- obj = engine.subscribe("UEB", "APPC-CL");
+ obj = engine.subscribe("UEB", "APPC-LCM-READ");
assertNotNull(obj);
assertTrue(obj instanceof LCMRequestWrapper);
LCMRequestWrapper dmaapRequest = (LCMRequestWrapper) obj;
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 182e39828..878c6e8c1 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
@@ -195,7 +195,7 @@ public class VCPEControlLoopTest {
/*
* Obtain the request sent from the Policy Engine
*/
- obj = engine.subscribe("UEB", "APPC-CL");
+ obj = engine.subscribe("UEB", "APPC-LCM-READ");
assertNotNull(obj);
/*
@@ -235,7 +235,7 @@ public class VCPEControlLoopTest {
* Give time for processing
*/
try {
- Thread.sleep(4000);
+ Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
logger.debug("An interrupt Exception was thrown");
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 9608f7cf0..419ab63a0 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
@@ -46,6 +46,7 @@ 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;
@@ -58,6 +59,17 @@ public class VDNSControlLoopTest {
private Util.Pair<ControlLoopPolicy, String> pair;
private PolicyEngineJUnitImpl engine;
+ 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");
+ }
+
@BeforeClass
public static void setUpSimulator() {
try {
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 a19d9267c..453354dba 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
@@ -44,6 +44,7 @@ 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;
@@ -54,7 +55,14 @@ public class VFWControlLoopTest {
private KieSession kieSession;
private Util.Pair<ControlLoopPolicy, String> pair;
- private PolicyEngineJUnitImpl engine;
+ private PolicyEngineJUnitImpl engine;
+
+ static {
+ /* Set environment properties */
+ PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
+ PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
+ PolicyEngine.manager.setEnvironmentProperty("aai.password", "AAI");
+ }
@BeforeClass
public static void setUpSimulator() {
@@ -240,7 +248,7 @@ public class VFWControlLoopTest {
*/
Response appcResponse = new Response((Request)obj);
appcResponse.getStatus().Code = ResponseCode.SUCCESS.getValue();
- appcResponse.getStatus().Description = "AppC success";
+ appcResponse.getStatus().Value = "SUCCESS";
kieSession.insert(appcResponse);
/*