From 3f90dba2636b06bcb90b8f1e158b30886af574d5 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 8 Apr 2019 11:13:14 -0500 Subject: Initial support for deploy This is a first pass, some functionality is missing (undeploy). Compile error fix from changes in policy/models repo. Change-Id: If448492ab665c135bace99d4d684d403e2a6be03 Issue-ID: POLICY-1624 Signed-off-by: jhh --- feature-lifecycle/src/test/resources/echo.drl | 36 -------------------- feature-lifecycle/src/test/resources/echo.kmodule | 26 --------------- feature-lifecycle/src/test/resources/echo.pom | 29 ---------------- feature-lifecycle/src/test/resources/lifecycle.drl | 39 ++++++++++++++++++++++ .../src/test/resources/lifecycle.kmodule | 26 +++++++++++++++ feature-lifecycle/src/test/resources/lifecycle.pom | 29 ++++++++++++++++ .../src/test/resources/tosca-policy.json | 9 +++++ 7 files changed, 103 insertions(+), 91 deletions(-) delete mode 100644 feature-lifecycle/src/test/resources/echo.drl delete mode 100644 feature-lifecycle/src/test/resources/echo.kmodule delete mode 100644 feature-lifecycle/src/test/resources/echo.pom create mode 100644 feature-lifecycle/src/test/resources/lifecycle.drl create mode 100644 feature-lifecycle/src/test/resources/lifecycle.kmodule create mode 100644 feature-lifecycle/src/test/resources/lifecycle.pom create mode 100644 feature-lifecycle/src/test/resources/tosca-policy.json (limited to 'feature-lifecycle/src/test/resources') diff --git a/feature-lifecycle/src/test/resources/echo.drl b/feature-lifecycle/src/test/resources/echo.drl deleted file mode 100644 index c044f2cb..00000000 --- a/feature-lifecycle/src/test/resources/echo.drl +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * 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========================================================= - */ - -package org.onap.policy.drools.test; - -rule "INIT" -lock-on-active -when -then - insert("hello, I am up!"); -end - -rule "ECHO" -when - $o : Object(); -then - System.out.println("ECHO: " + $o); - retract($o); -end diff --git a/feature-lifecycle/src/test/resources/echo.kmodule b/feature-lifecycle/src/test/resources/echo.kmodule deleted file mode 100644 index 1019bd3d..00000000 --- a/feature-lifecycle/src/test/resources/echo.kmodule +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/feature-lifecycle/src/test/resources/echo.pom b/feature-lifecycle/src/test/resources/echo.pom deleted file mode 100644 index 7e654793..00000000 --- a/feature-lifecycle/src/test/resources/echo.pom +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - 4.0.0 - - org.onap.policy.drools.test - echo - 1.4.0-SNAPSHOT - - diff --git a/feature-lifecycle/src/test/resources/lifecycle.drl b/feature-lifecycle/src/test/resources/lifecycle.drl new file mode 100644 index 00000000..597661cf --- /dev/null +++ b/feature-lifecycle/src/test/resources/lifecycle.drl @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * 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========================================================= + */ + +package org.onap.policy.drools.test; + +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; + +rule "INSERT.TOSCA.POLICY" +when + $policy : ToscaPolicy(); +then + System.out.println(""); + System.out.println(""); + System.out.println("************************************************************************"); + System.out.println(drools.getRule().getName() + ":"); + System.out.println(""); + System.out.println("Tosca Policy Type: " + $policy.getType() + " " + $policy.getTypeVersion()); + System.out.println("Tosca Policy: " + $policy.getName() + " " + $policy.getVersion()); + System.out.println("************************************************************************"); + System.out.println(""); + System.out.println(""); +end diff --git a/feature-lifecycle/src/test/resources/lifecycle.kmodule b/feature-lifecycle/src/test/resources/lifecycle.kmodule new file mode 100644 index 00000000..8bf1ed5a --- /dev/null +++ b/feature-lifecycle/src/test/resources/lifecycle.kmodule @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/feature-lifecycle/src/test/resources/lifecycle.pom b/feature-lifecycle/src/test/resources/lifecycle.pom new file mode 100644 index 00000000..87eafc10 --- /dev/null +++ b/feature-lifecycle/src/test/resources/lifecycle.pom @@ -0,0 +1,29 @@ + + + + + + 4.0.0 + + org.onap.policy.drools.test + lifecycle + 1.4.0-SNAPSHOT + + diff --git a/feature-lifecycle/src/test/resources/tosca-policy.json b/feature-lifecycle/src/test/resources/tosca-policy.json new file mode 100644 index 00000000..5258ca1c --- /dev/null +++ b/feature-lifecycle/src/test/resources/tosca-policy.json @@ -0,0 +1,9 @@ +{ + "type": "onap.policies.controlloop.Operational", + "typeVersion": "1.0.0", + "properties": { + "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0A%20%20trigger_policy%3A%20unique-policy-id-1-restart%0A%20%20timeout%3A%203600%0A%20%20abatement%3A%20true%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-restart%0A%20%20%20%20name%3A%20Restart%20the%20VM%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20APPC%0A%20%20%20%20recipe%3A%20Restart%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VM%0A%20%20%20%20retry%3A%203%0A%20%20%20%20timeout%3A%201200%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard" + }, + "name": "operational.restart", + "version": "1.0.0" +} -- cgit 1.2.3-korg