summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test/resources
diff options
context:
space:
mode:
Diffstat (limited to 'rulemgt/src/test/resources')
-rw-r--r--rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-changed.drl91
-rw-r--r--rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-spaces.drl88
-rw-r--r--rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b.drl90
-rw-r--r--rulemgt/src/test/resources/index-add.json6
-rw-r--r--rulemgt/src/test/resources/index-empty.json1
-rw-r--r--rulemgt/src/test/resources/index-rule-changed.json6
-rw-r--r--rulemgt/src/test/resources/index-rule-spaces-test.json6
7 files changed, 288 insertions, 0 deletions
diff --git a/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-changed.drl b/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-changed.drl
new file mode 100644
index 0000000..039bf68
--- /dev/null
+++ b/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-changed.drl
@@ -0,0 +1,91 @@
+package org.onap.holmes.droolsRule;
+
+import org.onap.holmes.common.dmaap.DmaapService;
+import org.onap.holmes.common.api.stat.VesAlarm;
+import org.onap.holmes.common.aai.CorrelationUtil;
+import org.onap.holmes.common.dmaap.entity.PolicyMsg;
+import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
+import org.onap.holmes.common.utils.DroolsLog;
+
+
+rule "Relation_analysis_Rule"
+salience 200
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0,
+ $sourceId: sourceId, sourceId != null && !sourceId.equals(""),
+ $sourceName: sourceName, sourceName != null && !sourceName.equals(""),
+ $startEpochMicrosec: startEpochMicrosec,
+ eventName in ("Fault_MultiCloud_VMFailure"),
+ $eventId: eventId)
+ $child : VesAlarm( eventId != $eventId, parentId == null,
+ CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),
+ eventName in ("Fault_MME_eNodeB out of service alarm"),
+ startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("Relation_analysis_Rule: rootId=" + $root.getEventId() + ", childId=" + $child.getEventId());
+ $child.setParentId($root.getEventId());
+ update($child);
+
+end
+
+rule "root_has_child_handle_Rule"
+salience 150
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)
+ $child : VesAlarm(eventId != $eventId, parentId == $eventId)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_has_child_handle_Rule: rootId=" + $root.getEventId() + ", childId=" + $child.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ $root.setRootFlag(1);
+ update($root);
+end
+
+rule "root_no_child_handle_Rule"
+salience 100
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,
+ sourceId != null && !sourceId.equals(""),
+ sourceName != null && !sourceName.equals(""),
+ eventName in ("Fault_MultiCloud_VMFailure"))
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_no_child_handle_Rule: rootId=" + $root.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ $root.setRootFlag(1);
+ update($root);
+end
+
+rule "root_cleared_handle_Rule"
+salience 100
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_cleared_handle_Rule: rootId=" + $root.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ retract($root);
+end
+
+rule "child_handle_Rule"
+salience 100
+no-loop true
+ when
+ $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("child_handle_Rule: childId=" + $child.getEventId());
+ retract($child);
+ DroolsLog.printInfo("done");
+end
diff --git a/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-spaces.drl b/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-spaces.drl
new file mode 100644
index 0000000..a75f202
--- /dev/null
+++ b/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-spaces.drl
@@ -0,0 +1,88 @@
+package org.onap.holmes.droolsRule;
+
+import org.onap.holmes.common.dmaap.DmaapService;
+import org.onap.holmes.common.api.stat.VesAlarm;
+import org.onap.holmes.common.aai.CorrelationUtil;
+import org.onap.holmes.common.dmaap.entity.PolicyMsg;
+import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
+import org.onap.holmes.common.utils.DroolsLog;
+
+rule "Relation_analysis_Rule"
+salience 200
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0,
+ $sourceId: sourceId, sourceId != null && !sourceId.equals(""),
+ $sourceName: sourceName, sourceName != null && !sourceName.equals(""),
+ $startEpochMicrosec: startEpochMicrosec,
+ eventName in ("Fault_MultiCloud_VMFailure"),
+ $eventId: eventId)
+ $child : VesAlarm( eventId != $eventId, parentId == null,
+ CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),
+ eventName in ("Fault_MME_eNodeB out of service alarm"),
+ startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )
+ then
+ DroolsLog.printInfo( "===========================================================" );
+ DroolsLog.printInfo("Relation_analysis_Rule: rootId=" + $root.getEventId() + ", childId=" + $child.getEventId());
+ $child.setParentId($root.getEventId());
+ update($child);
+end
+
+rule "root_has_child_handle_Rule"
+salience 150
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)
+ $child : VesAlarm(eventId != $eventId, parentId == $eventId)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_has_child_handle_Rule: rootId=" + $root.getEventId() + ", childId=" + $child.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ $root.setRootFlag(1);
+ update($root);
+end
+
+rule "root_no_child_handle_Rule"
+salience 100
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,
+ sourceId != null && !sourceId.equals(""),
+ sourceName != null && !sourceName.equals(""),
+ eventName in ("Fault_MultiCloud_VMFailure"))
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_no_child_handle_Rule: rootId=" + $root.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ $root.setRootFlag(1);
+ update($root);
+end
+
+rule "root_cleared_handle_Rule"
+salience 100
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_cleared_handle_Rule: rootId=" + $root.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ retract($root);
+end
+
+rule "child_handle_Rule"
+salience 100
+no-loop true
+ when
+ $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("child_handle_Rule: childId=" + $child.getEventId());
+ retract($child);
+end
diff --git a/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b.drl b/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b.drl
new file mode 100644
index 0000000..5fbaaa5
--- /dev/null
+++ b/rulemgt/src/test/resources/ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b.drl
@@ -0,0 +1,90 @@
+package org.onap.holmes.droolsRule;
+
+import org.onap.holmes.common.dmaap.DmaapService;
+import org.onap.holmes.common.api.stat.VesAlarm;
+import org.onap.holmes.common.aai.CorrelationUtil;
+import org.onap.holmes.common.dmaap.entity.PolicyMsg;
+import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
+import org.onap.holmes.common.utils.DroolsLog;
+
+
+rule "Relation_analysis_Rule"
+salience 200
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0,
+ $sourceId: sourceId, sourceId != null && !sourceId.equals(""),
+ $sourceName: sourceName, sourceName != null && !sourceName.equals(""),
+ $startEpochMicrosec: startEpochMicrosec,
+ eventName in ("Fault_MultiCloud_VMFailure"),
+ $eventId: eventId)
+ $child : VesAlarm( eventId != $eventId, parentId == null,
+ CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),
+ eventName in ("Fault_MME_eNodeB out of service alarm"),
+ startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("Relation_analysis_Rule: rootId=" + $root.getEventId() + ", childId=" + $child.getEventId());
+ $child.setParentId($root.getEventId());
+ update($child);
+
+end
+
+rule "root_has_child_handle_Rule"
+salience 150
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)
+ $child : VesAlarm(eventId != $eventId, parentId == $eventId)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_has_child_handle_Rule: rootId=" + $root.getEventId() + ", childId=" + $child.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ $root.setRootFlag(1);
+ update($root);
+end
+
+rule "root_no_child_handle_Rule"
+salience 100
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,
+ sourceId != null && !sourceId.equals(""),
+ sourceName != null && !sourceName.equals(""),
+ eventName in ("Fault_MultiCloud_VMFailure"))
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_no_child_handle_Rule: rootId=" + $root.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ $root.setRootFlag(1);
+ update($root);
+end
+
+rule "root_cleared_handle_Rule"
+salience 100
+no-loop true
+ when
+ $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("root_cleared_handle_Rule: rootId=" + $root.getEventId());
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
+ dmaapService.publishPolicyMsg(policyMsg, "dcae_cl_out");
+ retract($root);
+end
+
+rule "child_handle_Rule"
+salience 100
+no-loop true
+ when
+ $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)
+ then
+ DroolsLog.printInfo("===========================================================");
+ DroolsLog.printInfo("child_handle_Rule: childId=" + $child.getEventId());
+ retract($child);
+end
diff --git a/rulemgt/src/test/resources/index-add.json b/rulemgt/src/test/resources/index-add.json
new file mode 100644
index 0000000..f0ee695
--- /dev/null
+++ b/rulemgt/src/test/resources/index-add.json
@@ -0,0 +1,6 @@
+[
+ {
+ "closedControlLoopName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b",
+ "file": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b.drl"
+ }
+] \ No newline at end of file
diff --git a/rulemgt/src/test/resources/index-empty.json b/rulemgt/src/test/resources/index-empty.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/rulemgt/src/test/resources/index-empty.json
@@ -0,0 +1 @@
+[] \ No newline at end of file
diff --git a/rulemgt/src/test/resources/index-rule-changed.json b/rulemgt/src/test/resources/index-rule-changed.json
new file mode 100644
index 0000000..1c7b237
--- /dev/null
+++ b/rulemgt/src/test/resources/index-rule-changed.json
@@ -0,0 +1,6 @@
+[
+ {
+ "closedControlLoopName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b",
+ "file": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-changed.drl"
+ }
+] \ No newline at end of file
diff --git a/rulemgt/src/test/resources/index-rule-spaces-test.json b/rulemgt/src/test/resources/index-rule-spaces-test.json
new file mode 100644
index 0000000..f1d82db
--- /dev/null
+++ b/rulemgt/src/test/resources/index-rule-spaces-test.json
@@ -0,0 +1,6 @@
+[
+ {
+ "closedControlLoopName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b",
+ "file": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b-spaces.drl"
+ }
+] \ No newline at end of file