aboutsummaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-02-07 17:56:44 +0000
committerliamfallon <liam.fallon@est.tech>2022-02-08 18:39:03 +0000
commit59b90519eda3b95b0cfc49b6349a591c7d0c78e2 (patch)
tree810e07f7d5cf270582264c40245372f597c713a2 /testsuites
parentdef44b294fa00bb5470e977eef9a05e5087035f0 (diff)
Remove JAXB and XML, use GSON for JSON
This review converst apex-pdp to use GSON for JSON handling. In order to preserve backward compatibility with the JAXB format of JSON, custom handling of maps was required. Therefore, the policy-common StandardCoder could not be used. There are a lot of small changes, removing annotations from concepts and tweaking of test data. However, this cleans up the code base so it is worth doing. Issue-ID: POLICY-1820 Change-Id: I213fa64f6d7f3f1df8d10f111d9fbedbe80f9fe0 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaver.java8
-rw-r--r--testsuites/integration/integration-common/src/main/resources/examples/models/JMS/JMSTestModel.json834
-rw-r--r--testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelSaverTest.java4
-rw-r--r--testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java2
-rw-r--r--testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java10
5 files changed, 420 insertions, 438 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-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/TestApexSamplePolicyModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java
index 54adc166d..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
@@ -59,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