From 6b98bb3ec93a0bbfbe0e660cabc69978b53bfee8 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Thu, 18 Jan 2018 00:47:09 -0500 Subject: Sync the latest code changes Issue-ID: AAI-493 Change-Id: I5f39ce9bb19cfb9607b659bed82066cae7569ecc Signed-off-by: Venkata Harish K Kajur --- .../test/java/org/onap/aai/dbmap/AAIGraphTest.java | 79 + .../onap/aai/introspection/JSONStrategyTest.java | 136 + .../aai/introspection/PropertyPredicatesTest.java | 19 +- .../aai/introspection/sideeffect/DataCopyTest.java | 18 +- .../aai/introspection/sideeffect/DataLinkTest.java | 24 +- .../aai/introspection/tools/CreateUUIDTest.java | 91 + .../validation/IntrospectorValidationTest.java | 6 +- .../onap/aai/logging/EcompErrorCategoryTest.java | 50 + .../onap/aai/logging/EcompResponseCodeTest.java | 49 + .../aai/logging/EcompResponseDescriptionTest.java | 50 + .../org/onap/aai/logging/LoggingContextTest.java | 2 +- .../onap/aai/parsers/query/GraphTraversalTest.java | 46 +- .../onap/aai/parsers/query/UniqueURIQueryTest.java | 2 +- .../relationship/RelationshipToURITest.java | 16 +- .../org/onap/aai/parsers/uri/URIParserTest.java | 2 +- .../parsers/uri/URIToExtensionInformationTest.java | 2 +- .../query/builder/QueryBuilderTestAbstraction.java | 87 +- .../org/onap/aai/query/builder/SimplePathTest.java | 6 +- .../onap/aai/query/builder/TraversalQueryTest.java | 36 +- .../java/org/onap/aai/rest/CloudRegionTest.java | 76 + .../onap/aai/rest/GenericVnfLInterfaceTest.java | 78 + .../test/java/org/onap/aai/rest/TenantTest.java | 93 + .../java/org/onap/aai/rest/db/HttpEntryTest.java | 223 +- .../aai/serialization/db/DbSerializerTest.java | 497 +- .../onap/aai/serialization/db/EdgeRulesTest.java | 94 +- .../query/GraphTraversalQueryEngineTest.java | 13 +- .../serialization/queryformats/ConsoleTest.java | 83 + .../serialization/queryformats/GraphSONTest.java | 80 + .../serialization/queryformats/RawFormatTest.java | 4 +- .../queryformats/SimpleFormatTest.java | 1 - .../java/org/onap/aai/util/AAICSVWriterTest.java | 77 + .../util/AAIConfigCommandLinePropGetterTest.java | 105 + .../org/onap/aai/util/AAIRSyncUtilityTest.java | 55 + .../java/org/onap/aai/util/FileWatcherTest.java | 78 + .../java/org/onap/aai/util/GenerateXsdTest.java | 278 +- .../org/onap/aai/util/HbaseSaltPrefixerTest.java | 72 + .../java/org/onap/aai/util/KeyValueListTest.java | 76 + .../java/org/onap/aai/util/MapperUtilTest.java | 72 + .../test/java/org/onap/aai/util/PojoUtilsTest.java | 107 + .../java/org/onap/aai/util/RestURLEncoderTest.java | 63 + .../onap/aai/util/StoreNotificationEventTest.java | 235 + .../aai/workarounds/LegacyURITransformerTest.java | 104 + .../etc/appprops/aaiconfig.properties | 70 +- .../etc/appprops/error.properties | 8 +- .../bundleconfig-local/etc/oxm/aai_oxm_v10.xml | 11219 +++++++++---------- .../bundleconfig-local/etc/oxm/aai_oxm_v11.xml | 1332 ++- .../bundleconfig-local/etc/oxm/aai_oxm_v12.xml | 743 +- .../bundleconfig-local/etc/oxm/aai_oxm_v2.xml | 1729 --- .../bundleconfig-local/etc/oxm/aai_oxm_v8.xml | 4578 +++++++- .../bundleconfig-local/etc/oxm/aai_oxm_v9.xml | 10760 +++++++++--------- .../etc/relationship/ambiguous-relationship.json | 6 +- .../etc/relationship/both-failv10-successv9.json | 6 +- .../etc/relationship/both-successv10-failv9.json | 4 +- .../etc/relationship/nothing-to-parse.json | 2 +- .../etc/relationship/only-related-link.json | 4 +- .../etc/relationship/only-relationship-data.json | 4 +- .../DbEdgeRules_TraversalQueryTest.json | 36 +- .../resources/dbedgerules/DbEdgeRules_test.json | 65 +- .../dbedgerules/DbEdgeRules_test_broken.json | 9 +- aai-core/src/test/resources/edgeLabelMigration.csv | 212 + aai-core/src/test/resources/logback.xml | 4 +- .../openecomp/aai/introspection/aai_oxm_v10.xml | 5796 ---------- .../org/openecomp/aai/introspection/aai_oxm_v8.xml | 3079 ----- .../org/openecomp/aai/introspection/aai_oxm_v9.xml | 599 - .../expected/generic-vnf-with-lag-interface.json | 27 + .../resource/cloud-region-with-all-children.json | 310 + .../payloads/resource/l-interface-with-ipv6.json | 22 + .../resources/payloads/templates/cloud-region.json | 310 + .../templates/generic-vnf-with-lag-interface.json | 24 + .../test/resources/payloads/templates/tenant.json | 169 + 70 files changed, 20523 insertions(+), 23889 deletions(-) create mode 100644 aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/rest/TenantTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java delete mode 100644 aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml create mode 100644 aai-core/src/test/resources/edgeLabelMigration.csv delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml create mode 100644 aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json create mode 100644 aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json create mode 100644 aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json create mode 100644 aai-core/src/test/resources/payloads/templates/cloud-region.json create mode 100644 aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json create mode 100644 aai-core/src/test/resources/payloads/templates/tenant.json (limited to 'aai-core/src/test') diff --git a/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java b/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java new file mode 100644 index 00000000..e358dc8e --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java @@ -0,0 +1,79 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.dbmap; + +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.schema.TitanManagement; +import org.hamcrest.CoreMatchers; +import org.junit.*; +import org.onap.aai.AAISetup; +import org.onap.aai.util.AAIConstants; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.Matchers.matchesPattern; +import static org.junit.Assert.*; + +public class AAIGraphTest extends AAISetup{ + + private static final String SERVICE_NAME = "JUNIT"; + + @Before + public void setup() { + System.setProperty("aai.service.name", SERVICE_NAME); + AAIGraph.getInstance(); + } + + @Test + public void getRealtimeInstanceConnectionName() throws Exception { + + TitanManagement graphMgt = AAIGraph.getInstance().getGraph().openManagement(); + String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get(); + assertThat(connectionInstanceName, containsString(SERVICE_NAME)); + assertThat(connectionInstanceName, containsString("realtime")); + assertThat(connectionInstanceName, matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_realtime_\\d+\\(current\\)$")); + graphMgt.rollback(); + } + + @Test + public void getCachedInstanceConnectionName() throws Exception { + + TitanManagement graphMgt = AAIGraph.getInstance().getGraph(DBConnectionType.CACHED).openManagement(); + String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get(); + assertThat(connectionInstanceName, containsString(SERVICE_NAME)); + assertThat(connectionInstanceName, containsString("cached")); + assertThat(connectionInstanceName, matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_cached_\\d+\\(current\\)$")); + graphMgt.rollback(); + } + + @Test + public void titanGraphOpenNameTest() throws Exception{ + TitanGraph graph = TitanFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(SERVICE_NAME).withGraphType("graphType").buildConfiguration()); + TitanManagement graphMgt = graph.openManagement(); + String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get(); + assertThat(connectionInstanceName,matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_graphType_\\d+\\(current\\)$")); + graphMgt.rollback(); + graph.close(); + } + +} \ No newline at end of file diff --git a/aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java b/aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java new file mode 100644 index 00000000..64856899 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java @@ -0,0 +1,136 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.introspection; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.AAISetup; + +import java.util.HashSet; +import java.util.Set; + +public class JSONStrategyTest extends AAISetup{ + private JSONStrategy jsonStrategy; + private JSONStrategy jsonStrategyContainer; + private JSONStrategy jsonStrategyComplex; + + @Before + public void setup(){ + try { + JSONObject pserver = new JSONObject(); + pserver.put("hostname", "value1"); + pserver.put("numberofCpus", 4); + jsonStrategy = new JSONStrategy(pserver, "pserver-type"); + + // The values of this object are arrays containing JSONObjects + JSONArray pservers = new JSONArray(); + pservers.add(pserver); + JSONObject container = new JSONObject(); + container.put("pservers", pservers); + jsonStrategyContainer = new JSONStrategy(container, "pservers-type"); + + // The values of this object are JSONObjects + JSONObject complex = new JSONObject(); + complex.put("pserver", pserver); + jsonStrategyComplex = new JSONStrategy(complex, "pservers-type"); + } + catch (Exception e){ + System.out.println("error during setup: " + e.getMessage()); + } + } + + @Test + public void getSetTest(){ + jsonStrategy.setValue("ramInMegabytes", 1024); + Assert.assertEquals("value1", jsonStrategy.getValue("hostname")); + Assert.assertEquals(4, jsonStrategy.getValue("numberofCpus")); + Assert.assertEquals(1024, jsonStrategy.getValue("ramInMegabytes")); + } + + @Test + public void getPropertiesTest() { + Set expected = new HashSet<>(); + expected.add("hostname"); + expected.add("numberofCpus"); + Assert.assertEquals(expected, jsonStrategy.getProperties()); + } + + @Test + public void getGenericTypeTest() { + // If the values of this object are arrays, return the type within the array + Assert.assertEquals("class org.json.simple.JSONObject" , jsonStrategyContainer.getGenericTypeClass("pservers").toString()); + } + + @Test + public void getJavaClassNameTest() { + Assert.assertEquals("org.json.simple.JSONObject", jsonStrategy.getJavaClassName()); + Assert.assertEquals("org.json.simple.JSONObject", jsonStrategyContainer.getJavaClassName()); + } + @Test + public void getTypeTest() { + Assert.assertEquals("java.lang.String", jsonStrategy.getType("hostname")); + Assert.assertEquals("java.lang.Integer", jsonStrategy.getType("numberofCpus")); + } + + @Test + public void isContainerTest() { + Assert.assertTrue(jsonStrategyContainer.isContainer()); + } + + @Test + public void newInstanceOfPropertyTest() { + Assert.assertEquals("class org.json.simple.JSONArray", jsonStrategyContainer.newInstanceOfProperty("pservers").getClass().toString()); + } + + @Test(expected = NullPointerException.class) + public void newInvalidInstanceOfPropertyTest() { + Assert.assertEquals(null, jsonStrategyContainer.newInstanceOfProperty("invalid").getClass().toString()); + } + @Test + public void newInstanceOfNestedPropertyTest() { + Assert.assertEquals("class org.json.simple.JSONObject", jsonStrategyContainer.newInstanceOfNestedProperty("pservers").getClass().toString()); + } + + @Test(expected = NullPointerException.class) + public void newInvalidInstanceOfNestedPropertyTest() { + jsonStrategyContainer.newInstanceOfNestedProperty("invalid").getClass().toString(); + } + + @Test + public void isComplexTypeTest() { + // Complex: The value of this key contains a JSONObject + Assert.assertTrue(jsonStrategyComplex.isComplexType("pserver")); + Assert.assertFalse(jsonStrategyContainer.isComplexType("pservers")); + Assert.assertFalse(jsonStrategy.isComplexType("hostname")); + } + + @Test + public void isComplexGenericTypeTest() { + // Complex Generic: The value of this key contains an array of JSONObjects + Assert.assertTrue(jsonStrategyContainer.isComplexGenericType("pservers")); + Assert.assertFalse(jsonStrategyComplex.isComplexGenericType("pserver")); + Assert.assertFalse(jsonStrategy.isComplexGenericType("hostname")); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java b/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java index 0250bbb3..d5eaf0b6 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java @@ -29,6 +29,7 @@ import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import java.util.Set; import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; @@ -43,33 +44,33 @@ public class PropertyPredicatesTest extends AAISetup { @Before public void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); - obj = loader.introspectorFromName("test-object"); + obj = loader.introspectorFromName("generic-vnf"); } @Test public void includeInTestGeneration() throws AAIUnknownObjectException { Set props = obj.getProperties(PropertyPredicates.includeInTestGeneration()); - - assertThat("props not found", props, - not(hasItems("persona-model-ver", "not-visible-test-element", "model-invariant-id", "model-version-id"))); + + assertThat("props not found", props, + not(hasItems("model-invariant-id", "model-version-id"))); } @Test public void isVisible() throws AAIUnknownObjectException { Set props = obj.getProperties(PropertyPredicates.isVisible()); - - assertThat("props not found", props, not(hasItems("persona-model-ver"))); + + assertThat("props not found", props, hasItems("model-invariant-id", "model-version-id")); } @Test public void all() throws AAIUnknownObjectException { Set props = obj.getProperties(); - - assertThat("all found", props, hasItems("persona-model-ver", "not-visible-test-element")); + + assertThat("all found", props, hasItems("model-invariant-id", "model-version-id")); } - + } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java index 4a870995..7d3cafac 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java @@ -83,9 +83,11 @@ public class DataCopyTest { loader); graph.traversal().addV("aai-node-type", "model", "model-invariant-id", "key1").as("v1") - .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key2", "model-version", "testValue").addInE("has", "v1", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key2", "model-version", "testValue") + .addOutE("org.onap.relationships.inventory.BelongsTo", "v1", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "model", "model-invariant-id", "key3").as("v2") - .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key4").addInE("has", "v2", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key4") + .addOutE("org.onap.relationships.inventory.BelongsTo", "v2", EdgeProperty.CONTAINS.toString(), true) .next(); graph.tx().commit(); } @@ -105,7 +107,7 @@ public class DataCopyTest { public void runPopulatePersonaModelVer() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key1"); obj.setValue("model-version-id", "key2"); @@ -123,7 +125,7 @@ public class DataCopyTest { runner.execute(obj, self); - assertEquals("value populated", "testValue", obj.getValue("persona-model-ver")); + assertEquals("value populated", "testValue", obj.getValue("persona-model-version")); g.tx().rollback(); @@ -134,7 +136,7 @@ public class DataCopyTest { public void runPopulateModelVersionId() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v9); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("persona-model-id", "key1"); obj.setValue("persona-model-version", "testValue"); @@ -187,7 +189,7 @@ public class DataCopyTest { public void expectedMissingPropertyExceptionInURI() throws AAIException, UnsupportedEncodingException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key1"); @@ -210,7 +212,7 @@ public class DataCopyTest { @Test public void expectedMissingPropertyExceptionForResultingObject() throws AAIException, UnsupportedEncodingException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key3"); obj.setValue("model-version-id", "key4"); @@ -234,7 +236,7 @@ public class DataCopyTest { @Test public void expectNoProcessingWithNoProperties() throws AAIException, UnsupportedEncodingException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); TransactionalGraphEngine spy = spy(dbEngine); diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java index b817cc69..684bb5b8 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java @@ -31,6 +31,7 @@ import org.junit.*; import org.junit.rules.ExpectedException; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import org.onap.aai.AAISetup; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.dbmap.DBConnectionType; import org.onap.aai.exceptions.AAIException; @@ -52,7 +53,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; -public class DataLinkTest { +public class DataLinkTest extends AAISetup { private static TitanGraph graph; private final static Version version = Version.getLatest(); @@ -71,8 +72,6 @@ public class DataLinkTest { @BeforeClass public static void setup() throws NoSuchFieldException, SecurityException, Exception { graph = TitanFactory.build().set("storage.backend","inmemory").open(); - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, @@ -81,13 +80,17 @@ public class DataLinkTest { graph.traversal().addV("aai-node-type", "vpn-binding", "vpn-id", "addKey").as("v1") .addV("aai-node-type", "vpn-binding", "vpn-id", "modifyKey").as("v2") - .addV("aai-node-type", "route-target", "global-route-target", "modifyTargetKey", "route-target-role", "modifyRoleKey", "linked", true).addInE("has", "v2", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "modifyTargetKey", "route-target-role", "modifyRoleKey", "linked", true) + .addOutE("org.onap.relationships.inventory.BelongsTo", "v2", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "vpn-binding", "vpn-id", "deleteKey").as("v3") - .addV("aai-node-type", "route-target", "global-route-target", "deleteTargetKey", "route-target-role", "deleteRoleKey", "linked", true).addInE("has", "v3", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "deleteTargetKey", "route-target-role", "deleteRoleKey", "linked", true) + .addOutE("org.onap.relationships.inventory.BelongsTo", "v3", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "vpn-binding", "vpn-id", "getKey").as("v4") - .addV("aai-node-type", "route-target", "global-route-target", "getTargetKey", "route-target-role", "getRoleKey", "linked", true).addInE("has", "v4", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "getTargetKey", "route-target-role", "getRoleKey", "linked", true) + .addOutE("org.onap.relationships.inventory.BelongsTo", "v4", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "vpn-binding", "vpn-id", "getKeyNoLink").as("v5") - .addV("aai-node-type", "route-target", "global-route-target", "getTargetKeyNoLink", "route-target-role", "getRoleKeyNoLink").addInE("has", "v5", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "getTargetKeyNoLink", "route-target-role", "getRoleKeyNoLink") + .addOutE("org.onap.relationships.inventory.BelongsTo", "v5", EdgeProperty.CONTAINS.toString(), true) .next(); graph.tx().commit(); } @@ -187,7 +190,12 @@ public class DataLinkTest { runner.execute(obj, self); assertEquals("route-target vertex not found", false, traversal.V() - .has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "deleteTargetKey").has("route-target-role", "deleteRoleKey").has("linked", true).hasNext()); + .has(AAIProperties.NODE_TYPE, "route-target") + .has("global-route-target", "deleteTargetKey") + .has("route-target-role", "deleteRoleKey") + .has("linked", true) + .hasNext() + ); g.tx().rollback(); } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java b/aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java new file mode 100644 index 00000000..bb2604ec --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java @@ -0,0 +1,91 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.introspection.tools; + +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.AAISetup; +import org.onap.aai.introspection.*; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class CreateUUIDTest extends AAISetup { + + private CreateUUID createUUID; + + private Loader loader; + private Issue issue; + + @Before + public void setup(){ + createUUID = new CreateUUID(); + loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); + } + + /** + * Tests to check if the issue is not resolvable since + * the property that is being tested doesn't have the auto generated uuid + * metadata set to true in the oxm xml for the version specified + * + * @throws AAIUnknownObjectException - if the object type specified is unable to be found in the oxm + */ + @Test + public void testNonResolvableIssueIfMissingPropNameThatIsRequired() throws AAIUnknownObjectException { + + Introspector introspector = loader.introspectorFromName("pserver"); + + issue = new Issue(); + issue.setDetail("Some message"); + issue.setType(IssueType.MISSING_KEY_PROP); + issue.setPropName("hostname"); + issue.setIntrospector(introspector); + + boolean isIssue = createUUID.resolveIssue(issue); + + assertFalse(isIssue); + } + + /** + * Tests when there is a resolvable issue when the property + * looking for, model-element-uuid, has the auto generated uuid + * metadata attribute associated to it if the data is missing + * + * @throws AAIUnknownObjectException - if the object type specified is unable to be found in the oxm + */ + @Test + public void testResolvableIssueWhenMissingPropNameAllowsToUseGeneratedUUID() throws AAIUnknownObjectException { + + Introspector introspector = loader.introspectorFromName("model-element"); + + issue = new Issue(); + issue.setDetail("Some message"); + issue.setType(IssueType.MISSING_KEY_PROP); + issue.setPropName("model-element-uuid"); + issue.setIntrospector(introspector); + + boolean isIssue = createUUID.resolveIssue(issue); + assertTrue(isIssue); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java b/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java index db21f578..3bba4ee0 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java @@ -63,7 +63,7 @@ public class IntrospectorValidationTest { @Ignore @Test public void verifySuccessWhenEmpty() throws AAIException { - Introspector obj = loader.introspectorFromName("test-object"); + Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "key1"); validator.validate(obj); List issues = validator.getIssues(); @@ -73,7 +73,7 @@ public class IntrospectorValidationTest { @Ignore @Test public void verifyRequiresSingleFieldFailure() throws AAIException { - Introspector obj = loader.introspectorFromName("test-object"); + Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "key1"); obj.setValue("model-invariant-id", "id1"); validator.validate(obj); @@ -85,7 +85,7 @@ public class IntrospectorValidationTest { @Ignore @Test public void verifyRequiresSuccess() throws AAIException { - Introspector obj = loader.introspectorFromName("test-object"); + Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "key1"); obj.setValue("model-invariant-id", "id1"); obj.setValue("model-version-id", "version-id1"); diff --git a/aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java b/aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java new file mode 100644 index 00000000..485a63f2 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java @@ -0,0 +1,50 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.logging; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import ch.qos.logback.classic.Level; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import org.junit.*; + +public class EcompErrorCategoryTest { + + EcompErrorCategory _ecompErrorCategory; + ILoggingEvent mockEvent; + + @Before + public void setUp() throws Exception { + + mockEvent = mock(ILoggingEvent.class); + _ecompErrorCategory= spy(EcompErrorCategory.class); + + } + @Test + public void warn(){ + String defaultCategory = "WARN"; + assertEquals(_ecompErrorCategory.convert(mockEvent), defaultCategory); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java new file mode 100644 index 00000000..522aeb2b --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java @@ -0,0 +1,49 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.logging; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import ch.qos.logback.classic.Level; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import org.junit.*; + +public class EcompResponseCodeTest { + + EcompResponseCode _ecompResponseCode; + ILoggingEvent mockEvent; + + @Before + public void setUp() throws Exception { + + mockEvent = mock(ILoggingEvent.class); + _ecompResponseCode= spy(EcompResponseCode.class); + + } + @Test + public void getDefaultCode(){ + assertEquals(_ecompResponseCode.convert(mockEvent), LoggingContext.UNKNOWN_ERROR); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java new file mode 100644 index 00000000..3453d2de --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java @@ -0,0 +1,50 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.logging; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import ch.qos.logback.classic.Level; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import org.junit.*; +import org.onap.aai.logging.LoggingContext.LoggingField; + +public class EcompResponseDescriptionTest { + + EcompResponseDescription _ecompResponseDescription; + ILoggingEvent mockEvent; + + @Before + public void setUp() throws Exception { + + mockEvent = mock(ILoggingEvent.class); + _ecompResponseDescription= spy(EcompResponseDescription.class); + + } + @Test + public void getDefaultDesc(){ + assertEquals(_ecompResponseDescription.convert(mockEvent), _ecompResponseDescription.DefaultDescription); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java b/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java index 7885410d..46ac5997 100644 --- a/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java +++ b/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java @@ -53,7 +53,7 @@ public class LoggingContextTest { } @Test - public void testRequestId() throws Exception { //AKA Transaction ID + public void testRequestId() { //AKA Transaction ID final String sUuid = "57d51eaa-edc6-4f50-a69d-f2d4d2445120"; LoggingContext.requestId(sUuid); diff --git a/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java b/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java index df9d6122..968adb3c 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java @@ -126,7 +126,7 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() .has("physical-location-id", "key1").has("aai-node-type", "complex") - .out("hasCtagPool") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "ctag-pool") .has("target-pe", "key2").has("availability-zone-name", "key3"); GraphTraversal expectedParent = __.start() @@ -164,14 +164,14 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") - .has("interface-id", "key2").out("hasCTag") + .has("interface-id", "key2").in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "cvlan-tag") .has("cvlan-tag", 655); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") .has("interface-id", "key2"); assertEquals( @@ -212,13 +212,13 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") - .has("interface-id", "key2").out("hasCTag") + .has("interface-id", "key2").in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "cvlan-tag"); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") .has("interface-id", "key2"); assertEquals( @@ -296,7 +296,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("cloud-owner", "mycloudowner").has("cloud-region-id", "mycloudregionid") .has("aai-node-type", "cloud-region") - .out("has") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "tenant") .has("tenant-name", "Tenant1"); @@ -340,7 +340,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("cloud-owner", "mycloudowner").has("cloud-region-id", "mycloudregionid") .has("aai-node-type", "cloud-region") - .out("has") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "tenant") .has("tenant-name", P.within(values)); @@ -432,14 +432,14 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") - .has("interface-id", "key2").out("hasCTag") + .has("interface-id", "key2").in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "cvlan-tag") .has("cvlan-tag", 333); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") .has("interface-id", "key2"); assertEquals( @@ -527,7 +527,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("vnf-id", "key1").has(AAIProperties.NODE_TYPE, P.within("vce", "generic-vnf")) - .union(__.out("has").has(AAIProperties.NODE_TYPE, "vf-module")).has("vf-module-id", "key2"); + .union(__.in("org.onap.relationships.inventory.BelongsTo").has(AAIProperties.NODE_TYPE, "vf-module")).has("vf-module-id", "key2"); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has(AAIProperties.NODE_TYPE, P.within("vce", "generic-vnf")); @@ -621,15 +621,15 @@ public class GraphTraversalTest extends AAISetup { @Test public void dbAliasedSearch() throws UnsupportedEncodingException, AAIException { - URI uri = UriBuilder.fromPath("network/test-objects").build(); + URI uri = UriBuilder.fromPath("network/generic-vnfs").build(); MultivaluedMap map = new MultivaluedHashMap<>(); map.putSingle("persona-model-customization-id", "key2"); QueryParser query = dbEnginev9.getQueryBuilder().createQueryFromURI(uri, map); GraphTraversal expected = __.start() - .has("aai-node-type", "test-object") + .has("aai-node-type", "generic-vnf") .has("model-customization-id", "key2"); GraphTraversal expectedParent = __.start() - .has("aai-node-type", "test-object"); + .has("aai-node-type", "generic-vnf"); assertEquals( "gremlin query should be " + expected.toString(), @@ -642,7 +642,7 @@ public class GraphTraversalTest extends AAISetup { assertEquals( "result type should be", - "test-object", + "generic-vnf", query.getResultType()); assertEquals( "result type should be empty", @@ -661,7 +661,7 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEnginev9.getQueryBuilder().createQueryFromURI(uri, map); GraphTraversal expected = __.start() .has("aai-node-type", "vpn-binding") - .where(__.out("has").has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "key2")); + .where(__.in("org.onap.relationships.inventory.BelongsTo").has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "key2")); GraphTraversal expectedParent = __.start() .has("aai-node-type", "vpn-binding"); @@ -693,7 +693,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver"); + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver"); GraphTraversal expectedParent = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex"); @@ -727,7 +727,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver") + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver") .has("hostname", "key2"); GraphTraversal expectedParent = __.start() .has("physical-location-id", "key1") @@ -762,14 +762,14 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver") + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver") .has("hostname", "key2") - .in("runsOnPserver").has("aai-node-type", "vserver") + .in("tosca.relationships.HostedOn").has("aai-node-type", "vserver") .has("vserver-id", "key3"); GraphTraversal expectedParent = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver") + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver") .has("hostname", "key2"); assertEquals( diff --git a/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java b/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java index 84e9c6bc..d9dcabd3 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java @@ -150,7 +150,7 @@ public class UniqueURIQueryTest extends AAISetup { String parentKey = "vce/key1/port-group/key2"; URI uri = UriBuilder.fromPath(parentURI + "/cvlan-tags").build(); QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); - GraphTraversal expected = __.start().has("aai-unique-key", parentKey).out("hasCTag").has("aai-node-type", "cvlan-tag"); + GraphTraversal expected = __.start().has("aai-unique-key", parentKey).in("org.onap.relationships.inventory.BelongsTo").has("aai-node-type", "cvlan-tag"); GraphTraversal parentExpected = __.start().has("aai-unique-key",parentKey); String parentResultType = "port-group"; String resultType = "cvlan-tag"; diff --git a/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java b/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java index 04727067..1710986b 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java @@ -54,7 +54,7 @@ public class RelationshipToURITest extends AAISetup { public void onlyLink() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("only-related-link.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); RelationshipToURI parse = new RelationshipToURI(loader, obj); @@ -67,7 +67,7 @@ public class RelationshipToURITest extends AAISetup { public void onlyData() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("only-relationship-data.json")); - URI expected = new URI("/network/test-objects/test-object/key1"); + URI expected = new URI("/network/generic-vnfs/generic-vnf/key1"); RelationshipToURI parse = new RelationshipToURI(loader, obj); @@ -80,7 +80,7 @@ public class RelationshipToURITest extends AAISetup { public void failV10() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-failv10-successv9.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AAIIdentityMapParseException.class); thrown.expect(hasProperty("code", is("AAI_3000"))); @@ -93,7 +93,7 @@ public class RelationshipToURITest extends AAISetup { public void successV9() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version9); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-failv10-successv9.json")); - URI expected = new URI("/network/test-objects/test-object/key2"); + URI expected = new URI("/network/generic-vnfs/generic-vnf/key2"); RelationshipToURI parse = new RelationshipToURI(loader, obj); URI uri = parse.getUri(); @@ -107,7 +107,7 @@ public class RelationshipToURITest extends AAISetup { public void failV9() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version9); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-successv10-failv9.json")); - URI expected = new URI("/network/test-objects/test-object/key1"); + URI expected = new URI("/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AAIIdentityMapParseException.class); thrown.expect(hasProperty("code", is("AAI_3000"))); @@ -122,7 +122,7 @@ public class RelationshipToURITest extends AAISetup { public void failNothingToParse() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("nothing-to-parse.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AAIIdentityMapParseException.class); thrown.expect(hasProperty("code", is("AAI_3000"))); @@ -136,7 +136,7 @@ public class RelationshipToURITest extends AAISetup { public void successV10() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-successv10-failv9.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); RelationshipToURI parse = new RelationshipToURI(loader, obj); @@ -152,7 +152,7 @@ public class RelationshipToURITest extends AAISetup { public void ambiguousRelationship() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("ambiguous-relationship.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AmbiguousMapAAIException.class); thrown.expect(hasProperty("code", is("AAI_6146"))); diff --git a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java index bc3a684b..42d26f99 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java @@ -59,7 +59,7 @@ public class URIParserTest extends AAISetup { URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/network/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build(); thrown.expect(AAIException.class); - thrown.expect(hasProperty("code", is("AAI_3000"))); + thrown.expect(hasProperty("code", is("AAI_3001"))); new URIToDBKey(loader, uri); } diff --git a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java index ce4933a6..ca64ec76 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java @@ -53,7 +53,7 @@ public class URIToExtensionInformationTest extends AAISetup { */ @Test public void vserversV8() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException { - URI uri = UriBuilder.fromPath("/aai/" + v8Loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/key1/vservers/vserver/key2").build(); + URI uri = UriBuilder.fromPath("/aai/" + v8Loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/testOwner1/testRegion1/tenants/tenant/key1/vservers/vserver/key2").build(); URIToExtensionInformation parse = new URIToExtensionInformation(v8Loader, uri); String namespace = "cloudInfrastructure"; diff --git a/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java b/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java index d478d608..b475a385 100644 --- a/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java +++ b/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java @@ -35,8 +35,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.onap.aai.AAISetup; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.exceptions.AAIException; @@ -51,19 +50,33 @@ import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public abstract class QueryBuilderTestAbstraction extends AAISetup { - protected Loader loader; - protected Graph graph; + protected static Loader loader; + protected static Graph graph; protected GraphTraversalSource g; - + protected EdgeRules testEdgeRules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_TraversalQueryTest.json"); - @Before - public void configure() throws Exception { + + @BeforeClass + public static void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); graph = TitanFactory.build().set("storage.backend", "inmemory").open(); + } + + @Before + public void configure() throws Exception { g = graph.traversal(); } - + + @After + public void deConfigure() throws Exception { + g.tx().rollback(); + } + + @AfterClass + public static void teardown() throws Exception { + graph.close(); + } @Test public void createEdgeGVnfToVnfcTraversal() throws AAIException { @@ -77,7 +90,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(vnfc, tQ.next()); - g.tx().rollback(); + } @Test @@ -94,7 +107,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(logicalLink, next); - g.tx().rollback(); + } @Test @@ -111,7 +124,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(logicalLink, next); - g.tx().rollback(); + } @Test @@ -128,7 +141,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(logicalLink, next); - g.tx().rollback(); + } @Test @@ -147,7 +160,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 vertexes ", 1, list.size()); assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); - g.tx().rollback(); + } @Test @@ -172,7 +185,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("2 - Has 1 vertexes ", 1, list2.size()); assertTrue("2 - traversal results in vce ", list2.contains(vce)); - g.tx().rollback(); + } @Test @@ -191,7 +204,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("1 - Has 1 vertexes ", 1, list.size()); assertTrue("1 - traversal results in vnfc ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -213,7 +226,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); assertTrue("Has vertex on the re-uses edge ", list.contains(vnfc2)); - g.tx().rollback(); + } @Test @@ -234,7 +247,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 vertexes ", 1, list.size()); assertTrue("Only returns the generic vnf vertex", list.contains(gvnf)); - g.tx().rollback(); + } @Test @@ -250,7 +263,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 vertexes ", 1, list.size()); - g.tx().rollback(); + } @Test @@ -266,7 +279,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); - g.tx().rollback(); + } @Test @@ -282,7 +295,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); - g.tx().rollback(); + } @Test @@ -302,7 +315,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 1, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -322,7 +335,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 1, list.size()); assertEquals("result has pserver ",pserver, list.get(0).iterator().next()); - g.tx().rollback(); + } @Test @@ -342,7 +355,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -362,7 +375,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { list.add(tQ.next()); assertFalse("Has next 3 ",tQ.hasNext()); assertTrue("Has all the vertexes", list.contains(v1) && list.remove(v2)); - g.tx().rollback(); + } @Test @@ -382,7 +395,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -402,7 +415,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(complex)); - g.tx().rollback(); + } @Test @@ -421,7 +434,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("1 - Has 1 edge ", 1, list.size()); assertTrue("1 - traversal results in edge ", list.contains(e)); - g.tx().rollback(); + } @Test @@ -440,7 +453,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("1 - Has 1 edge ", 1, list1.size()); assertTrue("1 - traversal results in edge ", list1.contains(e)); - g.tx().rollback(); + } @Test @@ -461,7 +474,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("result has default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -482,7 +495,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("result has default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -504,7 +517,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("result has default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test (expected = NoEdgeRuleFoundException.class) @@ -518,7 +531,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { QueryBuilder tQ = getNewEdgeTraversal(gvnf); tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver", Collections.emptyList()); - g.tx().rollback(); + } @Test @@ -538,7 +551,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 edges ", 1, list.size()); assertFalse("result does not have default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -558,7 +571,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 edges ", 2, list.size()); assertTrue("result has generic-vnf-pserver-A edge ", list.contains(e1)); assertTrue("result has generic-vnf-pserver-B edge ", list.contains(e2)); - g.tx().rollback(); + } @Test (expected = NoEdgeRuleFoundException.class) @@ -571,7 +584,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { List list = tQ.toList(); - g.tx().rollback(); + } private Vertex getVertex() throws AAIException { @@ -600,7 +613,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 edges ", 1, list.size()); assertFalse("result does not have default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -620,7 +633,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 edges ", 2, list.size()); assertTrue("result has generic-vnf-pserver-A edge ", list.contains(e1)); assertTrue("result has generic-vnf-pserver-B edge ", list.contains(e2)); - g.tx().rollback(); + } protected abstract QueryBuilder getNewEdgeTraversal(Vertex v); diff --git a/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java b/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java index a3515ab9..4dfe2dbd 100644 --- a/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java +++ b/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java @@ -79,9 +79,6 @@ public class SimplePathTest extends AAISetup { Vertex lint2 = graph.addVertex(T.label, "l-interface", T.id, "11", "aai-node-type", "l-interface", "interface-name", "lint2", "is-port-mirrored", "true", "in-maint", "true", "is-ip-unnumbered", "false"); - Vertex loglink2 = graph.addVertex(T.label, "logical-link", T.id, "21", "aai-node-type", "logical-link", - "link-name", "loglink2", "in-maint", "false", "link-type", "sausage"); - Vertex lint3 = graph.addVertex(T.label, "l-interface", T.id, "12", "aai-node-type", "l-interface", "interface-name", "lint3", "is-port-mirrored", "true", "in-maint", "true", "is-ip-unnumbered", "false"); @@ -91,8 +88,7 @@ public class SimplePathTest extends AAISetup { rules.addTreeEdge(g, gvnf1, lint1); rules.addEdge(g, lint1, loglink1); rules.addEdge(g, loglink1, lint2); - rules.addEdge(g, lint2, loglink2); - rules.addEdge(g, loglink2, lint3); + rules.addEdge(g, loglink1, lint3); rules.addTreeEdge(g, gvnf2, lint3); return g; diff --git a/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java b/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java index 41daf17f..81d42ddb 100644 --- a/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java +++ b/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java @@ -75,20 +75,20 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("they are equal", expected, tQ.getQuery()); - g.tx().rollback(); + } @Test public void traversalClones() throws UnsupportedEncodingException, AAIException, URISyntaxException { QueryBuilder tQ = new TraversalQuery<>(loader, g); - QueryBuilder builder = tQ.createQueryFromURI(new URI("network/test-objects/test-object/key1")).getQueryBuilder(); - GraphTraversal expected = __.start().has("vnf-id", "key1").has("aai-node-type", "test-object"); - GraphTraversal containerExpected = __.start().has("aai-node-type", "test-object"); + QueryBuilder builder = tQ.createQueryFromURI(new URI("network/generic-vnfs/generic-vnf/key1")).getQueryBuilder(); + GraphTraversal expected = __.start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf"); + GraphTraversal containerExpected = __.start().has("aai-node-type", "generic-vnf"); assertEquals("query object", expected.toString(), builder.getQuery().toString()); assertEquals("container query object", containerExpected.toString(), builder.getContainerQuery().getQuery().toString()); - g.tx().rollback(); + } @Test @@ -96,13 +96,21 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { QueryBuilder tQ = new TraversalQuery<>(loader, g); QueryBuilder builder = tQ.createQueryFromURI(new URI("network/generic-vnfs/generic-vnf/key1/l-interfaces/l-interface/key2")).getQueryBuilder(); - GraphTraversal expected = __.start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf").out("hasLInterface").has(AAIProperties.NODE_TYPE, "l-interface").has("interface-name", "key2"); - GraphTraversal containerExpected = __.start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf").out("hasLInterface").has(AAIProperties.NODE_TYPE, "l-interface"); + GraphTraversal expected = __.start() + .has("vnf-id", "key1") + .has("aai-node-type", "generic-vnf") + .in("org.onap.relationships.inventory.BelongsTo").has(AAIProperties.NODE_TYPE, "l-interface") + .has("interface-name", "key2"); + GraphTraversal containerExpected = __.start() + .has("vnf-id", "key1") + .has("aai-node-type", "generic-vnf") + .in("org.onap.relationships.inventory.BelongsTo") + .has(AAIProperties.NODE_TYPE, "l-interface"); assertEquals("query object", expected.toString(), builder.getQuery().toString()); assertEquals("container query object", containerExpected.toString(), builder.getContainerQuery().getQuery().toString()); - g.tx().rollback(); + } @Test @@ -121,7 +129,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("Has 1 vertexes ", 1, list.size()); assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); - g.tx().rollback(); + } @Test @@ -146,7 +154,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("2 - Has 1 vertexes ", 1, list2.size()); assertTrue("2 - traversal results in vce ", list2.contains(vce)); - g.tx().rollback(); + } @Test @@ -165,7 +173,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("1 - Has 1 vertexes ", 1, list.size()); assertTrue("1 - traversal results in vnfc ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -187,7 +195,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); assertTrue("Has vertex on the re-uses edge ", list.contains(vnfc2)); - g.tx().rollback(); + } @Test @@ -207,7 +215,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -227,7 +235,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(complex)); - g.tx().rollback(); + } diff --git a/aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java b/aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java new file mode 100644 index 00000000..55fdd53d --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java @@ -0,0 +1,76 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest; + +import com.jayway.jsonpath.JsonPath; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.AAIJunitRunner; +import org.onap.aai.HttpTestUtil; +import org.onap.aai.PayloadUtil; +import org.onap.aai.exceptions.AAIException; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.Response; +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + +/** + * CloudRegionTest is testing if you put a cloud region with all + * children nodes associated to it then you should be able to + * remove the cloud region without removing the individual child nodes first + */ +@RunWith(AAIJunitRunner.class) +public class CloudRegionTest { + + private HttpTestUtil httpTestUtil; + + @Before + public void setUp(){ + httpTestUtil = new HttpTestUtil(); + } + + @Ignore("Test is failing due to the deletion of node with children not correct will be fixed soon") + @Test + public void testPutWithAllCloudRegionChildrenNodesAndCheckIfDeleteIsSuccessful() throws IOException, AAIException { + + String cloudRegionPayload = PayloadUtil.getResourcePayload("cloud-region-with-all-children.json"); + String cloudRegionUri = "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/junit-cloud-owner/junit-cloud-region"; + + Response response = httpTestUtil.doPut(cloudRegionUri, cloudRegionPayload); + assertEquals("Expected the cloud region to be created", 201, response.getStatus()); + + response = httpTestUtil.doGet(cloudRegionUri); + assertEquals("Expected the cloud region to be found", 200, response.getStatus()); + String jsonResponse = response.getEntity().toString(); + + JSONAssert.assertEquals(cloudRegionPayload, jsonResponse, false); + String resourceVersion = JsonPath.read(jsonResponse, "$.resource-version"); + + response = httpTestUtil.doDelete(cloudRegionUri, resourceVersion); + assertEquals("Expected the cloud region to be deleted", 204, response.getStatus()); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java b/aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java new file mode 100644 index 00000000..f42eebb8 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java @@ -0,0 +1,78 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest; + +import org.json.JSONObject; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.AAIJunitRunner; +import org.onap.aai.HttpTestUtil; +import org.onap.aai.PayloadUtil; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +@RunWith(AAIJunitRunner.class) +public class GenericVnfLInterfaceTest { + + private HttpTestUtil httpTestUtil; + + @Before + public void setUp(){ + httpTestUtil = new HttpTestUtil(); + } + + @Test + public void testPutTwoLInterfacesToGenericVnf() throws Exception { + + Map templateValueMap = new HashMap<>(); + templateValueMap.put("ip-address", "ipv1"); + + String resource = PayloadUtil.getTemplatePayload("generic-vnf-with-lag-interface.json", templateValueMap); + Response response = httpTestUtil.doPut("/aai/v12/network/generic-vnfs/generic-vnf/vnf1", resource); + assertEquals("Expecting the generic vnf to be created", 201, response.getStatus()); + + response = httpTestUtil.doGet("/aai/v12/network/generic-vnfs/generic-vnf/vnf1"); + assertEquals("Expecting the generic vnf to be updated", 200, response.getStatus()); + + resource = response.getEntity().toString().replaceAll("ipv1\",\"resource-version\":\"\\d+\"", "ipv2\""); + response = httpTestUtil.doPut("/aai/v12/network/generic-vnfs/generic-vnf/vnf1", resource); + assertEquals("Expecting the generic vnf to be updated", 200, response.getStatus()); + + response = httpTestUtil.doGet("/aai/v12/network/generic-vnfs/generic-vnf/vnf1"); + assertEquals("Expecting the generic vnf to be updated", 200, response.getStatus()); + + String expected = PayloadUtil.getExpectedPayload("generic-vnf-with-lag-interface.json"); + JSONAssert.assertEquals(expected, response.getEntity().toString(), false); + + JSONObject jsonObject = new JSONObject(response.getEntity().toString()); + String resourceVersion = (String) jsonObject.get("resource-version"); + + response = httpTestUtil.doDelete("/aai/v12/network/generic-vnfs/generic-vnf/vnf1", resourceVersion); + assertEquals("Expecting the generic vnf to be deleted", 204, response.getStatus()); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/rest/TenantTest.java b/aai-core/src/test/java/org/onap/aai/rest/TenantTest.java new file mode 100644 index 00000000..3de8dfa2 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/rest/TenantTest.java @@ -0,0 +1,93 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.rest; + +import com.jayway.jsonpath.JsonPath; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.AAIJunitRunner; +import org.onap.aai.HttpTestUtil; +import org.onap.aai.PayloadUtil; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import static org.junit.Assert.assertEquals; + +@RunWith(AAIJunitRunner.class) +public class TenantTest { + + private HttpTestUtil httpTestUtil; + + private Map templateValuesMap; + + @Before + public void setup(){ + httpTestUtil = new HttpTestUtil(); + templateValuesMap = new HashMap<>(); + } + + @Ignore("Test is failing due to the deletion of node with children not correct will be fixed soon") + @Test + public void testCloudRegionTenantDeleteSuccessWithoutDeletingVserver() throws Exception { + + templateValuesMap.put("cloud-region-id", UUID.randomUUID().toString()); + templateValuesMap.put("cloud-owner", UUID.randomUUID().toString()); + templateValuesMap.put("tenant-id", UUID.randomUUID().toString()); + templateValuesMap.put("vserver-id", UUID.randomUUID().toString()); + + String cloudRegionPayload = PayloadUtil.getTemplatePayload("cloud-region.json", templateValuesMap); + String cloudRegionUri = String.format("/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/%s/%s", + templateValuesMap.get("cloud-owner"), + templateValuesMap.get("cloud-region-id") + ); + + String tenantUri = cloudRegionUri + "/tenants/tenant/" + templateValuesMap.get("tenant-id"); + String tenantPayload = PayloadUtil.getTemplatePayload("tenant.json", templateValuesMap); + + Response response = httpTestUtil.doPut(cloudRegionUri, cloudRegionPayload); + assertEquals("Expected the cloud region to be created", 201, response.getStatus()); + + response = httpTestUtil.doGet(tenantUri); + assertEquals("Expected the cloud region to be created", 200, response.getStatus()); + String responseStr = response.getEntity().toString(); + + JSONAssert.assertEquals(tenantPayload, responseStr, false); + String resourceVersion = JsonPath.read(responseStr, "$.resource-version"); + + response = httpTestUtil.doDelete(tenantUri, resourceVersion); + assertEquals("Expected the cloud region to be created", 204, response.getStatus()); + + response = httpTestUtil.doGet(cloudRegionUri); + assertEquals("Expected the cloud region to be created", 200, response.getStatus()); + responseStr = response.getEntity().toString(); + resourceVersion = JsonPath.read(responseStr, "$.resource-version"); + + response = httpTestUtil.doDelete(cloudRegionUri, resourceVersion); + assertEquals("Expected the cloud region to be created", 204, response.getStatus()); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java index f643fc47..0d4f4f14 100644 --- a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java +++ b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java @@ -52,6 +52,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.when; @@ -115,6 +116,31 @@ public class HttpEntryTest extends AAISetup { when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); } + private Response getResponse(HttpEntry httpEntry, Loader loader, TransactionalGraphEngine dbEngine, HttpMethod method, String uri, String content) throws UnsupportedEncodingException, AAIException { + URI uriObject = UriBuilder.fromPath(uri).build(); + QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); + String objType = uriQuery.getResultType(); + if (uri.endsWith("relationship")) { + objType = "relationship"; + } + Introspector obj = null; + if (method.equals(HttpMethod.GET)) { + obj = loader.introspectorFromName(objType); + } else { + obj = loader.unmarshal(objType, content, org.onap.aai.restcore.MediaType.getEnum("application/json")); + } + + DBRequest dbRequest = + new DBRequest.Builder(method, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") + .rawRequestContent(content).build(); + + List dbRequestList = new ArrayList<>(); + dbRequestList.add(dbRequest); + + Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); + return responsesTuple.getValue1().get(0).getValue1(); + } + @Test public void test1PutOnPserver() throws UnsupportedEncodingException, AAIException { @@ -124,99 +150,95 @@ public class HttpEntryTest extends AAISetup { Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; String content = "{\"hostname\":\"junit-test1\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + dbEngine.commit(); + assertEquals("Expected the pserver to be created", 201, response.getStatus()); + } - Introspector obj = loader.unmarshal("pserver", content, org.onap.aai.restcore.MediaType.getEnum("application/json")); - - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.PUT, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + @Test + public void test2PutOnPserverNoPInterface() throws UnsupportedEncodingException, AAIException { - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test2"; + String content = "{\"hostname\":\"junit-test2\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); dbEngine.commit(); assertEquals("Expected the pserver to be created", 201, response.getStatus()); } @Test - public void test2GetOnPserver() throws UnsupportedEncodingException, AAIException { - + public void test3PutOnPInterface() { + try { DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1/p-interfaces/p-interface/p1"; + String content = "{\"interface-name\":\"p1\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + dbEngine.commit(); + assertEquals("Expected the p-interface to be created", 201, response.getStatus()); + } catch (UnsupportedEncodingException | AAIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - String content = ""; - Introspector obj = loader.introspectorFromName("pserver"); + @Test + public void test4GetOnPserver() throws UnsupportedEncodingException, AAIException { - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; + String content = "{\"hostname\":\"junit-test1\", \"equip-type\":\"junit-equip-type\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); dbEngine.commit(); assertEquals("Expected the pserver to be returned", 200, response.getStatus()); } @Test - public void test3MergePatchOnPserver() throws UnsupportedEncodingException, AAIException { + public void test5MergePatchOnPserver() throws UnsupportedEncodingException, AAIException { DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; String content = "{\"hostname\":\"junit-test1\", \"equip-type\":\"junit-equip-type\"}"; - - Introspector obj = loader.unmarshal("pserver", content, org.onap.aai.restcore.MediaType.getEnum("application/json")); - - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.MERGE_PATCH, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); - - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); - - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.MERGE_PATCH, uri, content); dbEngine.commit(); assertEquals("Expected the pserver to be updated", 200, response.getStatus()); } - private int doDelete(String resourceVersion) throws UnsupportedEncodingException, AAIException { + private int doDelete(String resourceVersion, String uri, String nodeType) throws UnsupportedEncodingException, AAIException { queryParameters.add("resource-version", resourceVersion); DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); + URI uriObject = UriBuilder.fromPath(uri).build(); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); String content = ""; - Introspector obj = loader.introspectorFromName("pserver"); + Introspector obj = loader.introspectorFromName(nodeType); DBRequest dbRequest = new DBRequest.Builder(HttpMethod.DELETE, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") @@ -232,7 +254,8 @@ public class HttpEntryTest extends AAISetup { } @Test - public void test4DeleteOnPserver() throws UnsupportedEncodingException, AAIException { + public void test6DeleteOnPserver() throws UnsupportedEncodingException, AAIException { + DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); @@ -240,22 +263,31 @@ public class HttpEntryTest extends AAISetup { TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; String content = ""; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); + dbEngine.commit(); + String msg = response.getEntity().toString(); + JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject(); + String resourceVersion = ""; + if ( jsonObj.isJsonObject()) { + resourceVersion = jsonObj.get("resource-version").getAsString(); + } + assertEquals("Expected the pserver to be deleted", 204, doDelete(resourceVersion, "/cloud-infrastructure/pservers/pserver/junit-test1", "pserver")); + } - Introspector obj = loader.introspectorFromName("pserver"); - - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + @Test + public void test7DeleteOnPserverNoPinterface() throws UnsupportedEncodingException, AAIException { - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test2"; + String content = ""; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); dbEngine.commit(); String msg = response.getEntity().toString(); JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject(); @@ -263,36 +295,79 @@ public class HttpEntryTest extends AAISetup { if ( jsonObj.isJsonObject()) { resourceVersion = jsonObj.get("resource-version").getAsString(); } - assertEquals("Expected the pserver to be deleted", 204, doDelete(resourceVersion)); + assertEquals("Expected the pserver to be deleted", 204, doDelete(resourceVersion, "/cloud-infrastructure/pservers/pserver/junit-test2", "pserver")); } + @Test - public void test5FailedGetOnPserver() throws UnsupportedEncodingException, AAIException { + public void test8FailedGetOnPserver() throws UnsupportedEncodingException, AAIException { DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test2").build(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test2"; + String content = ""; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); + dbEngine.commit(); - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); + assertEquals("Expected the pserver to be deleted", 404, response.getStatus()); + } - String content = ""; + @Test + public void putEdgeTest() throws UnsupportedEncodingException, AAIException { - Introspector obj = loader.introspectorFromName("pserver"); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + //Put pserver + String uri = "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver"; + String content = "{\"hostname\":\"junit-edge-test-pserver\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + //Put complex + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex"; + content = "{\"physical-location-id\":\"junit-edge-test-complex\",\"physical-location-type\":\"AAIDefault\",\"street1\":\"AAIDefault\",\"city\":\"AAIDefault\",\"state\":\"NJ\",\"postal-code\":\"07748\",\"country\":\"USA\",\"region\":\"US\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + + //PutEdge + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex/relationship-list/relationship"; + content = "{\"related-to\":\"pserver\",\"related-link\":\"/aai/" + Version.getLatest().toString() + "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver\",\"relationship-label\":\"org.onap.relationships.inventory.LocatedIn\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT_EDGE, uri, content); + + dbEngine.rollback(); + //System.out.println(response.getEntity().toString()); + assertEquals("Expected the pserver to be created", 200, response.getStatus()); + } - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + @Test + public void putEdgeWrongLabelTest() throws UnsupportedEncodingException, AAIException { - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); - dbEngine.commit(); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - assertEquals("Expected the pserver to be deleted", 404, response.getStatus()); + //Put pserver + String uri = "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver"; + String content = "{\"hostname\":\"junit-edge-test-pserver\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + //Put complex + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex"; + content = "{\"physical-location-id\":\"junit-edge-test-complex\",\"physical-location-type\":\"AAIDefault\",\"street1\":\"AAIDefault\",\"city\":\"AAIDefault\",\"state\":\"NJ\",\"postal-code\":\"07748\",\"country\":\"USA\",\"region\":\"US\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + + //PutEdge + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex/relationship-list/relationship"; + content = "{\"related-to\":\"pserver\",\"related-link\":\"/aai/" + Version.getLatest().toString() + "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver\",\"relationship-label\":\"junk\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT_EDGE, uri, content); + + dbEngine.rollback(); + String msg = response.getEntity().toString(); + assertEquals("Expected the pserver to be created", 400, response.getStatus()); + assertTrue(msg.contains("ERR.5.4.6107")); + assertTrue(msg.contains("Required Edge-property not found in input data:no COUSIN edge rule between complex and pserver with label junk")); } } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java index 5fade2ed..b124e5dd 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java @@ -1,28 +1,27 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - package org.onap.aai.serialization.db; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -30,10 +29,7 @@ import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -41,10 +37,7 @@ import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.*; import org.junit.rules.ExpectedException; import org.onap.aai.AAISetup; import org.onap.aai.db.props.AAIProperties; @@ -69,7 +62,7 @@ public class DbSerializerTest extends AAISetup { @Rule public ExpectedException thrown = ExpectedException.none(); - protected Graph graph; + protected static Graph graph; protected final EdgeRules rules = EdgeRules.getInstance(); private final Version version = Version.getLatest(); @@ -82,22 +75,27 @@ public class DbSerializerTest extends AAISetup { private DBSerializer dbser; TransactionalGraphEngine spy; TransactionalGraphEngine.Admin adminSpy; - + + @BeforeClass + public static void init() throws Exception { + graph = TitanFactory.build().set("storage.backend", "inmemory").open(); + createGraph(); + + } + @Before public void setup() throws Exception { - graph = TitanFactory.build().set("storage.backend", "inmemory").open(); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine(queryStyle, type, loader); spy = spy(dbEngine); adminSpy = spy(dbEngine.asAdmin()); - - createGraph(); + engine = new TitanDBEngine(queryStyle, type, loader); dbser = new DBSerializer(version, engine, introspectorFactoryType, "AAI-TEST"); } - public void createGraph() throws AAIException { + public static void createGraph() throws AAIException { /* * This setus up the test graph, For future junits , add more vertices * and edges @@ -115,19 +113,63 @@ public class DbSerializerTest extends AAISetup { .next(); GraphTraversalSource g = graph.traversal(); - rules.addEdge(g, l3interipv4addresslist_1, subnet_2); - rules.addEdge(g, l3interipv6addresslist_3, subnet_4); - rules.addTreeEdge(g, subnet_5, l3network_6); + EdgeRules.getInstance().addEdge(g, l3interipv4addresslist_1, subnet_2); + EdgeRules.getInstance().addEdge(g, l3interipv6addresslist_3, subnet_4); + EdgeRules.getInstance().addTreeEdge(g, subnet_5, l3network_6); + } + + @Test + public void testFindDeletableDoesNotReturnDuplicates() throws AAIException { + EdgeRules testRules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); + + Vertex genericVnf1 = graph.addVertex("aai-node-type", "generic-vnf", "vnf-id", "vnf1", "vnf-name", "vnfName1"); + + Vertex lInterface1 = graph.addVertex("aai-node-type", "l-interface", "interface-name", "lInterface1"); + Vertex lInterface2 = graph.addVertex("aai-node-type", "l-interface", "interface-name", "lInterface2"); + + Vertex logicalLink1 = graph.addVertex("aai-node-type", "logical-link", "link-name", "logicalLink1"); + Vertex logicalLink2 = graph.addVertex("aai-node-type", "logical-link", "link-name", "logicalLink2"); + + GraphTraversalSource g = graph.traversal(); + + testRules.addTreeEdge(g, genericVnf1, lInterface1); + testRules.addTreeEdge(g, genericVnf1, lInterface2); + testRules.addEdge(g, lInterface1, logicalLink1); + testRules.addEdge(g, lInterface1, logicalLink2); + // This line will cause the logical link2 to be found twice under linterface 1 + // and also under the linterface 2 and since in the past deletable returned + // duplicates this test checks that it shouldn't return duplicates + testRules.addEdge(g, lInterface2, logicalLink2); + + when(spy.asAdmin()).thenReturn(adminSpy); + when(adminSpy.getTraversalSource()).thenReturn(g); + when(adminSpy.getReadOnlyTraversalSource()).thenReturn(g); + + List deletableVertexes = spy.getQueryEngine().findDeletable(genericVnf1); + Set vertexSet = new HashSet<>(); + + for (Vertex deletableVertex : deletableVertexes) { + if(!vertexSet.contains(deletableVertex)){ + vertexSet.add(deletableVertex); + } else { + fail("Find deletable is returning a list of duplicate vertexes"); + } + } } @After public void tearDown() throws Exception { + engine.rollback(); + } + + @AfterClass + public static void destroy() throws Exception { graph.close(); } @Test - public void subnetDelwithInEdgesIpv4Test() throws AAIException { + public void subnetDelWithInEdgesIpv4Test() throws AAIException { String expected_message = "Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types [l3-interface-ipv4-address-list]"; /* @@ -141,7 +183,7 @@ public class DbSerializerTest extends AAISetup { } @Test - public void subnetDelwithInEdgesIpv6Test() throws AAIException { + public void subnetDelWithInEdgesIpv6Test() throws AAIException { String expected_message = "Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types [l3-interface-ipv6-address-list]"; /* @@ -154,7 +196,7 @@ public class DbSerializerTest extends AAISetup { } @Test - public void subnetDelwithInEdgesL3network() throws AAIException { + public void subnetDelWithInEdgesL3network() throws AAIException { String expected_message = ""; /* @@ -169,7 +211,6 @@ public class DbSerializerTest extends AAISetup { public String testDelete(Vertex v) throws AAIException { - // Graph g_tx = graph.newTransaction(); GraphTraversalSource traversal = graph.traversal(); when(spy.asAdmin()).thenReturn(adminSpy); when(adminSpy.getTraversalSource()).thenReturn(traversal); @@ -181,7 +222,6 @@ public class DbSerializerTest extends AAISetup { serializer.delete(v, "resourceVersion", false); } catch (AAIException exception) { exceptionMessage = exception.getMessage(); - } return exceptionMessage; @@ -197,7 +237,7 @@ public class DbSerializerTest extends AAISetup { Vertex fromGraph = engine.tx().traversal().V().has("aai-node-type","generic-vnf").toList().get(0); assertEquals(testVertex.id(), fromGraph.id()); assertEquals("AAI-TEST", fromGraph.property(AAIProperties.SOURCE_OF_TRUTH.toString()).value()); - engine.rollback(); + } @Test @@ -205,22 +245,38 @@ public class DbSerializerTest extends AAISetup { engine.startTransaction(); DBSerializer dbser2 = new DBSerializer(Version.getLatest(), engine, introspectorFactoryType, "AAI-TEST-2"); - Graph graph = TinkerGraph.open(); Vertex vert = graph.addVertex("aai-node-type", "generic-vnf"); dbser.touchStandardVertexProperties(vert, true); - String resverStart = (String)vert.property(AAIProperties.RESOURCE_VERSION.toString()).value(); - String lastModTimeStart = (String)vert.property(AAIProperties.LAST_MOD_TS.toString()).value(); + String resverStart = (String)vert.property(AAIProperties.RESOURCE_VERSION).value(); + String lastModTimeStart = (String)vert.property(AAIProperties.LAST_MOD_TS).value(); Thread.sleep(10); //bc the resource version is set based on current time in milliseconds, //if this test runs through too fast the value may not change //causing the test to fail. sleeping ensures a different value dbser2.touchStandardVertexProperties(vert, false); - assertFalse(resverStart.equals((String)vert.property(AAIProperties.RESOURCE_VERSION.toString()).value())); - assertFalse(lastModTimeStart.equals((String)vert.property(AAIProperties.LAST_MOD_TS.toString()).value())); - assertEquals("AAI-TEST-2", (String)vert.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH.toString()).value()); - engine.rollback(); + assertFalse(resverStart.equals(vert.property(AAIProperties.RESOURCE_VERSION).value())); + assertFalse(lastModTimeStart.equals(vert.property(AAIProperties.LAST_MOD_TS).value())); + assertEquals("AAI-TEST-2", vert.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH).value()); + + } + + @Test + public void touchStandardVertexPropertiesAAIUUIDTest() throws AAIException, InterruptedException { + engine.startTransaction(); + + Graph graph = TinkerGraph.open(); + Vertex v = graph.addVertex("aai-node-type", "generic-vnf"); + + dbser.touchStandardVertexProperties(v, true); + + assertTrue(v.property(AAIProperties.AAI_UUID).isPresent()); + try { + UUID.fromString((String)v.property(AAIProperties.AAI_UUID).value()); + } catch (IllegalArgumentException e) { + fail("Vertex uuid is not valid uuid"); + } } @Test @@ -228,7 +284,7 @@ public class DbSerializerTest extends AAISetup { engine.startTransaction(); assertTrue(dbser.verifyResourceVersion("delete", "vnfc", "abc", "abc", "vnfcs/vnfc/vnfcId")); - engine.rollback(); + } @Test @@ -237,11 +293,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("resource-version passed for create of generic-vnfs/generic-vnf/myid"); - try { - dbser.verifyResourceVersion("create", "generic-vnf", null, "old-res-ver", "generic-vnfs/generic-vnf/myid"); - } finally { - engine.rollback(); - } + dbser.verifyResourceVersion("create", "generic-vnf", null, "old-res-ver", "generic-vnfs/generic-vnf/myid"); + } @Test @@ -250,11 +303,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("resource-version not passed for update of generic-vnfs/generic-vnf/myid"); - try { - dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", null, "generic-vnfs/generic-vnf/myid"); - } finally { - engine.rollback(); - } + dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", null, "generic-vnfs/generic-vnf/myid"); + } @Test @@ -263,11 +313,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("resource-version MISMATCH for update of generic-vnfs/generic-vnf/myid"); - try { - dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", "old-res-ver", "generic-vnfs/generic-vnf/myid"); - } finally { - engine.rollback(); - } + dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", "old-res-ver", "generic-vnfs/generic-vnf/myid"); + } @Test @@ -291,7 +338,7 @@ public class DbSerializerTest extends AAISetup { cr.property("aai-node-type").remove(); URI compareFailure = new URI("/unknown-uri"); assertEquals(compareFailure, dbser.getURIForVertex(ten)); - engine.rollback(); + } @Test @@ -304,7 +351,7 @@ public class DbSerializerTest extends AAISetup { assertEquals("cloud-region", crIntro.getDbName()); assertEquals("me", crIntro.getValue("cloud-owner")); assertEquals("123", crIntro.getValue("cloud-region-id")); - engine.rollback(); + } @Test @@ -334,7 +381,7 @@ public class DbSerializerTest extends AAISetup { (String)ten.property(AAIProperties.AAI_URI.toString()).value()); assertEquals("/cloud-infrastructure/cloud-regions/cloud-region/me/123/tenants/tenant/453/vservers/vserver/vs1", (String)vs.property(AAIProperties.AAI_URI.toString()).value()); - engine.rollback(); + } @Test @@ -347,8 +394,8 @@ public class DbSerializerTest extends AAISetup { rules.addTreeEdge(engine.tx().traversal(), cr, ten); Edge e = dbser.getEdgeBetween(EdgeType.TREE, ten, cr, null); - assertEquals("has", e.label()); - engine.rollback(); + assertEquals("org.onap.relationships.inventory.BelongsTo", e.label()); + } @Test @@ -372,7 +419,7 @@ public class DbSerializerTest extends AAISetup { assertFalse(engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertFalse(engine.tx().traversal().V(vnfc).both("uses").hasNext()); - engine.rollback(); + } @Test @@ -392,11 +439,11 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-data",relData); assertTrue(dbser.createEdge(relationship, gvnf)); - assertTrue(engine.tx().traversal().V(gvnf).both("uses").hasNext()); - assertTrue(engine.tx().traversal().V(vnfc).both("uses").hasNext()); - engine.rollback(); + assertTrue(engine.tx().traversal().V(gvnf).both("org.onap.relationships.inventory.BelongsTo").hasNext()); + assertTrue(engine.tx().traversal().V(vnfc).both("org.onap.relationships.inventory.BelongsTo").hasNext()); + } - + @Test public void createCousinEdgeThatShouldBeTreeTest() throws AAIException, UnsupportedEncodingException, URISyntaxException { engine.startTransaction(); @@ -405,31 +452,27 @@ public class DbSerializerTest extends AAISetup { Vertex vf = engine.tx().addVertex("aai-node-type","vf-module","vf-module-id","vf-id"); EdgeRules.getInstance().addTreeEdge(engine.tx().traversal(), gvnf, vf); - + Introspector relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vf-module"); relationship.setValue("related-link", dbser.getURIForVertex(vf).toString()); - //relationship.setValue("relationship-label", ""); Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf2 = dbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf-1"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf-1")); - + try { dbser.serializeToDb(gvnfObj, gvnf2, uriQuery, null, "test"); } catch (AAIException e) { assertEquals("AAI_6145", e.getCode()); - } - finally { - engine.rollback(); } } - + @Test public void createEdgeNodeDoesNotExistExceptionTest() throws AAIException, UnsupportedEncodingException { engine.startTransaction(); @@ -447,11 +490,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("Node of type vnfc. Could not find object at: /network/vnfcs/vnfc/b-name"); - try { - dbser.createEdge(relationship, gvnf); - } finally { - engine.rollback(); - } + dbser.createEdge(relationship, gvnf); + } @Test @@ -464,7 +504,7 @@ public class DbSerializerTest extends AAISetup { gvnf.setValue("vnf-id", "myvnf"); dbser.serializeSingleVertex(gvnfVert, gvnf, "test"); assertTrue(engine.tx().traversal().V().has("aai-node-type","generic-vnf").has("vnf-id","myvnf").hasNext()); - engine.rollback(); + } @Test @@ -483,10 +523,10 @@ public class DbSerializerTest extends AAISetup { dbser.serializeSingleVertex(ten, tenIn, "test"); assertTrue(engine.tx().traversal().V().has("aai-node-type","tenant").has("tenant-id","453").has("tenant-name","mytenant").hasNext()); - engine.rollback(); + } - - + + @Test public void getVertexPropertiesRelationshipHasLabelTest() throws AAIException, UnsupportedEncodingException { engine.startTransaction(); @@ -495,15 +535,21 @@ public class DbSerializerTest extends AAISetup { Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123"); EdgeRules rules = EdgeRules.getInstance(); rules.addEdge(engine.tx().traversal(), gvnf, vnfc); - + Introspector obj = loader.introspectorFromName("generic-vnf"); obj = this.dbser.dbToObject(Arrays.asList(gvnf), obj, AAIProperties.MAXIMUM_DEPTH, false, "false"); - - assertEquals("edge label between generic-vnf and vnfs is uses", "uses", obj.getWrappedValue("relationship-list").getWrappedListValue("relationship").get(0).getValue("relationship-label")); - - engine.rollback(); + + assertEquals("edge label between generic-vnf and vnfs is uses", + "org.onap.relationships.inventory.BelongsTo", + obj.getWrappedValue("relationship-list") + .getWrappedListValue("relationship") + .get(0) + .getValue("relationship-label") + ); + + } - + @Test public void getVertexPropertiesRelationshipOldVersionNoEdgeLabelTest() throws AAIException, UnsupportedEncodingException { @@ -512,7 +558,7 @@ public class DbSerializerTest extends AAISetup { Loader loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); engine.startTransaction(); - + Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","vnf-123"); Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123"); EdgeRules rules = EdgeRules.getInstance(); @@ -520,19 +566,19 @@ public class DbSerializerTest extends AAISetup { Introspector obj = loader.introspectorFromName("generic-vnf"); obj = dbser.dbToObject(Arrays.asList(gvnf), obj, AAIProperties.MAXIMUM_DEPTH, false, "false"); - + assertEquals("Relationship does not contain edge-property", false, obj.getWrappedValue("relationship-list").getWrappedListValue("relationship").get(0).hasProperty("relationship-label")); - - engine.rollback(); + + } - + @Test public void createEdgeWithValidLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); - + DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -547,16 +593,16 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "over-uses"); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("over-uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("over-uses").hasNext()); - engine.rollback(); + } - + @Test public void createEdgeWithInvalidLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -573,20 +619,17 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("no COUSIN edge rule between generic-vnf and vnfc with label NA"); - try { - dbser.createEdge(relationship, gvnf); - } finally { - engine.rollback(); - } + dbser.createEdge(relationship, gvnf); + } - + @Test public void createEdgeWithValidLabelWhenSameEdgeExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); - + DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -601,20 +644,20 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "re-uses"); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("re-uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("re-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V(vnfc).both().count().next()); - engine.rollback(); + } - + @Test public void createEdgeWithValidLabelWhenDiffEdgeExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -630,9 +673,9 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "uses"); localDbser.createEdge(relationship, gvnf); - + relationship.setValue("relationship-label", "re-uses"); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("re-uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("re-uses").hasNext()); @@ -640,15 +683,15 @@ public class DbSerializerTest extends AAISetup { assertTrue(engine.tx().traversal().V(vnfc).both("uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void createEdgeWithNoLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -662,23 +705,23 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); localDbser.createEdge(relationship, gvnf); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void deleteEdgeWithNoLabelWhenMultipleExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); - + DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -694,7 +737,7 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-to", "vnfc"); relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); - + assertTrue(localDbser.deleteEdge(relationship, gvnf)); assertFalse("generic-vnf has no edge uses", engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertFalse("vnfc has no edge uses", engine.tx().traversal().V(vnfc).both("uses").hasNext()); @@ -704,15 +747,15 @@ public class DbSerializerTest extends AAISetup { assertTrue("vnfc has edge re-uses", engine.tx().traversal().V(vnfc).both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void deleteEdgeWithValidLabelWhenMultipleExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -729,7 +772,7 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "re-uses"); - + assertTrue(localDbser.deleteEdge(relationship, gvnf)); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertTrue("vnfc has edge uses", engine.tx().traversal().V(vnfc).both("uses").hasNext()); @@ -739,15 +782,15 @@ public class DbSerializerTest extends AAISetup { assertTrue("vnfc has edge re-uses", engine.tx().traversal().V(vnfc).both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void deleteEdgeWithValidInvalidLabelWhenMultipleExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -764,24 +807,20 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "NA"); - + thrown.expect(AAIException.class); thrown.expectMessage("no COUSIN edge rule between generic-vnf and vnfc with label NA"); - try { - localDbser.deleteEdge(relationship, gvnf); - } finally { - engine.rollback(); - } + localDbser.deleteEdge(relationship, gvnf); } - + @Test public void serializeToDbWithLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); - + engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); Introspector relationship = loader.introspectorFromName("relationship"); @@ -790,16 +829,16 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-label", "re-uses"); Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf = localDbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertFalse("generic-vnf has no edge re-uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -810,17 +849,17 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge re-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } - + @Test public void serializeToDbWithoutLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); - + engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); Introspector relationship = loader.introspectorFromName("relationship"); @@ -829,16 +868,16 @@ public class DbSerializerTest extends AAISetup { Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf = localDbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -849,17 +888,17 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge over-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } - + @Test public void serializeToDbWithInvalidLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); - + engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); Introspector relationship = loader.introspectorFromName("relationship"); @@ -868,33 +907,29 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-label", "NA"); Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf = localDbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - + thrown.expect(AAIException.class); thrown.expectMessage("No EdgeRule found for passed nodeTypes: generic-vnf, vnfc with label NA."); - try { - localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - } finally { - engine.rollback(); - } - engine.rollback(); + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); + } - + @Test public void serializeToDbWithLabelAndEdgeExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); - + Introspector relationship; Introspector relationshipList; List relList = new ArrayList<>(); @@ -905,7 +940,7 @@ public class DbSerializerTest extends AAISetup { gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - // create relationship to vnfc + // create relationship to vnfc relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vnfc"); relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); @@ -913,10 +948,10 @@ public class DbSerializerTest extends AAISetup { relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + // add gvnf to graph localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + // add second relationship relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vnfc"); @@ -926,9 +961,9 @@ public class DbSerializerTest extends AAISetup { relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -939,18 +974,18 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge over-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } - + @Test public void serializeToDbWithLabelDroppingRelationshipTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); - + Introspector relationship; Introspector relationshipList; List relList = new ArrayList<>(); @@ -961,7 +996,7 @@ public class DbSerializerTest extends AAISetup { gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - // create relationship to vnfc + // create relationship to vnfc relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vnfc"); relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); @@ -975,18 +1010,18 @@ public class DbSerializerTest extends AAISetup { relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + // add gvnf to graph localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + // drop second relationship relList.remove(1); relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -997,7 +1032,7 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge over-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } private DBSerializer getDBSerializerWithSpecificEdgeRules(EdgeRules ers) @@ -1016,9 +1051,9 @@ public class DbSerializerTest extends AAISetup { Introspector gv = loader.introspectorFromName("generic-vnf"); gv.setValue("vnf-name", "myname"); Introspector rel = loader.introspectorFromName("relationship"); - DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, + DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, ModelType.MOXY, "AAI-TEST"); - + dbser.addRelatedToProperty(rel, gv); List relToProps = rel.getWrappedListValue("related-to-property"); assertTrue(relToProps.size() == 1); @@ -1026,40 +1061,40 @@ public class DbSerializerTest extends AAISetup { assertTrue("generic-vnf.vnf-name".equals(relToProp.getValue("property-key"))); assertTrue("myname".equals(relToProp.getValue("property-value"))); } - + @Test public void dbToObjectContainerMismatchTest() throws AAIException, UnsupportedEncodingException { - DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, + DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, ModelType.MOXY, "AAI-TEST"); - + Graph vertexMaker = TinkerGraph.open(); Vertex a = vertexMaker.addVertex(T.id, "0"); Vertex b = vertexMaker.addVertex(T.id, "1"); List vertices = Arrays.asList(a,b); - + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11); Introspector intro = loader.introspectorFromName("image"); //just need any non-container object - + thrown.expect(AAIException.class); thrown.expectMessage("query object mismatch: this object cannot hold multiple items."); - + dbser.dbToObject(vertices, intro, Integer.MAX_VALUE, true, "doesn't matter"); } - + @Test public void dbToObjectTest() throws AAIException, UnsupportedEncodingException { engine.startTransaction(); - - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + Vertex gv1 = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex gv2 = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id2"); List vertices = Arrays.asList(gv1, gv2); - + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); Introspector gvContainer = loader.introspectorFromName("generic-vnfs"); - + Introspector res = dbser.dbToObject(vertices, gvContainer, 0, true, "true"); List gvs = res.getWrappedListValue("generic-vnf"); assertTrue(gvs.size() == 2); @@ -1067,75 +1102,75 @@ public class DbSerializerTest extends AAISetup { String vnfId = i.getValue("vnf-id"); assertTrue("id1".equals(vnfId) || "id2".equals(vnfId)); } - - engine.rollback(); + + } - + @Test public void getEdgeBetweenNoLabelTest() throws AAIException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); Vertex gv = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex lint = engine.tx().addVertex("aai-node-type", "l-interface", "interface-name", "name1"); rules.addTreeEdge(engine.tx().traversal(), gv, lint); - + Edge res = dbser.getEdgeBetween(EdgeType.TREE, gv, lint); - assertTrue("hasLInterface".equals(res.label())); - engine.rollback(); + assertEquals("org.onap.relationships.inventory.BelongsTo", res.label()); + } @Test public void deleteItemsWithTraversal() throws AAIException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); Vertex gv = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex lint = engine.tx().addVertex("aai-node-type", "l-interface", "interface-name", "name1"); - + assertTrue(engine.tx().traversal().V().has("vnf-id", "id1").hasNext()); assertTrue(engine.tx().traversal().V().has("interface-name", "name1").hasNext()); - + dbser.deleteItemsWithTraversal(Arrays.asList(gv, lint)); - + assertTrue(!engine.tx().traversal().V().has("vnf-id", "id1").hasNext()); assertTrue(!engine.tx().traversal().V().has("interface-name", "name1").hasNext()); - - engine.rollback(); + + } - + @Test public void serializeToDbWithParentTest() throws AAIException, UnsupportedEncodingException, URISyntaxException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); Vertex gv = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex lint = engine.tx().addVertex("aai-node-type", "l-interface", "interface-name", "name1"); rules.addTreeEdge(engine.tx().traversal(), gv, lint); - + Introspector lintIntro = loader.introspectorFromName("l-interface"); lintIntro.setValue("interface-role", "actor"); URI lintURI = new URI("/network/generic-vnfs/generic-vnf/id1/l-interfaces/l-interface/name1"); QueryParser uriQuery = dbEngine.getQueryBuilder(gv).createQueryFromURI(lintURI); dbser.serializeToDb(lintIntro, lint, uriQuery, "test-identifier", "AAI-TEST"); - + assertTrue(engine.tx().traversal().V(lint).has("interface-role", "actor").hasNext()); - - engine.rollback(); + + } - + @Test public void getLatestVersionViewTest() throws AAIException, UnsupportedEncodingException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); - Vertex phys = engine.tx().addVertex("aai-node-type", "physical-link", "link-name", "zaldo", + Vertex phys = engine.tx().addVertex("aai-node-type", "physical-link", "link-name", "zaldo", "speed-value", "very-fast", "service-provider-bandwidth-up-units", "things"); - + Introspector res = dbser.getLatestVersionView(phys); assertTrue("zaldo".equals(res.getValue("link-name"))); assertTrue("very-fast".equals(res.getValue("speed-value"))); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java index bc6a721f..773b9cd2 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java @@ -22,9 +22,10 @@ package org.onap.aai.serialization.db; -import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.*; import org.junit.Test; import org.onap.aai.AAISetup; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -34,13 +35,11 @@ import java.util.Map; import java.util.Set; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.T; -import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.junit.Rule; import org.junit.rules.ExpectedException; +import org.onap.aai.db.props.AAIProperties; import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Version; import org.onap.aai.serialization.db.exceptions.EdgeMultiplicityException; @@ -61,7 +60,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, "cloud-region", "flavor"); - assertEquals("out direction", rule.getDirection(), Direction.OUT); + assertEquals("out direction", rule.getDirection(), Direction.IN); } @Test @@ -69,7 +68,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, "flavor", "cloud-region"); - assertEquals("in direction", rule.getDirection(), Direction.IN); + assertEquals("in direction", rule.getDirection(), Direction.OUT); } @Test @@ -77,7 +76,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "model-ver", "model-element"); - assertEquals("in direction", rule.getDirection(), Direction.IN); + assertEquals("in direction", Direction.IN, rule.getDirection()); } @Test @@ -85,21 +84,25 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "model-element", "model-ver"); - assertEquals("out direction", rule.getDirection(), Direction.OUT); + assertEquals("out direction", Direction.OUT, rule.getDirection()); } @Test public void verifyMultipleGet() throws AAIException { EdgeRules rules = EdgeRules.getInstance(); Map ruleMap = rules.getEdgeRules("model-element", "model-ver"); - assertEquals("has isA rule", "isA", ruleMap.get("isA").getLabel()); - assertEquals("has startsWith rule", "startsWith", ruleMap.get("startsWith").getLabel()); + assertEquals("has isA rule", "org.onap.relationships.inventory.IsA", + ruleMap.get("org.onap.relationships.inventory.IsA").getLabel()); + assertEquals("has startsWith rule", "org.onap.relationships.inventory.BelongsTo", + ruleMap.get("org.onap.relationships.inventory.BelongsTo").getLabel()); } @Test public void verifyMultipleGetSingleRule() throws AAIException { EdgeRules rules = EdgeRules.getInstance(); Map ruleMap = rules.getEdgeRules("availability-zone", "complex"); - assertEquals("has groupsResourcesIn rule", "groupsResourcesIn", ruleMap.get("groupsResourcesIn").getLabel()); + + assertEquals("has org.onap.relationships.inventory.LocatedIn rule", "org.onap.relationships.inventory.LocatedIn", + ruleMap.get("org.onap.relationships.inventory.LocatedIn").getLabel()); } @Test @@ -116,7 +119,7 @@ public class EdgeRulesTest extends AAISetup { assertEquals("true: pserver | complex", true, EdgeRules.getInstance().hasEdgeRule("pserver", "complex")); assertEquals("false: pserver | service", false, EdgeRules.getInstance().hasEdgeRule("pserver", "service")); } - + @Test public void hasTreeEdgeRuleTest() { assertEquals("true: cloud-region | tenant", true, EdgeRules.getInstance().hasTreeEdgeRule("cloud-region", "tenant")); @@ -125,7 +128,7 @@ public class EdgeRulesTest extends AAISetup { assertEquals("true: service-instance | allotted-resource", true, EdgeRules.getInstance().hasTreeEdgeRule("service-instance", "allotted-resource")); } - + @Test public void hasCousinEdgeRuleTest() { assertEquals("false: cloud-region | tenant", false, EdgeRules.getInstance().hasCousinEdgeRule("cloud-region", "tenant", null)); @@ -133,11 +136,11 @@ public class EdgeRulesTest extends AAISetup { assertEquals("true: pserver | complex", true, EdgeRules.getInstance().hasCousinEdgeRule("pserver", "complex", null)); assertEquals("true: service-instance | allotted-resource", true, EdgeRules.getInstance().hasCousinEdgeRule("service-instance", "allotted-resource", null)); assertEquals("true: logical-link | l-interface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", null)); - assertEquals("true: logical-link | l-interface : sourceLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "sourceLInterface")); - assertEquals("true: logical-link | l-interface : targetLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "targetLInterface")); + assertEquals("true: logical-link | l-interface : sourceLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "org.onap.relationships.inventory.Source")); + assertEquals("true: logical-link | l-interface : targetLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "org.onap.relationships.inventory.Destination")); assertEquals("false: logical-link | l-interface : blah", false, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "blah")); } - + @Test public void hasEdgeRuleVertexTest() { Graph graph = TinkerGraph.open(); @@ -153,11 +156,11 @@ public class EdgeRulesTest extends AAISetup { Vertex v2 = graph.addVertex("aai-node-type", "tenant"); EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, v1, v2); - assertEquals(true, "OUT".equalsIgnoreCase(rule.getContains())); - assertEquals(true, "OUT".equalsIgnoreCase(rule.getDeleteOtherV())); - assertEquals(true, MultiplicityRule.ONE2MANY.equals(rule.getMultiplicityRule())); - assertEquals(true, "IN".equalsIgnoreCase(rule.getServiceInfrastructure())); - assertEquals(true, "OUT".equalsIgnoreCase(rule.getPreventDelete())); + assertEquals(true, "IN".equalsIgnoreCase(rule.getContains())); + assertEquals(true, "NONE".equalsIgnoreCase(rule.getDeleteOtherV())); + assertEquals(true, MultiplicityRule.MANY2ONE.equals(rule.getMultiplicityRule())); + assertEquals(true, "OUT".equalsIgnoreCase(rule.getServiceInfrastructure())); + assertEquals(true, "IN".equalsIgnoreCase(rule.getPreventDelete())); } @Test @@ -168,7 +171,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); GraphTraversalSource g = graph.traversal(); rules.addTreeEdge(g, v1, v2); - assertEquals(true, g.V(v1).out("has").has("aai-node-type", "tenant").hasNext()); + assertEquals(true, g.V(v1).in("org.onap.relationships.inventory.BelongsTo").has("aai-node-type", "tenant").hasNext()); Vertex v3 = graph.addVertex(T.id, "2", "aai-node-type", "cloud-region"); assertEquals(null, rules.addTreeEdgeIfPossible(g, v3, v2)); @@ -182,7 +185,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); GraphTraversalSource g = graph.traversal(); rules.addEdge(g, v1, v2); - assertEquals(true, g.V(v2).out("hasFlavor").has("aai-node-type", "flavor").hasNext()); + assertEquals(true, g.V(v2).out("org.onap.relationships.inventory.Uses").has("aai-node-type", "flavor").hasNext()); Vertex v3 = graph.addVertex(T.id, "2", "aai-node-type", "flavor"); assertEquals(null, rules.addEdgeIfPossible(g, v3, v2)); @@ -191,7 +194,7 @@ public class EdgeRulesTest extends AAISetup { @Test public void multiplicityViolationTest() throws AAIException { thrown.expect(EdgeMultiplicityException.class); - thrown.expectMessage("multiplicity rule violated: only one edge can exist with label: uses between vf-module and volume-group"); + thrown.expectMessage("multiplicity rule violated: only one edge can exist with label: org.onap.relationships.inventory.Uses between vf-module and volume-group"); Graph graph = TinkerGraph.open(); Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "vf-module"); @@ -225,7 +228,7 @@ public class EdgeRulesTest extends AAISetup { public void getAllRulesTest() { EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); Multimap allRules = rules.getAllRules(); - assertEquals(14, allRules.size()); + assertEquals(16, allRules.size()); assertEquals(true, allRules.containsKey("foo|bar")); assertEquals(true, allRules.containsKey("foo|bar")); assertEquals(true, allRules.containsKey("quux|foo")); @@ -263,6 +266,15 @@ public class EdgeRulesTest extends AAISetup { // so if any required properties are missing, the verification builds // will catch it and incorrect rules can't get merged in. for (Version v : Version.values()) { + // NOt adding descriptions prior to v12 + switch (v.toString()) { + case "v7": + case "v8": + case "v9": + case "v10": + case "v11": + continue; + } EdgeRules rules = EdgeRules.getInstance(v); rules.getAllRules(); } @@ -277,23 +289,23 @@ public class EdgeRulesTest extends AAISetup { @Test public void verifyOutDirectionUsingLabel() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); - EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "generic-vnf", "l3-network", "usesL3Network"); + EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "generic-vnf", "l3-network", "org.onap.relationships.inventory.Uses"); assertEquals("out direction", rule.getDirection(), Direction.OUT); } @Test - public void verifyOutDirectionLinterfaceToLinterfaceUsingLabel() throws AAIException, NoEdgeRuleFoundException { + public void verifyInDirectionLinterfaceToLinterfaceUsingLabel() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, "l-interface", "l-interface"); - assertEquals("out direction", rule.getDirection(), Direction.OUT); + assertEquals("in direction", rule.getDirection(), Direction.IN); } @Test public void verifyOutFlippedDirectionUsingLabel() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); - EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "l3-network", "generic-vnf", "usesL3Network"); + EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "l3-network", "generic-vnf", "org.onap.relationships.inventory.Uses"); assertEquals("in direction", rule.getDirection(), Direction.IN); } @@ -348,4 +360,28 @@ public class EdgeRulesTest extends AAISetup { Map edgeRules = rules.getEdgeRulesWithLabels(EdgeType.COUSIN, "generic-vnf", "vnfc", labels); } + @Test + public void addEdgeVerifyAAIUUIDCousinTest() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "flavor"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "vserver"); + EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); + GraphTraversalSource g = graph.traversal(); + Edge e = rules.addEdge(g, v1, v2); + assertTrue(e.property(AAIProperties.AAI_UUID).isPresent()); + //assertTrue(e.property(AAIProperties.AAI_UUID).value().toString().matches("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")); + } + + @Test + public void addEdgeVerifyAAIUUIDTreeTest() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "tenant"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "vserver"); + EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); + GraphTraversalSource g = graph.traversal(); + Edge e = rules.addTreeEdge(g, v1, v2); + assertTrue(e.property(AAIProperties.AAI_UUID).isPresent()); + //assertTrue(e.property(AAIProperties.AAI_UUID).value().toString().matches("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")); + } + } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java b/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java index 4b4a0e64..55002a6f 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java @@ -19,7 +19,6 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - package org.onap.aai.serialization.engines.query; import static org.junit.Assert.*; @@ -31,6 +30,8 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; import org.apache.tinkerpop.gremlin.structure.Direction; @@ -51,7 +52,7 @@ import org.onap.aai.introspection.Version; import org.onap.aai.serialization.db.EdgeRules; public class GraphTraversalQueryEngineTest extends AAISetup { - + @Test public void testFindParents() throws AAIException { //setup @@ -236,13 +237,13 @@ public class GraphTraversalQueryEngineTest extends AAISetup { GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g); //test - List outRes = engine.findRelatedVertices(gv, Direction.OUT, "hasLInterface", "l-interface"); + List outRes = engine.findRelatedVertices(gv, Direction.IN, "org.onap.relationships.inventory.BelongsTo", "l-interface"); assertTrue(outRes.containsAll(outExpected) && outExpected.containsAll(outRes)); - - List inRes = engine.findRelatedVertices(log, Direction.IN, "usesLogicalLink", "l-interface"); + + List inRes = engine.findRelatedVertices(log, Direction.IN, "tosca.relationships.network.LinksTo", "l-interface"); assertTrue(inRes.containsAll(inExpected) && inExpected.containsAll(inRes)); - List bothRes = engine.findRelatedVertices(lint, Direction.BOTH, "usesLogicalLink", "logical-link"); + List bothRes = engine.findRelatedVertices(lint, Direction.BOTH, "tosca.relationships.network.LinksTo", "logical-link"); assertTrue(bothRes.containsAll(bothExpected) && bothExpected.containsAll(bothRes)); } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java new file mode 100644 index 00000000..a60eaf90 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java @@ -0,0 +1,83 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.serialization.queryformats; + +import static org.junit.Assert.*; +import org.junit.Test; +import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; + +import com.google.gson.JsonObject; + +public class ConsoleTest { + + + Console fM1 = new Console(); + + String param = "abcd"; + + JsonObject resultVal; + + @Test + public void classConsoleInstantiateCheck() { + + try { + Console fm1 = new Console(); + assertNotNull("Created class Object is null", fm1); + } + catch(Exception e) { + fail(); + } + } + + //Below method is expecting to throw an exception + + @Test(expected=NullPointerException.class) + public void formatObjectParamNullCheck() throws AAIFormatVertexException { + + param=null; + Console fm3 = new Console(); + resultVal = fm3.formatObject(param); + } + + @Test + public void formatObjectResultCheck() { + + try { + Console fm2 = new Console(); + + resultVal = fm2.formatObject(param); + assertNotNull("The result is null", resultVal); + + //System.out.println(resultVal); + + JsonObject jsonObj = new JsonObject(); + jsonObj.addProperty("result", "abcd"); + + assertEquals(jsonObj, resultVal); + + } + catch (Exception e) { + fail(); + } + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java new file mode 100644 index 00000000..8f418a43 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java @@ -0,0 +1,80 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.serialization.queryformats; + +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.*; +import static org.junit.Assert.assertEquals; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +public class GraphSONTest { + + private Graph graph; + private Vertex v1; + + //private JsonObject jsonObj = new JsonParser().parse("{\"id\":0,\"label\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"Sam\"}]}}").getAsJsonObject(); + private JsonObject jsonObj = new JsonObject() ; + private JsonObject properties = new JsonObject(); + private JsonArray name = new JsonArray() ; + private JsonObject idVal = new JsonObject() ; + + @Before + public void setUp() { + + jsonObj.addProperty("id", 0); + jsonObj.addProperty("label", "vertex"); + + idVal.addProperty("id", 1); + idVal.addProperty("value", "Sam"); + + name.add(idVal); + properties.add("name",name); + jsonObj.add("properties", properties); + + graph = TinkerGraph.open(); + v1 = graph.addVertex("name", "Sam"); + + } + + @Test + public void classGraphSONTestWithVertex(){ + + GraphSON graphSonObj1 = new GraphSON(); + JsonObject obj = graphSonObj1.formatObject(v1); + + assertEquals(jsonObj, obj); + } + + @Test + public void parallelThresholdCehck(){ + + GraphSON graphSonObj2 = new GraphSON(); + assertEquals(50, graphSonObj2.parallelThreshold()); + + } + + +} diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java index a33349fd..ae76467c 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java @@ -92,7 +92,7 @@ public class RawFormatTest extends AAISetup { @Test public void verifyPserverRelatedToHasEdgeLabel () throws AAIFormatVertexException, AAIException, AAIFormatQueryResultFormatNotSupported { - assertTrue(rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("locatedIn")); + assertTrue(rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("org.onap.relationships.inventory.LocatedIn")); } @Test @@ -102,7 +102,7 @@ public class RawFormatTest extends AAISetup { @Test public void verifyComplexRelatedToHasEdgeLabel () throws AAIFormatVertexException, AAIException, AAIFormatQueryResultFormatNotSupported { - assertTrue(rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("locatedIn")); + assertTrue(rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("org.onap.relationships.inventory.LocatedIn")); } @Test diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java index ec89aa30..fd3a8893 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java @@ -19,7 +19,6 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - package org.onap.aai.serialization.queryformats; import com.google.gson.JsonObject; diff --git a/aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java b/aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java new file mode 100644 index 00000000..b149e95f --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java @@ -0,0 +1,77 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import org.junit.Assert; +import org.junit.Test; + +public class AAICSVWriterTest { + + private final String TEMP_DIR=System.getProperty("java.io.tmpdir")+"/test.csv"; + + @Test + public void writeFile() throws IOException + { + + + FileWriter fileWriter = new FileWriter(TEMP_DIR); + AAICSVWriter aaicsvWriter = new AAICSVWriter(fileWriter, ",", '\'', null); + aaicsvWriter.writeColumn(new String[]{"id", "name", null}); + aaicsvWriter.writeColumn(null); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}, true); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", null}); + aaicsvWriter.writeNext(null); + aaicsvWriter.close(); + File file = new File(TEMP_DIR); + Assert.assertTrue("File shoud be exists", file.exists()); + } + + @Test + public void writeFile1() throws IOException + { + FileWriter fileWriter = new FileWriter(TEMP_DIR); + AAICSVWriter aaicsvWriter = new AAICSVWriter(fileWriter, ",", '\u0000', null); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}, true); + aaicsvWriter.writeNext(new String[]{"1", "Tes\"t@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\t@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Test,@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\n"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\r"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\u0000"}, false); + aaicsvWriter.close(); + File file = new File(TEMP_DIR); + Assert.assertTrue("File shoud be exists", file.exists()); + + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java b/aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java new file mode 100644 index 00000000..fcce479a --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java @@ -0,0 +1,105 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.assertEquals; + +import java.security.Permission; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.AAISetup; + +public class AAIConfigCommandLinePropGetterTest extends AAISetup { + + private SecurityManager m; + private TestSecurityManager sm; + + @Before + public void setUp() + { + m = System.getSecurityManager(); + sm = new TestSecurityManager(); + System.setSecurityManager(sm); + } + + @After + public void tearDown() + { + System.setSecurityManager(m); + } + + @Test + public void testMainNoArgs() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } + + @Test + public void testMainReadProp() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {"aai.primary.filetransfer.serverlist"}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } + + @Test + public void testMainOneArg() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {"one"}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } + + @Test + public void testMainMoreThanOneArg() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {"one", "two"}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } +} + +class TestSecurityManager extends SecurityManager { + @Override + public void checkPermission(Permission permission) { + if ("exitVM".equals(permission.getName())) + { + throw new SecurityException("System.exit attempted and blocked."); + } + } + @Override + public void checkExit(int status) { + throw new SecurityException(Integer.toString(status)); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java b/aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java new file mode 100644 index 00000000..f5daf3b0 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java @@ -0,0 +1,55 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.AAISetup; + +public class AAIRSyncUtilityTest extends AAISetup { + + private static AAIRSyncUtility syncUtility; + + @BeforeClass + public static void setUp() throws Exception { + syncUtility = new AAIRSyncUtility(); + } + + @Test(expected = NullPointerException.class) + public void testDoCommandNullCommands() throws Exception { + syncUtility.doCommand(null); + } + + @Test(expected = Exception.class) + public void testDoCommandEmptyCommands() throws Exception { + List commands = new ArrayList(); + syncUtility.doCommand(commands); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java b/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java new file mode 100644 index 00000000..bb754c0e --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java @@ -0,0 +1,78 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.*; + +import java.io.File; + +import org.junit.Test; +import org.mockito.Mockito; + +public class FileWatcherTest { + + class FileWatcherExtension extends FileWatcher { + + public FileWatcherExtension(File file) { + super(file); + } + + @Override + protected void onChange(File file) { + System.out.println("do nothing"); + } + } + + @Test + public void testFileWatcher() { + File file = new File("helloworld"); + file.setLastModified(new Long(123)); + FileWatcher fileWatcher = new FileWatcherExtension(file); + assertNotNull(fileWatcher); + file.deleteOnExit(); + } + + @Test(expected=NullPointerException.class) + public void testFileWatcher_nullConstructor() { + FileWatcher fileWatcher = new FileWatcherExtension(null); + assertNull(fileWatcher); + } + + @Test + public void testRun() { + // verify that code is reachable outside of conditional check in run() + File file = new File("helloworld"); + file.setLastModified(new Long(100)); + FileWatcher fileWatcher = new FileWatcherExtension(file); + fileWatcher.run(); + file.deleteOnExit(); + } + + @Test + public void testOnChange() throws Exception { + FileWatcher fileWatcher = Mockito.mock(FileWatcher.class, Mockito.CALLS_REAL_METHODS); + + fileWatcher.onChange(Mockito.any(File.class)); + + Mockito.verify(fileWatcher).onChange(Mockito.any(File.class)); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java b/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java index 9a36680b..9e1e33a5 100644 --- a/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java +++ b/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java @@ -21,35 +21,271 @@ */ package org.onap.aai.util; -import org.junit.Test; -import org.onap.aai.introspection.Version; +import static org.junit.Assert.*; -public class GenerateXsdTest { +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; - @Test - public void testGenerationOfXsdAndYaml() throws Exception { +import org.hamcrest.CoreMatchers; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; - GenerateXsd generateXsd = new GenerateXsd(); - System.setProperty("gen_version", Version.getLatest().toString()); - System.setProperty("gen_type", "XSD"); - System.setProperty("yamlresponses_url", ""); - System.setProperty("yamlresponses_label", ""); +import org.onap.aai.introspection.Version; - generateXsd.main(new String[]{}); - System.setProperty("gen_version", Version.getLatest().toString()); - System.setProperty("gen_type", "YAML"); +public class GenerateXsdTest { + private static final int maxSizeForXml = 20000; + private String testXML; + + @Before + public void setUp() throws Exception { + //PowerMockito.mockStatic(GenerateXsd.class); + StringBuilder sb = new StringBuilder(maxSizeForXml); + addNamespace(sb); + addRelationshipList(sb); + addRelationship(sb); + addRelatedToProperty(sb); + addRelationshipData(sb); + addBusiness(sb); + addCustomers(sb); + addCustomer(sb); + addServiceSubscriptions(sb); + addServiceSubscription(sb); + addEndOfXML(sb); + testXML = sb.toString(); + } + + private void addNamespace(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelationshipList(StringBuilder sb ) { + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("/n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelationship(StringBuilder sb ) { + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append(""); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelatedToProperty(StringBuilder sb) { + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelationshipData(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addBusiness(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addCustomers(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addCustomer(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addServiceSubscriptions(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + private void addServiceSubscription(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addEndOfXML(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + } + + + @Test + public void test_processOxmFile() { + - String wikiLink = System.getProperty("aai.wiki.link"); + GenerateXsd generateXsd = new GenerateXsd(); + + //GenerateXsd generateXsdSpy = PowerMockito.spy(generateXsd); - if(wikiLink == null){ - wikiLink = "https://wiki.onap.org/"; - } + //generateXsdSpy.processOxmFile(null, Version.getLatest(), testXML); - System.setProperty("yamlresponses_url", wikiLink); - System.setProperty("yamlresponses_label", "Response codes found in [response codes]"); + String xsdResult = generateXsd.processOxmFile(null, Version.getLatest(), testXML); + + String relationshipListExpected = " \n \n \n \n \n \n "; + String relatedToPropertyExpected = " \n \n \n \n \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Key part of a key/value pair\")\r\n \r\n \r\n \n" + + " \n \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Value part of a key/value pair\")\r\n \r\n \r\n \n \n \n "; + assertNotNull(xsdResult); + } + @Test + public void test_generateSwaggerFromOxmFile( ) { + - generateXsd.main(new String[]{}); - } + GenerateXsd generateXsd = new GenerateXsd(); + String customerOperation = " /business/customers/customer/{global-customer-id}:\n get:\n tags:\n - Business\n summary: returns customer"; + String relationshipListDefinition = " relationship-list:\n properties:\n relationship:\n type: array\n items: \n $ref: \"#/definitions/relationship\""; + String swaggerResult = generateXsd.generateSwaggerFromOxmFile(null, testXML); + assertNotNull(swaggerResult); + } } diff --git a/aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java b/aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java new file mode 100644 index 00000000..918f8974 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java @@ -0,0 +1,72 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.*; + + +import org.junit.Test; + + +public class HbaseSaltPrefixerTest { + + HbaseSaltPrefixer obj = HbaseSaltPrefixer.getInstance(); + + //Sample key value used for testing + String key = "foo1234"; + + String result = obj.prependSalt(key); + + @Test + public void classInstantiateCheck() { + try { + assertNotNull("Created class Object is not null", obj); + } + catch(Exception e) { + fail(); + } + } + + @Test + public void prependSaltResult_NullCheck () { + try { + assertNotNull("result is not null", result); + } + catch(NullPointerException e) { + fail(); + } + } + + @Test + public void prependSaltResult_PrefixSuccessChecks () { + try { + // Ensure that '-' has been prepended + assertFalse(result.startsWith("-")); + // Ensure that *something* has been prepended + assertFalse(result.equalsIgnoreCase(key)); + } + catch (Exception e) { + fail(); + } + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java b/aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java new file mode 100644 index 00000000..c05ffefc --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java @@ -0,0 +1,76 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +public class KeyValueListTest { + KeyValueList kv; + KeyValueList kv1; + + @Before + public void setup() { + String key = "key"; + String value = "value"; + kv = new KeyValueList(); + kv.setKey(key); + kv.setValue(value); + kv.setAdditionalProperty("name1", "val1"); + kv1 = new KeyValueList(); + kv1.setKey("key1"); + kv1.setValue("value1"); + } + + @Test + public void getSetTest() { + assertEquals("key", kv.getKey()); + assertEquals("value", kv.getValue()); + } + + @Test + public void additionalPropertyTest() { + assertEquals("Additional properties added", "val1", kv.getAdditionalProperties().get("name1")); + } + + @Test + public void hashCodeTest() { + assertEquals("Hashing function returns the same code", kv.hashCode(), kv.hashCode()); + assertNotEquals("Hashing function returns different code for different objects", kv.hashCode(), kv1.hashCode()); + } + + @Test + public void equalsTest() { + KeyValueList kv2 = new KeyValueList(); + kv2.setKey("key"); + kv2.setValue("value"); + kv2.setAdditionalProperty("name1", "val1"); + assertTrue("Equal KeyValueList objects", kv.equals(kv2)); + assertFalse("Non-equal KeyValueList objects", kv.equals(kv1)); + } + + @Test + public void toStringTest() { + assertNotEquals("Different objects should return different strings", kv.toString(), kv1.toString()); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java b/aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java new file mode 100644 index 00000000..dae2c22d --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java @@ -0,0 +1,72 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import org.json.JSONObject; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class MapperUtilTest { + + public class SampleClass { + private String color; + private String shape; + + public SampleClass(String c, String s){ + color = c; + shape = s; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getShape() { + return shape; + } + + public void setShape(String shape) { + this.shape = shape; + } + } + + private JSONObject expectedJson; + + @Before + public void setup(){ + expectedJson = new JSONObject(); + } + + @Test + public void writeAsJSONStringTest() throws Exception { + expectedJson.put("color", "black"); + expectedJson.put("shape", "box"); + SampleClass sample = new SampleClass("black", "box"); + assertEquals(expectedJson.toString(), MapperUtil.writeAsJSONString(sample)); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java b/aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java new file mode 100644 index 00000000..7121a82b --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java @@ -0,0 +1,107 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDateTime; +import java.time.Month; + +import org.junit.Test; +import org.mockito.Mockito; + +public class PojoUtilsTest { + + @Test + public void testGetJsonFromObject_Clazz_MockTest() throws Exception { + + String obj = "helloWorld"; + PojoUtils pojoUtils = Mockito.mock(PojoUtils.class); + Mockito.doCallRealMethod().when(pojoUtils).getJsonFromObject(Mockito.anyString()); + + pojoUtils.getJsonFromObject(obj); + + Mockito.verify(pojoUtils, Mockito.times(1)).getJsonFromObject(Mockito.anyString(), Mockito.eq(false), Mockito.eq(true)); + } + + @Test + public void testGetJsonFromObject_Clazz() throws Exception { + + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + LocalDateTime date = LocalDateTime.of(2017, Month.SEPTEMBER, 18, 10, 55, 0, 300); + + String res = pojoUtils.getJsonFromObject(date); + + assertNotNull(res); + assertTrue(res.contains("\"dayOfMonth\" : 18")); + assertTrue(res.contains("\"dayOfWeek\" : \"MONDAY\"")); + assertTrue(res.contains("\"dayOfYear\" : 261")); + assertTrue(res.contains("\"hour\" : 10")); + assertTrue(res.contains("\"minute\" : 55")); + assertTrue(res.contains("\"month\" : \"SEPTEMBER\"")); + assertTrue(res.contains("\"monthValue\" : 9")); + assertTrue(res.contains("\"nano\" : 300")); + assertTrue(res.contains("\"second\" : 0")); + assertTrue(res.contains("\"year\" : 2017")); + } + + @Test + public void testGetJsonFromObject_Clazz_null() throws Exception { + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + + String res = pojoUtils.getJsonFromObject(null); + + assertNotNull(res); + assertEquals("null", res); + } + + @Test + public void testGetJsonFromObject_null() throws Exception { + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + + String res = pojoUtils.getJsonFromObject(null, false, true); + + assertNotNull(res); + assertEquals("null", res); + } + + @Test + public void testGetJsonFromObject() throws Exception { + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + LocalDateTime date = LocalDateTime.of(2017, Month.SEPTEMBER, 18, 10, 55, 0, 300); + + String res = pojoUtils.getJsonFromObject(date, false, false); + assertNotNull(res); + + res = pojoUtils.getJsonFromObject(date, true, false); + assertNotNull(res); + + res = pojoUtils.getJsonFromObject(date, true, true); + assertNotNull(res); + } + + static PojoUtils getInstance() { + return new PojoUtils(); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java b/aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java new file mode 100644 index 00000000..e296b5e1 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java @@ -0,0 +1,63 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +import org.junit.Test; + +public class RestURLEncoderTest { + + @Test + public void testEncodeURL() throws Exception { + + String url = "nodeKeyTest&more-string strings"; + String encodedUrl = "nodeKeyTest%26more-string%20strings"; + + String res = RestURLEncoder.encodeURL(url); + assertEquals(encodedUrl, res); + } + + @Test + public void testEncodeURL_plusSign() throws Exception { + + String url = "nodeKeyTest+more+string"; + String encodedUrl = "nodeKeyTest%2Bmore%2Bstring"; + + String res = RestURLEncoder.encodeURL(url); + assertEquals(encodedUrl, res); + } + + @Test + public void testEncodeURL_noException() throws Exception { + // no exception expected, none thrown: passes. + try { + String encodeResult = RestURLEncoder.encodeURL(""); + + assertNotNull("Result is not null", encodeResult); + } catch (Exception e) { + fail(); + } + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java b/aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java new file mode 100644 index 00000000..5c87b29e --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java @@ -0,0 +1,235 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.util; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Map; + +import javax.json.Json; +import javax.json.JsonObject; + +import org.eclipse.persistence.dynamic.DynamicEntity; +import org.eclipse.persistence.dynamic.DynamicType; +import org.eclipse.persistence.jaxb.JAXBContextProperties; +import org.eclipse.persistence.jaxb.JAXBMarshaller; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.AAISetup; +import org.onap.aai.dmaap.AAIDmaapEventJMSProducer; +import org.onap.aai.domain.notificationEvent.NotificationEvent.EventHeader; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; + +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; + +public class StoreNotificationEventTest extends AAISetup { + + private static AAIDmaapEventJMSProducer producer; + private static StoreNotificationEvent sne; + + @BeforeClass + public static void setUp() throws Exception { + producer = Mockito.mock(AAIDmaapEventJMSProducer.class); + sne = new StoreNotificationEvent(producer, "transiationId", "sourceOfTruth"); + } + + @Test(expected = AAIException.class) + public void testStoreEventNullObj() throws AAIException { + sne.storeEvent(new EventHeader(), null); + } + + @Test(expected = AAIException.class) + public void testStoreEventInvalidObjForPojoUtils() throws AAIException { + sne.storeEvent(new EventHeader(), new Object()); + } + + @Test + public void testStoreEventEmptyEventHeader() throws AAIException, JsonGenerationException, JsonMappingException, IOException { + JsonObject object = Json.createObjectBuilder().add("hello", "world").build(); + String res = sne.storeEvent(new EventHeader(), object); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\" : \"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\"")); + assertTrue(res.contains("\"timestamp\"")); + assertTrue(res.contains("\"source-name\" : \"" + AAIConfig.get("aai.notificationEvent.default.sourceName") + "\"")); + assertTrue(res.contains("\"domain\" : \"" + AAIConfig.get("aai.notificationEvent.default.domain") + "\"")); + assertTrue(res.contains("\"sequence-number\" : \"" + AAIConfig.get("aai.notificationEvent.default.sequenceNumber") + "\"")); + assertTrue(res.contains("\"severity\" : \"" + AAIConfig.get("aai.notificationEvent.default.severity") + "\"")); + assertTrue(res.contains("\"event-type\" : \"" + AAIConfig.get("aai.notificationEvent.default.eventType") + "\"")); + assertTrue(res.contains("\"version\" : \"" + AAIConfig.get("aai.notificationEvent.default.version") + "\"")); + assertTrue(res.contains("\"action\" : \"UNK\"")); + assertTrue(res.contains("\"entity-link\" : \"UNK\"")); + assertTrue(res.contains("\"entity\"")); + assertTrue(res.contains("\"hello\"")); + assertTrue(res.contains("\"chars\" : \"world\"")); + assertTrue(res.contains("\"string\" : \"world\"")); + assertTrue(res.contains("\"valueType\" : \"STRING\"")); + } + + @Test + public void testStoreEvent() throws AAIException, JsonGenerationException, JsonMappingException, IOException { + JsonObject object = Json.createObjectBuilder().add("hello", "world").build(); + EventHeader eh = new EventHeader(); + eh.setId("123"); + eh.setTimestamp("current-time"); + eh.setEntityLink("entity-link"); + eh.setAction("action!"); + eh.setEventType("surprise"); + eh.setDomain("PROD"); + eh.setSourceName("source"); + eh.setSequenceNumber("23"); + eh.setSeverity("ALERT"); + eh.setVersion("v11"); + + String res = sne.storeEvent(eh, object); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\" : \"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\" : \"123\"")); + assertTrue(res.contains("\"timestamp\" : \"current-time\"")); + assertTrue(res.contains("\"source-name\" : \"source\"")); + assertTrue(res.contains("\"domain\" : \"PROD\"")); + assertTrue(res.contains("\"sequence-number\" : \"23\"")); + assertTrue(res.contains("\"severity\" : \"ALERT\"")); + assertTrue(res.contains("\"event-type\" : \"surprise\"")); + assertTrue(res.contains("\"version\" : \"v11\"")); + assertTrue(res.contains("\"action\" : \"action!\"")); + assertTrue(res.contains("\"entity-link\" : \"entity-link\"")); + assertTrue(res.contains("\"entity\"")); + assertTrue(res.contains("\"hello\"")); + assertTrue(res.contains("\"chars\" : \"world\"")); + assertTrue(res.contains("\"string\" : \"world\"")); + assertTrue(res.contains("\"valueType\" : \"STRING\"")); + } + + @Test(expected=AAIException.class) + public void testStoreDynamicEventNullObj() throws AAIException { + DynamicEntity eventHeader = Mockito.mock(DynamicEntity.class); + DynamicJAXBContext notificationJaxbContext = Mockito.mock(DynamicJAXBContext.class); + sne.storeDynamicEvent(notificationJaxbContext, "v11", eventHeader, null); + } + + @Test(expected = AAIException.class) + public void testStoreDynamicEventAAIException() throws Exception { + DynamicEntity eventHeader = Mockito.mock(DynamicEntity.class); + DynamicEntity obj = Mockito.mock(DynamicEntity.class); + DynamicJAXBContext notificationJaxbContext = Mockito.mock(DynamicJAXBContext.class); + ClassLoader cl = getClass().getClassLoader(); + InputStream is = cl.getResourceAsStream("bundleconfig-local/etc/oxm/aai_oxm_v11.xml"); + Map properties = new HashMap(); + properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, is); + DynamicJAXBContext notificationJaxbContextReal = DynamicJAXBContextFactory.createContextFromOXM(cl, properties); + DynamicType dtReal = notificationJaxbContextReal.getDynamicType("inventory.aai.onap.org.v11.NotificationEvent"); + DynamicType dt = Mockito.mock(DynamicType.class); + DynamicEntity notificationEventReal = dtReal.newDynamicEntity(); + JAXBMarshaller marshaller = Mockito.mock(JAXBMarshaller.class); + + Mockito.when(notificationJaxbContext.getDynamicType(Mockito.anyString())).thenReturn(dt); + Mockito.when(dt.newDynamicEntity()).thenReturn(notificationEventReal); + Mockito.when(notificationJaxbContext.createMarshaller()).thenReturn(marshaller); + Mockito.doNothing().when(marshaller).marshal(Mockito.any(DynamicJAXBContext.class), Mockito.any(StringWriter.class)); + + sne.storeDynamicEvent(notificationJaxbContext, "v11", eventHeader, obj); + } + + @Test(expected = AAIException.class) + public void testStoreEventIntrospectorNullObj() throws Exception { + Loader loader = Mockito.mock(Loader.class); + sne.storeEvent(loader, null, null); + } + + @Test + public void testStoreEventIntrospector() throws Exception { + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11); + Introspector eventHeader = loader.introspectorFromName("notification-event-header"); + eventHeader.setValue("id", "123"); + eventHeader.setValue("timestamp", "current-time"); + eventHeader.setValue("entity-link", "entity-link"); + eventHeader.setValue("action", "action!"); + eventHeader.setValue("event-type", "surprise"); + eventHeader.setValue("domain", "PROD"); + eventHeader.setValue("source-name", "source"); + eventHeader.setValue("sequence-number", "23"); + eventHeader.setValue("severity", "ALERT"); + eventHeader.setValue("version", "v11"); + + Introspector obj = loader.introspectorFromName("notification-event"); + + String res = sne.storeEvent(loader, eventHeader, obj); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\":\"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\":\"123\"")); + assertTrue(res.contains("\"timestamp\":\"current-time\"")); + assertTrue(res.contains("\"source-name\":\"source\"")); + assertTrue(res.contains("\"domain\":\"PROD\"")); + assertTrue(res.contains("\"sequence-number\":\"23\"")); + assertTrue(res.contains("\"severity\":\"ALERT\"")); + assertTrue(res.contains("\"event-type\":\"surprise\"")); + assertTrue(res.contains("\"version\":\"v11\"")); + assertTrue(res.contains("\"action\":\"action!\"")); + assertTrue(res.contains("\"entity-link\":\"entity-link\"")); + assertTrue(res.contains("\"notification-event\"")); + } + + @Test + public void testStoreEventIntrospectorEmptyEventHeader() throws Exception { + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11); + Introspector eventHeader = loader.introspectorFromName("notification-event-header"); + Introspector obj = loader.introspectorFromName("notification-event"); + + String res = sne.storeEvent(loader, eventHeader, obj); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\":\"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\"")); + assertTrue(res.contains("\"timestamp\"")); + assertTrue(res.contains("\"source-name\":\"" + AAIConfig.get("aai.notificationEvent.default.sourceName") + "\"")); + assertTrue(res.contains("\"domain\":\"" + AAIConfig.get("aai.notificationEvent.default.domain") + "\"")); + assertTrue(res.contains("\"sequence-number\":\"" + AAIConfig.get("aai.notificationEvent.default.sequenceNumber") + "\"")); + assertTrue(res.contains("\"severity\":\"" + AAIConfig.get("aai.notificationEvent.default.severity") + "\"")); + assertTrue(res.contains("\"event-type\":\"" + AAIConfig.get("aai.notificationEvent.default.eventType") + "\"")); + assertTrue(res.contains("\"version\":\"" + AAIConfig.get("aai.notificationEvent.default.version") + "\"")); + assertTrue(res.contains("\"action\":\"UNK\"")); + assertTrue(res.contains("\"entity-link\":\"UNK\"")); + assertTrue(res.contains("\"notification-event\"")); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java b/aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java new file mode 100644 index 00000000..ebcaf750 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.aai.workarounds; + +import org.junit.Test; +import org.onap.aai.AAISetup; +import org.onap.aai.introspection.Version; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.junit.Assert.assertEquals; + + +public class LegacyURITransformerTest extends AAISetup { + + private LegacyURITransformer uriTransformer = LegacyURITransformer.getInstance(); + private String fromSuccess = "http://myhostname.com:8443/aai/{version}/cloud-infrastructure/tenants/tenant/key1/vservers/vserver/key2"; + private String toSuccess = "http://myhostname.com:8443/aai/servers/{version}/key1/vservers/key2"; + + + /** + * V 5. + * @throws URISyntaxException + * + * @throws MalformedURLException the malformed URL exception + */ + @Test + public void v5() throws URISyntaxException { + testSpec(Version.v8, fromSuccess, fromSuccess); + } + + + /** + * Test spec. + * + * @param version the version + * @param toExpected the to expected + * @param fromExpected the from expected + * @throws URISyntaxException + * @throws MalformedURLException the malformed URL exception + */ + public void testSpec(Version version, String toExpected, String fromExpected) throws URISyntaxException { + + URI toExpectedUri = new URI(toExpected.replace("{version}",version.toString())); + URI fromExpectedUri = new URI(fromExpected.replace("{version}",version.toString())); + + URI result = toLegacyURISpec(version, fromExpectedUri); + + assertEquals("to", toExpectedUri, result); + + result = fromLegacyURISpec(version, toExpectedUri); + + assertEquals("from", fromExpectedUri, result); + } + + + /** + * To legacy URL spec. + * + * @param version the version + * @param url the url + * @return the url + * @throws URISyntaxException + * @throws MalformedURLException the malformed URL exception + */ + public URI toLegacyURISpec(Version version, URI uri) throws URISyntaxException { + return uri; + } + + /** + * From legacy URL spec. + * + * @param version the version + * @param url the url + * @return the url + * @throws URISyntaxException + * @throws MalformedURLException the malformed URL exception + */ + public URI fromLegacyURISpec(Version version, URI uri) throws URISyntaxException { + return uri; + } + + +} diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties index c91976f3..d484a415 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -20,10 +20,74 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. # -aai.server.url.base=https://baseurl:8443/aai/ +#################################################################### +# REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE +# TEMPLATE AND *ALL* DATAFILES +#################################################################### + +aai.config.checktime=1000 + +# this could come from siteconfig.pl? +aai.config.nodename=AutomaticallyOverwritten + +aai.logging.hbase.interceptor=true +aai.logging.hbase.enabled=true +aai.logging.hbase.logrequest=true +aai.logging.hbase.logresponse=true + +aai.logging.trace.enabled=true +aai.logging.trace.logrequest=false +aai.logging.trace.logresponse=false + +aai.transaction.logging=true +aai.transaction.logging.get=true +aai.transaction.logging.post=true + +aai.server.url.base=https://localhost:8443/aai/ +aai.server.url=https://localhost:8443/aai/v12/ +aai.global.callback.url=https://localhost:8443/aai/ + +aai.default.api.version=v12 aai.resourceversion.enableflag=true -aai.logging.maxStackTraceEntries=10 -aai.default.api.version=v9 + +aai.notification.current.version=v12 +aai.notificationEvent.default.status=UNPROCESSED +aai.notificationEvent.default.eventType=AAI-EVENT +aai.notificationEvent.default.domain=devINT1 +aai.notificationEvent.default.sourceName=aai +aai.notificationEvent.default.sequenceNumber=0 +aai.notificationEvent.default.severity=NORMAL +aai.notificationEvent.default.version=v12 + + +# Used by Model-processing code +aai.model.delete.sleep.per.vtx.msec=500 +aai.model.query.resultset.maxcount=50 +aai.model.query.timeout.sec=90 + +# Used by Data Grooming +aai.grooming.default.max.fix=150 +aai.grooming.default.sleep.minutes=7 + +# Used by DupeTool +aai.dupeTool.default.max.fix=25 +aai.dupeTool.default.sleep.minutes=7 + +aai.model.proc.max.levels=50 +aai.edgeTag.proc.max.levels=50 + +# Used by the ForceDelete tool +aai.forceDel.protected.nt.list=cloud-region +aai.forceDel.protected.edge.count=10 +aai.forceDel.protected.descendant.count=10 + +# Used for CTAG-Pool generation +aai.ctagPool.rangeString.vplsPe1=2001-2500 +aai.ctagPool.rangeString.vplsPe2=2501-3000 + +aai.dmaap.workload.enableEventProcessing=true + +aai.realtime.clients=JUNIT aai.server.rebind=g aai.run.migrations=false diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties index 11416ca4..da9f5e5b 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties +++ b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties @@ -49,18 +49,13 @@ AAI_4008=5:4:ERROR:4008:500:3002:Output parsing error AAI_4009=4:0:ERROR:4009:400:3000:Invalid X-FromAppId in header AAI_4010=4:0:ERROR:4010:400:3000:Invalid X-TransactionId in header AAI_4011=5:4:ERROR:4011:500:3002:Missing data for REST error response -AAI_4012=5:4:ERROR:4012:500:3002:Bad rule data in RestRules -AAI_4013=5:4:ERROR:4013:500:3002:Error connecting to AAI REST API AAI_4014=4:0:ERROR:4014:400:3000:Invalid Accept header AAI_4015=4:0:ERROR:4015:400:3000:You must provide at least one indexed property AAI_4016=4:0:ERROR:4016:400:3000:The depth parameter must be a number or the string "all" AAI_4017=5:2:INFO:4017:400:3000:Could not set property AAI_4018=5:2:ERROR:4018:400:3000:Unable to convert the string to integer -#--- aaidbmap: 5101-5199 -AAI_5101=5:4:FATAL:5101:500:3002:Could not connect to database +#--- aaidbmap: 5102-5199 AAI_5102=5:4:FATAL:5102:500:3002:Graph database is null after open -AAI_5103=5:4:ERROR:5103:500:3002:Unexpected error during commit -AAI_5104=5:4:ERROR:5104:500:3002:Unexpected error during rollback AAI_5105=5:4:ERROR:5105:500:3002:Unexpected error reading/updating database AAI_5106=5:4:WARN:5106:404:3001:Node not found AAI_5107=5:2:WARN:5107:400:3000:Required information missing @@ -148,6 +143,7 @@ AAI_7401=5:4:ERROR:7401:500:3002:Error connecting to AAI REST API AAI_7402=5:4:ERROR:7402:500:3002:Unexpected error AAI_7403=5:4:WARN:7403:400:3001:Request error AAI_7404=5:4:INFO:7404:404:3001:Node not found +AAI_7405=5:4:WARN:7405:200:0:UUID not formatted correctly, generating UUID #--- aaiauth: 9101-9199 AAI_9101=5:0:WARN:9101:403:3300:User is not authorized to perform function diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml index d3c46600..51eaa349 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml @@ -23,5819 +23,5416 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml index ecbfefb8..90d023ce 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml @@ -24,7 +24,7 @@ --> - + @@ -33,7 +33,7 @@ - + @@ -229,6 +229,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -258,7 +522,7 @@ - + @@ -296,6 +560,22 @@ + + + + + + + + + + + + + + + + @@ -311,9 +591,12 @@ + + + - + @@ -582,6 +865,11 @@ + + + + + @@ -593,7 +881,7 @@ - + @@ -743,7 +1031,23 @@ - + + + + + + + + + + + + + + + + + @@ -899,7 +1203,7 @@ - + @@ -953,7 +1257,7 @@ - + @@ -968,6 +1272,17 @@ + + + + + + + + + + + @@ -975,8 +1290,7 @@ - - + @@ -1030,7 +1344,7 @@ - + @@ -1275,6 +1589,7 @@ + @@ -1602,6 +1917,16 @@ + + + + + + + + + + @@ -1669,6 +1994,11 @@ + + + + + @@ -1680,7 +2010,13 @@ + + + + + + @@ -1839,7 +2175,7 @@ - + @@ -1898,34 +2234,39 @@ - - + + + + + - + + + + + + - - + + + + + - + - - + + - - - - - - - - - - - + + + + + @@ -1934,24 +2275,12 @@ - - - - - - - - - - - - + + + + + - - - - - @@ -1981,6 +2310,7 @@ + @@ -1988,6 +2318,7 @@ + @@ -2070,6 +2401,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2134,10 +2573,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2145,6 +2621,7 @@ + @@ -2195,11 +2672,6 @@ - - - - - @@ -2226,7 +2698,7 @@ - + @@ -2262,7 +2734,7 @@ - + @@ -2296,8 +2768,8 @@ - - + + @@ -2413,9 +2885,99 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2436,6 +2998,12 @@ + + + + + + @@ -2453,7 +3021,7 @@ - + @@ -2470,6 +3038,7 @@ + @@ -2477,6 +3046,7 @@ + @@ -2612,7 +3182,6 @@ - @@ -2739,11 +3308,6 @@ - - - - - @@ -2754,14 +3318,19 @@ - + - + - + - + + + + + + @@ -2770,7 +3339,6 @@ - @@ -2780,48 +3348,14 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2964,7 +3498,7 @@ - + @@ -3167,14 +3701,14 @@ - + - + - + - + @@ -3209,15 +3743,31 @@ + + + + + + + + + + + + + + + + - + @@ -3309,6 +3859,7 @@ + @@ -3316,6 +3867,7 @@ + @@ -3518,14 +4070,24 @@ - + + + + + + + + + + + - + - + - + @@ -3533,6 +4095,12 @@ + + + + + + @@ -3565,6 +4133,11 @@ + + + + + @@ -3593,9 +4166,10 @@ + - + @@ -3613,6 +4187,22 @@ + + + + + + + + + + + + + + + + @@ -3680,6 +4270,21 @@ + + + + + + + + + + + + + + + @@ -3731,6 +4336,7 @@ + @@ -3738,6 +4344,7 @@ + @@ -3776,6 +4383,7 @@ + @@ -3786,6 +4394,7 @@ + @@ -3797,7 +4406,27 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -3814,6 +4443,8 @@ + + @@ -3865,6 +4496,7 @@ + @@ -3872,6 +4504,7 @@ + @@ -3995,7 +4628,7 @@ - + @@ -4245,7 +4878,27 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -4355,7 +5008,7 @@ - + @@ -4385,7 +5038,7 @@ - + @@ -4497,11 +5150,10 @@ - - - - - + + + + @@ -5041,7 +5693,7 @@ - + @@ -5049,7 +5701,7 @@ - + @@ -5107,6 +5759,23 @@ + + + + + + + + + + + + + + + + + @@ -5139,6 +5808,7 @@ + @@ -5211,6 +5881,7 @@ + @@ -5218,6 +5889,7 @@ + @@ -5473,368 +6145,218 @@ - + - + - + - + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + - - + - + - - + - + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + - + - + - + - + - - - - + - + - - - - + - + - - - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml index 30fe6b6f..2364cf82 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml @@ -225,7 +225,7 @@ - + @@ -501,6 +501,7 @@ + @@ -519,7 +520,7 @@ - + @@ -582,7 +583,7 @@ - + @@ -670,7 +671,7 @@ - + @@ -1950,6 +1951,11 @@ + + + + + @@ -2633,22 +2639,22 @@ - + - + - + - + @@ -2871,395 +2877,31 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + @@ -3271,7 +2913,7 @@ - + @@ -3293,26 +2935,36 @@ - + - + - - + + - + + + + + + + + + + + @@ -3320,14 +2972,15 @@ + + - - + + - @@ -3372,7 +3025,7 @@ - + @@ -5064,6 +4717,11 @@ + + + + + @@ -5494,8 +5152,10 @@ - - + + + + @@ -5505,6 +5165,7 @@ + @@ -5562,7 +5223,7 @@ - + @@ -5582,6 +5243,11 @@ + + + + + @@ -6309,22 +5975,22 @@ - + - + - + - + @@ -6711,5 +6377,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml deleted file mode 100644 index eba7c4b9..00000000 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml +++ /dev/null @@ -1,1729 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml index 7474362f..d666b738 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml @@ -24,30 +24,332 @@ --> - + - - + + - + + + + + + + - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,13 +358,13 @@ - - - - - + + + + + @@ -119,5 +421,4235 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml index bfd67319..ecffb2fc 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml @@ -23,5580 +23,5308 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + - + - + - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + - + - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - + - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json index 241cc146..c6407e2c 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json @@ -1,10 +1,10 @@ { - "related-to": "test-object", + "related-to": "generic-vnf", "relationship-data" : [{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key1" },{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key2" }] } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json index 0f0378d9..5bafc9ff 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json @@ -1,8 +1,8 @@ { - "related-to": "test-object", - "related-link": "/aai/v10/network/test-objects/test-objet/key1", + "related-to": "generic-vnf", + "related-link": "/aai/v10/network/generic-vnfs/test-objet/key1", "relationship-data" : [{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key2" }] } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json index 490bbd30..3afe6bb7 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json @@ -1,6 +1,6 @@ { - "related-to": "test-object", - "related-link": "http://localhost/aai/v10/network/test-objects/test-object/key1", + "related-to": "generic-vnf", + "related-link": "http://localhost/aai/v10/network/generic-vnfs/generic-vnf/key1", "relationship-data" : [{ "relationship-key" : "test-obect.vnf-id", "relationship-value":"key2" diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json index ea5ff2fe..b24834af 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json @@ -1,4 +1,4 @@ { - "related-to": "test-object", + "related-to": "generic-vnf", "relationship-data" : [] } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json index 15e383aa..4cc103e8 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json @@ -1,4 +1,4 @@ { - "related-to": "test-object", - "related-link": "http://localhost/aai/v10/network/test-objects/test-object/key1" + "related-to": "generic-vnf", + "related-link": "http://localhost/aai/v10/network/generic-vnfs/generic-vnf/key1" } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json index dc7445e0..b9fccc9c 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json @@ -1,7 +1,7 @@ { - "related-to": "test-object", + "related-to": "generic-vnf", "relationship-data" : [{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key1" }] } \ No newline at end of file diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json index 0b79192a..515831e9 100644 --- a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json @@ -10,7 +10,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "vnfc", @@ -21,7 +22,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "vce", @@ -33,7 +35,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "pserver", @@ -45,7 +48,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -57,7 +61,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -68,7 +73,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "complex", @@ -80,7 +86,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "complex", @@ -91,7 +98,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "l-interface", @@ -103,7 +111,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "l-interface", @@ -115,7 +124,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "false" + "default": "false", + "description": "Hard to describe" }, { "from": "l-interface", @@ -127,7 +137,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "false" + "default": "false", + "description": "Hard to describe" }, { "from": "pserver", @@ -139,7 +150,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" } ] } diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json index 76059ed6..9888ed76 100644 --- a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json @@ -9,7 +9,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "foo", @@ -20,7 +21,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "foo", @@ -31,7 +33,8 @@ "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "quux", @@ -42,7 +45,8 @@ "contains-other-v": "!${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "test-parent", @@ -53,7 +57,8 @@ "contains-other-v": "${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "test-cousin", @@ -64,7 +69,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "test-child", @@ -75,8 +81,9 @@ "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" - }, + "prevent-delete": "NONE", + "description": "Hard to describe" + }, { "from": "a", "to": "b", @@ -87,7 +94,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "false" + "default": "false", + "description": "Hard to describe" }, { "from": "a", @@ -99,7 +107,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default" : "true" + "default" : "true", + "description": "Hard to describe" }, { "from": "z", @@ -110,7 +119,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "y", @@ -122,7 +132,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default" : "true" + "default" : "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -134,7 +145,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -145,7 +157,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -156,6 +169,30 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe", + "prevent-delete": "NONE" + }, + { + "from": "l-interface", + "to": "logical-link", + "label": "usesLogicalLink", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE" + }, + { + "from": "generic-vnf", + "to": "l-interface", + "label": "hasLInterface", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE" } ] diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json index d4b7f7f3..f9d401f2 100644 --- a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json @@ -8,7 +8,8 @@ "multiplicity": "One2Many", "contains-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "foo", @@ -19,7 +20,8 @@ "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "quux", @@ -29,7 +31,8 @@ "multiplicity": "One2Many", "contains-other-v": "!${direction}", "delete-other-v": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" } ] } \ No newline at end of file diff --git a/aai-core/src/test/resources/edgeLabelMigration.csv b/aai-core/src/test/resources/edgeLabelMigration.csv new file mode 100644 index 00000000..53639e55 --- /dev/null +++ b/aai-core/src/test/resources/edgeLabelMigration.csv @@ -0,0 +1,212 @@ +from,to,label,direction,multiplicity,contains-other-v,delete-other-v,SVC-INFRA,prevent-delete,new from,new to,new label,new direction,new multiplicity,new contains-other-v,new delete-other-v,new SVC-INFRA,new prevent-delete,new default +allotted-resource,allotted-resource,bindsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,allotted-resource,allotted-resource,tosca.relationships.network.BindsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +allotted-resource,generic-vnf,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,generic-vnf,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,l3-network,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,l3-network,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,l-interface,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,allotted-resource,l-interface,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,network-policy,uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,allotted-resource,network-policy,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +allotted-resource,vlan,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,vlan,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,vpn-binding,belongsTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},allotted-resource,vpn-binding,org.onap.relationships.inventory.BelongsTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +allotted-resource,tunnel-xconnect,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,tunnel-xconnect,allotted-resource,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +availability-zone,complex,groupsResourcesIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},availability-zone,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +availability-zone,service-capability,supportsServiceCapability,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},availability-zone,service-capability,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +cloud-region,availability-zone,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},availability-zone,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +cloud-region,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},cloud-region,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +cloud-region,l3-network,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,cloud-region,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +cloud-region,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,cloud-region,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +cloud-region,dvs-switch,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},dvs-switch,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,flavor,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},flavor,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,group-assignment,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},group-assignment,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,image,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},image,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,oam-network,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},oam-network,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,snapshot,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},snapshot,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,tenant,has,OUT,ONE2MANY,${direction},${direction},!${direction},${direction},tenant,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,${direction},!${direction},T +cloud-region,vip-ipv4-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vip-ipv4-address-list,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,vip-ipv6-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vip-ipv6-address-list,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,volume-group,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},volume-group,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +complex,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,${direction},NONE,complex,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +complex,ctag-pool,hasCtagPool,OUT,MANY2MANY,${direction},${direction},NONE,NONE,ctag-pool,complex,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +configuration,allotted-resource,uses,OUT,ONE2ONE,NONE,${direction},NONE,NONE,configuration,allotted-resource,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,${direction},NONE,NONE,T +configuration,logical-link,has,OUT,ONE2MANY,NONE,${direction},NONE,NONE,configuration,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +configuration,metadatum,owns,OUT,ONE2MANY,${direction},${direction},NONE,NONE,metadatum,configuration,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +connector,virtual-data-center,contains,OUT,MANY2MANY,NONE,NONE,NONE,NONE,connector,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +connector,metadatum,hasMetaData,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,connector,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +constrained-element-set,element-choice-set,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,element-choice-set,constrained-element-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +ctag-pool,availability-zone,supportsAvailabilityZone,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},ctag-pool,availability-zone,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +customer,service-subscription,subscribesTo,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,service-subscription,customer,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +dvs-switch,availability-zone,existsIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},dvs-switch,availability-zone,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +element-choice-set,model-element,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,element-choice-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,entitlement,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,entitlement,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,availability-zone,hasAvailabilityZone,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},generic-vnf,availability-zone,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +generic-vnf,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},generic-vnf,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +generic-vnf,configuration,uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,generic-vnf,configuration,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +generic-vnf,ctag-pool,usesCtagPool,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,ctag-pool,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,ipsec-configuration,uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,generic-vnf,ipsec-configuration,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +generic-vnf,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,${direction},NONE,generic-vnf,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,license-key-resource,uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},generic-vnf,license-key-resource,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +generic-vnf,pnf,hostedOn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,pnf,tosca.relationships.HostedOn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,pserver,runsOnPserver,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},generic-vnf,pserver,tosca.relationships.HostedOn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +generic-vnf,vnfc,uses,OUT,ONE2MANY,NONE,${direction},${direction},NONE,vnfc,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,NONE,!${direction},!${direction},NONE,T +generic-vnf,vnf-image,usesVnfImage,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},generic-vnf,vnf-image,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +generic-vnf,volume-group,uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,generic-vnf,volume-group,org.onap.relationships.inventory.DependsOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,vserver,runsOnVserver,OUT,ONE2MANY,NONE,NONE,${direction},NONE,generic-vnf,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,lag-interface,hasLAGInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,lag-interface,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +generic-vnf,license,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,license,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +generic-vnf,network-profile,hasNetworkProfile,OUT,MANY2MANY,NONE,NONE,NONE,NONE,network-profile,generic-vnf,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,service-instance,hasInstance,OUT,MANY2MANY,NONE,NONE,${direction},NONE,service-instance,generic-vnf,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +generic-vnf,site-pair-set,hasSitePairSet,OUT,MANY2MANY,NONE,NONE,NONE,NONE,site-pair-set,generic-vnf,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,vf-module,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vf-module,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +group-assignment,pserver,has,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},pserver,group-assignment,org.onap.relationships.inventory.MemberOf,OUT,MANY2ONE,NONE,NONE,NONE,${direction},T +group-assignment,tenant,has,OUT,MANY2MANY,NONE,NONE,NONE,NONE,tenant,group-assignment,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +image,metadatum,hasMetaDatum,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,image,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +instance-group,model,targets,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},instance-group,model,org.onap.relationships.inventory.Targets,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +ipsec-configuration,vig-server,hasVigServer,OUT,ONE2MANY,${direction},${direction},NONE,NONE,vig-server,ipsec-configuration,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +l3-interface-ipv4-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-interface-ipv4-address-list,instance-group,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-interface-ipv4-address-list,l3-network,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-interface-ipv4-address-list,l3-network,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-interface-ipv4-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},l3-interface-ipv4-address-list,subnet,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +l3-interface-ipv6-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-interface-ipv6-address-list,instance-group,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-interface-ipv6-address-list,l3-network,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-interface-ipv6-address-list,l3-network,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-interface-ipv6-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},l3-interface-ipv6-address-list,subnet,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +l3-network,ctag-assignment,hasCtagAssignment,OUT,MANY2MANY,${direction},${direction},${direction},NONE,ctag-assignment,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l3-network,instance-group,memberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-network,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-network,network-policy,uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-network,network-policy,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-network,route-table-reference,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-network,route-table-reference,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-network,vpn-binding,usesVpnBinding,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},l3-network,vpn-binding,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +l3-network,segmentation-assignment,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,segmentation-assignment,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +l3-network,service-instance,hasInstance,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,service-instance,l3-network,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +l3-network,subnet,hasSubnet,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,subnet,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +lag-interface,lag-link,usesLAGLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,lag-interface,lag-link,tosca.relationships.network.LinksTo,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +lag-interface,logical-link,uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,lag-interface,logical-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +lag-interface,p-interface,usesPInterface,OUT,MANY2MANY,NONE,NONE,${direction},NONE,lag-interface,p-interface,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +lag-interface,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,lag-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +line-of-business,generic-vnf,realizedBy,OUT,MANY2MANY,NONE,NONE,NONE,NONE,line-of-business,generic-vnf,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l-interface,l3-interface-ipv4-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv4-address-list,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,l3-interface-ipv6-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv6-address-list,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l-interface,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l-interface,l-interface,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,l-interface,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,logical-link,usesLogicalLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,l-interface,logical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,${direction},${direction},NONE,T +l-interface,logical-link,sourceLInterface,OUT,MANY2MANY,NONE,${direction},${direction},NONE,logical-link,l-interface,org.onap.relationships.inventory.Source,OUT,ONE2MANY,NONE,!${direction},!${direction},NONE,F +l-interface,logical-link,targetLInterface,OUT,MANY2MANY,NONE,${direction},${direction},NONE,logical-link,l-interface,org.onap.relationships.inventory.Destination,OUT,ONE2MANY,NONE,!${direction},!${direction},NONE,F +l-interface,sriov-vf,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,sriov-vf,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +l-interface,vlan,hasVlan,OUT,MANY2MANY,${direction},${direction},NONE,NONE,vlan,l-interface,tosca.relationships.network.LinksTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +logical-link,cloud-region,existsIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,cloud-region,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,generic-vnf,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,generic-vnf,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,lag-link,usesLAGLink,OUT,MANY2MANY,NONE,NONE,${direction},NONE,logical-link,lag-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +logical-link,logical-link,uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,logical-link,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +logical-link,pnf,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,pnf,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,pserver,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},logical-link,pserver,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +logical-link,vpn-binding,uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},logical-link,vpn-binding,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +model,model-ver,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-ver,model,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-constraint,constrained-element-set,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,constrained-element-set,model-constraint,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,constrained-element-set,connectsTo,OUT,ONE2MANY,${direction},${direction},NONE,NONE,constrained-element-set,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-constraint,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-constraint,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-element,connectsTo,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-ver,isA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},model-element,model-ver,org.onap.relationships.inventory.IsA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +model-ver,metadatum,hasMetaDatum,OUT,ONE2MANY,${direction},${direction},NONE,NONE,metadatum,model-ver,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-ver,model-element,startsWith,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,model-ver,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query,model,relatedTo,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},named-query,model,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},T +named-query,named-query-element,startsWith,OUT,ONE2ONE,${direction},${direction},NONE,NONE,named-query-element,named-query,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,model,isA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},named-query-element,model,org.onap.relationships.inventory.IsA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +named-query-element,named-query-element,connectsTo,OUT,MANY2MANY,${direction},${direction},NONE,NONE,named-query-element,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,property-constraint,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,property-constraint,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,related-lookup,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,related-lookup,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +newvce,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,l-interface,newvce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +oam-network,complex,definedFor,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},oam-network,complex,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +oam-network,service-capability,supportsServiceCapability,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},oam-network,service-capability,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +operational-environment,operational-environment,managedBy,OUT,ONE2ONE,NONE,NONE,NONE,NONE,operational-environment,operational-environment,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +owning-entity,service-instance,owns,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,owning-entity,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +p-interface,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,p-interface,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +p-interface,logical-link,usesLogicalLink,OUT,MANY2ONE,NONE,NONE,${direction},NONE,p-interface,logical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +p-interface,physical-link,usesPhysicalLink,OUT,MANY2MANY,NONE,${direction},NONE,NONE,p-interface,physical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,${direction},NONE,NONE,T +p-interface,sriov-pf,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,sriov-pf,p-interface,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +platform,generic-vnf,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,platform,generic-vnf,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +pnf,lag-interface,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,lag-interface,pnf,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pnf,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,p-interface,pnf,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pnf,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},pnf,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +pnf,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,pnf,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +pnf,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,pnf,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +port-group,cvlan-tag,hasCTag,OUT,MANY2MANY,${direction},${direction},${direction},NONE,cvlan-tag,port-group,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +project,service-instance,created,OUT,ONE2MANY,NONE,NONE,NONE,NONE,project,service-instance,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +pserver,lag-interface,hasLAGInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,lag-interface,pserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pserver,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,p-interface,pserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pserver,availability-zone,existsIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},pserver,availability-zone,org.onap.relationships.inventory.MemberOf,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +pserver,cloud-region,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,pserver,cloud-region,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +pserver,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},pserver,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +pserver,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,pserver,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +routing-instance,site-pair,hasSitePair,OUT,MANY2MANY,${direction},${direction},NONE,NONE,site-pair,routing-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,allotted-resource,has,OUT,MANY2MANY,${direction},${direction},NONE,NONE,allotted-resource,service-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,metadatum,hasMetaData,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,service-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,allotted-resource,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,allotted-resource,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,configuration,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,configuration,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,connector,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,connector,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,ctag-assignment,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,ctag-assignment,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,cvlan-tag,hasIPAGFacingVLAN,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,cvlan-tag,org.onap.relationships.inventory.ComposedOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,logical-link,uses,OUT,MANY2MANY,NONE,${direction},NONE,NONE,service-instance,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +service-instance,pnf,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,pnf,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,service-instance,dependsOn,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,service-instance,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,vlan,dependsOn,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,vlan,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,zone,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,service-instance,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +service-subscription,service-instance,hasInstance,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,service-instance,service-subscription,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +site-pair,class-of-service,hasClassOfService,OUT,MANY2MANY,${direction},${direction},NONE,NONE,class-of-service,site-pair,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +site-pair-set,routing-instance,hasRoutingInstance,OUT,MANY2MANY,${direction},${direction},NONE,NONE,routing-instance,site-pair-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +sriov-vf,sriov-pf,uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,sriov-vf,sriov-pf,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +subnet,host-route,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,host-route,subnet,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +tenant,service-subscription,relatedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-subscription,tenant,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +tenant,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,NONE,NONE,tenant,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +tenant,vserver,owns,OUT,ONE2MANY,${direction},${direction},!${direction},${direction},vserver,tenant,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,${direction},!${direction},T +vce,entitlement,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,entitlement,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vce,license,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,license,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vce,port-group,hasPortGroup,OUT,MANY2MANY,${direction},${direction},${direction},NONE,port-group,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vce,service-instance,hasServiceInstance,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,service-instance,vce,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +vce,availability-zone,hasAvailabilityZone,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},vce,availability-zone,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +vce,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vce,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +vce,vserver,runsOnVserver,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vce,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +vf-module,l3-network,uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vf-module,l3-network,org.onap.relationships.inventory.DependsOn,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +vf-module,vnfc,uses,OUT,ONE2MANY,NONE,${direction},${direction},${direction},vf-module,vnfc,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,${direction},${direction},T +vf-module,volume-group,uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,vf-module,volume-group,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,T +vip-ipv4-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vip-ipv4-address-list,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vip-ipv4-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vip-ipv4-address-list,subnet,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +vip-ipv6-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vip-ipv6-address-list,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vip-ipv6-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vip-ipv6-address-list,subnet,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +virtual-data-center,generic-vnf,hasVNF,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,generic-vnf,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +virtual-data-center,logical-link,contains,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vlan,l3-interface-ipv4-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv4-address-list,vlan,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vlan,l3-interface-ipv6-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv6-address-list,vlan,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vlan,logical-link,usesLogicalLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,vlan,logical-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +vlan,multicast-configuration,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vlan,multicast-configuration,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,l3-interface-ipv4-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},NONE,NONE,l3-interface-ipv4-address-list,vnfc,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vnfc,l3-interface-ipv6-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},NONE,NONE,l3-interface-ipv6-address-list,vnfc,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vnfc,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,vip-ipv4-address-list,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,vip-ipv4-address-list,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,vip-ipv6-address-list,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,vip-ipv6-address-list,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +volume-group,tenant,belongsTo,OUT,MANY2MANY,NONE,NONE,${direction},NONE,tenant,volume-group,org.onap.relationships.inventory.DependsOn,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +volume-group,complex,existsIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},volume-group,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vpls-pe,lag-interface,hasLAGinterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,lag-interface,vpls-pe,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vpls-pe,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,p-interface,vpls-pe,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vpls-pe,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},vpls-pe,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +vpls-pe,ctag-pool,usesCtagPool,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vpls-pe,ctag-pool,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vpn-binding,route-target,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,route-target,vpn-binding,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vserver,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,vserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vserver,vf-module,isPartOf,OUT,MANY2ONE,NONE,NONE,${direction},NONE,vf-module,vserver,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +vserver,vnfc,hosts,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vnfc,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +vserver,flavor,hasFlavor,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,flavor,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,image,hasImage,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,image,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,pserver,runsOnPserver,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,pserver,tosca.relationships.HostedOn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,snapshot,uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,vserver,snapshot,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,T +vserver,volume,hasVolume,OUT,MANY2MANY,${direction},${direction},${direction},NONE,vserver,volume,tosca.relationships.AttachesTo,OUT,ONE2MANY,${direction},${direction},${direction},NONE,T +zone,complex,existsIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},zone,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +,,,,,,,,,allotted-resource,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,generic-vnf,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,l3-network,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,logical-link,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,service-instance,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,vf-module,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +configuration,l-interface,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,configuration,l-interface,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +configuration,pnf,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,configuration,pnf,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +forwarder,forwarding-path,belongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,forwarder,forwarding-path,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +forwarding-path,service-instance,implements,OUT,MANY2ONE,NONE,!${direction},NONE,NONE,forwarding-path,service-instance,org.onap.relationships.inventory.AppliesTo,OUT,MANY2ONE,NONE,!${direction},NONE,NONE,T +forwarder,l-interface,forwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,forwarder,l-interface,org.onap.relationships.inventory.ForwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +forwarder,p-interface,forwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,forwarder,p-interface,org.onap.relationships.inventory.ForwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T diff --git a/aai-core/src/test/resources/logback.xml b/aai-core/src/test/resources/logback.xml index 959ef63f..37425b97 100644 --- a/aai-core/src/test/resources/logback.xml +++ b/aai-core/src/test/resources/logback.xml @@ -130,7 +130,7 @@ ${logDirectory}/rest/audit.log - ${logDirectory}/rest/audit-${Pid}.%d{yyyy-MM-dd}.log.zip + ${logDirectory}/rest/audit-${lrmRVer}-${lrmRO}-${Pid}.%d{yyyy-MM-dd}.log.zip ${logDirectory}/rest/perform.log - ${logDirectory}/rest/perform-${Pid}.%d{yyyy-MM-dd}.log.zip + ${logDirectory}/rest/perform-${lrmRVer}-${lrmRO}-${Pid}.%d{yyyy-MM-dd}.log.zip - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml b/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml deleted file mode 100644 index 06dc6e03..00000000 --- a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml +++ /dev/null @@ -1,3079 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml b/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml deleted file mode 100644 index aec9b83d..00000000 --- a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml +++ /dev/null @@ -1,599 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json b/aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json new file mode 100644 index 00000000..3c656da1 --- /dev/null +++ b/aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json @@ -0,0 +1,27 @@ +{ + "vnf-id": "vnf1", + "vnf-type": "someval", + "vnf-name": "someval", + "lag-interfaces": { + "lag-interface": [ + { + "interface-name": "lag1", + "l-interfaces": { + "l-interface": [ + { + "interface-name": "int1", + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "ipv1" + }, + { + "l3-interface-ipv6-address": "ipv2" + } + ] + } + ] + } + } + ] + } +} diff --git a/aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json b/aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json new file mode 100644 index 00000000..97372dd8 --- /dev/null +++ b/aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json @@ -0,0 +1,310 @@ +{ + "cloud-owner" : "junit-cloud-owner", + "cloud-region-id" : "junit-cloud-region", + "cloud-type" : "P9P1X6U9eDXR", + "owner-defined-type" : "OUrR8kI6Br", + "cloud-region-version" : "Nyr", + "identity-url" : "JHqvA1M", + "cloud-zone" : "Y5UfJUM", + "complex-name" : "QLP", + "sriov-automation" : false, + "tenants" : { + "tenant" : [ { + "tenant-id" : "tenant1", + "tenant-name" : "yhgVBcv3Pr", + "tenant-context" : "De4NNayqFBO", + "vservers" : { + "vserver" : [ { + "vserver-id" : "vserver1", + "vserver-name" : "P3SJ347Uyv", + "vserver-name2" : "1dHd", + "prov-status" : "PR04shorWQ", + "vserver-selflink" : "v7dU8H", + "in-maint" : false, + "is-closed-loop-disabled" : true, + "volumes" : { + "volume" : [ { + "volume-id" : "61cbb17e-8e5f-4545-a8ea-13a0e9c9871f-vk250x", + "volume-selflink" : "mYkfJ9rGv" + }, { + "volume-id" : "d98083a6-b235-4e54-b19b-2ebfa1604246-vk250x", + "volume-selflink" : "69RRsreL4" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "top-linterface", + "interface-role" : "3W1FAJGSQ", + "v6-wan-link-ip" : "WugWw3N", + "selflink" : "Of4j0pU", + "interface-id" : "eoW", + "macaddr" : "XNbbIy33", + "network-name" : "ZETDv5sGhiS", + "management-option" : "qR3RyCxgEU", + "interface-description" : "ksuRPpWDEH7", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "20Q0ZE6n5iB0", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "KjPXyH", + "vlans" : { + "vlan" : [ { + "vlan-interface" : "8d225c33-7494-4173-939f-0e1e8741344d-vk250x", + "vlan-id-inner" : 884, + "vlan-id-outer" : 992, + "speed-value" : "RyFPm", + "speed-units" : "ZrckmLff7b", + "vlan-description" : "zjAeUFgeagpf", + "backdoor-connection" : "gANMvUquB", + "vpn-key" : "l0rV7bb2Sc", + "orchestration-status" : "WVnLpbzIx", + "in-maint" : false, + "prov-status" : "tYMRi6df", + "is-ip-unnumbered" : false, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "2e7d62a5-ff93-446f-9fa3-b4ba585e742b-vk250x", + "l3-interface-ipv4-prefix-length" : 640, + "vlan-id-inner" : 652, + "vlan-id-outer" : 868, + "is-floating" : true, + "neutron-network-id" : "dJ8Fqs4ZTRn", + "neutron-subnet-id" : "HC6ji9DO8" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "818cd2e5-8dac-4a49-aa2e-4f97d4e98594-vk250x", + "l3-interface-ipv6-prefix-length" : 910, + "vlan-id-inner" : 116, + "vlan-id-outer" : 661, + "is-floating" : true, + "neutron-network-id" : "vSpYqFg5Tfe", + "neutron-subnet-id" : "bqkOUZSlVF" + }, { + "l3-interface-ipv6-address" : "915a8e5d-9d39-4f99-a350-c48f48ac8f46-vk250x", + "l3-interface-ipv6-prefix-length" : 593, + "vlan-id-inner" : 554, + "vlan-id-outer" : 762, + "is-floating" : false, + "neutron-network-id" : "b7PM", + "neutron-subnet-id" : "u51Ma93" + } ] + } ] + }, + "sriov-vfs" : { + "sriov-vf" : [ { + "pci-id" : "01ca7dbe-e270-4545-a045-72e9e3fcb44b-vk250x", + "vf-vlan-filter" : "f9YNFlqrfHi", + "vf-mac-filter" : "HQhFdXpL1v", + "vf-vlan-strip" : true, + "vf-vlan-anti-spoof-check" : false, + "vf-mac-anti-spoof-check" : false, + "vf-mirrors" : "SqknCX", + "vf-broadcast-allow" : true, + "vf-unknown-multicast-allow" : false, + "vf-unknown-unicast-allow" : false, + "vf-insert-stag" : true, + "vf-link-status" : "MsSX9hug4u1", + "neutron-network-id" : "f4jq6yFxVVtC" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "nested-linterface1", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + },{ + "interface-name" : "nested-linterface2", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + } ] + }, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "fc25fa49-ec46-43f5-bd39-c1c9067d2962-vk250x", + "l3-interface-ipv4-prefix-length" : 339, + "vlan-id-inner" : 644, + "vlan-id-outer" : 701, + "is-floating" : true, + "neutron-network-id" : "IEpYVl", + "neutron-subnet-id" : "7uWdipdgtC4Qc" + }, { + "l3-interface-ipv4-address" : "402d29fe-baf4-47e3-9208-e12a75e25349-vk250x", + "l3-interface-ipv4-prefix-length" : 370, + "vlan-id-inner" : 971, + "vlan-id-outer" : 142, + "is-floating" : false, + "neutron-network-id" : "sRi62ZY3IrKkq", + "neutron-subnet-id" : "PeV5RhIfV2Ib7" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "c9befce1-5617-4525-b217-105a57f6bd59-vk250x", + "l3-interface-ipv6-prefix-length" : 333, + "vlan-id-inner" : 275, + "vlan-id-outer" : 324, + "is-floating" : true, + "neutron-network-id" : "em6Lc6ovvWsdx", + "neutron-subnet-id" : "pyx4f" + }, { + "l3-interface-ipv6-address" : "18aa594c-143b-4564-ac0c-72144aecbb66-vk250x", + "l3-interface-ipv6-prefix-length" : 350, + "vlan-id-inner" : 893, + "vlan-id-outer" : 37, + "is-floating" : false, + "neutron-network-id" : "lhiR1", + "neutron-subnet-id" : "kdfoiCb7JYBuh" + } ] + } ] + } + } ] + } + } ] + }, + "flavors" : { + "flavor" : [ { + "flavor-id" : "a7208e23-b517-4ccb-a3ab-00952aa89480-vk250x", + "flavor-name" : "JGWnOD", + "flavor-vcpus" : 803, + "flavor-ram" : 920, + "flavor-disk" : 438, + "flavor-ephemeral" : 41, + "flavor-swap" : "KiuHc7", + "flavor-is-public" : false, + "flavor-selflink" : "pXtX", + "flavor-disabled" : false + } ] + }, + "group-assignments" : { + "group-assignment" : [ { + "group-id" : "30c1bb60-1b71-4b46-910f-d33c7905a779-vk250x", + "group-type" : "bRh", + "group-name" : "hg11sdvW", + "group-description" : "df3w60RR" + } ] + }, + "snapshots" : { + "snapshot" : [ { + "snapshot-id" : "26c013f4-c119-4ddd-89cf-e9b2729f87e5-vk250x", + "snapshot-name" : "0J3q8ZjyPGH", + "snapshot-architecture" : "wMu9Tvile", + "snapshot-os-distro" : "2Vv4Pqzu", + "snapshot-os-version" : "Vim0fyf404YVW", + "application" : "oxkCtHUk", + "application-vendor" : "tTpXkD", + "application-version" : "aOqn", + "snapshot-selflink" : "GCapKV9Tq", + "prev-snapshot-id" : "Imnj21xW5Hez" + }, { + "snapshot-id" : "ee2e8769-2dcf-4a3c-90bd-a0ba91c97f13-vk250x", + "snapshot-name" : "zRh94rw3pc1", + "snapshot-architecture" : "FxVDY", + "snapshot-os-distro" : "QZnKXjI5LDBSi", + "snapshot-os-version" : "u0Bl2moOJ7bb", + "application" : "dlXZPm9B7", + "application-vendor" : "89tls6", + "application-version" : "c05X", + "snapshot-selflink" : "rmExWmnDIZu3", + "prev-snapshot-id" : "5chZxlmHfhe" + } ] + }, + "images" : { + "image" : [ { + "image-id" : "691210f6-f3f2-488f-993c-a9c9570fb71f-vk250x", + "image-name" : "GsPzYlduuWk", + "image-architecture" : "vNdK4fYJf", + "image-os-distro" : "ZxYe", + "image-os-version" : "SVBBpHEc", + "application" : "GgBxi1zv8h2KG", + "application-vendor" : "x6NtDNUj", + "application-version" : "VOZYqE04K9", + "image-selflink" : "gOzbbHZtkuh", + "metadata" : { + "metadatum" : [ { + "metaname" : "b9565dfa-ed1f-4d35-90c6-bb56a48d9b2a-vk250x", + "metaval" : "nyq5IHmI" + } ] + } + }, { + "image-id" : "1f00c00a-9ab7-44a0-9961-bcf5f806fef8-vk250x", + "image-name" : "WChNCg3ThQ1Of", + "image-architecture" : "oL2m4nUPPG6j", + "image-os-distro" : "kf7", + "image-os-version" : "DxTTyv4S16e", + "application" : "Y0dytCJ2ouDk", + "application-vendor" : "F7E7a", + "application-version" : "8wkd3Cy", + "image-selflink" : "5N5A", + "metadata" : { + "metadatum" : [ { + "metaname" : "a5c4c98f-0b36-4f70-a235-5135e8e644f1-vk250x", + "metaval" : "vupk3k29rdN" + }, { + "metaname" : "e6084e48-df73-4854-a2be-522087b5f6a3-vk250x", + "metaval" : "l9VaEeP" + } ] + } + } ] + }, + "dvs-switches" : { + "dvs-switch" : [ { + "switch-name" : "b01222d9-f9f9-493d-8ee0-9ab7c095d5a0-vk250x", + "vcenter-url" : "NNtc" + }, { + "switch-name" : "7abed153-9fb5-4c05-87aa-ead0feb35b16-vk250x", + "vcenter-url" : "YSS" + } ] + }, + "oam-networks" : { + "oam-network" : [ { + "network-uuid" : "af2371f8-0fa6-4d4d-90c8-9c5d3ba3e01e-vk250x", + "network-name" : "cVevT9o20HAs4", + "cvlan-tag" : 560, + "ipv4-oam-gateway-address" : "F565rGb", + "ipv4-oam-gateway-address-prefix-length" : 540 + } ] + }, + "availability-zones" : { + "availability-zone" : [ { + "availability-zone-name" : "9761e922-fd2a-4c96-9a13-4e62e1daccdc-vk250x", + "hypervisor-type" : "qijdeI", + "operational-status" : "C0KkUiJ" + } ] + }, + "vip-ipv4-address-list" : [ { + "vip-ipv4-address" : "08b4a6c1-c702-4449-8791-caaa5341c6d9-vk250x", + "vip-ipv4-prefix-length" : 185, + "vlan-id-inner" : 969, + "vlan-id-outer" : 414, + "is-floating" : true, + "neutron-network-id" : "S7r90cEZ", + "neutron-subnet-id" : "2NwjH" + } ], + "vip-ipv6-address-list" : [ { + "vip-ipv6-address" : "f01dbad0-10c5-491c-a6e5-d972c9b99f56-vk250x", + "vip-ipv6-prefix-length" : 365, + "vlan-id-inner" : 326, + "vlan-id-outer" : 927, + "is-floating" : true, + "neutron-network-id" : "ULEl0", + "neutron-subnet-id" : "eyt9" + } ] +} \ No newline at end of file diff --git a/aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json b/aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json new file mode 100644 index 00000000..fee82181 --- /dev/null +++ b/aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json @@ -0,0 +1,22 @@ +{ + "vnf-id": "vnf1", + "lag-interfaces": { + "lag-interface": [ + { + "interface-name": "lag1", + "l-interfaces": { + "l-interface": [ + { + "interface-name": "int1", + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "ipv6-1" + } + ] + } + ] + } + } + ] + } +} diff --git a/aai-core/src/test/resources/payloads/templates/cloud-region.json b/aai-core/src/test/resources/payloads/templates/cloud-region.json new file mode 100644 index 00000000..176214af --- /dev/null +++ b/aai-core/src/test/resources/payloads/templates/cloud-region.json @@ -0,0 +1,310 @@ +{ + "cloud-owner" : "${cloud-owner}", + "cloud-region-id" : "${cloud-region-id}", + "cloud-type" : "P9P1X6U9eDXR", + "owner-defined-type" : "OUrR8kI6Br", + "cloud-region-version" : "Nyr", + "identity-url" : "JHqvA1M", + "cloud-zone" : "Y5UfJUM", + "complex-name" : "QLP", + "sriov-automation" : false, + "tenants" : { + "tenant" : [ { + "tenant-id" : "${tenant-id}", + "tenant-name" : "yhgVBcv3Pr", + "tenant-context" : "De4NNayqFBO", + "vservers" : { + "vserver" : [ { + "vserver-id" : "${vserver-id}", + "vserver-name" : "P3SJ347Uyv", + "vserver-name2" : "1dHd", + "prov-status" : "PR04shorWQ", + "vserver-selflink" : "v7dU8H", + "in-maint" : false, + "is-closed-loop-disabled" : true, + "volumes" : { + "volume" : [ { + "volume-id" : "61cbb17e-8e5f-4545-a8ea-13a0e9c9871f-vk250x", + "volume-selflink" : "mYkfJ9rGv" + }, { + "volume-id" : "d98083a6-b235-4e54-b19b-2ebfa1604246-vk250x", + "volume-selflink" : "69RRsreL4" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "top-linterface", + "interface-role" : "3W1FAJGSQ", + "v6-wan-link-ip" : "WugWw3N", + "selflink" : "Of4j0pU", + "interface-id" : "eoW", + "macaddr" : "XNbbIy33", + "network-name" : "ZETDv5sGhiS", + "management-option" : "qR3RyCxgEU", + "interface-description" : "ksuRPpWDEH7", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "20Q0ZE6n5iB0", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "KjPXyH", + "vlans" : { + "vlan" : [ { + "vlan-interface" : "8d225c33-7494-4173-939f-0e1e8741344d-vk250x", + "vlan-id-inner" : 884, + "vlan-id-outer" : 992, + "speed-value" : "RyFPm", + "speed-units" : "ZrckmLff7b", + "vlan-description" : "zjAeUFgeagpf", + "backdoor-connection" : "gANMvUquB", + "vpn-key" : "l0rV7bb2Sc", + "orchestration-status" : "WVnLpbzIx", + "in-maint" : false, + "prov-status" : "tYMRi6df", + "is-ip-unnumbered" : false, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "2e7d62a5-ff93-446f-9fa3-b4ba585e742b-vk250x", + "l3-interface-ipv4-prefix-length" : 640, + "vlan-id-inner" : 652, + "vlan-id-outer" : 868, + "is-floating" : true, + "neutron-network-id" : "dJ8Fqs4ZTRn", + "neutron-subnet-id" : "HC6ji9DO8" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "818cd2e5-8dac-4a49-aa2e-4f97d4e98594-vk250x", + "l3-interface-ipv6-prefix-length" : 910, + "vlan-id-inner" : 116, + "vlan-id-outer" : 661, + "is-floating" : true, + "neutron-network-id" : "vSpYqFg5Tfe", + "neutron-subnet-id" : "bqkOUZSlVF" + }, { + "l3-interface-ipv6-address" : "915a8e5d-9d39-4f99-a350-c48f48ac8f46-vk250x", + "l3-interface-ipv6-prefix-length" : 593, + "vlan-id-inner" : 554, + "vlan-id-outer" : 762, + "is-floating" : false, + "neutron-network-id" : "b7PM", + "neutron-subnet-id" : "u51Ma93" + } ] + } ] + }, + "sriov-vfs" : { + "sriov-vf" : [ { + "pci-id" : "01ca7dbe-e270-4545-a045-72e9e3fcb44b-vk250x", + "vf-vlan-filter" : "f9YNFlqrfHi", + "vf-mac-filter" : "HQhFdXpL1v", + "vf-vlan-strip" : true, + "vf-vlan-anti-spoof-check" : false, + "vf-mac-anti-spoof-check" : false, + "vf-mirrors" : "SqknCX", + "vf-broadcast-allow" : true, + "vf-unknown-multicast-allow" : false, + "vf-unknown-unicast-allow" : false, + "vf-insert-stag" : true, + "vf-link-status" : "MsSX9hug4u1", + "neutron-network-id" : "f4jq6yFxVVtC" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "nested-linterface1", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + },{ + "interface-name" : "nested-linterface2", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + } ] + }, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "fc25fa49-ec46-43f5-bd39-c1c9067d2962-vk250x", + "l3-interface-ipv4-prefix-length" : 339, + "vlan-id-inner" : 644, + "vlan-id-outer" : 701, + "is-floating" : true, + "neutron-network-id" : "IEpYVl", + "neutron-subnet-id" : "7uWdipdgtC4Qc" + }, { + "l3-interface-ipv4-address" : "402d29fe-baf4-47e3-9208-e12a75e25349-vk250x", + "l3-interface-ipv4-prefix-length" : 370, + "vlan-id-inner" : 971, + "vlan-id-outer" : 142, + "is-floating" : false, + "neutron-network-id" : "sRi62ZY3IrKkq", + "neutron-subnet-id" : "PeV5RhIfV2Ib7" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "c9befce1-5617-4525-b217-105a57f6bd59-vk250x", + "l3-interface-ipv6-prefix-length" : 333, + "vlan-id-inner" : 275, + "vlan-id-outer" : 324, + "is-floating" : true, + "neutron-network-id" : "em6Lc6ovvWsdx", + "neutron-subnet-id" : "pyx4f" + }, { + "l3-interface-ipv6-address" : "18aa594c-143b-4564-ac0c-72144aecbb66-vk250x", + "l3-interface-ipv6-prefix-length" : 350, + "vlan-id-inner" : 893, + "vlan-id-outer" : 37, + "is-floating" : false, + "neutron-network-id" : "lhiR1", + "neutron-subnet-id" : "kdfoiCb7JYBuh" + } ] + } ] + } + } ] + } + } ] + }, + "flavors" : { + "flavor" : [ { + "flavor-id" : "a7208e23-b517-4ccb-a3ab-00952aa89480-vk250x", + "flavor-name" : "JGWnOD", + "flavor-vcpus" : 803, + "flavor-ram" : 920, + "flavor-disk" : 438, + "flavor-ephemeral" : 41, + "flavor-swap" : "KiuHc7", + "flavor-is-public" : false, + "flavor-selflink" : "pXtX", + "flavor-disabled" : false + } ] + }, + "group-assignments" : { + "group-assignment" : [ { + "group-id" : "30c1bb60-1b71-4b46-910f-d33c7905a779-vk250x", + "group-type" : "bRh", + "group-name" : "hg11sdvW", + "group-description" : "df3w60RR" + } ] + }, + "snapshots" : { + "snapshot" : [ { + "snapshot-id" : "26c013f4-c119-4ddd-89cf-e9b2729f87e5-vk250x", + "snapshot-name" : "0J3q8ZjyPGH", + "snapshot-architecture" : "wMu9Tvile", + "snapshot-os-distro" : "2Vv4Pqzu", + "snapshot-os-version" : "Vim0fyf404YVW", + "application" : "oxkCtHUk", + "application-vendor" : "tTpXkD", + "application-version" : "aOqn", + "snapshot-selflink" : "GCapKV9Tq", + "prev-snapshot-id" : "Imnj21xW5Hez" + }, { + "snapshot-id" : "ee2e8769-2dcf-4a3c-90bd-a0ba91c97f13-vk250x", + "snapshot-name" : "zRh94rw3pc1", + "snapshot-architecture" : "FxVDY", + "snapshot-os-distro" : "QZnKXjI5LDBSi", + "snapshot-os-version" : "u0Bl2moOJ7bb", + "application" : "dlXZPm9B7", + "application-vendor" : "89tls6", + "application-version" : "c05X", + "snapshot-selflink" : "rmExWmnDIZu3", + "prev-snapshot-id" : "5chZxlmHfhe" + } ] + }, + "images" : { + "image" : [ { + "image-id" : "691210f6-f3f2-488f-993c-a9c9570fb71f-vk250x", + "image-name" : "GsPzYlduuWk", + "image-architecture" : "vNdK4fYJf", + "image-os-distro" : "ZxYe", + "image-os-version" : "SVBBpHEc", + "application" : "GgBxi1zv8h2KG", + "application-vendor" : "x6NtDNUj", + "application-version" : "VOZYqE04K9", + "image-selflink" : "gOzbbHZtkuh", + "metadata" : { + "metadatum" : [ { + "metaname" : "b9565dfa-ed1f-4d35-90c6-bb56a48d9b2a-vk250x", + "metaval" : "nyq5IHmI" + } ] + } + }, { + "image-id" : "1f00c00a-9ab7-44a0-9961-bcf5f806fef8-vk250x", + "image-name" : "WChNCg3ThQ1Of", + "image-architecture" : "oL2m4nUPPG6j", + "image-os-distro" : "kf7", + "image-os-version" : "DxTTyv4S16e", + "application" : "Y0dytCJ2ouDk", + "application-vendor" : "F7E7a", + "application-version" : "8wkd3Cy", + "image-selflink" : "5N5A", + "metadata" : { + "metadatum" : [ { + "metaname" : "a5c4c98f-0b36-4f70-a235-5135e8e644f1-vk250x", + "metaval" : "vupk3k29rdN" + }, { + "metaname" : "e6084e48-df73-4854-a2be-522087b5f6a3-vk250x", + "metaval" : "l9VaEeP" + } ] + } + } ] + }, + "dvs-switches" : { + "dvs-switch" : [ { + "switch-name" : "b01222d9-f9f9-493d-8ee0-9ab7c095d5a0-vk250x", + "vcenter-url" : "NNtc" + }, { + "switch-name" : "7abed153-9fb5-4c05-87aa-ead0feb35b16-vk250x", + "vcenter-url" : "YSS" + } ] + }, + "oam-networks" : { + "oam-network" : [ { + "network-uuid" : "af2371f8-0fa6-4d4d-90c8-9c5d3ba3e01e-vk250x", + "network-name" : "cVevT9o20HAs4", + "cvlan-tag" : 560, + "ipv4-oam-gateway-address" : "F565rGb", + "ipv4-oam-gateway-address-prefix-length" : 540 + } ] + }, + "availability-zones" : { + "availability-zone" : [ { + "availability-zone-name" : "9761e922-fd2a-4c96-9a13-4e62e1daccdc-vk250x", + "hypervisor-type" : "qijdeI", + "operational-status" : "C0KkUiJ" + } ] + }, + "vip-ipv4-address-list" : [ { + "vip-ipv4-address" : "08b4a6c1-c702-4449-8791-caaa5341c6d9-vk250x", + "vip-ipv4-prefix-length" : 185, + "vlan-id-inner" : 969, + "vlan-id-outer" : 414, + "is-floating" : true, + "neutron-network-id" : "S7r90cEZ", + "neutron-subnet-id" : "2NwjH" + } ], + "vip-ipv6-address-list" : [ { + "vip-ipv6-address" : "f01dbad0-10c5-491c-a6e5-d972c9b99f56-vk250x", + "vip-ipv6-prefix-length" : 365, + "vlan-id-inner" : 326, + "vlan-id-outer" : 927, + "is-floating" : true, + "neutron-network-id" : "ULEl0", + "neutron-subnet-id" : "eyt9" + } ] +} \ No newline at end of file diff --git a/aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json b/aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json new file mode 100644 index 00000000..fc025bb2 --- /dev/null +++ b/aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json @@ -0,0 +1,24 @@ +{ + "vnf-id": "vnf1", + "vnf-type": "someval", + "vnf-name": "someval", + "lag-interfaces": { + "lag-interface": [ + { + "interface-name": "lag1", + "l-interfaces": { + "l-interface": [ + { + "interface-name": "int1", + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "${ip-address}" + } + ] + } + ] + } + } + ] + } +} diff --git a/aai-core/src/test/resources/payloads/templates/tenant.json b/aai-core/src/test/resources/payloads/templates/tenant.json new file mode 100644 index 00000000..ce0f5588 --- /dev/null +++ b/aai-core/src/test/resources/payloads/templates/tenant.json @@ -0,0 +1,169 @@ +{ + "tenant-id" : "${tenant-id}", + "tenant-name" : "yhgVBcv3Pr", + "tenant-context" : "De4NNayqFBO", + "vservers" : { + "vserver" : [ { + "vserver-id" : "${vserver-id}", + "vserver-name" : "P3SJ347Uyv", + "vserver-name2" : "1dHd", + "prov-status" : "PR04shorWQ", + "vserver-selflink" : "v7dU8H", + "in-maint" : false, + "is-closed-loop-disabled" : true, + "volumes" : { + "volume" : [ { + "volume-id" : "61cbb17e-8e5f-4545-a8ea-13a0e9c9871f-vk250x", + "volume-selflink" : "mYkfJ9rGv" + }, { + "volume-id" : "d98083a6-b235-4e54-b19b-2ebfa1604246-vk250x", + "volume-selflink" : "69RRsreL4" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "top-linterface", + "interface-role" : "3W1FAJGSQ", + "v6-wan-link-ip" : "WugWw3N", + "selflink" : "Of4j0pU", + "interface-id" : "eoW", + "macaddr" : "XNbbIy33", + "network-name" : "ZETDv5sGhiS", + "management-option" : "qR3RyCxgEU", + "interface-description" : "ksuRPpWDEH7", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "20Q0ZE6n5iB0", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "KjPXyH", + "vlans" : { + "vlan" : [ { + "vlan-interface" : "8d225c33-7494-4173-939f-0e1e8741344d-vk250x", + "vlan-id-inner" : 884, + "vlan-id-outer" : 992, + "speed-value" : "RyFPm", + "speed-units" : "ZrckmLff7b", + "vlan-description" : "zjAeUFgeagpf", + "backdoor-connection" : "gANMvUquB", + "vpn-key" : "l0rV7bb2Sc", + "orchestration-status" : "WVnLpbzIx", + "in-maint" : false, + "prov-status" : "tYMRi6df", + "is-ip-unnumbered" : false, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "2e7d62a5-ff93-446f-9fa3-b4ba585e742b-vk250x", + "l3-interface-ipv4-prefix-length" : 640, + "vlan-id-inner" : 652, + "vlan-id-outer" : 868, + "is-floating" : true, + "neutron-network-id" : "dJ8Fqs4ZTRn", + "neutron-subnet-id" : "HC6ji9DO8" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "818cd2e5-8dac-4a49-aa2e-4f97d4e98594-vk250x", + "l3-interface-ipv6-prefix-length" : 910, + "vlan-id-inner" : 116, + "vlan-id-outer" : 661, + "is-floating" : true, + "neutron-network-id" : "vSpYqFg5Tfe", + "neutron-subnet-id" : "bqkOUZSlVF" + }, { + "l3-interface-ipv6-address" : "915a8e5d-9d39-4f99-a350-c48f48ac8f46-vk250x", + "l3-interface-ipv6-prefix-length" : 593, + "vlan-id-inner" : 554, + "vlan-id-outer" : 762, + "is-floating" : false, + "neutron-network-id" : "b7PM", + "neutron-subnet-id" : "u51Ma93" + } ] + } ] + }, + "sriov-vfs" : { + "sriov-vf" : [ { + "pci-id" : "01ca7dbe-e270-4545-a045-72e9e3fcb44b-vk250x", + "vf-vlan-filter" : "f9YNFlqrfHi", + "vf-mac-filter" : "HQhFdXpL1v", + "vf-vlan-strip" : true, + "vf-vlan-anti-spoof-check" : false, + "vf-mac-anti-spoof-check" : false, + "vf-mirrors" : "SqknCX", + "vf-broadcast-allow" : true, + "vf-unknown-multicast-allow" : false, + "vf-unknown-unicast-allow" : false, + "vf-insert-stag" : true, + "vf-link-status" : "MsSX9hug4u1", + "neutron-network-id" : "f4jq6yFxVVtC" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "nested-linterface1", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + },{ + "interface-name" : "nested-linterface2", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + } ] + }, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "fc25fa49-ec46-43f5-bd39-c1c9067d2962-vk250x", + "l3-interface-ipv4-prefix-length" : 339, + "vlan-id-inner" : 644, + "vlan-id-outer" : 701, + "is-floating" : true, + "neutron-network-id" : "IEpYVl", + "neutron-subnet-id" : "7uWdipdgtC4Qc" + }, { + "l3-interface-ipv4-address" : "402d29fe-baf4-47e3-9208-e12a75e25349-vk250x", + "l3-interface-ipv4-prefix-length" : 370, + "vlan-id-inner" : 971, + "vlan-id-outer" : 142, + "is-floating" : false, + "neutron-network-id" : "sRi62ZY3IrKkq", + "neutron-subnet-id" : "PeV5RhIfV2Ib7" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "c9befce1-5617-4525-b217-105a57f6bd59-vk250x", + "l3-interface-ipv6-prefix-length" : 333, + "vlan-id-inner" : 275, + "vlan-id-outer" : 324, + "is-floating" : true, + "neutron-network-id" : "em6Lc6ovvWsdx", + "neutron-subnet-id" : "pyx4f" + }, { + "l3-interface-ipv6-address" : "18aa594c-143b-4564-ac0c-72144aecbb66-vk250x", + "l3-interface-ipv6-prefix-length" : 350, + "vlan-id-inner" : 893, + "vlan-id-outer" : 37, + "is-floating" : false, + "neutron-network-id" : "lhiR1", + "neutron-subnet-id" : "kdfoiCb7JYBuh" + } ] + } ] + } + } ] + } +} \ No newline at end of file -- cgit 1.2.3-korg