diff options
author | Muller, Andrew (am8383) <am8383@us.att.com> | 2017-08-11 15:13:28 -0400 |
---|---|---|
committer | James Forsyth <jf2512@att.com> | 2017-08-11 20:09:31 +0000 |
commit | fd16c2550e347e5f8d7be11c12dae479e7947ed8 (patch) | |
tree | 9d18ce007cb65c714290c628da18e0999b7fdfea /aai-resources/src/test | |
parent | b840faea026675dd1aa065d2cb8e025dce8d9068 (diff) |
[AAI-154 Amsterdam] Check in titan refactor
Change-Id: I955ac630071680e690c523e005d289d8fc40ba6c
Signed-off-by: Muller, Andrew (am8383) <am8383@us.att.com>
Diffstat (limited to 'aai-resources/src/test')
10 files changed, 101 insertions, 30 deletions
diff --git a/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java b/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java index 1b5b67b..5b71cf7 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java @@ -34,12 +34,12 @@ 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.Vertex; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.dbmap.DBConnectionType; import org.openecomp.aai.introspection.Loader; @@ -51,12 +51,12 @@ import org.openecomp.aai.serialization.db.EdgeRules; import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -//import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; +import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; import org.openecomp.aai.util.AAIConstants; + import com.thinkaurelius.titan.core.Cardinality; import com.thinkaurelius.titan.core.TitanFactory; import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanTransaction; import com.thinkaurelius.titan.core.schema.TitanManagement; @Ignore @@ -72,7 +72,7 @@ public class VertexMergeTest { private static TitanGraph graph; private static EdgeRules rules; private static GraphTraversalSource g; - private static TitanTransaction tx; + private static Graph tx; @BeforeClass public static void setUp() throws NoSuchFieldException, SecurityException, Exception { graph = TitanFactory.build().set("storage.backend","inmemory").open(); @@ -80,7 +80,7 @@ public class VertexMergeTest { g = tx.traversal(); System.setProperty("AJSC_HOME", "."); System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); -// QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/"); + QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, @@ -166,7 +166,7 @@ public class VertexMergeTest { } @AfterClass public static void cleanUp() { - tx.rollback(); + tx.tx().rollback(); graph.close(); } diff --git a/aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java b/aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java new file mode 100644 index 0000000..f9a511a --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.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.openecomp.aai.serialization.queryformats; + +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.io.IoCore; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; +import org.openecomp.aai.db.props.AAIProperties; +import org.openecomp.aai.serialization.queryformats.exceptions.AAIFormatVertexException; +import org.openecomp.aai.serialization.queryformats.utils.UrlBuilder; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import static org.mockito.Matchers.isA; +import static org.mockito.Mockito.when; + +public class QueryFormatTestHelper { + + + public static final String testResources = "src/test/resources/org/openecomp/aai/serialization/queryformats/"; + public static final String graphsonResources = "src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/"; + + + public static void mockPathed(UrlBuilder mock) throws AAIFormatVertexException { + Answer<String> answer = new Answer<String>() { + public String answer(InvocationOnMock invocation) throws Throwable { + Vertex v = invocation.getArgumentAt(0, Vertex.class); + + return v.<String>property(AAIProperties.AAI_URI).orElse("urimissing"); + } + }; + when(mock.pathed(isA(Vertex.class))).thenAnswer(answer); + + } + + public static Graph loadGraphson(String fileName) throws IOException { + final Graph graph = TinkerGraph.open(); + graph.io(IoCore.graphson()).readGraph(QueryFormatTestHelper.graphsonResources + fileName); + + return graph; + } + + public static void setFinalStatic(Field field, Object newValue) throws Exception { + field.setAccessible(true); + // remove final modifier from field + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + field.set(null, newValue); + } + +} diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml index 6eebc6c..647b6f1 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml @@ -4411,7 +4411,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4441,7 +4441,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> @@ -5500,7 +5500,7 @@ </xml-element> <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Design of zone [Medium/Large�]" /> + <xml-property name="description" value="Design of zone [Medium/Large?]" /> </xml-properties> </xml-element> <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml index 78c1011..fb44778 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml @@ -4454,7 +4454,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4484,7 +4484,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> @@ -5543,7 +5543,7 @@ </xml-element> <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Design of zone [Medium/Large…]" /> + <xml-property name="description" value="Design of zone [Medium/Large?]" /> </xml-properties> </xml-element> <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml index b081627..1cd8119 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml @@ -4111,7 +4111,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4141,7 +4141,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml index 8cba262..436fb2f 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml @@ -4360,7 +4360,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4390,7 +4390,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> @@ -5435,7 +5435,7 @@ </xml-element> <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Design of zone [Medium/Large�]" /> + <xml-property name="description" value="Design of zone [Medium/Large?]" /> </xml-properties> </xml-element> <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml index d2f9823..3124e92 100644 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml +++ b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml @@ -4448,7 +4448,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4478,7 +4478,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> @@ -5537,7 +5537,7 @@ </xml-element> <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Design of zone [Medium/Large�]" /> + <xml-property name="description" value="Design of zone [Medium/Large?]" /> </xml-properties> </xml-element> <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml index 6fa090b..903f21f 100644 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml +++ b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml @@ -4493,7 +4493,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4523,7 +4523,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> @@ -5582,7 +5582,7 @@ </xml-element> <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Design of zone [Medium/Large…]" /> + <xml-property name="description" value="Design of zone [Medium/Large?]" /> </xml-properties> </xml-element> <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml index 03477c0..36bea63 100644 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml +++ b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml @@ -4363,7 +4363,7 @@ </xml-element> <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> @@ -4393,7 +4393,7 @@ </xml-element> <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,?aes-192-cbc, aes-265-cbc" /> </xml-properties> </xml-element> <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> @@ -5438,7 +5438,7 @@ </xml-element> <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Design of zone [Medium/Large�]" /> + <xml-property name="description" value="Design of zone [Medium/Large?]" /> </xml-properties> </xml-element> <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> diff --git a/aai-resources/src/test/resources/test_aaiconfig.properties b/aai-resources/src/test/resources/test_aaiconfig.properties index d5a7c25..33cf631 100644 --- a/aai-resources/src/test/resources/test_aaiconfig.properties +++ b/aai-resources/src/test/resources/test_aaiconfig.properties @@ -98,10 +98,6 @@ aai.servicedescription.hostedcomm=HOSTED COMMUNICATIONS aai.servicedescription.mobility=MOBILITY aai.servicedescription.vusp=VIRTUAL USP -<<<<<<< HEAD -aai.notification.current.package=org.openecomp.aai.dbmapGen.v6 -======= ->>>>>>> feature/AAI-8158-cleanup-at-t-specific-reference aai.notification.current.version=v7 aai.notificationEvent.default.status=UNPROCESSED aai.notificationEvent.default.eventType=AAI-EVENT |