aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
diff options
context:
space:
mode:
authorTarun Tej Velaga <tt3868@att.com>2017-07-24 17:13:43 +0000
committerTarun Tej Velaga <tt3868@att.com>2017-07-25 14:23:59 +0000
commite92ff832cf993db876f22b2d27562fedf59f5043 (patch)
tree47429eeaaf4241905d7ea1f71dbdb5c2d0504618 /ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
parent570290dc6ba8198e653022c2f6f8e5d01cfa8d1b (diff)
[Policy-52, Policy-92, Policy-93] Policy Enhancements and bugfixes
Change-Id: I5675cf4527e17963b3142cf7184c0df31a766197 Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
Diffstat (limited to 'ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java')
-rw-r--r--ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java b/ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
index 3137a1232..9dff9f33c 100644
--- a/ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
+++ b/ECOMP-ControlloopPolicy/src/test/java/org/openecomp/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
@@ -66,7 +66,13 @@ public class ControlLoopGuardBuilderTest {
//
// Add a guard policy without limit constraint
//
- GuardPolicy policy1 = new GuardPolicy("1111", "guardpolicy1", "guardpolicy1", "APPC", "restart");
+ String clname = "CL_vUSP123";
+ LinkedList<String> targets = new LinkedList<String>();
+ targets.add("s1");
+ targets.add("s2");
+ targets.add("s3");
+ MatchParameters matchParameters = new MatchParameters(clname, "APPC", "Restart", targets);
+ GuardPolicy policy1 = new GuardPolicy("id123", "guardpolicy1", "description aaa", matchParameters);
builder = builder.addGuardPolicy(policy1);
//
// Assert there is no limit constraint associated with the only guard policy
@@ -83,13 +89,16 @@ public class ControlLoopGuardBuilderTest {
//
// Add a constraint to policy1
//
- Map<String, String> time_in_range = new HashMap<String, String>();
- time_in_range.put("arg2", "PT5H");
- time_in_range.put("arg3", "PT24H");
+ Map<String, String> active_time_range = new HashMap<String, String>();
+ active_time_range.put("start", "00:00:00-05:00");
+ active_time_range.put("end", "23:59:59-05:00");
List<String> blacklist = new LinkedList<String>();
blacklist.add("eNodeB_common_id1");
blacklist.add("eNodeB_common_id2");
- Constraint cons = new Constraint(5, "PT15M", time_in_range, blacklist);
+ Map<String, String> time_window = new HashMap<String, String>();
+ time_window.put("value", "10");
+ time_window.put("units", "minute");
+ Constraint cons = new Constraint(5, time_window, active_time_range, blacklist);
builder = builder.addLimitConstraint(policy1.getId(), cons);
//
// Add a duplicate constraint to policy1
@@ -142,12 +151,12 @@ public class ControlLoopGuardBuilderTest {
fail(e.getMessage());
}
}
-
+
@Test
public void test1() {
this.test("src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml");
}
-
+
@Test
public void test2() {
this.test("src/test/resources/v2.0.0-guard/policy_guard_1707_appc.yaml");