diff options
Diffstat (limited to 'testsuites')
11 files changed, 424 insertions, 659 deletions
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.java index 362ccf923..324ae6cdf 100644 --- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.java +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019,2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -57,35 +57,29 @@ public final class SampleDomainModelSaver { final ApexModelSaver<AxPolicyModel> javaModelSaver = new ApexModelSaver<>(AxPolicyModel.class, javaPolicyModel, args[0]); javaModelSaver.apexModelWriteJson(); - javaModelSaver.apexModelWriteXml(); // Save Javascript model final AxPolicyModel javascriptPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVASCRIPT"); final ApexModelSaver<AxPolicyModel> javascriptModelSaver = new ApexModelSaver<>(AxPolicyModel.class, javascriptPolicyModel, args[0]); javascriptModelSaver.apexModelWriteJson(); - javascriptModelSaver.apexModelWriteXml(); // Save JRuby model final AxPolicyModel jRubyPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JRUBY"); final ApexModelSaver<AxPolicyModel> jRubyModelSaver = new ApexModelSaver<>(AxPolicyModel.class, jRubyPolicyModel, args[0]); jRubyModelSaver.apexModelWriteJson(); - jRubyModelSaver.apexModelWriteXml(); // Save Jython model final AxPolicyModel jythonPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JYTHON"); final ApexModelSaver<AxPolicyModel> jythonModelSaver = new ApexModelSaver<>(AxPolicyModel.class, jythonPolicyModel, args[0]); jythonModelSaver.apexModelWriteJson(); - jythonModelSaver.apexModelWriteXml(); // Save MVEL model final AxPolicyModel mvelPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("MVEL"); final ApexModelSaver<AxPolicyModel> mvelModelSaver = new ApexModelSaver<>(AxPolicyModel.class, mvelPolicyModel, args[0]); mvelModelSaver.apexModelWriteJson(); - mvelModelSaver.apexModelWriteXml(); } - } diff --git a/testsuites/integration/integration-common/src/main/resources/examples/models/JMS/JMSTestModel.json b/testsuites/integration/integration-common/src/main/resources/examples/models/JMS/JMSTestModel.json index 67fdcbfe5..f2ada87c5 100644 --- a/testsuites/integration/integration-common/src/main/resources/examples/models/JMS/JMSTestModel.json +++ b/testsuites/integration/integration-common/src/main/resources/examples/models/JMS/JMSTestModel.json @@ -1,456 +1,454 @@ { - "apexPolicyModel": { - "key": { + "key": { + "name": "JMSTestModel", + "version": "0.0.1" + }, + "keyInformation": { + "key": { + "name": "JMSTestModel_KeyInfo", + "version": "0.0.1" + }, + "keyInfoMap": { + "entry": [ + { + "key": { + "name": "JMSCopyInOutTask", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSCopyInOutTask", + "version": "0.0.1" + }, + "UUID": "b59815ef-fc5b-4e44-9f6e-2f6212bb7296", + "description": "Generated description for a concept called \"JMSCopyInOutTask\" with version \"null\" and UUID \"b59815ef-fc5b-4e44-9f6e-2f6212bb7296\"" + } + }, + { + "key": { "name": "JMSTestModel", "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestModel", + "version": "0.0.1" + }, + "UUID": "a731a845-f984-46a9-adf4-c6c7ca0baa0d", + "description": "Generated description for a concept called \"JMSTestModel\" with version \"null\" and UUID \"a731a845-f984-46a9-adf4-c6c7ca0baa0d\"" + } }, - "keyInformation": { + { + "key": { + "name": "JMSTestModel_Albums", + "version": "0.0.1" + }, + "value": { "key": { - "name": "JMSTestModel_KeyInfo", - "version": "0.0.1" + "name": "JMSTestModel_Albums", + "version": "0.0.1" }, - "keyInfoMap": { - "entry": [ - { - "key": { - "name": "JMSCopyInOutTask", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSCopyInOutTask", - "version": "0.0.1" - }, - "UUID": "b59815ef-fc5b-4e44-9f6e-2f6212bb7296", - "description": "Generated description for a concept called \"JMSCopyInOutTask\" with version \"null\" and UUID \"b59815ef-fc5b-4e44-9f6e-2f6212bb7296\"" - } - }, - { - "key": { - "name": "JMSTestModel", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestModel", - "version": "0.0.1" - }, - "UUID": "a731a845-f984-46a9-adf4-c6c7ca0baa0d", - "description": "Generated description for a concept called \"JMSTestModel\" with version \"null\" and UUID \"a731a845-f984-46a9-adf4-c6c7ca0baa0d\"" - } - }, - { - "key": { - "name": "JMSTestModel_Albums", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestModel_Albums", - "version": "0.0.1" - }, - "UUID": "b580c2e2-067e-452c-8410-d69344fa718c", - "description": "Generated description for concept referred to by key \"JMSTestModel_Albums:0.0.1\"" - } - }, - { - "key": { - "name": "JMSTestModel_Events", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestModel_Events", - "version": "0.0.1" - }, - "UUID": "463f3fa6-2be3-4ded-a015-1f045ee8991e", - "description": "Generated description for concept referred to by key \"JMSTestModel_Events:0.0.1\"" - } - }, - { - "key": { - "name": "JMSTestModel_KeyInfo", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestModel_KeyInfo", - "version": "0.0.1" - }, - "UUID": "b14d97fb-f215-4b70-9cd6-cbfb3ed085ee", - "description": "Generated description for concept referred to by key \"JMSTestModel_KeyInfo:0.0.1\"" - } + "UUID": "b580c2e2-067e-452c-8410-d69344fa718c", + "description": "Generated description for concept referred to by key \"JMSTestModel_Albums:0.0.1\"" + } + }, + { + "key": { + "name": "JMSTestModel_Events", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestModel_Events", + "version": "0.0.1" + }, + "UUID": "463f3fa6-2be3-4ded-a015-1f045ee8991e", + "description": "Generated description for concept referred to by key \"JMSTestModel_Events:0.0.1\"" + } + }, + { + "key": { + "name": "JMSTestModel_KeyInfo", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestModel_KeyInfo", + "version": "0.0.1" + }, + "UUID": "b14d97fb-f215-4b70-9cd6-cbfb3ed085ee", + "description": "Generated description for concept referred to by key \"JMSTestModel_KeyInfo:0.0.1\"" + } + }, + { + "key": { + "name": "JMSTestModel_Policies", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestModel_Policies", + "version": "0.0.1" + }, + "UUID": "9ae9047f-e0d8-42c4-b3a6-e32954ace3b6", + "description": "Generated description for concept referred to by key \"JMSTestModel_Policies:0.0.1\"" + } + }, + { + "key": { + "name": "JMSTestModel_Schemas", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestModel_Schemas", + "version": "0.0.1" + }, + "UUID": "adc30c29-d4b9-4408-9213-6d86b051d59c", + "description": "Generated description for concept referred to by key \"JMSTestModel_Schemas:0.0.1\"" + } + }, + { + "key": { + "name": "JMSTestModel_Tasks", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestModel_Tasks", + "version": "0.0.1" + }, + "UUID": "c3545f15-710c-4339-9a4e-e0eacffac52e", + "description": "Generated description for concept referred to by key \"JMSTestModel_Tasks:0.0.1\"" + } + }, + { + "key": { + "name": "JMSTestPolicy", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "JMSTestPolicy", + "version": "0.0.1" + }, + "UUID": "fdda6a40-6767-45b0-8703-3b5b3bafaf19", + "description": "Generated description for a concept called \"JMSTestPolicy\" with version \"null\" and UUID \"fdda6a40-6767-45b0-8703-3b5b3bafaf19\"" + } + }, + { + "key": { + "name": "PingTestClassIncomingEvent", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "PingTestClassIncomingEvent", + "version": "0.0.1" + }, + "UUID": "6cdd11f3-5fe8-4510-81b9-af3be303ebae", + "description": "Generated description for a concept called \"PingTestClassIncomingEvent\" with version \"null\" and UUID \"6cdd11f3-5fe8-4510-81b9-af3be303ebae\"" + } + }, + { + "key": { + "name": "PingTestClassOutgoingEvent", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "PingTestClassOutgoingEvent", + "version": "0.0.1" + }, + "UUID": "dc04de01-2284-4461-9fe2-da58a2122a73", + "description": "Generated description for a concept called \"PingTestClassOutgoingEvent\" with version \"0.0.1\" and UUID \"dc04de01-2284-4461-9fe2-da58a2122a73\"" + } + }, + { + "key": { + "name": "PingTestClassType", + "version": "0.0.1" + }, + "value": { + "key": { + "name": "PingTestClassType", + "version": "0.0.1" + }, + "UUID": "bdc2f70a-de52-4127-8012-b9593657da3c", + "description": "Generated description for a concept called \"PingTestClassType\" with version \"null\" and UUID \"bdc2f70a-de52-4127-8012-b9593657da3c\"" + } + } + ] + } + }, + "policies": { + "key": { + "name": "JMSTestModel_Policies", + "version": "0.0.1" + }, + "policyMap": { + "entry": [ + { + "key": { + "name": "JMSTestPolicy", + "version": "0.0.1" + }, + "value": { + "policyKey": { + "name": "JMSTestPolicy", + "version": "0.0.1" + }, + "template": "FREEFORM", + "state": { + "entry": [ + { + "key": "TestJMSState", + "value": { + "stateKey": { + "parentKeyName": "JMSTestPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "NULL", + "localName": "TestJMSState" }, - { - "key": { - "name": "JMSTestModel_Policies", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestModel_Policies", - "version": "0.0.1" - }, - "UUID": "9ae9047f-e0d8-42c4-b3a6-e32954ace3b6", - "description": "Generated description for concept referred to by key \"JMSTestModel_Policies:0.0.1\"" - } + "trigger": { + "name": "PingTestClassIncomingEvent", + "version": "0.0.1" }, - { - "key": { - "name": "JMSTestModel_Schemas", - "version": "0.0.1" - }, - "value": { + "stateOutputs": { + "entry": [ + { + "key": "InOutOutputMapping", + "value": { "key": { - "name": "JMSTestModel_Schemas", - "version": "0.0.1" + "parentKeyName": "JMSTestPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "TestJMSState", + "localName": "InOutOutputMapping" }, - "UUID": "adc30c29-d4b9-4408-9213-6d86b051d59c", - "description": "Generated description for concept referred to by key \"JMSTestModel_Schemas:0.0.1\"" - } - }, - { - "key": { - "name": "JMSTestModel_Tasks", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestModel_Tasks", - "version": "0.0.1" + "outgoingEvent": { + "name": "PingTestClassOutgoingEvent", + "version": "0.0.1" }, - "UUID": "c3545f15-710c-4339-9a4e-e0eacffac52e", - "description": "Generated description for concept referred to by key \"JMSTestModel_Tasks:0.0.1\"" + "nextState": { + "parentKeyName": "NULL", + "parentKeyVersion": "0.0.0", + "parentLocalName": "NULL", + "localName": "NULL" + } + } } + ] }, - { - "key": { - "name": "JMSTestPolicy", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSTestPolicy", - "version": "0.0.1" - }, - "UUID": "fdda6a40-6767-45b0-8703-3b5b3bafaf19", - "description": "Generated description for a concept called \"JMSTestPolicy\" with version \"null\" and UUID \"fdda6a40-6767-45b0-8703-3b5b3bafaf19\"" - } + "contextAlbumReference": [], + "taskSelectionLogic": { + "key": "NULL", + "logicFlavour": "UNDEFINED", + "logic": "" }, - { - "key": { - "name": "PingTestClassIncomingEvent", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "PingTestClassIncomingEvent", - "version": "0.0.1" - }, - "UUID": "6cdd11f3-5fe8-4510-81b9-af3be303ebae", - "description": "Generated description for a concept called \"PingTestClassIncomingEvent\" with version \"null\" and UUID \"6cdd11f3-5fe8-4510-81b9-af3be303ebae\"" - } + "stateFinalizerLogicMap": { + "entry": [] }, - { - "key": { - "name": "PingTestClassOutgoingEvent", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "PingTestClassOutgoingEvent", - "version": "0.0.1" - }, - "UUID": "dc04de01-2284-4461-9fe2-da58a2122a73", - "description": "Generated description for a concept called \"PingTestClassOutgoingEvent\" with version \"0.0.1\" and UUID \"dc04de01-2284-4461-9fe2-da58a2122a73\"" - } + "defaultTask": { + "name": "JMSCopyInOutTask", + "version": "0.0.1" }, - { - "key": { - "name": "PingTestClassType", + "taskReferences": { + "entry": [ + { + "key": { + "name": "JMSCopyInOutTask", "version": "0.0.1" - }, - "value": { + }, + "value": { "key": { - "name": "PingTestClassType", - "version": "0.0.1" + "parentKeyName": "JMSTestPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "TestJMSState", + "localName": "InOutTask" }, - "UUID": "bdc2f70a-de52-4127-8012-b9593657da3c", - "description": "Generated description for a concept called \"PingTestClassType\" with version \"null\" and UUID \"bdc2f70a-de52-4127-8012-b9593657da3c\"" + "outputType": "DIRECT", + "output": { + "parentKeyName": "JMSTestPolicy", + "parentKeyVersion": "0.0.1", + "parentLocalName": "TestJMSState", + "localName": "InOutOutputMapping" + } + } } + ] } - ] - } - }, - "policies": { - "key": { - "name": "JMSTestModel_Policies", - "version": "0.0.1" + } + } + ] }, - "policyMap": { - "entry": [ - { - "key": { - "name": "JMSTestPolicy", - "version": "0.0.1" - }, - "value": { - "policyKey": { - "name": "JMSTestPolicy", - "version": "0.0.1" - }, - "template": "FREEFORM", - "state": { - "entry": [ - { - "key": "TestJMSState", - "value": { - "stateKey": { - "parentKeyName": "JMSTestPolicy", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "TestJMSState" - }, - "trigger": { - "name": "PingTestClassIncomingEvent", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "InOutOutputMapping", - "value": { - "key": { - "parentKeyName": "JMSTestPolicy", - "parentKeyVersion": "0.0.1", - "parentLocalName": "TestJMSState", - "localName": "InOutOutputMapping" - }, - "outgoingEvent": { - "name": "PingTestClassOutgoingEvent", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "NULL", - "parentKeyVersion": "0.0.0", - "parentLocalName": "NULL", - "localName": "NULL" - } - } - } - ] - }, - "contextAlbumReference": [], - "taskSelectionLogic": { - "key": "NULL", - "logicFlavour": "UNDEFINED", - "logic": "" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "JMSCopyInOutTask", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "JMSCopyInOutTask", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "JMSTestPolicy", - "parentKeyVersion": "0.0.1", - "parentLocalName": "TestJMSState", - "localName": "InOutTask" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "JMSTestPolicy", - "parentKeyVersion": "0.0.1", - "parentLocalName": "TestJMSState", - "localName": "InOutOutputMapping" - } - } - } - ] - } - } - } - ] - }, - "firstState": "TestJMSState" - } - } - ] - } - }, - "tasks": { + "firstState": "TestJMSState" + } + } + ] + } + }, + "tasks": { + "key": { + "name": "JMSTestModel_Tasks", + "version": "0.0.1" + }, + "taskMap": { + "entry": [ + { + "key": { + "name": "JMSCopyInOutTask", + "version": "0.0.1" + }, + "value": { "key": { - "name": "JMSTestModel_Tasks", - "version": "0.0.1" + "name": "JMSCopyInOutTask", + "version": "0.0.1" }, - "taskMap": { - "entry": [ - { - "key": { - "name": "JMSCopyInOutTask", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "JMSCopyInOutTask", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "PingTestClass", - "value": { - "key": "PingTestClass", - "fieldSchemaKey": { - "name": "PingTestClassType", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "PingTestClass", - "value": { - "key": "PingTestClass", - "fieldSchemaKey": { - "name": "PingTestClassType", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [] - }, - "contextAlbumReference": [], - "taskLogic": { - "key": "TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "var outFieldType = org.onap.policy.apex.testsuites.integration.common.testclasses.PingTestClass;\nvar outValue = new outFieldType();\n\nvar inValue = executor.inFields.get(\"PingTestClass\");\n\nexecutor.logger.debug(inValue.toString());\n\noutValue.setPingTime(inValue.getPingTime());\noutValue.setPongTime(new Date().getTime());\noutValue.setName(inValue.getName() + \"_out\");\n\noutValue.setDescription(\ninValue.getDescription() +\n\". So Romeo would, were he not Romeo call'd,\" +\n\" retain that dear perfection which he owes, without that title.\");\n\nexecutor.logger.debug(outValue.toString());\nexecutor.outFields.put(\"PingTestClass\", outValue)\n\ntrue;" - } - } - } - ] + "inputFields": { + "entry": [ + { + "key": "PingTestClass", + "value": { + "key": "PingTestClass", + "fieldSchemaKey": { + "name": "PingTestClassType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + }, + "outputFields": { + "entry": [ + { + "key": "PingTestClass", + "value": { + "key": "PingTestClass", + "fieldSchemaKey": { + "name": "PingTestClassType", + "version": "0.0.1" + }, + "optional": false + } + } + ] + }, + "taskParameters": { + "entry": [] + }, + "contextAlbumReference": [], + "taskLogic": { + "key": "TaskLogic", + "logicFlavour": "JAVASCRIPT", + "logic": "var outFieldType = org.onap.policy.apex.testsuites.integration.common.testclasses.PingTestClass;\nvar outValue = new outFieldType();\n\nvar inValue = executor.inFields.get(\"PingTestClass\");\n\nexecutor.logger.debug(inValue.toString());\n\noutValue.setPingTime(inValue.getPingTime());\noutValue.setPongTime(new Date().getTime());\noutValue.setName(inValue.getName() + \"_out\");\n\noutValue.setDescription(\ninValue.getDescription() +\n\". So Romeo would, were he not Romeo call'd,\" +\n\" retain that dear perfection which he owes, without that title.\");\n\nexecutor.logger.debug(outValue.toString());\nexecutor.outFields.put(\"PingTestClass\", outValue)\n\ntrue;" } - }, - "events": { + } + } + ] + } + }, + "events": { + "key": { + "name": "JMSTestModel_Events", + "version": "0.0.1" + }, + "eventMap": { + "entry": [ + { + "key": { + "name": "PingTestClassIncomingEvent", + "version": "0.0.1" + }, + "value": { "key": { - "name": "JMSTestModel_Events", - "version": "0.0.1" + "name": "PingTestClassIncomingEvent", + "version": "0.0.1" }, - "eventMap": { - "entry": [ - { - "key": { - "name": "PingTestClassIncomingEvent", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "PingTestClassIncomingEvent", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.testsuites.integration.uservice.adapt.jms", - "source": "JMS", - "target": "Apex", - "parameter": { - "entry": [ - { - "key": "PingTestClass", - "value": { - "key": "PingTestClass", - "fieldSchemaKey": { - "name": "PingTestClassType", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } + "nameSpace": "org.onap.policy.apex.testsuites.integration.uservice.adapt.jms", + "source": "JMS", + "target": "Apex", + "parameter": { + "entry": [ + { + "key": "PingTestClass", + "value": { + "key": "PingTestClass", + "fieldSchemaKey": { + "name": "PingTestClassType", + "version": "0.0.1" }, - { - "key": { - "name": "PingTestClassOutgoingEvent", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "PingTestClassOutgoingEvent", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.testsuites.integration.uservice.adapt.jms", - "source": "Apex", - "target": "JMS", - "parameter": { - "entry": [ - { - "key": "PingTestClass", - "value": { - "key": "PingTestClass", - "fieldSchemaKey": { - "name": "PingTestClassType", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - } - ] + "optional": false + } + } + ] } + } }, - "albums": { + { + "key": { + "name": "PingTestClassOutgoingEvent", + "version": "0.0.1" + }, + "value": { "key": { - "name": "JMSTestModel_Albums", - "version": "0.0.1" + "name": "PingTestClassOutgoingEvent", + "version": "0.0.1" }, - "albums": { - "entry": [] + "nameSpace": "org.onap.policy.apex.testsuites.integration.uservice.adapt.jms", + "source": "Apex", + "target": "JMS", + "parameter": { + "entry": [ + { + "key": "PingTestClass", + "value": { + "key": "PingTestClass", + "fieldSchemaKey": { + "name": "PingTestClassType", + "version": "0.0.1" + }, + "optional": false + } + } + ] } - }, - "schemas": { + } + } + ] + } + }, + "albums": { + "key": { + "name": "JMSTestModel_Albums", + "version": "0.0.1" + }, + "albums": { + "entry": [] + } + }, + "schemas": { + "key": { + "name": "JMSTestModel_Schemas", + "version": "0.0.1" + }, + "schemas": { + "entry": [ + { + "key": { + "name": "PingTestClassType", + "version": "0.0.1" + }, + "value": { "key": { - "name": "JMSTestModel_Schemas", - "version": "0.0.1" + "name": "PingTestClassType", + "version": "0.0.1" }, - "schemas": { - "entry": [ - { - "key": { - "name": "PingTestClassType", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "PingTestClassType", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.testsuites.integration.common.testclasses.PingTestClass" - } - } - ] - } + "schemaFlavour": "Java", + "schemaDefinition": "org.onap.policy.apex.testsuites.integration.common.testclasses.PingTestClass" + } } + ] } + } } diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java index c7ab1d9a0..eaf223373 100644 --- a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java +++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2020 Nordix Foundation + * Modifications Copyright (C) 2020,2022 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ public class SampleDomainModelSaverTest { File tempDir = new File(tempDirectory.toString()); assertTrue(tempDir.isDirectory()); - assertEquals(10, tempDir.listFiles().length); + assertEquals(5, tempDir.listFiles().length); Files.walk(tempDirectory).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); } diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java index b0370c5d9..8d5b702b0 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2019-2020,2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.APEX_DISTRIBUTOR; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.DATE_CONTEXT_ALBUM; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.LONG_CONTEXT_ALBUM; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java index 500405422..ca3c05744 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019,2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,9 +24,6 @@ package org.onap.policy.apex.testsuites.integration.context.entities; import java.util.Arrays; import java.util.List; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Table; import javax.xml.bind.annotation.XmlElement; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -42,8 +39,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; /** * The Class ArtifactKeyTestEntity is an entity for testing artifact keys. */ -@Entity -@Table(name = "ArtifactKeyTestEntity") @Getter @Setter @ToString @@ -52,7 +47,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; public class ArtifactKeyTestEntity extends AxConcept { private static final long serialVersionUID = -2962570563281067896L; - @EmbeddedId() @XmlElement(name = "key", required = true) protected AxArtifactKey key; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java index a8b90d17a..8492ca898 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019,2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,9 +24,6 @@ package org.onap.policy.apex.testsuites.integration.context.entities; import java.util.Arrays; import java.util.List; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Table; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import lombok.AllArgsConstructor; @@ -44,8 +41,6 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter; /** * The Class ReferenceKeyTestEntity provides a reference key test concept. */ -@Entity -@Table(name = "ReferenceKeyTestEntity") @Getter @Setter @ToString @@ -54,7 +49,6 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter; public class ReferenceKeyTestEntity extends AxConcept { private static final long serialVersionUID = -2962570563281067895L; - @EmbeddedId() @XmlElement(name = "key", required = true) @XmlJavaTypeAdapter(AxReferenceKeyAdapter.class) protected AxReferenceKey key; diff --git a/testsuites/integration/integration-context-test/src/test/resources/META-INF/persistence.xml b/testsuites/integration/integration-context-test/src/test/resources/META-INF/persistence.xml deleted file mode 100644 index 341c33e89..000000000 --- a/testsuites/integration/integration-context-test/src/test/resources/META-INF/persistence.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ============LICENSE_START======================================================= - Copyright (C) 2016-2018 Ericsson. All rights reserved. - Modifications Copyright (C) 2019-2021 Nordix Foundation. - ================================================================================ - 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========================================================= ---> - -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> - <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL"> - <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> - - <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class> - <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxModel</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.TestEntity</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbums</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextModel</class> - - <properties> - <property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:apex_test" /> - <property name="eclipselink.target-database" value="Derby" /> - <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" /> - - <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> - <property name="eclipselink.ddl-generation.output-mode" value="database" /> - <property name="eclipselink.logging.level" value="INFO" /> - </properties> - </persistence-unit> -</persistence> diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java index 956691797..2cc7a791f 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +36,6 @@ public class TestApexSamplePolicyCreateModelFiles { final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator(type); final TestApexModel<AxPolicyModel> testApexPolicyModel = new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator); - assertThatCode(() -> testApexPolicyModel.testApexModelWriteReadXml()).doesNotThrowAnyException(); assertThatCode(() -> testApexPolicyModel.testApexModelWriteReadJson()).doesNotThrowAnyException(); } } diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java deleted file mode 100644 index 413b57880..000000000 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. 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========================================================= - */ - -package org.onap.policy.apex.testsuites.integration.executor.handling; - -import java.sql.Connection; -import java.sql.DriverManager; -import org.junit.Before; -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; -import org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao; -import org.onap.policy.apex.model.basicmodel.test.TestApexModel; -import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; - -/** - * The Class TestApexSamplePolicyDbWrite. - */ -public class TestApexSamplePolicyDbWrite { - TestApexModel<AxPolicyModel> testApexModel; - - /** - * Setup. - * - * @throws Exception the exception - */ - @Before - public void setup() throws Exception { - final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator("MVEL"); - testApexModel = new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator); - } - - /** - * Test model write read jpa. - * - * @throws Exception the exception - */ - @Test - public void testModelWriteReadJpa() throws Exception { - final DaoParameters DaoParameters = new DaoParameters(); - DaoParameters.setPluginClass(DefaultApexDao.class.getName()); - DaoParameters.setPersistenceUnit("SampleModelTest"); - - Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb"); - testApexModel.testApexModelWriteReadJpa(DaoParameters); - connection.close(); - } -} diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java index 0561162c8..3cb7369fb 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020,2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,13 +23,9 @@ package org.onap.policy.apex.testsuites.integration.executor.handling; import static org.junit.Assert.assertEquals; -import java.sql.Connection; -import java.sql.DriverManager; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; -import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; -import org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao; import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; @@ -63,16 +59,6 @@ public class TestApexSamplePolicyModel { } /** - * Test model write read xml. - * - * @throws Exception the exception - */ - @Test - public void testModelWriteReadXml() throws Exception { - testApexModel.testApexModelWriteReadXml(); - } - - /** * Test model write read json. * * @throws Exception the exception @@ -81,22 +67,4 @@ public class TestApexSamplePolicyModel { public void testModelWriteReadJson() throws Exception { testApexModel.testApexModelWriteReadJson(); } - - /** - * Test model write read jpa. - * - * @throws Exception the exception - */ - @Test - public void testModelWriteReadJpa() throws Exception { - final DaoParameters DaoParameters = new DaoParameters(); - DaoParameters.setPluginClass(DefaultApexDao.class.getName()); - DaoParameters.setPersistenceUnit("SampleModelTest"); - - Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb"); - testApexModel.testApexModelWriteReadJpa(DaoParameters); - connection.close(); - } - - } diff --git a/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml b/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml deleted file mode 100644 index b2d6a96ed..000000000 --- a/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ============LICENSE_START======================================================= - Copyright (C) 2016-2018 Ericsson. 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========================================================= ---> - -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> - <persistence-unit name="SampleModelTest" transaction-type="RESOURCE_LOCAL"> - <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> - - <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class> - <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.AxModel</class> - <class>org.onap.policy.apex.model.basicmodel.concepts.TestEntity</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbums</class> - <class>org.onap.policy.apex.model.contextmodel.concepts.AxContextModel</class> - <class>org.onap.policy.apex.model.eventmodel.concepts.AxField</class> - <class>org.onap.policy.apex.model.eventmodel.concepts.AxInputField</class> - <class>org.onap.policy.apex.model.eventmodel.concepts.AxOutputField</class> - <class>org.onap.policy.apex.model.eventmodel.concepts.AxEvent</class> - <class>org.onap.policy.apex.model.eventmodel.concepts.AxEvents</class> - <class>org.onap.policy.apex.model.eventmodel.concepts.AxEventModel</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxLogic</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxTaskParameter</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxTaskLogic</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxTask</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxTasks</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxTaskSelectionLogic</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxStateFinalizerLogic</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxStateOutput</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxStateTaskReference</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxState</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxPolicy</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxPolicies</class> - <class>org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel</class> - - <properties> - <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:testdb" /> - <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" /> - <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> - <property name="eclipselink.ddl-generation.output-mode" value="database" /> - <property name="eclipselink.logging.level" value="INFO" /> - </properties> - </persistence-unit> -</persistence> |