aboutsummaryrefslogtreecommitdiffstats
path: root/policy-core/drools-artifact-1.2/src/main/resources/rules.drl
diff options
context:
space:
mode:
authorRalph Straubs <rs8887@att.com>2017-09-18 03:37:28 -0500
committerRalph Straubs <rs8887@att.com>2017-09-18 07:16:10 -0500
commitf5de85e49dd1bf74ae6342344069fa71771288f2 (patch)
tree857d2956b14e7b2744ace1ff8e7a80586789a23f /policy-core/drools-artifact-1.2/src/main/resources/rules.drl
parentfbed3c9c7b816b9fa4dd96dc218a0603b1d1c544 (diff)
Add Junit tests to 'policy-core'
These tests focus on the following classes: - PolicyContainer - PolicySession - PolicySessionFeatureAPI 'maven-invoker-plugin' was used to compile and install artifacts for testing during the 'test-compile' phase. These aren't part of the Maven project hierarchy, so they aren't visible to Sonar and SonarQube, and they aren't deployed. Change-Id: I67c122debbe5280f0153e7330248dc5d13c5b2c0 Issue-ID: POLICY-236 Signed-off-by: Ralph Straubs <rs8887@att.com>
Diffstat (limited to 'policy-core/drools-artifact-1.2/src/main/resources/rules.drl')
-rw-r--r--policy-core/drools-artifact-1.2/src/main/resources/rules.drl29
1 files changed, 29 insertions, 0 deletions
diff --git a/policy-core/drools-artifact-1.2/src/main/resources/rules.drl b/policy-core/drools-artifact-1.2/src/main/resources/rules.drl
new file mode 100644
index 00000000..e69b6597
--- /dev/null
+++ b/policy-core/drools-artifact-1.2/src/main/resources/rules.drl
@@ -0,0 +1,29 @@
+package org.onap.policy.drools.core.test;
+
+rule "Initialization"
+ when
+ then
+ {
+ System.out.println("Initialization rule running");
+ }
+end
+
+rule "Multiply elements of an int array"
+ when
+ $object : Object()
+ then
+ {
+ if ($object instanceof int[])
+ {
+ int[] array = (int[])($object);
+
+ System.out.println("Received array of length " + array.length);
+ int product = 1;
+ for (int i = 1 ; i < array.length ; i += 1)
+ {
+ product *= array[i];
+ }
+ array[0] = product;
+ }
+ }
+end