aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo/src/main/resources
diff options
context:
space:
mode:
authordaniel <dc443y@att.com>2017-08-28 09:13:31 -0500
committerdaniel <dc443y@att.com>2017-08-28 11:03:14 -0500
commit98d04b5c4e9aa3f7dd40cd40cbd1b00689b0bc22 (patch)
tree3f240e4f0484fc167edd73957aaeea67a3657f6f /controlloop/templates/template.demo/src/main/resources
parentd03507850e293674cc118f76bab0629d457179ae (diff)
Fix JUnit Test for ControlLoops
Fixed the test case by using getters and setters for Policy objects in the drl. Added gson dependency in the pom to fix gson runtime errors. Fixed dependencies in template.demo pom to add vfc. The drl was having compilation errors in the guard permitted rule due to the operation request object not being casted into a VFCRequest when being passed into the VFCManager. Issue-ID: POLICY-194 Change-Id: Id71c74ad9727ad942a683f63a0dfad3f22b6376b Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/templates/template.demo/src/main/resources')
-rw-r--r--controlloop/templates/template.demo/src/main/resources/ControlLoop_Template_xacml_guard.drl12
1 files changed, 6 insertions, 6 deletions
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 8eab47885..276e64b7d 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
@@ -320,7 +320,7 @@ rule "${policyName}.EVENT.MANAGER"
//
// Check whether we need to wait for abatement
//
- if ($manager.getProcessor().getControlLoop().abatement == true && notification.notification == ControlLoopNotificationType.FINAL_SUCCESS) {
+ if ($manager.getProcessor().getControlLoop().getAbatement() == true && notification.notification == ControlLoopNotificationType.FINAL_SUCCESS) {
Logger.info("Waiting for abatement.");
} else {
Logger.info("No abatement is promised to come, close out the control loop for " + $event.requestID);
@@ -486,7 +486,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED"
notification.policyVersion = "${policyVersion}";
Engine.deliver("UEB", "POLICY-CL-MGT", notification);
- switch ($operation.policy.actor){
+ switch ($operation.policy.getActor()){
case "APPC":
@@ -497,7 +497,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED"
case "VFC":
if (request instanceof VFCRequest) {
// Start VFC thread
- Thread t = new Thread(new VFCManager(request));
+ Thread t = new Thread(new VFCManager((VFCRequest)request));
t.start();
}
break;
@@ -567,8 +567,8 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
"",
drools.getWorkingMemory(),
$event.closedLoopControlName,
- $operation.policy.actor.toString(),
- $operation.policy.recipe,
+ $operation.policy.getActor().toString(),
+ $operation.policy.getRecipe(),
$manager.getTargetInstance($operation.policy),
//$event.target,
$event.requestID.toString()
@@ -576,7 +576,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
t.start();
}
else{
- insert(new PolicyGuardResponse("Permit", $event.requestID, $operation.policy.recipe));
+ insert(new PolicyGuardResponse("Permit", $event.requestID, $operation.policy.getRecipe()));
}