From 4c5c31eb9a2513af080d60d0f537b8339856150d Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Wed, 2 Sep 2020 17:19:26 +0100 Subject: APEX standalone support for ToscaPolicy format Legacy format support is removed, and Tosca format support is added. Change-Id: I3cfc181ccb5471a5d224c0162af18c1fa0fdbc70 Issue-ID: POLICY-2812 Signed-off-by: a.sreekumar --- .../service/engine/event/PluginFactoriesTest.java | 9 +- .../engine/main/ApexCommandLineArgumentsTest.java | 129 ++--- .../apex/service/engine/main/ApexMainTest.java | 16 +- .../engine/parameters/ApexParametersTest.java | 7 +- .../engine/parameters/ContextParameterTests.java | 27 +- .../engine/parameters/ExecutorParameterTests.java | 24 +- .../service/engine/parameters/ParameterTests.java | 41 +- .../engine/parameters/ProducerConsumerTests.java | 25 +- .../engine/parameters/SyncParameterTests.java | 29 +- .../engine/runtime/impl/EngineServiceImplTest.java | 280 +++-------- .../src/test/resources/parameters/badParams.json | 67 ++- .../parameters/badParamsModelNotFile.json | 64 --- .../src/test/resources/parameters/blankParams.json | 29 +- .../test/resources/parameters/correctParams.json | 533 ++++++++++++++++++-- .../parameters/correctParamsJavaProperties.json | 547 +++++++++++++++++++-- .../resources/parameters/factoryGoodParams.json | 119 +++-- .../src/test/resources/parameters/goodParams.json | 121 +++-- .../resources/parameters/goodParamsRelative.json | 120 +++-- .../resources/parameters/javaPropertiesBad.json | 119 +++-- .../resources/parameters/javaPropertiesEmpty.json | 91 ++-- .../resources/parameters/javaPropertiesOK.json | 103 ++-- .../src/test/resources/parameters/noParams.json | 14 + .../parameters/prodConsBadCTParClass.json | 85 ++-- .../parameters/prodConsBadEPParClass.json | 85 ++-- .../resources/parameters/prodConsBadFileName.json | 83 ++-- .../parameters/prodConsMismatchCTParClass.json | 83 ++-- .../parameters/prodConsMismatchEPParClass.json | 83 ++-- .../test/resources/parameters/prodConsNoCT.json | 83 ++-- .../resources/parameters/prodConsNoCTParClass.json | 81 +-- .../test/resources/parameters/prodConsNoEP.json | 83 ++-- .../resources/parameters/prodConsNoEPParClass.json | 81 +-- .../resources/parameters/prodConsOKFileName.json | 83 ++-- .../parameters/prodConsWrongTypeCTParClass.json | 83 ++-- .../parameters/prodConsWrongTypeEPParClass.json | 83 ++-- .../serviceContextBadClassDistParams.json | 49 +- .../serviceContextBadClassLockParams.json | 49 +- .../parameters/serviceContextBadClassParams.json | 39 +- .../serviceContextBadClassPersistParams.json | 49 +- .../parameters/serviceContextBadParams.json | 39 +- .../serviceContextBadPluginClassParams.json | 39 +- .../serviceContextBadPluginNameParams.json | 39 +- .../parameters/serviceContextNoParams.json | 37 +- .../parameters/serviceContextOKDefaultParams.json | 89 ++-- .../parameters/serviceContextOKDistParams.json | 91 ++-- .../parameters/serviceContextOKFlushParams.json | 93 ++-- .../parameters/serviceContextOKFullParams.json | 101 ++-- .../parameters/serviceExecutorBadParams.json | 43 +- .../serviceExecutorBadPluginNameParams.json | 47 +- .../serviceExecutorBadPluginValueBlankParams.json | 47 +- .../serviceExecutorBadPluginValueObjectParams.json | 51 +- .../serviceExecutorBadPluginValueParams.json | 47 +- .../parameters/serviceExecutorEmptyParams.json | 43 +- .../serviceExecutorNoExecutorParams.json | 37 +- .../parameters/serviceExecutorNoParams.json | 81 +-- .../resources/parameters/superDooperParams.json | 82 +-- .../parameters/syncBadParamsBadPeers.json | 143 +++--- .../parameters/syncBadParamsBadTimeout.json | 121 +++-- .../parameters/syncBadParamsInvalidTimeout.json | 147 +++--- .../parameters/syncBadParamsNoSyncWithPeer.json | 141 +++--- .../parameters/syncBadParamsNotSyncWithPeer.json | 143 +++--- .../parameters/syncBadParamsUnpairedTimeout.json | 147 +++--- .../test/resources/parameters/syncGoodParams.json | 139 +++--- .../parameters/syncGoodParamsBothTimeout.json | 147 +++--- .../parameters/syncGoodParamsConsumerTimeout.json | 143 +++--- .../parameters/syncGoodParamsProducerTimeout.json | 143 +++--- .../resources/parameters/syncMismatchedPeers.json | 139 +++--- .../parameters/syncMismatchedTimeout.json | 143 +++--- .../parameters/syncUnusedConsumerPeers.json | 137 +++--- .../parameters/syncUnusedProducerPeers.json | 139 +++--- 69 files changed, 4158 insertions(+), 2516 deletions(-) delete mode 100644 services/services-engine/src/test/resources/parameters/badParamsModelNotFile.json (limited to 'services/services-engine/src/test') diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/PluginFactoriesTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/PluginFactoriesTest.java index 3055daeef..514b3b1e5 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/PluginFactoriesTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/PluginFactoriesTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. 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. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -41,7 +42,7 @@ public class PluginFactoriesTest { @Test public void testEventConsumerFactory() throws ApexEventException, ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/factoryGoodParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/factoryGoodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexCommandLineArgumentsTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexCommandLineArgumentsTest.java index 09fbe91fe..09663c0bf 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexCommandLineArgumentsTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexCommandLineArgumentsTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -43,99 +44,62 @@ public class ApexCommandLineArgumentsTest { public void testCommandLineArguments() throws ApexException { final ApexCommandLineArguments apexArguments = new ApexCommandLineArguments(); - final String[] args00 = - { "" }; - assertThatThrownBy(() -> { - apexArguments.parse(args00); - apexArguments.validate(); - }).hasMessage("Apex configuration file was not specified as an argument"); - final String[] args01 = - { "-h" }; + final String[] args00 = {""}; + apexArguments.parse(args00); + assertThatThrownBy(() -> apexArguments.validate()) + .hasMessage("Tosca Policy file was not specified as an argument"); + final String[] args01 = {"-h"}; final String result = apexArguments.parse(args01); assertTrue(result.startsWith("usage: org.onap.policy.apex.service.engine.main.ApexMain [options...]")); - final String[] args02 = - { "-v" }; + final String[] args02 = {"-v"}; final String result02 = apexArguments.parse(args02); assertTrue(result02.startsWith("Apex Adaptive Policy Engine")); - final String[] args03 = - { "-v", "-h" }; - + final String[] args03 = {"-v", "-h"}; final String result03 = apexArguments.parse(args03); assertTrue(result03.startsWith("usage: org.onap.policy.apex.service.engine.main.ApexMain [options...]")); - final String[] args04 = - { "-h", "-v" }; - + final String[] args04 = {"-h", "-v"}; final String result04 = apexArguments.parse(args04); assertTrue(result04.startsWith("usage: org.onap.policy.apex.service.engine.main.ApexMain [options...]")); - final String[] args05 = - { "-a" }; + final String[] args05 = {"-a"}; assertThatThrownBy(() -> apexArguments.parse(args05)) .hasMessage("invalid command line arguments specified : Unrecognized option: -a"); - final String[] args06 = - { "-c", "hello", "-m", "goodbye", "-h", "-v" }; + + final String[] args06 = {"-p", "goodbye", "-h", "-v"}; final String result06 = apexArguments.parse(args06); assertTrue(result06.startsWith("usage: org.onap.policy.apex.service.engine.main.ApexMain [options...]")); - final String[] args07 = - { "-c", "hello", "-m", "goodbye", "-h", "aaa" }; + final String[] args07 = {"-p", "goodbye", "-h", "aaa"}; assertThatThrownBy(() -> apexArguments.parse(args07)) - .hasMessage("too many command line arguments specified : [-c, hello, -m, goodbye, -h, aaa]"); + .hasMessage("too many command line arguments specified : [-p, goodbye, -h, aaa]"); } @Test public void testCommandLineFileParameters() throws ApexException { final ApexCommandLineArguments apexArguments = new ApexCommandLineArguments(); - final String[] args00 = - { "-c", "zooby" }; - assertThatThrownBy(() -> { - apexArguments.parse(args00); - apexArguments.validate(); - }).hasMessage("Apex configuration file \"zooby\" does not exist"); - final String[] args01 = - { "-c" }; - assertThatThrownBy(() -> { - apexArguments.parse(args01); - apexArguments.validate(); - }).hasMessage("invalid command line arguments specified : Missing argument for option: c"); - final String[] args02 = - { "-c", "src/test/resources/parameters/goodParams.json" }; - apexArguments.parse(args02); - apexArguments.validate(); + final String[] args00 = {"-c", "zooby"}; + assertThatThrownBy(() -> apexArguments.parse(args00)) + .hasMessage("invalid command line arguments specified : Unrecognized option: -c"); - final String[] args03 = - { "-c", "src/test/resources/parameters/goodParams.json", "-m", "zooby" }; - assertThatThrownBy(() -> { - apexArguments.parse(args03); - apexArguments.validate(); - }).hasMessage("Apex model file \"zooby\" does not exist"); - final String[] args04 = - { "-m" }; - assertThatThrownBy(() -> { - apexArguments.parse(args04); - apexArguments.validate(); - }).hasMessage("invalid command line arguments specified : Missing argument for option: m"); - final String[] args05 = - { "-c", "src/test/resources/parameters/goodParams.json", "-m" }; - assertThatThrownBy(() -> { - apexArguments.parse(args05); - apexArguments.validate(); - }).hasMessage("invalid command line arguments specified : Missing argument for option: m"); - final String[] args06 = - { "-c", "src/test/resources/parameters/goodParams.json", "-m", - "src/test/resources/main/DummyModelFile.json" }; - apexArguments.parse(args06); + final String[] args01 = {"-p"}; + assertThatThrownBy(() -> apexArguments.parse(args01)) + .hasMessage("invalid command line arguments specified : Missing argument for option: p"); + + final String[] args02 = {"-p", "src/test/resources/parameters/goodParams.json"}; + apexArguments.parse(args02); apexArguments.validate(); - final String[] args07 = - { "-c", "parameters/goodParams.json", "-m", "main/DummyModelFile.json" }; + final String[] args03 = {"-p", "src/test/resources/parameters/goodParams.json", "-m", "zooby"}; + assertThatThrownBy(() -> apexArguments.parse(args03)) + .hasMessage("invalid command line arguments specified : Unrecognized option: -m"); - apexArguments.parse(args07); + final String[] args06 = {"-p", "src/test/resources/parameters/goodParams.json"}; + apexArguments.parse(args06); apexArguments.validate(); } @@ -143,33 +107,26 @@ public class ApexCommandLineArgumentsTest { public void testCommandLineRelativeRootParameters() throws ApexException { final ApexCommandLineArguments apexArguments = new ApexCommandLineArguments(); - final String[] args00 = - { "-c", "src/test/resources/parameters/goodParams.json", "-rfr", "zooby" }; - assertThatThrownBy(() -> { - apexArguments.parse(args00); - apexArguments.validate(); - }).hasMessageContaining("zooby\" does not exist or is not a directory"); - final String[] args01 = - { "-rfr" }; - assertThatThrownBy(() -> { - apexArguments.parse(args01); - apexArguments.validate(); - }).hasMessage("invalid command line arguments specified : Missing argument for option: rfr"); - final String[] args02 = - { "-c", "src/test/resources/parameters/goodParams.json", "-rfr", "pom.xml" }; - assertThatThrownBy(() -> { - apexArguments.parse(args02); - apexArguments.validate(); - }).hasMessageContaining("pom.xml\" does not exist or is not a directory"); - final String[] args03 = - { "-c", "src/test/resources/parameters/goodParams.json", "-rfr", "target" }; + final String[] args00 = {"-p", "src/test/resources/parameters/goodParams.json", "-rfr", "zooby"}; + apexArguments.parse(args00); + assertThatThrownBy(() -> apexArguments.validate()) + .hasMessageContaining("zooby\" does not exist or is not a directory"); + + final String[] args01 = {"-rfr"}; + assertThatThrownBy(() -> apexArguments.parse(args01)) + .hasMessage("invalid command line arguments specified : Missing argument for option: rfr"); + final String[] args02 = {"-p", "src/test/resources/parameters/goodParams.json", "-rfr", "pom.xml"}; + apexArguments.parse(args02); + assertThatThrownBy(() -> apexArguments.validate()) + .hasMessageContaining("pom.xml\" does not exist or is not a directory"); + + final String[] args03 = {"-p", "src/test/resources/parameters/goodParams.json", "-rfr", "target"}; apexArguments.parse(args03); apexArguments.validate(); final String[] args04 = - { "-c", "src/test/resources/parameters/goodParamsRelative.json", "-rfr", "src/test/resources" }; - + {"-p", "src/test/resources/parameters/goodParamsRelative.json", "-rfr", "src/test/resources"}; apexArguments.parse(args04); apexArguments.validate(); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java index f38dcaa40..122e47bb1 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java @@ -62,9 +62,9 @@ public class ApexMainTest { ApexMain.main(null); await().atMost(200, TimeUnit.MILLISECONDS).until(() -> outContent.toString() - .contains("Apex configuration file was not specified as an argument")); + .contains("Tosca Policy file was not specified as an argument")); assertThat(outContent.toString()) - .contains("Apex configuration file was not specified as an argument"); + .contains("Tosca Policy file was not specified as an argument"); } @Test @@ -100,7 +100,7 @@ public class ApexMainTest { OutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); - String[] args = { "-c", "src/test/resources/parameters/badParams.json" }; + String[] args = { "-p", "src/test/resources/parameters/badParams.json" }; final ApexMain apexMain = new ApexMain(args); await().atMost(200, TimeUnit.MILLISECONDS).until(() -> outContent.toString() @@ -114,7 +114,7 @@ public class ApexMainTest { OutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); - String[] args = { "-c", "src/test/resources/parameters/correctParams.json" }; + String[] args = { "-p", "src/test/resources/parameters/correctParams.json" }; final ApexMain apexMain = new ApexMain(args); assertEquals("MyApexEngine", @@ -129,7 +129,7 @@ public class ApexMainTest { OutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); - String[] args = { "-c", "src/test/resources/parameters/correctParamsJavaProperties.json" }; + String[] args = { "-p", "src/test/resources/parameters/correctParamsJavaProperties.json" }; final ApexMain apexMain = new ApexMain(args); assertEquals("MyApexEngine", @@ -147,8 +147,7 @@ public class ApexMainTest { OutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); Map argsMap = new HashMap(); - String[] args = {"-c", "src/test/resources/parameters/correctParams.json", "-m", - "src/test/resources/policymodels/SmallModel.json"}; + String[] args = {"-p", "src/test/resources/parameters/correctParams.json"}; argsMap.put(new ToscaPolicyIdentifier("id1", "v1"), args); final ApexMain apexMain = new ApexMain(argsMap); ApexParameters apexParam = (ApexParameters) apexMain.getApexParametersMap().values().toArray()[0]; @@ -163,8 +162,7 @@ public class ApexMainTest { OutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); Map argsMap = new HashMap(); - String[] args = {"-c", "src/test/resources/parameters/correctParams.json", "-m", - "src/test/resources/policymodels/SmallModel.json"}; + String[] args = {"-p", "src/test/resources/parameters/correctParams.json"}; argsMap.put(new ToscaPolicyIdentifier("id1", "v1"), args); argsMap.put(new ToscaPolicyIdentifier("id2", "v2"), args); final ApexMain apexMain = new ApexMain(argsMap); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java index 1c816768f..9557ca8f9 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -41,7 +42,7 @@ public class ApexParametersTest { @Test public void testJavaPropertiesOk() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/javaPropertiesOK.json" }; + final String[] args = {"-p", "src/test/resources/parameters/javaPropertiesOK.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -55,7 +56,7 @@ public class ApexParametersTest { @Test public void testJavaPropertiesEmpty() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/javaPropertiesEmpty.json" }; + final String[] args = {"-p", "src/test/resources/parameters/javaPropertiesEmpty.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -65,7 +66,7 @@ public class ApexParametersTest { @Test public void testJavaPropertiesBad() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/javaPropertiesBad.json" }; + final String[] args = {"-p", "src/test/resources/parameters/javaPropertiesBad.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java index e8485d109..a55afbed4 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -40,7 +41,7 @@ public class ContextParameterTests { @Test public void testNoParamsTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextNoParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextNoParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -51,7 +52,7 @@ public class ContextParameterTests { @Test public void testBadParamsTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -62,7 +63,7 @@ public class ContextParameterTests { @Test public void testBadPluginParamNameTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadPluginNameParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadPluginNameParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -74,7 +75,7 @@ public class ContextParameterTests { @Test public void testBadClassParamTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadClassParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadClassParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)).hasMessage( @@ -86,7 +87,7 @@ public class ContextParameterTests { @Test public void testBadPluginClassTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadPluginClassParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadPluginClassParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -102,7 +103,7 @@ public class ContextParameterTests { @Test public void testOkFlushParamTest() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextOKFlushParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextOKFlushParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -115,7 +116,7 @@ public class ContextParameterTests { @Test public void testOkDefaultParamTest() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextOKDefaultParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextOKDefaultParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -128,7 +129,7 @@ public class ContextParameterTests { @Test public void testOkDistParamTest() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextOKDistParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextOKDistParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -142,7 +143,7 @@ public class ContextParameterTests { @Test public void testOkFullDefaultParamTest() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/goodParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/goodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -164,7 +165,7 @@ public class ContextParameterTests { @Test public void testOkFullParamTest() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextOKFullParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextOKFullParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -192,7 +193,7 @@ public class ContextParameterTests { @Test public void testBadClassDistParamTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadClassDistParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadClassDistParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -207,7 +208,7 @@ public class ContextParameterTests { @Test public void testBadClassLockParamTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadClassLockParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadClassLockParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -222,7 +223,7 @@ public class ContextParameterTests { @Test public void testBadClassPersistParamTest() { - final String[] args = { "-c", "src/test/resources/parameters/serviceContextBadClassPersistParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/serviceContextBadClassPersistParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java index 5d1b3f726..92a7b7d54 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -23,7 +24,6 @@ package org.onap.policy.apex.service.engine.parameters; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.After; import org.junit.Test; @@ -45,7 +45,7 @@ public class ExecutorParameterTests { @Test public void testNoParamsTest() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorNoParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorNoParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -56,7 +56,7 @@ public class ExecutorParameterTests { @Test public void testBadParamsTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorBadParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -68,7 +68,7 @@ public class ExecutorParameterTests { @Test public void testNoExecutorParamsTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorNoExecutorParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorNoExecutorParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -80,7 +80,7 @@ public class ExecutorParameterTests { @Test public void testEmptyParamsTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorEmptyParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorEmptyParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -92,7 +92,7 @@ public class ExecutorParameterTests { @Test public void testBadPluginParamNameTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginNameParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorBadPluginNameParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -104,7 +104,7 @@ public class ExecutorParameterTests { @Test public void testBadPluginParamObjectTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -116,7 +116,7 @@ public class ExecutorParameterTests { @Test public void testBadPluginParamBlankTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -128,7 +128,7 @@ public class ExecutorParameterTests { @Test public void testBadPluginParamValueTest() { - final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginValueParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/serviceExecutorBadPluginValueParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -141,7 +141,7 @@ public class ExecutorParameterTests { @Test public void testGoodParametersTest() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/goodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -160,7 +160,7 @@ public class ExecutorParameterTests { final String[] args = { "-rfr", "src/test/resources", - "-c", + "-p", "src/test/resources/parameters/goodParamsRelative.json" }; // @formatter:on @@ -173,7 +173,5 @@ public class ExecutorParameterTests { assertEquals(45, parameters.getEngineServiceParameters().getId()); assertEquals(19, parameters.getEngineServiceParameters().getInstanceCount()); assertEquals(65522, parameters.getEngineServiceParameters().getDeploymentPort()); - assertTrue(parameters.getEngineServiceParameters().getPolicyModelFileName() - .endsWith("policymodels/SmallModel.json")); } } diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java index 4948ab5f3..da4ceaa12 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -26,6 +27,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.nio.file.NoSuchFileException; import java.util.Arrays; import org.junit.Test; import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.consumer.ApexFileEventConsumer; @@ -48,27 +50,25 @@ import org.onap.policy.common.parameters.ParameterException; public class ParameterTests { @Test public void testInvalidParametersNoFileTest() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/invalidNoFile.json"}; + final String[] args = {"-p", "src/test/resources/parameters/invalidNoFile.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) - .hasMessageStartingWith("error reading parameters from \"src") - .hasMessageContaining("FileNotFoundException"); + .hasRootCauseInstanceOf(NoSuchFileException.class); } @Test public void testInvalidParametersEmptyTest() { - final String[] args = {"-c", "src/test/resources/parameters/empty.json"}; + final String[] args = {"-p", "src/test/resources/parameters/empty.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) - .hasMessageStartingWith("validation error(s) on parameters from \"src/test/resources/parameters/empty" - + ".json\""); + .hasMessageStartingWith("error reading parameters from \"src/test/resources/parameters/empty.json"); } @Test public void testInvalidParametersNoParamsTest() { - final String[] args = {"-c", "src/test/resources/parameters/noParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/noParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -85,7 +85,7 @@ public class ParameterTests { @Test public void testInvalidParametersBlankParamsTest() { - final String[] args = {"-c", "src/test/resources/parameters/blankParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/blankParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -97,6 +97,7 @@ public class ParameterTests { + "INVALID, parameter group has status INVALID\n" + " field \"id\" type \"int\" value \"-1\" INVALID, " + "id not specified or specified value [-1] invalid, must be specified as id >= 0\n" + + " field \"policyModel\" type \"java.lang.String\" value \"null\" INVALID, must be specified\n" + " parameter group map \"eventOutputParameters\" INVALID, " + "at least one event output must be specified\n" + " parameter group map \"eventInputParameters\" INVALID, " @@ -105,7 +106,7 @@ public class ParameterTests { @Test public void testInvalidParametersTest() { - final String[] args = {"-c", "src/test/resources/parameters/badParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/badParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -123,8 +124,6 @@ public class ParameterTests { + "instanceCount [-345] invalid, must be specified as instanceCount >= 1\n" + " field \"deploymentPort\" type \"int\" value \"65536\" INVALID, " + "deploymentPort [65536] invalid, must be specified as 1024 <= port <= 65535\n" - + " field \"policyModelFileName\" type \"java.lang.String\" " - + "value \"/some/file/name.xml\" INVALID, not found\n" + " parameter group map \"eventOutputParameters\" INVALID, " + "parameter group map has status INVALID\n" + " parameter group \"FirstProducer\" type " + "\"org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters\" INVALID" @@ -145,25 +144,9 @@ public class ParameterTests { + "\"null\" invalid, must be specified as a non-empty string\n"); } - @Test - public void testModelNotFileTest() { - final String[] args = {"-c", "src/test/resources/parameters/badParamsModelNotFile.json"}; - final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); - - assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) - .hasMessage("validation error(s) on parameters from " - + "\"src/test/resources/parameters/badParamsModelNotFile.json\"\n" - + "parameter group \"APEX_PARAMETERS\" type " - + "\"org.onap.policy.apex.service.parameters.ApexParameters\" INVALID, " - + "parameter group has status INVALID\n" + " parameter group \"MyApexEngine\" type " - + "\"org.onap.policy.apex.service.parameters.engineservice.EngineServiceParameters\" " - + "INVALID, parameter group has status INVALID\n" + " field \"policyModelFileName\" " - + "type \"java.lang.String\" value \"src/test\" INVALID, is not a plain file\n"); - } - @Test public void testGoodParametersTest() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/goodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -207,7 +190,7 @@ public class ParameterTests { @Test public void testSuperDooperParametersTest() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/superDooperParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/superDooperParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java index 8c7c9df82..0ef4fa252 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -40,7 +41,7 @@ import org.onap.policy.common.parameters.ParameterException; public class ProducerConsumerTests { @Test public void testGoodParametersTest() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/goodParams.json" }; + final String[] args = {"-p", "src/test/resources/parameters/goodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -70,7 +71,7 @@ public class ProducerConsumerTests { @Test public void testNoCarrierTechnology() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsNoCT.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsNoCT.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -86,7 +87,7 @@ public class ProducerConsumerTests { @Test public void testNoEventProcol() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsNoEP.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsNoEP.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -111,7 +112,7 @@ public class ProducerConsumerTests { @Test public void testNoCarrierTechnologyParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsNoCTParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsNoCTParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -122,7 +123,7 @@ public class ProducerConsumerTests { @Test public void testMismatchCarrierTechnologyParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsMismatchCTParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsMismatchCTParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)).hasMessage( @@ -135,7 +136,7 @@ public class ProducerConsumerTests { @Test public void testWrongTypeCarrierTechnologyParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsWrongTypeCTParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsWrongTypeCTParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)).hasMessage( @@ -151,7 +152,7 @@ public class ProducerConsumerTests { @Test public void testOkFileNameCarrierTechnology() throws ParameterException { - final String[] args = { "-c", "src/test/resources/parameters/prodConsOKFileName.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsOKFileName.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -166,7 +167,7 @@ public class ProducerConsumerTests { @Test public void testBadFileNameCarrierTechnology() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsBadFileName.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsBadFileName.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)).hasMessage( @@ -186,7 +187,7 @@ public class ProducerConsumerTests { @Test public void testBadEventProtocolParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsBadEPParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsBadEPParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -199,7 +200,7 @@ public class ProducerConsumerTests { @Test public void testNoEventProtocolParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsNoEPParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsNoEPParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -210,7 +211,7 @@ public class ProducerConsumerTests { @Test public void testMismatchEventProtocolParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsMismatchEPParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsMismatchEPParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)).hasMessage( @@ -224,7 +225,7 @@ public class ProducerConsumerTests { @Test public void testWrongTypeEventProtocolParClass() { - final String[] args = { "-c", "src/test/resources/parameters/prodConsWrongTypeEPParClass.json" }; + final String[] args = {"-p", "src/test/resources/parameters/prodConsWrongTypeEPParClass.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)).hasMessage( diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java index 91f8c6699..9f420d8fb 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -45,7 +46,7 @@ import org.onap.policy.common.parameters.ParameterException; public class SyncParameterTests { @Test public void testSyncBadNoSyncWithPeer() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -63,7 +64,7 @@ public class SyncParameterTests { @Test public void testSyncBadNotSyncWithPeer() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -81,7 +82,7 @@ public class SyncParameterTests { @Test public void testSyncBadSyncBadPeers() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsBadPeers.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncBadParamsBadPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -110,7 +111,7 @@ public class SyncParameterTests { @Test public void testSyncBadSyncInvalidTimeout() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsInvalidTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncBadParamsInvalidTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -141,7 +142,7 @@ public class SyncParameterTests { @Test public void testSyncBadSyncBadTimeout() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsBadTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncBadParamsBadTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -159,7 +160,7 @@ public class SyncParameterTests { @Test public void testSyncBadSyncUnpairedTimeout() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsUnpairedTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncBadParamsUnpairedTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -190,7 +191,7 @@ public class SyncParameterTests { @Test public void testSyncGoodSyncGoodTimeoutProducer() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncGoodParamsProducerTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncGoodParamsProducerTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -207,7 +208,7 @@ public class SyncParameterTests { @Test public void testSyncGoodSyncGoodTimeoutConsumer() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncGoodParamsConsumerTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncGoodParamsConsumerTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -224,7 +225,7 @@ public class SyncParameterTests { @Test public void testSyncGoodSyncGoodTimeoutBoth() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncGoodParamsBothTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncGoodParamsBothTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); @@ -241,7 +242,7 @@ public class SyncParameterTests { @Test public void testSyncUnusedConsumerPeers() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncUnusedConsumerPeers.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncUnusedConsumerPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -266,7 +267,7 @@ public class SyncParameterTests { @Test public void testSyncMismatchedPeers() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncMismatchedPeers.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncMismatchedPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -297,7 +298,7 @@ public class SyncParameterTests { @Test public void testSyncUnusedProducerPeers() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncUnusedProducerPeers.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncUnusedProducerPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -320,7 +321,7 @@ public class SyncParameterTests { @Test public void testSyncMismatchedTimeout() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncMismatchedTimeout.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncMismatchedTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments)) @@ -345,7 +346,7 @@ public class SyncParameterTests { @Test public void testSyncGoodParametersTest() throws ParameterException { - final String[] args = {"-c", "src/test/resources/parameters/syncGoodParams.json"}; + final String[] args = {"-p", "src/test/resources/parameters/syncGoodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java index eb99c97bb..e9a1a858e 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImplTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -21,6 +22,7 @@ package org.onap.policy.apex.service.engine.runtime.impl; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -73,7 +75,7 @@ public class EngineServiceImplTest { simpleModelString = TextFileUtils.getTextFileAsString("src/test/resources/policymodels/SmallModel.json"); differentModelString = - TextFileUtils.getTextFileAsString("src/test/resources/policymodels/SmallModelDifferent.json"); + TextFileUtils.getTextFileAsString("src/test/resources/policymodels/SmallModelDifferent.json"); final ApexModelReader modelReader = new ApexModelReader<>(AxPolicyModel.class); simpleModel = modelReader.read(new ByteArrayInputStream(simpleModelString.getBytes())); @@ -110,18 +112,18 @@ public class EngineServiceImplTest { ExecutorParameters jsExecutorParameters = new ExecutorParameters(); jsExecutorParameters.setName("JAVASCRIPT"); jsExecutorParameters - .setTaskSelectionExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummyTse"); + .setTaskSelectionExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummyTse"); jsExecutorParameters.setTaskExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummyTe"); jsExecutorParameters - .setStateFinalizerExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummySfe"); + .setStateFinalizerExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummySfe"); engineParameters.getExecutorParameterMap().put("JAVASCRIPT", jsExecutorParameters); ExecutorParameters mvvelExecutorParameters = new ExecutorParameters(); mvvelExecutorParameters.setName("MVEL"); mvvelExecutorParameters - .setTaskSelectionExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummyTse"); + .setTaskSelectionExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummyTse"); mvvelExecutorParameters.setTaskExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummyTe"); mvvelExecutorParameters - .setStateFinalizerExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummySfe"); + .setStateFinalizerExecutorPluginClass("org.onap.policy.apex.service.engine.runtime.impl.DummySfe"); engineParameters.getExecutorParameterMap().put("MVEL", jsExecutorParameters); ParameterService.register(engineParameters); } @@ -142,26 +144,17 @@ public class EngineServiceImplTest { @Test public void testEngineServiceImplSanity() throws ApexException { - try { - EngineServiceImpl.create(null); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine service configuration parameters are null", apEx.getMessage()); - } - + assertThatThrownBy(() -> EngineServiceImpl.create(null)).isInstanceOf(ApexException.class) + .hasMessage("engine service configuration parameters are null"); EngineServiceParameters config = new EngineServiceParameters(); config.setInstanceCount(0); - - try { - EngineServiceImpl.create(config); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("Invalid engine service configuration parameters:", apEx.getMessage().substring(0, 48)); - } + assertThatThrownBy(() -> EngineServiceImpl.create(config)).isInstanceOf(ApexException.class) + .hasMessageContaining("Invalid engine service configuration parameters"); config.setId(123); config.setEngineKey(new AxArtifactKey("Engine", "0.0.1")); config.setInstanceCount(1); + config.setPolicyModel("policyModelContent"); EngineServiceImpl esImpl = EngineServiceImpl.create(config); assertEquals("Engine:0.0.1", esImpl.getKey().getId()); @@ -171,12 +164,8 @@ public class EngineServiceImplTest { esImpl.registerActionListener(null, new DummyApexEventListener()); esImpl.registerActionListener("DummyListener", new DummyApexEventListener()); - try { - esImpl.deregisterActionListener(null); - fail("test should throw an exception"); - } catch (Exception apEx) { - assertEquals("removeEventListener()<-Engine-0:0.0.1,STOPPED, listenerName is null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.deregisterActionListener(null)) + .hasMessage("removeEventListener()<-Engine-0:0.0.1,STOPPED, listenerName is null"); esImpl.deregisterActionListener("DummyListener"); @@ -185,38 +174,21 @@ public class EngineServiceImplTest { assertNull(esImpl.getApexModelKey()); - try { - esImpl.getRuntimeInfo(null); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.getRuntimeInfo(null)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.getRuntimeInfo(new AxArtifactKey("DummyKey", "0.0.1")); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine with key DummyKey:0.0.1 not found in engine service", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.getRuntimeInfo(new AxArtifactKey("DummyKey", "0.0.1"))) + .isInstanceOf(ApexException.class).hasMessage("engine with key DummyKey:0.0.1 not found in engine service"); String runtimeInfo = esImpl.getRuntimeInfo(esImpl.getEngineKeys().iterator().next()); assertEquals("{\n \"TimeStamp\":", runtimeInfo.substring(0, 16)); assertEquals(AxEngineState.STOPPED, esImpl.getState()); - try { - esImpl.getStatus(null); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } - - try { - esImpl.getStatus(new AxArtifactKey("DummyKey", "0.0.1")); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine with key DummyKey:0.0.1 not found in engine service", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.getStatus(null)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); + assertThatThrownBy(() -> esImpl.getStatus(new AxArtifactKey("DummyKey", "0.0.1"))) + .isInstanceOf(ApexException.class).hasMessage("engine with key DummyKey:0.0.1 not found in engine service"); String status = esImpl.getStatus(esImpl.getEngineKeys().iterator().next()); assertTrue(status.contains("\n \"apexEngineModel\" :")); @@ -230,182 +202,84 @@ public class EngineServiceImplTest { assertTrue(esImpl.isStopped(new AxArtifactKey("DummyKey", "0.0.1"))); assertTrue(esImpl.isStopped(esImpl.getEngineKeys().iterator().next())); - try { - esImpl.start(null); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } - - try { - esImpl.start(new AxArtifactKey("DummyKey", "0.0.1")); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine with key DummyKey:0.0.1 not found in engine service", apEx.getMessage()); - } - - try { - esImpl.start(esImpl.getEngineKeys().iterator().next()); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("start()<-Engine-0:0.0.1,STOPPED, cannot start engine, " - + "engine has not been initialized, its model is not loaded", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.start(null)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.startAll(); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("start()<-Engine-0:0.0.1,STOPPED, cannot start engine, " - + "engine has not been initialized, its model is not loaded", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.start(new AxArtifactKey("DummyKey", "0.0.1"))).isInstanceOf(ApexException.class) + .hasMessage("engine with key DummyKey:0.0.1 not found in engine service"); - try { - esImpl.stop(null); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.start(esImpl.getEngineKeys().iterator().next())) + .isInstanceOf(ApexException.class).hasMessage("start()<-Engine-0:0.0.1,STOPPED, cannot start engine, " + + "engine has not been initialized, its model is not loaded"); - try { - esImpl.stop(new AxArtifactKey("DummyKey", "0.0.1")); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine with key DummyKey:0.0.1 not found in engine service", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.startAll()).isInstanceOf(ApexException.class) + .hasMessage("start()<-Engine-0:0.0.1,STOPPED, cannot start engine, " + + "engine has not been initialized, its model is not loaded"); - try { - esImpl.stop(esImpl.getEngineKeys().iterator().next()); - } catch (ApexException apEx) { - fail("test should not throw an exception"); - } + assertThatThrownBy(() -> esImpl.stop(null)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.stop(); - } catch (ApexException apEx) { - fail("test should not throw an exception"); - } + assertThatThrownBy(() -> esImpl.stop(new AxArtifactKey("DummyKey", "0.0.1"))).isInstanceOf(ApexException.class) + .hasMessage("engine with key DummyKey:0.0.1 not found in engine service"); - try { - esImpl.sendEvent(null); - } catch (Exception apEx) { - fail("test should not throw an exception"); - } + esImpl.stop(esImpl.getEngineKeys().iterator().next()); - try { - esImpl.sendEvent(new ApexEvent("SomeEvent", "0.0.1", "the.event.namespace", "EventSource", "EventTarget")); - } catch (ApexException apEx) { - fail("test should not throw an exception"); - } + esImpl.stop(); + esImpl.sendEvent(null); + esImpl.sendEvent(new ApexEvent("SomeEvent", "0.0.1", "the.event.namespace", "EventSource", "EventTarget")); esImpl.startPeriodicEvents(100000); - try { - esImpl.startPeriodicEvents(100000); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("Peiodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator " - + "[period=100000, firstEventTime=0, lastEventTime=0, eventCount=0]", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.startPeriodicEvents(100000)).isInstanceOf(ApexException.class) + .hasMessage("Peiodic event geneation already running on engine Engine:0.0.1, ApexPeriodicEventGenerator " + + "[period=100000, firstEventTime=0, lastEventTime=0, eventCount=0]"); esImpl.stopPeriodicEvents(); - try { - esImpl.stopPeriodicEvents(); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("Peiodic event geneation not running on engine Engine:0.0.1", apEx.getMessage()); - } - try { - esImpl.clear(null); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.stopPeriodicEvents()).isInstanceOf(ApexException.class) + .hasMessage("Peiodic event geneation not running on engine Engine:0.0.1"); - try { - esImpl.clear(new AxArtifactKey("DummyKey", "0.0.1")); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine with key DummyKey:0.0.1 not found in engine service", apEx.getMessage()); - } - - try { - esImpl.clear(esImpl.getEngineKeys().iterator().next()); - } catch (ApexException apEx) { - fail("test should not throw an exception"); - } + assertThatThrownBy(() -> esImpl.clear(null)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.clear(); - } catch (ApexException apEx) { - fail("test should not throw an exception"); - } + assertThatThrownBy(() -> esImpl.clear(new AxArtifactKey("DummyKey", "0.0.1"))).isInstanceOf(ApexException.class) + .hasMessage("engine with key DummyKey:0.0.1 not found in engine service"); + esImpl.clear(esImpl.getEngineKeys().iterator().next()); + esImpl.clear(); - try { - esImpl.updateModel(null, (String) null, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(null, (String) null, true)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), (String) null, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("model for updating engine service with key DummyKey:0.0.1 is empty", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), (String) null, true)) + .isInstanceOf(ApexException.class) + .hasMessage("model for updating engine service with key DummyKey:0.0.1 is empty"); - try { - esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), "", true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("model for updating engine service with key DummyKey:0.0.1 is empty", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), "", true)) + .isInstanceOf(ApexException.class) + .hasMessage("model for updating engine service with key DummyKey:0.0.1 is empty"); - try { - esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), "I am not an Apex model", true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("failed to unmarshal the apex model on engine service DummyKey:0.0.1", apEx.getMessage()); - } + assertThatThrownBy( + () -> esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), "I am not an Apex model", true)) + .isInstanceOf(ApexException.class) + .hasMessage("failed to unmarshal the apex model on engine service DummyKey:0.0.1"); - try { - esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), simpleModelString, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine service key DummyKey:0.0.1 does not match the keyEngine:0.0.1 of this engine service", - apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), simpleModelString, true)) + .isInstanceOf(ApexException.class) + .hasMessage("engine service key DummyKey:0.0.1 does not match the keyEngine:0.0.1 of this engine service"); - try { - esImpl.updateModel(null, simpleModelString, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(null, simpleModelString, true)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.updateModel(null, (AxPolicyModel) null, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine key must be specified and may not be null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(null, (AxPolicyModel) null, true)).isInstanceOf(ApexException.class) + .hasMessage("engine key must be specified and may not be null"); - try { - esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), (AxPolicyModel) null, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("model for updating on engine service with key DummyKey:0.0.1 is null", apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), (AxPolicyModel) null, true)) + .isInstanceOf(ApexException.class) + .hasMessage("model for updating on engine service with key DummyKey:0.0.1 is null"); - try { - esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), simpleModel, true); - fail("test should throw an exception"); - } catch (ApexException apEx) { - assertEquals("engine service key DummyKey:0.0.1 does not match the keyEngine:0.0.1 of this engine service", - apEx.getMessage()); - } + assertThatThrownBy(() -> esImpl.updateModel(new AxArtifactKey("DummyKey", "0.0.1"), simpleModel, true)) + .isInstanceOf(ApexException.class) + .hasMessage("engine service key DummyKey:0.0.1 does not match the keyEngine:0.0.1 of this engine service"); } @Test @@ -414,7 +288,7 @@ public class EngineServiceImplTest { config.setId(123); config.setEngineKey(new AxArtifactKey("Engine", "0.0.1")); config.setInstanceCount(1); - + config.setPolicyModel("policyModelContent"); EngineServiceImpl esImpl = EngineServiceImpl.create(config); assertEquals("Engine:0.0.1", esImpl.getKey().getId()); diff --git a/services/services-engine/src/test/resources/parameters/badParams.json b/services/services-engine/src/test/resources/parameters/badParams.json index c3b96c7ba..33aaed4f3 100644 --- a/services/services-engine/src/test/resources/parameters/badParams.json +++ b/services/services-engine/src/test/resources/parameters/badParams.json @@ -1,31 +1,48 @@ { - "engineServiceParameters": { - "name": "hello there", - "version": "PA1", - "id": -45, - "instanceCount": -345, - "deploymentPort": 65536, - "policyModelFileName": "/some/file/name.xml" - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE" + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "hello there", + "version": "PA1", + "id": -45, + "instanceCount": -345, + "deploymentPort": 65536, + "policy_type_impl": { + "apexPolicyModel": {} + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE" + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/badParamsModelNotFile.json b/services/services-engine/src/test/resources/parameters/badParamsModelNotFile.json deleted file mode 100644 index 8dec995be..000000000 --- a/services/services-engine/src/test/resources/parameters/badParamsModelNotFile.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MyOtherProducer": { - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/bbb.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - } - } - } -} \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/blankParams.json b/services/services-engine/src/test/resources/parameters/blankParams.json index d874ae98b..ca3b39026 100644 --- a/services/services-engine/src/test/resources/parameters/blankParams.json +++ b/services/services-engine/src/test/resources/parameters/blankParams.json @@ -1,11 +1,20 @@ { - "engineServiceParameters": { - - }, - "eventInputParameters": { - - }, - "eventOutputParameters": { - - } -} + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": {}, + "eventInputParameters": {}, + "eventOutputParameters": {} + } + } + } + ] + } +} \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/correctParams.json b/services/services-engine/src/test/resources/parameters/correctParams.json index 90f5fa15b..43fef1cbe 100644 --- a/services/services-engine/src/test/resources/parameters/correctParams.json +++ b/services/services-engine/src/test/resources/parameters/correctParams.json @@ -1,43 +1,512 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 2, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": { + "key": { + "name": "SmallModel", + "version": "0.0.1" + }, + "keyInformation": { + "key": { + "name": "SmallModel_KeyInfo", + "version": "0.0.1" + }, + "keyInfoMap": { + "entry": [ + { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "UUID": "fec1b353-b35f-4384-b7d9-69622059c248", + "description": "Generated description for a concept called \"BasicContextAlbum\" with version \"0.0.1\" and UUID \"fec1b353-b35f-4384-b7d9-69622059c248\"" + } + }, + { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "UUID": "cc8d3c1a-e975-459a-bcd2-69f423eaa1f3", + "description": "Generated description for a concept called \"BasicEvent\" with version \"0.0.1\" and UUID \"cc8d3c1a-e975-459a-bcd2-69f423eaa1f3\"" + } + }, + { + "key": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "UUID": "d0c5d8ee-5fe7-4978-89ce-4a3e69cad043", + "description": "Generated description for a concept called \"BasicPolicy\" with version \"0.0.1\" and UUID \"d0c5d8ee-5fe7-4978-89ce-4a3e69cad043\"" + } + }, + { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "UUID": "c5651414-fc1c-493b-878d-75f0ce685c36", + "description": "Generated description for a concept called \"BasicTask\" with version \"0.0.1\" and UUID \"c5651414-fc1c-493b-878d-75f0ce685c36\"" + } + }, + { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "UUID": "790ff718-8dc0-44e0-89d8-1b3bbe238310", + "description": "Generated description for a concept called \"IntType\" with version \"0.0.1\" and UUID \"790ff718-8dc0-44e0-89d8-1b3bbe238310\"" + } + }, + { + "key": { + "name": "SmallModel", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel", + "version": "0.0.1" + }, + "UUID": "a1bd1f4e-713b-456b-b1a8-bb48beee28e8", + "description": "Generated description for a concept called \"SmallModel\" with version \"0.0.1\" and UUID \"a1bd1f4e-713b-456b-b1a8-bb48beee28e8\"" + } + }, + { + "key": { + "name": "SmallModel_Albums", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Albums", + "version": "0.0.1" + }, + "UUID": "72bed9af-ab7d-3379-b9f7-b5eca5c9ef22", + "description": "Generated description for concept referred to by key \"SmallModel_Albums:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Events", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Events", + "version": "0.0.1" + }, + "UUID": "796dc6b0-627d-34ae-a5e2-1bc4b4b486b8", + "description": "Generated description for concept referred to by key \"SmallModel_Events:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_KeyInfo", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_KeyInfo", + "version": "0.0.1" + }, + "UUID": "b4876774-6907-3d27-a2b8-f05737c5ee4a", + "description": "Generated description for concept referred to by key \"SmallModel_KeyInfo:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Policies", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Policies", + "version": "0.0.1" + }, + "UUID": "5bcf946b-67be-3190-a906-f954896f999f", + "description": "Generated description for concept referred to by key \"SmallModel_Policies:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Schemas", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Schemas", + "version": "0.0.1" + }, + "UUID": "c25bf5c3-7f1e-3667-b8a9-971ba21517bc", + "description": "Generated description for concept referred to by key \"SmallModel_Schemas:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Tasks", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Tasks", + "version": "0.0.1" + }, + "UUID": "43b015ca-2ed1-3a35-b103-e8a5aa68f1ef", + "description": "Generated description for concept referred to by key \"SmallModel_Tasks:0.0.1\"" + } + } + ] + } + }, + "policies": { + "key": { + "name": "SmallModel_Policies", + "version": "0.0.1" + }, + "policyMap": { + "entry": [ + { + "key": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "value": { + "policyKey": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "template": "FREEFORM", + "state": { + "entry": [ + { + "key": "OnlyState", + "value": { + "stateKey": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "OnlyState" + }, + "trigger": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "stateOutputs": { + "entry": [ + { + "key": "OnlyOutput", + "value": { + "key": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "OnlyState", + "localName": "OnlyOutput" + }, + "outgoingEvent": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "nextState": { + "parentKeyName": "NULL", + "parentKeyVersion": "0.0.0", + "parentLocalName": "NULL", + "localName": "NULL" + } + } + } + ] + }, + "contextAlbumReference": [ + { + "name": "BasicContextAlbum", + "version": "0.0.1" + } + ], + "taskSelectionLogic": { + "key": "NULL", + "logicFlavour": "UNDEFINED", + "logic": "" + }, + "stateFinalizerLogicMap": { + "entry": [] + }, + "defaultTask": { + "name": "BasicTask", + "version": "0.0.1" + }, + "taskReferences": { + "entry": [ + { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "value": { + "key": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "OnlyState", + "localName": "BasicTask" + }, + "outputType": "DIRECT", + "output": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "OnlyState", + "localName": "OnlyOutput" + } + } + } + ] + } + } + } + ] + }, + "firstState": "OnlyState" + } + } + ] + } + }, + "tasks": { + "key": { + "name": "SmallModel_Tasks", + "version": "0.0.1" + }, + "taskMap": { + "entry": [ + { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "inputFields": { + "entry": [ + { + "key": "intPar", + "value": { + "key": "intPar", + "fieldSchemaKey": { + "name": "IntType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + }, + "outputFields": { + "entry": [ + { + "key": "intPar", + "value": { + "key": "intPar", + "fieldSchemaKey": { + "name": "IntType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + }, + "taskParameters": { + "entry": [] + }, + "contextAlbumReference": [ + { + "name": "BasicContextAlbum", + "version": "0.0.1" + } + ], + "taskLogic": { + "key": "TaskLogic", + "logicFlavour": "JAVASCRIPT", + "logic": "executor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"BasicContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nexecutor.logger.debug(executor.eo);\n\nvar returnValue = executor.isTrue;" + } + } + } + ] + } + }, + "events": { + "key": { + "name": "SmallModel_Events", + "version": "0.0.1" + }, + "eventMap": { + "entry": [ + { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "nameSpace": "org.onap.policy.apex.events", + "source": "source", + "target": "target", + "parameter": { + "entry": [ + { + "key": "intPar", + "value": { + "key": "intPar", + "fieldSchemaKey": { + "name": "IntType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + } + } + } + ] + } + }, + "albums": { + "key": { + "name": "SmallModel_Albums", + "version": "0.0.1" + }, + "albums": { + "entry": [ + { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "scope": "GLOBAL", + "isWritable": true, + "itemSchema": { + "name": "IntType", + "version": "0.0.1" + } + } + } + ] + } + }, + "schemas": { + "key": { + "name": "SmallModel_Schemas", + "version": "0.0.1" + }, + "schemas": { + "entry": [ + { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "schemaFlavour": "Java", + "schemaDefinition": "java.lang.Integer" + } + } + ] + } + } + } + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "standardIo": true + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "src/test/resources/events/TestPojoEvent.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/correctParamsJavaProperties.json b/services/services-engine/src/test/resources/parameters/correctParamsJavaProperties.json index e92254655..8c1f99903 100644 --- a/services/services-engine/src/test/resources/parameters/correctParamsJavaProperties.json +++ b/services/services-engine/src/test/resources/parameters/correctParamsJavaProperties.json @@ -1,47 +1,522 @@ { - "javaProperties" : [ - ["javax.net.ssl.trustStore", "trust-store-file"], - ["javax.net.ssl.trustStorePassword", "UG9sMWN5XzBuYXA="] - ], - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 2, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "javaProperties": [ + [ + "javax.net.ssl.trustStore", + "trust-store-file" + ], + [ + "javax.net.ssl.trustStorePassword", + "UG9sMWN5XzBuYXA=" + ] + ], + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": { + "key": { + "name": "SmallModel", + "version": "0.0.1" + }, + "keyInformation": { + "key": { + "name": "SmallModel_KeyInfo", + "version": "0.0.1" + }, + "keyInfoMap": { + "entry": [ + { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "UUID": "fec1b353-b35f-4384-b7d9-69622059c248", + "description": "Generated description for a concept called \"BasicContextAlbum\" with version \"0.0.1\" and UUID \"fec1b353-b35f-4384-b7d9-69622059c248\"" + } + }, + { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "UUID": "cc8d3c1a-e975-459a-bcd2-69f423eaa1f3", + "description": "Generated description for a concept called \"BasicEvent\" with version \"0.0.1\" and UUID \"cc8d3c1a-e975-459a-bcd2-69f423eaa1f3\"" + } + }, + { + "key": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "UUID": "d0c5d8ee-5fe7-4978-89ce-4a3e69cad043", + "description": "Generated description for a concept called \"BasicPolicy\" with version \"0.0.1\" and UUID \"d0c5d8ee-5fe7-4978-89ce-4a3e69cad043\"" + } + }, + { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "UUID": "c5651414-fc1c-493b-878d-75f0ce685c36", + "description": "Generated description for a concept called \"BasicTask\" with version \"0.0.1\" and UUID \"c5651414-fc1c-493b-878d-75f0ce685c36\"" + } + }, + { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "UUID": "790ff718-8dc0-44e0-89d8-1b3bbe238310", + "description": "Generated description for a concept called \"IntType\" with version \"0.0.1\" and UUID \"790ff718-8dc0-44e0-89d8-1b3bbe238310\"" + } + }, + { + "key": { + "name": "SmallModel", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel", + "version": "0.0.1" + }, + "UUID": "a1bd1f4e-713b-456b-b1a8-bb48beee28e8", + "description": "Generated description for a concept called \"SmallModel\" with version \"0.0.1\" and UUID \"a1bd1f4e-713b-456b-b1a8-bb48beee28e8\"" + } + }, + { + "key": { + "name": "SmallModel_Albums", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Albums", + "version": "0.0.1" + }, + "UUID": "72bed9af-ab7d-3379-b9f7-b5eca5c9ef22", + "description": "Generated description for concept referred to by key \"SmallModel_Albums:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Events", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Events", + "version": "0.0.1" + }, + "UUID": "796dc6b0-627d-34ae-a5e2-1bc4b4b486b8", + "description": "Generated description for concept referred to by key \"SmallModel_Events:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_KeyInfo", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_KeyInfo", + "version": "0.0.1" + }, + "UUID": "b4876774-6907-3d27-a2b8-f05737c5ee4a", + "description": "Generated description for concept referred to by key \"SmallModel_KeyInfo:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Policies", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Policies", + "version": "0.0.1" + }, + "UUID": "5bcf946b-67be-3190-a906-f954896f999f", + "description": "Generated description for concept referred to by key \"SmallModel_Policies:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Schemas", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Schemas", + "version": "0.0.1" + }, + "UUID": "c25bf5c3-7f1e-3667-b8a9-971ba21517bc", + "description": "Generated description for concept referred to by key \"SmallModel_Schemas:0.0.1\"" + } + }, + { + "key": { + "name": "SmallModel_Tasks", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "SmallModel_Tasks", + "version": "0.0.1" + }, + "UUID": "43b015ca-2ed1-3a35-b103-e8a5aa68f1ef", + "description": "Generated description for concept referred to by key \"SmallModel_Tasks:0.0.1\"" + } + } + ] + } + }, + "policies": { + "key": { + "name": "SmallModel_Policies", + "version": "0.0.1" + }, + "policyMap": { + "entry": [ + { + "key": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "value": { + "policyKey": { + "name": "BasicPolicy", + "version": "0.0.1" + }, + "template": "FREEFORM", + "state": { + "entry": [ + { + "key": "OnlyState", + "value": { + "stateKey": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "OnlyState" + }, + "trigger": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "stateOutputs": { + "entry": [ + { + "key": "OnlyOutput", + "value": { + "key": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "OnlyState", + "localName": "OnlyOutput" + }, + "outgoingEvent": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "nextState": { + "parentKeyName": "NULL", + "parentKeyVersion": "0.0.0", + "parentLocalName": "NULL", + "localName": "NULL" + } + } + } + ] + }, + "contextAlbumReference": [ + { + "name": "BasicContextAlbum", + "version": "0.0.1" + } + ], + "taskSelectionLogic": { + "key": "NULL", + "logicFlavour": "UNDEFINED", + "logic": "" + }, + "stateFinalizerLogicMap": { + "entry": [] + }, + "defaultTask": { + "name": "BasicTask", + "version": "0.0.1" + }, + "taskReferences": { + "entry": [ + { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "value": { + "key": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "OnlyState", + "localName": "BasicTask" + }, + "outputType": "DIRECT", + "output": { + "parentKeyName": "BasicPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "OnlyState", + "localName": "OnlyOutput" + } + } + } + ] + } + } + } + ] + }, + "firstState": "OnlyState" + } + } + ] + } + }, + "tasks": { + "key": { + "name": "SmallModel_Tasks", + "version": "0.0.1" + }, + "taskMap": { + "entry": [ + { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicTask", + "version": "0.0.1" + }, + "inputFields": { + "entry": [ + { + "key": "intPar", + "value": { + "key": "intPar", + "fieldSchemaKey": { + "name": "IntType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + }, + "outputFields": { + "entry": [ + { + "key": "intPar", + "value": { + "key": "intPar", + "fieldSchemaKey": { + "name": "IntType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + }, + "taskParameters": { + "entry": [] + }, + "contextAlbumReference": [ + { + "name": "BasicContextAlbum", + "version": "0.0.1" + } + ], + "taskLogic": { + "key": "TaskLogic", + "logicFlavour": "JAVASCRIPT", + "logic": "executor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"BasicContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nexecutor.logger.debug(executor.eo);\n\nvar returnValue = executor.isTrue;" + } + } + } + ] + } + }, + "events": { + "key": { + "name": "SmallModel_Events", + "version": "0.0.1" + }, + "eventMap": { + "entry": [ + { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicEvent", + "version": "0.0.1" + }, + "nameSpace": "org.onap.policy.apex.events", + "source": "source", + "target": "target", + "parameter": { + "entry": [ + { + "key": "intPar", + "value": { + "key": "intPar", + "fieldSchemaKey": { + "name": "IntType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + } + } + } + ] + } + }, + "albums": { + "key": { + "name": "SmallModel_Albums", + "version": "0.0.1" + }, + "albums": { + "entry": [ + { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "BasicContextAlbum", + "version": "0.0.1" + }, + "scope": "GLOBAL", + "isWritable": true, + "itemSchema": { + "name": "IntType", + "version": "0.0.1" + } + } + } + ] + } + }, + "schemas": { + "key": { + "name": "SmallModel_Schemas", + "version": "0.0.1" + }, + "schemas": { + "entry": [ + { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "IntType", + "version": "0.0.1" + }, + "schemaFlavour": "Java", + "schemaDefinition": "java.lang.Integer" + } + } + ] + } + } + } + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "standardIo": true + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "src/test/resources/events/TestPojoEvent.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/factoryGoodParams.json b/services/services-engine/src/test/resources/parameters/factoryGoodParams.json index 87448f5e7..c83b4e984 100644 --- a/services/services-engine/src/test/resources/parameters/factoryGoodParams.json +++ b/services/services-engine/src/test/resources/parameters/factoryGoodParams.json @@ -1,64 +1,81 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MyOtherProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + }, + "MyOtherProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/goodParams.json b/services/services-engine/src/test/resources/parameters/goodParams.json index f323b0b51..af075c023 100644 --- a/services/services-engine/src/test/resources/parameters/goodParams.json +++ b/services/services-engine/src/test/resources/parameters/goodParams.json @@ -1,64 +1,81 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MyOtherProducer": { - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + }, + "MyOtherProducer": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } } - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/goodParamsRelative.json b/services/services-engine/src/test/resources/parameters/goodParamsRelative.json index b3d193111..937034ce7 100644 --- a/services/services-engine/src/test/resources/parameters/goodParamsRelative.json +++ b/services/services-engine/src/test/resources/parameters/goodParamsRelative.json @@ -1,64 +1,80 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MyOtherProducer": { - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + }, + "MyOtherProducer": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "aaa.json" + } } - } - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "bbb.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/javaPropertiesBad.json b/services/services-engine/src/test/resources/parameters/javaPropertiesBad.json index dc663bd56..f9de6c76f 100644 --- a/services/services-engine/src/test/resources/parameters/javaPropertiesBad.json +++ b/services/services-engine/src/test/resources/parameters/javaPropertiesBad.json @@ -1,53 +1,82 @@ { - "javaProperties" : [ - ["property0"], - ["property1", "property1Value", "propertyExtraValue"], - [], - [null, "proeprtyValue"], - null, - ["propertyname", null] - ], - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - }, - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "javaProperties": [ + [ + "property0" + ], + [ + "property1", + "property1Value", + "propertyExtraValue" + ], + [], + [ + null, + "proeprtyValue" + ], + null, + [ + "propertyname", + null + ] + ], + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } -} \ No newline at end of file + } + ] + } +} diff --git a/services/services-engine/src/test/resources/parameters/javaPropertiesEmpty.json b/services/services-engine/src/test/resources/parameters/javaPropertiesEmpty.json index aca972302..2e94dc9a8 100644 --- a/services/services-engine/src/test/resources/parameters/javaPropertiesEmpty.json +++ b/services/services-engine/src/test/resources/parameters/javaPropertiesEmpty.json @@ -1,46 +1,63 @@ { - "javaProperties" : [], - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - }, - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "javaProperties": [], + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/javaPropertiesOK.json b/services/services-engine/src/test/resources/parameters/javaPropertiesOK.json index 74b967f74..c3168ebdd 100644 --- a/services/services-engine/src/test/resources/parameters/javaPropertiesOK.json +++ b/services/services-engine/src/test/resources/parameters/javaPropertiesOK.json @@ -1,49 +1,72 @@ { - "javaProperties" : [ - ["property0", "property0Value"], - ["property1", "property1Value"] - ], - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - }, - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "javaProperties": [ + [ + "property0", + "property0Value" + ], + [ + "property1", + "property1Value" + ] + ], + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/noParams.json b/services/services-engine/src/test/resources/parameters/noParams.json index 7a73a41bf..15ed425a5 100644 --- a/services/services-engine/src/test/resources/parameters/noParams.json +++ b/services/services-engine/src/test/resources/parameters/noParams.json @@ -1,2 +1,16 @@ { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": {} + } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsBadCTParClass.json b/services/services-engine/src/test/resources/parameters/prodConsBadCTParClass.json index 48c2dc905..5b3292651 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsBadCTParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsBadCTParClass.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FileCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FileCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } -} \ No newline at end of file + } + ] + } +} diff --git a/services/services-engine/src/test/resources/parameters/prodConsBadEPParClass.json b/services/services-engine/src/test/resources/parameters/prodConsBadEPParClass.json index 51e9c3972..2f9348388 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsBadEPParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsBadEPParClass.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JsonEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JsonEventProtocolParameters" + } + } } + } } - } -} \ No newline at end of file + } + ] + } +} diff --git a/services/services-engine/src/test/resources/parameters/prodConsBadFileName.json b/services/services-engine/src/test/resources/parameters/prodConsBadFileName.json index 38fba4480..fbe210ff8 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsBadFileName.json +++ b/services/services-engine/src/test/resources/parameters/prodConsBadFileName.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": null + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsMismatchCTParClass.json b/services/services-engine/src/test/resources/parameters/prodConsMismatchCTParClass.json index 42c3e69ee..8e0629dc6 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsMismatchCTParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsMismatchCTParClass.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_LOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_LOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsMismatchEPParClass.json b/services/services-engine/src/test/resources/parameters/prodConsMismatchEPParClass.json index 1bb893218..5f5047e2f 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsMismatchEPParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsMismatchEPParClass.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_BEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_BEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsNoCT.json b/services/services-engine/src/test/resources/parameters/prodConsNoCT.json index e94f05a5b..63367f805 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsNoCT.json +++ b/services/services-engine/src/test/resources/parameters/prodConsNoCT.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FileCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FileCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsNoCTParClass.json b/services/services-engine/src/test/resources/parameters/prodConsNoCTParClass.json index 07d50b30f..bd927b2bc 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsNoCTParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsNoCTParClass.json @@ -1,41 +1,58 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsNoEP.json b/services/services-engine/src/test/resources/parameters/prodConsNoEP.json index bdb780f4a..55bc30e41 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsNoEP.json +++ b/services/services-engine/src/test/resources/parameters/prodConsNoEP.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventParameters": { + "eventProtocol": "JSON" } + } }, - "eventParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FileCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameterClassName": "org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FileCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsNoEPParClass.json b/services/services-engine/src/test/resources/parameters/prodConsNoEPParClass.json index f39173ff8..f85532718 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsNoEPParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsNoEPParClass.json @@ -1,41 +1,58 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsOKFileName.json b/services/services-engine/src/test/resources/parameters/prodConsOKFileName.json index 938c318a7..cad5c82c3 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsOKFileName.json +++ b/services/services-engine/src/test/resources/parameters/prodConsOKFileName.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsWrongTypeCTParClass.json b/services/services-engine/src/test/resources/parameters/prodConsWrongTypeCTParClass.json index adbda5c13..3a4c80ea5 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsWrongTypeCTParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsWrongTypeCTParClass.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/prodConsWrongTypeEPParClass.json b/services/services-engine/src/test/resources/parameters/prodConsWrongTypeEPParClass.json index bbc50bde6..b7c31b033 100644 --- a/services/services-engine/src/test/resources/parameters/prodConsWrongTypeEPParClass.json +++ b/services/services-engine/src/test/resources/parameters/prodConsWrongTypeEPParClass.json @@ -1,42 +1,59 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "aProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "aProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "aConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + "eventInputParameters": { + "aConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadClassDistParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadClassDistParams.json index 12f22c1eb..d25f81702 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadClassDistParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadClassDistParams.json @@ -1,23 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", - "distributorParameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "distributorParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - } - }, - "executorParameters": { - "MVEL": { + } + }, + "executorParameters": { + "MVEL": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadClassLockParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadClassLockParams.json index 00e6ca64a..b0f326346 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadClassLockParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadClassLockParams.json @@ -1,23 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", - "lockManagerParameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "lockManagerParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - } - }, - "executorParameters": { - "JAVASCRIPT": { + } + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadClassParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadClassParams.json index c10172d23..94713fe70 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadClassParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadClassParams.json @@ -1,15 +1,32 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "java.lang.Integer" + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "java.lang.Integer" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadClassPersistParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadClassPersistParams.json index 8c2331e32..239023aff 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadClassPersistParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadClassPersistParams.json @@ -1,23 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", - "persistorParameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "persistorParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - } - }, - "executorParameters": { - "JAVASCRIPT": { + } + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadParams.json index abb6b18cf..f5157bbcd 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadParams.json @@ -1,15 +1,32 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "hello" + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "hello" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadPluginClassParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadPluginClassParams.json index 1083f18b1..5dc96a4e0 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadPluginClassParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadPluginClassParams.json @@ -1,15 +1,32 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextBadPluginNameParams.json b/services/services-engine/src/test/resources/parameters/serviceContextBadPluginNameParams.json index 7d9d8900c..350d54feb 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextBadPluginNameParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextBadPluginNameParams.json @@ -1,15 +1,32 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassNamelooby": "" + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassNamelooby": "" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextNoParams.json b/services/services-engine/src/test/resources/parameters/serviceContextNoParams.json index 44c53bb29..28bf1aec5 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextNoParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextNoParams.json @@ -1,15 +1,30 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": {} + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextOKDefaultParams.json b/services/services-engine/src/test/resources/parameters/serviceContextOKDefaultParams.json index f4fee9fa9..16328ff67 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextOKDefaultParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextOKDefaultParams.json @@ -1,45 +1,62 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" - }, - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters" + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextOKDistParams.json b/services/services-engine/src/test/resources/parameters/serviceContextOKDistParams.json index 5aff80d94..6509fde6c 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextOKDistParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextOKDistParams.json @@ -1,48 +1,65 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "contextParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.DistributorParameters" - } - }, - "executorParameters": { - "JAVASCRIPT": { + } + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextOKFlushParams.json b/services/services-engine/src/test/resources/parameters/serviceContextOKFlushParams.json index 8bae50523..0b1b1e7c0 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextOKFlushParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextOKFlushParams.json @@ -1,49 +1,66 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", - "persistorParameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "persistorParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.PersistorParameters", "flushPeriod": 123456 - } - }, - "executorParameters": { - "JAVASCRIPT": { + } + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json b/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json index 24544d2ab..00be15d79 100644 --- a/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json @@ -1,59 +1,76 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "contextParameters": { - "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", - "distributorParameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "contextParameters": { + "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", + "distributorParameters": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperDistributorParameters", "configFile": "my/lovely/configFile.xml", "jgroupsFile": "holy/stone.xml", "preferIPv4Stack": false, "jgroupsBindAddress": "fatherted" - }, - "lockManagerParameters": { + }, + "lockManagerParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.LockManagerParameters" - }, - "persistorParameters": { + }, + "persistorParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.PersistorParameters", "flushPeriod": 123456 - } - }, - "executorParameters": { - "JAVASCRIPT": { + } + }, + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorBadParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorBadParams.json index f9f50ee07..84a882977 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorBadParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorBadParams.json @@ -1,18 +1,35 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "ZOOBY": "hello" + }, + "ZOOBY": "hello" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginNameParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginNameParams.json index 4a28d58aa..df53f5d63 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginNameParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginNameParams.json @@ -1,23 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "ZOOBY": { + }, + "ZOOBY": { "parameterClassNamelooby": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "LOOBY": { + }, + "LOOBY": { "parameterClassNamelooby": "" + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json index 7dd74ea34..78e1bfff5 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json @@ -1,23 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "ZOOBY": { + }, + "ZOOBY": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "LOOBY": { + }, + "LOOBY": { "parameterClassName": " " + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json index 2f7219f46..da3ab9552 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json @@ -1,25 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "ZOOBY": { + }, + "ZOOBY": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "LOOBY": { - "parameterClassName": { - - } + }, + "LOOBY": { + "parameterClassName": {} + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueParams.json index 39618055f..116276fb4 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorBadPluginValueParams.json @@ -1,23 +1,40 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "ZOOBY": { + }, + "ZOOBY": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "LOOBY": { + }, + "LOOBY": { "parameterClassName": "helloworld" + } } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorEmptyParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorEmptyParams.json index 3927740e3..1a4c30934 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorEmptyParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorEmptyParams.json @@ -1,20 +1,35 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" - }, - "ZOOBY": { - + }, + "ZOOBY": {} } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorNoExecutorParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorNoExecutorParams.json index 0c6618f2e..d5c540191 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorNoExecutorParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorNoExecutorParams.json @@ -1,13 +1,30 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "someParameter": "someValue" + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "someParameter": "someValue" + } + } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/serviceExecutorNoParams.json b/services/services-engine/src/test/resources/parameters/serviceExecutorNoParams.json index 4eb6fe024..db6b7e0b9 100644 --- a/services/services-engine/src/test/resources/parameters/serviceExecutorNoParams.json +++ b/services/services-engine/src/test/resources/parameters/serviceExecutorNoParams.json @@ -1,40 +1,55 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": {} + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/superDooperParams.json b/services/services-engine/src/test/resources/parameters/superDooperParams.json index 75820ebaf..ff06f4688 100644 --- a/services/services-engine/src/test/resources/parameters/superDooperParams.json +++ b/services/services-engine/src/test/resources/parameters/superDooperParams.json @@ -1,17 +1,30 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 345, - "deploymentPort": 65522 - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters", - "parameters": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 345, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters", + "parameters": { "bootstrapServers": "somehost:12345", "acks": 0, "retries": 25, @@ -25,31 +38,36 @@ "producerTopic": "producer-out", "consumerPollTime": 101, "consumerTopicList": [ - "consumer-out-0", - "consumer-out-1", - "consumer-out-2" + "consumer-out-0", + "consumer-out-1", + "consumer-out-2" ], "keySerializer": "some.key.serailizer", "valueSerializer": "some.value.serailizer", "keyDeserializer": "some.key.deserailizer", "valueDeserializer": "some.value.deserailizer" + } + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" } + } }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - } - } - }, - "eventInputParameters": { - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + "eventInputParameters": { + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } } + } } - } -} + } + ] + } +} \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncBadParamsBadPeers.json b/services/services-engine/src/test/resources/parameters/syncBadParamsBadPeers.json index 355531417..06cfd1f5c 100644 --- a/services/services-engine/src/test/resources/parameters/syncBadParamsBadPeers.json +++ b/services/services-engine/src/test/resources/parameters/syncBadParamsBadPeers.json @@ -1,72 +1,89 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer1" - }, - "SyncProducer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer1" + }, + "SyncProducer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer1" - }, - "SyncConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer1" + }, + "SyncConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + } + } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncBadParamsBadTimeout.json b/services/services-engine/src/test/resources/parameters/syncBadParamsBadTimeout.json index 7a04a439a..d2e93d2d4 100644 --- a/services/services-engine/src/test/resources/parameters/syncBadParamsBadTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncBadParamsBadTimeout.json @@ -1,65 +1,80 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": "src/test/resources/policymodels/SmallModel.json", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MyOtherProducer": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } + }, + "MyOtherProducer": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "synchronousTimeout": 12345 + } }, - "synchronousTimeout": 12345 - } - }, - "eventInputParameters": { - "TheFileConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "TheFileConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - } - }, - "MySuperDooperConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "MySuperDooperConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + } + } } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncBadParamsInvalidTimeout.json b/services/services-engine/src/test/resources/parameters/syncBadParamsInvalidTimeout.json index 6a4270b27..3f95bd912 100644 --- a/services/services-engine/src/test/resources/parameters/syncBadParamsInvalidTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncBadParamsInvalidTimeout.json @@ -1,76 +1,93 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousTimeout": -10, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousTimeout": -3, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousTimeout": -10, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousTimeout": -3, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "synchronousTimeout": -1, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "synchronousTimeout": -1, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true, + "synchronousTimeout": -99999999 + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true, - "synchronousTimeout": -99999999 + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json b/services/services-engine/src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json index 8c6910a13..de8df54f4 100644 --- a/services/services-engine/src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json +++ b/services/services-engine/src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json @@ -1,71 +1,88 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0" - }, - "SyncConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer1" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0" + }, + "SyncConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer1" + } + } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json b/services/services-engine/src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json index e1ed8316a..c8544a680 100644 --- a/services/services-engine/src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json +++ b/services/services-engine/src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json @@ -1,72 +1,89 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } + } }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": false, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": false, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0" - }, - "SyncConsumer1": { - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer1" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0" + }, + "SyncConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer1" + } + } + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncBadParamsUnpairedTimeout.json b/services/services-engine/src/test/resources/parameters/syncBadParamsUnpairedTimeout.json index 9e24926b9..20ff05fed 100644 --- a/services/services-engine/src/test/resources/parameters/syncBadParamsUnpairedTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncBadParamsUnpairedTimeout.json @@ -1,76 +1,93 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousTimeout": 10, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousTimeout": 3, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousTimeout": 10, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousTimeout": 3, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "synchronousTimeout": 1, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "synchronousTimeout": 1, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true, + "synchronousTimeout": 99999999 + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true, - "synchronousTimeout": 99999999 + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncGoodParams.json b/services/services-engine/src/test/resources/parameters/syncGoodParams.json index 2a29254de..4b134cc04 100644 --- a/services/services-engine/src/test/resources/parameters/syncGoodParams.json +++ b/services/services-engine/src/test/resources/parameters/syncGoodParams.json @@ -1,72 +1,89 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncGoodParamsBothTimeout.json b/services/services-engine/src/test/resources/parameters/syncGoodParamsBothTimeout.json index 1988b76bd..4d2ad3205 100644 --- a/services/services-engine/src/test/resources/parameters/syncGoodParamsBothTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncGoodParamsBothTimeout.json @@ -1,76 +1,93 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "synchronousTimeout": 12345, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousTimeout": 1, - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "synchronousTimeout": 12345, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousTimeout": 1, + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousTimeout": 12345, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousTimeout": 12345, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "synchronousTimeout": 1, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "synchronousTimeout": 1, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncGoodParamsConsumerTimeout.json b/services/services-engine/src/test/resources/parameters/syncGoodParamsConsumerTimeout.json index b294a22f7..cc0906ac1 100644 --- a/services/services-engine/src/test/resources/parameters/syncGoodParamsConsumerTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncGoodParamsConsumerTimeout.json @@ -1,74 +1,91 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousTimeout": 12345, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousTimeout": 12345, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "synchronousTimeout": 1, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "synchronousTimeout": 1, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncGoodParamsProducerTimeout.json b/services/services-engine/src/test/resources/parameters/syncGoodParamsProducerTimeout.json index 824f0f6c2..6d117f7f2 100644 --- a/services/services-engine/src/test/resources/parameters/syncGoodParamsProducerTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncGoodParamsProducerTimeout.json @@ -1,74 +1,91 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "synchronousTimeout": 12345, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "synchronousTimeout": 12345, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer1", - "synchronousTimeout": 1 - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer1", + "synchronousTimeout": 1 + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncMismatchedPeers.json b/services/services-engine/src/test/resources/parameters/syncMismatchedPeers.json index 4ca73fc74..152506a1e 100644 --- a/services/services-engine/src/test/resources/parameters/syncMismatchedPeers.json +++ b/services/services-engine/src/test/resources/parameters/syncMismatchedPeers.json @@ -1,72 +1,89 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer1" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer0" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer1" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer0" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncMismatchedTimeout.json b/services/services-engine/src/test/resources/parameters/syncMismatchedTimeout.json index e4f9ea335..c7a784cf6 100644 --- a/services/services-engine/src/test/resources/parameters/syncMismatchedTimeout.json +++ b/services/services-engine/src/test/resources/parameters/syncMismatchedTimeout.json @@ -1,74 +1,91 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer1", - "synchronousTimeout" : 456 - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer1", + "synchronousTimeout": 456 + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true, + "synchronousTimeout": 123 + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true, - "synchronousTimeout" : 123 + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncUnusedConsumerPeers.json b/services/services-engine/src/test/resources/parameters/syncUnusedConsumerPeers.json index 3f2c8c555..bcc6245fc 100644 --- a/services/services-engine/src/test/resources/parameters/syncUnusedConsumerPeers.json +++ b/services/services-engine/src/test/resources/parameters/syncUnusedConsumerPeers.json @@ -1,72 +1,87 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": "src/test/resources/policymodels/SmallModel.json", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer0" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer0" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer0", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer0", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file diff --git a/services/services-engine/src/test/resources/parameters/syncUnusedProducerPeers.json b/services/services-engine/src/test/resources/parameters/syncUnusedProducerPeers.json index c377ea6fc..001205a1f 100644 --- a/services/services-engine/src/test/resources/parameters/syncUnusedProducerPeers.json +++ b/services/services-engine/src/test/resources/parameters/syncUnusedProducerPeers.json @@ -1,72 +1,89 @@ { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 19, - "deploymentPort": 65522, - "policyModelFileName": "src/test/resources/policymodels/SmallModel.json", - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "onap.policies.apex.Simplecontrolloop": { + "type": "onap.policies.native.Apex", + "type_version": "1.0.0", + "name": "onap.policies.apex.Simplecontrolloop", + "version": "1.0.0", + "properties": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 19, + "deploymentPort": 65522, + "policy_type_impl": { + "apexPolicyModel": {} + }, + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters" + } } - } - } - }, - "eventOutputParameters": { - "SyncProducer0": { - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { - "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncConsumer0" - }, - "SyncProducer1": { - "synchronousMode": true, - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventOutputParameters": { + "SyncProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/aaa.json" - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousPeer": "SyncConsumer1" - } - }, - "eventInputParameters": { - "SyncConsumer0": { - "eventProtocolParameters": { - "eventProtocol": "JSON" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncConsumer0" + }, + "SyncProducer1": { + "synchronousMode": true, + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "target/aaa.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousPeer": "SyncConsumer1" + } }, - "synchronousMode": true, - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "FILE", - "parameters": { + "eventInputParameters": { + "SyncConsumer0": { + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "synchronousMode": true, + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { "fileName": "target/bbb.json" + } } + }, + "SyncConsumer1": { + "synchronousPeer": "SyncProducer1", + "carrierTechnologyParameters": { + "carrierTechnology": "SUPER_DOOPER", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "SUPER_TOK_DEL", + "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" + }, + "synchronousMode": true + } } - }, - "SyncConsumer1": { - "synchronousPeer": "SyncProducer1", - "carrierTechnologyParameters": { - "carrierTechnology": "SUPER_DOOPER", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "SUPER_TOK_DEL", - "parameterClassName": "org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters" - }, - "synchronousMode": true + } } - } + } + ] + } } \ No newline at end of file -- cgit 1.2.3-korg