summaryrefslogtreecommitdiffstats
path: root/controlloop/common/rules-test/src/main/java
diff options
context:
space:
mode:
authoruj426b <uj426b@att.com>2020-07-16 14:47:45 -0400
committerUtkarsh Jauhari <uj426b@att.com>2020-07-20 13:46:49 +0000
commita956225992fa998fe4f89db07d16cb67c18cafcc (patch)
tree779333b5dc29dc576e04125c550ad5ae04800528 /controlloop/common/rules-test/src/main/java
parent24297a111b10247058150f2947fea13d72d36b5c (diff)
Support vDNS RainyDay test Case.
Change-Id: I6d2b17c5379b19b04589da4d7bc4a7f6ebc4d23a Issue-ID: POLICY-2432 Signed-off-by: uj426b <uj426b@att.com>
Diffstat (limited to 'controlloop/common/rules-test/src/main/java')
-rw-r--r--controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java
index 0baac9e8c..7c34fc875 100644
--- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java
+++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java
@@ -88,6 +88,7 @@ public abstract class BaseRuleTest {
// VDNS
private static final String VDNS_TOSCA_LEGACY_POLICY = "vdns/tosca-legacy-vdns.json";
private static final String VDNS_TOSCA_COMPLIANT_POLICY = "vdns/tosca-compliant-vdns.json";
+ private static final String VDNS_TOSCA_COMPLIANT_RAINY_POLICY = "vdns/tosca-compliant-vdns-rainy.json";
private static final String VDNS_ONSET = "vdns/vdns.onset.json";
// VFW
@@ -334,6 +335,15 @@ public abstract class BaseRuleTest {
httpSunnyDay(VDNS_TOSCA_COMPLIANT_POLICY, VDNS_ONSET);
}
+ /**
+ * Vdns Rainy Day with Compliant Tosca Policy.
+ */
+ @Test
+ public void testVdnsRainyDayCompliant() {
+ httpRainyDay(VDNS_TOSCA_COMPLIANT_RAINY_POLICY, VDNS_ONSET);
+ }
+
+
// VFW
/**
@@ -647,6 +657,33 @@ public abstract class BaseRuleTest {
waitForFinalSuccess(policy, policyClMgt);
}
+ /**
+ * Rainy day scenario for use cases that use an HTTP simulator.
+ *
+ * @param policyFile file containing the ToscaPolicy to be loaded
+ * @param onsetFile file containing the ONSET to be injected
+ * @param operation expected APPC operation request
+ */
+ protected void httpRainyDay(String policyFile, String onsetFile) {
+ policyClMgt = topics.createListener(POLICY_CL_MGT_TOPIC, VirtualControlLoopNotification.class, controller);
+
+ assertEquals(0, controller.getDrools().factCount(rules.getControllerName()));
+ policy = rules.setupPolicyFromFile(policyFile);
+ assertEquals(2, controller.getDrools().factCount(rules.getControllerName()));
+
+ /* Inject an ONSET event over the DCAE topic */
+ topics.inject(DCAE_TOPIC, onsetFile);
+
+ /* Wait to acquire a LOCK and a PDP-X PERMIT */
+ waitForLockAndPermit(policy, policyClMgt);
+
+ /* --- Operation Completed --- */
+ waitForOperationFailure();
+
+ /* --- Transaction Completed --- */
+ waitForFinalFailure(policy, policyClMgt);
+ }
+
protected long getCreateCount() {
return ControlLoopEventManager2.getCreateCount();
}