summaryrefslogtreecommitdiffstats
path: root/feature-server-pool/src/test/resources/drools-artifact-1.1
diff options
context:
space:
mode:
Diffstat (limited to 'feature-server-pool/src/test/resources/drools-artifact-1.1')
-rw-r--r--feature-server-pool/src/test/resources/drools-artifact-1.1/pom.xml31
-rw-r--r--feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/META-INF/kmodule.xml25
-rw-r--r--feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl51
3 files changed, 107 insertions, 0 deletions
diff --git a/feature-server-pool/src/test/resources/drools-artifact-1.1/pom.xml b/feature-server-pool/src/test/resources/drools-artifact-1.1/pom.xml
new file mode 100644
index 00000000..e747e42b
--- /dev/null
+++ b/feature-server-pool/src/test/resources/drools-artifact-1.1/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ feature-server-pool
+ ================================================================================
+ Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.onap.policy.drools-pdp</groupId>
+ <artifactId>drools-artifact1</artifactId>
+ <version>1.0.0</version>
+ <description>supports Junit tests in feature-server-pool</description>
+
+</project>
diff --git a/feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/META-INF/kmodule.xml b/feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/META-INF/kmodule.xml
new file mode 100644
index 00000000..1e447eb3
--- /dev/null
+++ b/feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/META-INF/kmodule.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ feature-server-pool
+ ================================================================================
+ Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
+ <kbase name="rules">
+ <ksession name="session1"/>
+ </kbase>
+</kmodule>
diff --git a/feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl b/feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl
new file mode 100644
index 00000000..9591dee0
--- /dev/null
+++ b/feature-server-pool/src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl
@@ -0,0 +1,51 @@
+/*
+ * ============LICENSE_START=======================================================
+ * feature-server-pool
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.policy.drools.serverpool.test;
+
+import org.onap.policy.drools.serverpool.AdapterImpl;
+import org.onap.policy.drools.serverpooltest.Adapter;
+import org.onap.policy.drools.serverpooltest.TestDroolsObject;
+
+rule "Initialization"
+ when
+ then
+ {
+ System.out.println("Initialization rule running");
+ }
+end
+
+rule "Receive 'TestDroolsObject'"
+ when
+ $object : TestDroolsObject()
+ then
+ {
+ Adapter adapter = AdapterImpl.getAdapter();
+ String key = $object.getKey();
+ System.out.println(adapter.toString()
+ + ": Received TestDroolsObject - key=" + key);
+ adapter.notificationQueue().add(key);
+ if (!key.contains("SAVE"))
+ {
+ // 'SAVE' keyword identifies messages that shouldn't be retracted
+ retract($object);
+ }
+ }
+end
+