From 1fc5ce5b48f8c270d5d044356843b8a8566bdccc Mon Sep 17 00:00:00 2001 From: "Threefoot, Jane (jt6620)" Date: Wed, 14 Mar 2018 14:48:10 -0400 Subject: added new aai-schema-ingest library New, lightweight, configurable library for OXM and edge rules json ingest. Allows for broken-up OXM and json for increased model-driven capabilities. Issue-ID: AAI-875 Change-Id: I987c7dc2ad9a68ef3ccaac8da8d3b5b0205dc264 Signed-off-by: Threefoot, Jane (jt6620) --- .../test/resources/edgeRules/defaultEdgesTest.json | 52 ++++++++ .../test/resources/edgeRules/otherTestRules.json | 136 +++++++++++++++++++++ .../src/test/resources/edgeRules/test.json | 48 ++++++++ .../src/test/resources/edgeRules/test2.json | 27 ++++ .../src/test/resources/edgeRules/test3.json | 64 ++++++++++ .../forWiringTests/schemaIngest2.properties | 3 + .../schemaIngestForXMLTest.properties | 3 + .../schemaIngestWiringTest.properties | 3 + .../test/resources/forWiringTests/testContext.xml | 14 +++ .../forWiringTests/testUsingPropFileContext.xml | 19 +++ .../src/test/resources/oxm/test_business_v10.xml | 50 ++++++++ .../src/test/resources/oxm/test_business_v11.xml | 45 +++++++ .../src/test/resources/oxm/test_network_v10.xml | 51 ++++++++ .../src/test/resources/oxm/test_network_v11.xml | 76 ++++++++++++ .../src/test/resources/schemaIngest.properties | 3 + 15 files changed, 594 insertions(+) create mode 100644 aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json create mode 100644 aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json create mode 100644 aai-schema-ingest/src/test/resources/edgeRules/test.json create mode 100644 aai-schema-ingest/src/test/resources/edgeRules/test2.json create mode 100644 aai-schema-ingest/src/test/resources/edgeRules/test3.json create mode 100644 aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties create mode 100644 aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties create mode 100644 aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties create mode 100644 aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml create mode 100644 aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml create mode 100644 aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml create mode 100644 aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml create mode 100644 aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml create mode 100644 aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml create mode 100644 aai-schema-ingest/src/test/resources/schemaIngest.properties (limited to 'aai-schema-ingest/src/test/resources') diff --git a/aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json b/aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json new file mode 100644 index 00000000..2f4baed6 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json @@ -0,0 +1,52 @@ +{ + "rules": [ + { + "from": "apple", + "to": "orange", + "label": "sitsBy", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"for testing pairs with no default" + }, + { + "from": "apple", + "to": "orange", + "label": "makesSaladWith", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"for testing pairs with no default" + }, + { + "from": "seed", + "to": "plant", + "label": "grows", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "seed", + "to": "plant", + "label": "becomes", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json b/aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json new file mode 100644 index 00000000..881239f6 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json @@ -0,0 +1,136 @@ +{ + "rules": [ + { + "from": "parent", + "to": "notation", + "label": "has", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains notation" + }, + { + "from": "not-notation", + "to": "parent", + "label": "contains", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains not-notation" + }, + { + "from": "parent", + "to": "out-out", + "label": "eats", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains out-out" + }, + { + "from": "parent", + "to": "in-in", + "label": "verbs", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains in-in" + }, + { + "from": "out-in", + "to": "parent", + "label": "alarms", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains out-in" + }, + { + "from": "in-out", + "to": "parent", + "label": "befriends", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains in-out" + }, + { + "from": "parent", + "to": "grandparent1", + "label": "has", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent1" + }, + { + "from": "grandparent2", + "to": "parent", + "label": "contains", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent2" + }, + { + "from": "parent", + "to": "grandparent3", + "label": "eats", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent3" + }, + { + "from": "parent", + "to": "grandparent4", + "label": "verbs", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent4" + }, + { + "from": "grandparent5", + "to": "parent", + "label": "alarms", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent5" + }, + { + "from": "grandparent6", + "to": "parent", + "label": "befriends", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent6" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test.json b/aai-schema-ingest/src/test/resources/edgeRules/test.json new file mode 100644 index 00000000..66691ebf --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/test.json @@ -0,0 +1,48 @@ +{ + "rules": [ + { + "from": "foo", + "to": "bar", + "label": "eats", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "foo", + "to": "bar", + "label": "eatz", + "direction": "IN", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "foo", + "to": "baz", + "label": "isVeryHappyAbout", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "${direction}", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "quux", + "to": "foo", + "label": "dancesWith", + "direction": "IN", + "multiplicity": "One2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test2.json b/aai-schema-ingest/src/test/resources/edgeRules/test2.json new file mode 100644 index 00000000..7d94e41c --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/test2.json @@ -0,0 +1,27 @@ +{ + "rules": [ + { + "from": "foo", + "to": "dog", + "label": "pets", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "dog", + "to": "puppy", + "label": "caresFor", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe", + "default": "true" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test3.json b/aai-schema-ingest/src/test/resources/edgeRules/test3.json new file mode 100644 index 00000000..916efdcc --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/test3.json @@ -0,0 +1,64 @@ +{ + "rules": [ + { + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "logical-link", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Source", + "direction": "OUT", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"" + }, + { + "from": "logical-link", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Destination", + "direction": "OUT", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"" + }, + { + "from": "l-interface", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "lag-interface", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties new file mode 100644 index 00000000..fb20eba2 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties @@ -0,0 +1,3 @@ +schemaConfig=testConfig.json +nodeDir=bloop/blap +edgeDir=different \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties new file mode 100644 index 00000000..11e5fb47 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties @@ -0,0 +1,3 @@ +schemaConfig=imatest +nodeDir=andIMalittleteapot +edgeDir=meh \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties new file mode 100644 index 00000000..8bff7d4d --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties @@ -0,0 +1,3 @@ +schemaConfig=NA +nodeDir=src/test/resources/oxm/ +edgeDir=src/test/resources/edgeRules/ \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml b/aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml new file mode 100644 index 00000000..592c2661 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml b/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml new file mode 100644 index 00000000..7c3302f0 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml new file mode 100644 index 00000000..5ead4178 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml b/aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml new file mode 100644 index 00000000..39a3ca9b --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml new file mode 100644 index 00000000..e7d77ac9 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml b/aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml new file mode 100644 index 00000000..9ede62d4 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/schemaIngest.properties b/aai-schema-ingest/src/test/resources/schemaIngest.properties new file mode 100644 index 00000000..3112c994 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/schemaIngest.properties @@ -0,0 +1,3 @@ +schemaConfig=foo +nodeDir=bar +edgeDir=quux \ No newline at end of file -- cgit 1.2.3-korg