From ad07a8ba9780e2ffdb16c77d6a2970db42b1a957 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Tue, 12 Sep 2017 20:37:34 -0400 Subject: Add unit test cases to increase coverage to 30% Remove classes that are already removed internally Use a unified AAISetup class that uses common configuration Issue-ID: AAI-213 Change-Id: If99b5230140ea300cd70eeaf9fd4064e4a07d99a Signed-off-by: Venkata Harish K Kajur --- aai-resources/pom.xml | 6 + .../org/openecomp/aai/dbgen/GraphMLReaderNew.java | 353 -- .../org/openecomp/aai/dbgen/GraphMLWriterNew.java | 358 -- .../openecomp/aai/dbgen/PropertyNameChange.java | 317 -- .../openecomp/aai/util/GenerateMethodMapper.java | 142 - .../org/openecomp/aai/util/HttpsAuthClient.java | 237 - .../src/test/java/org/openecomp/aai/AAISetup.java | 37 + .../interceptors/AAILogJAXRSInInterceptorTest.java | 39 + .../interceptors/PostAaiAjscInterceptorTest.java | 53 + .../interceptors/PreAaiAjscInterceptorTest.java | 41 + .../openecomp/aai/migration/VertexMergeTest.java | 64 +- .../openecomp/aai/rest/BulkAddConsumerTest.java | 168 + .../aai/rest/BulkProcessConsumerTest.java | 54 + .../openecomp/aai/rest/ExampleConsumerTest.java | 131 + .../openecomp/aai/rest/ExceptionHandlerTest.java | 138 + .../openecomp/aai/rest/LegacyMoxyConsumerTest.java | 617 +++ .../aai/rest/URLFromVertexIdConsumerTest.java | 179 + .../openecomp/aai/rest/VertexIdConsumerTest.java | 158 + .../aai/rest/retired/RetiredConsumerTest.java | 107 + .../aai/rest/retired/V3ThroughV7ConsumerTest.java | 9 + .../openecomp/aai/rest/retired/V7V8ModelsTest.java | 9 + .../aai/rest/retired/V7V8NamedQueriesTest.java | 9 + .../rest/tools/ModelVersionTransformerTest.java | 116 + .../openecomp/aai/rest/util/EchoResponseTest.java | 116 + .../aai/rest/util/LogFormatToolsTest.java | 15 + .../aai/rest/util/ValidateEncodingTest.java | 9 +- .../org/openecomp/aai/schema/db/AuditOXMTest.java | 25 +- .../openecomp/aai/schema/db/ManageSchemaTest.java | 25 +- .../org/openecomp/aai/transforms/JoltTestUtil.java | 7 +- .../LowerHyphenToLowerCamelConverterTest.java | 73 + .../openecomp/aai/transforms/MapTraverserTest.java | 54 + .../aai/util/AAIApiServerURLBaseTest.java | 85 - .../org/openecomp/aai/util/AAIApiVersionTest.java | 90 - .../aai/util/AAIAppServletContextListenerTest.java | 25 +- .../org/openecomp/aai/util/AAICSVWriterTest.java | 19 +- .../aai/util/AAIConfigPasswordDecodingTest.java | 53 - .../openecomp/aai/util/AAIRSyncUtilityTest.java | 21 +- .../aai/util/DataConversionHelperTest.java | 4 +- .../java/org/openecomp/aai/util/DbTestConfig.java | 12 +- .../org/openecomp/aai/util/DbTestFileWatcher.java | 4 +- .../openecomp/aai/util/DbTestProcessBuilder.java | 6 +- .../openecomp/aai/util/HbaseSaltPrefixerTest.java | 4 +- ...tyObfuscationConversionCommandLineUtilTest.java | 4 +- .../etc/appprops/aaiconfig.properties | 2 + .../etc/appprops/titan-cached.properties | 17 + .../etc/appprops/titan-realtime.properties | 14 + .../bundleconfig-local/etc/oxm/aai_oxm_v10.xml | 777 +-- .../bundleconfig-local/etc/oxm/aai_oxm_v11.xml | 791 ++- .../bundleconfig-local/etc/oxm/aai_oxm_v8.xml | 656 +-- .../bundleconfig-local/etc/oxm/aai_oxm_v9.xml | 738 +-- .../etc/queryformats/graphson/resource.graphson | 2 + .../etc/queryformats/resource-format.json | 13 + .../etc/queryformats/resource_and_url-format.json | 16 + .../etc/queryformats/simple-format.json | 43 + aai-resources/src/test/resources/log4j.properties | 3 - .../openecomp/aai/introspection/aai_oxm_v10.xml | 5794 -------------------- .../openecomp/aai/introspection/aai_oxm_v11.xml | 5793 ------------------- .../org/openecomp/aai/introspection/aai_oxm_v8.xml | 85 - .../org/openecomp/aai/introspection/aai_oxm_v9.xml | 5574 ------------------- .../aai/introspection/sideeffect/nested-case.json | 18 - .../queryformats/graphson/resource.graphson | 2 - .../queryformats/resource-format.json | 13 - .../queryformats/resource_and_url-format.json | 16 - .../serialization/queryformats/simple-format.json | 43 - .../bulk/pserver-transactions-invalid.json | 44 + .../payloads/bulk/pserver-transactions.json | 35 + .../resources/payloads/modeltransforms/model.json | 38 + .../resources/payloads/modeltransforms/model.xml | 22 + .../resources/payloads/relationship/complex.json | 16 + .../relationship/pserver-complex-relationship.json | 8 + .../resources/payloads/relationship/pserver.json | 4 + .../payloads/resource/pserver-patch-test.json | 28 + .../test/resources/payloads/resource/pserver.json | 28 + 73 files changed, 4442 insertions(+), 20184 deletions(-) delete mode 100644 aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java delete mode 100644 aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java delete mode 100644 aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java delete mode 100644 aai-resources/src/main/java/org/openecomp/aai/util/GenerateMethodMapper.java delete mode 100644 aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/AAISetup.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/BulkAddConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/BulkProcessConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/ExampleConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/LegacyMoxyConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/URLFromVertexIdConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/VertexIdConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/retired/RetiredConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/retired/V3ThroughV7ConsumerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8ModelsTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8NamedQueriesTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/tools/ModelVersionTransformerTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java create mode 100644 aai-resources/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java delete mode 100644 aai-resources/src/test/java/org/openecomp/aai/util/AAIApiServerURLBaseTest.java delete mode 100644 aai-resources/src/test/java/org/openecomp/aai/util/AAIApiVersionTest.java delete mode 100644 aai-resources/src/test/java/org/openecomp/aai/util/AAIConfigPasswordDecodingTest.java create mode 100644 aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-cached.properties create mode 100644 aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-realtime.properties create mode 100644 aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/graphson/resource.graphson create mode 100644 aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource-format.json create mode 100644 aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource_and_url-format.json create mode 100644 aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/simple-format.json delete mode 100644 aai-resources/src/test/resources/log4j.properties delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/introspection/sideeffect/nested-case.json delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/resource.graphson delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource-format.json delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource_and_url-format.json delete mode 100644 aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/simple-format.json create mode 100644 aai-resources/src/test/resources/payloads/bulk/pserver-transactions-invalid.json create mode 100644 aai-resources/src/test/resources/payloads/bulk/pserver-transactions.json create mode 100644 aai-resources/src/test/resources/payloads/modeltransforms/model.json create mode 100644 aai-resources/src/test/resources/payloads/modeltransforms/model.xml create mode 100644 aai-resources/src/test/resources/payloads/relationship/complex.json create mode 100644 aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship.json create mode 100644 aai-resources/src/test/resources/payloads/relationship/pserver.json create mode 100644 aai-resources/src/test/resources/payloads/resource/pserver-patch-test.json create mode 100644 aai-resources/src/test/resources/payloads/resource/pserver.json (limited to 'aai-resources') diff --git a/aai-resources/pom.xml b/aai-resources/pom.xml index 8008a1d..900acaa 100644 --- a/aai-resources/pom.xml +++ b/aai-resources/pom.xml @@ -443,6 +443,12 @@ jersey-json 1.18 + + org.skyscreamer + jsonassert + 1.4.0 + test + aai-resources diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java deleted file mode 100644 index 4f3fee0..0000000 --- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java +++ /dev/null @@ -1,353 +0,0 @@ -/*- - * ============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.dbgen; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.lang.reflect.Array; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.events.XMLEvent; - -import org.apache.tinkerpop.gremlin.structure.Edge; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Vertex; - -//import com.infrasight.model.UnicodeUtil; -import com.thinkaurelius.titan.core.TitanGraph; - -/** - * GraphMLReader writes the data from a GraphML stream to a graph. - */ -public class GraphMLReaderNew { - public static final Charset charset = Charset.forName("UTF8"); - - /** - * Input the GraphML stream data into the graph. - * In practice, usually the provided graph is empty. - * - * @param graph the graph to populate with the GraphML data - * @param titanGraph the titan graph - * @param graphMLInputStream an InputStream of GraphML data - * @return the map - * @throws XMLStreamException thrown when the GraphML data is not correctly formatted - */ - public static Map inputGraph(final Graph graph, final TitanGraph titanGraph, final InputStream graphMLInputStream) throws XMLStreamException { - return inputGraph(graph, titanGraph, new InputStreamReader(graphMLInputStream, charset), 1000); - } - -/* public static void inputGraphFiltered(final Graph graph, final InputStream graphMLInputStream) throws XMLStreamException { - inputGraph(graph, UnicodeUtil.createFilteredReader(new InputStreamReader(graphMLInputStream, charset)), 1000); - }*/ - - private static class KeySpec { - String attrName; - String attrType; - - /** - * Instantiates a new key spec. - * - * @param name the name - * @param type the type - */ - public KeySpec(String name, String type) { - this.attrName = name; - this.attrType = type; - } - } - - /** - * Input the GraphML stream data into the graph. - * More control over how data is streamed is provided by this method. - * - * @param graph the graph to populate with the GraphML data - * @param titanGraph the titan graph - * @param inputReader an Reader of GraphML character data - * @param bufferSize the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs) - * @return the map - * @throws XMLStreamException thrown when the GraphML data is not correctly formatted - */ - public static Map inputGraph(final Graph graph, final TitanGraph titanGraph, final Reader inputReader, int bufferSize) throws XMLStreamException { - - XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); - inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); - XMLStreamReader reader = inputFactory.createXMLStreamReader(inputReader); - - //final BatchGraph graph = BatchGraph.wrap(inputGraph, bufferSize); - - Map keyMap = new HashMap(); - - // Buffered Vertex Data - String vertexId = null; - Map vertexProps = null; - boolean inVertex = false; - - // Buffered Edge Data - String edgeId = null; - String edgeLabel = null; - Vertex edgeInVertex = null; - Vertex edgeOutVertex = null; - Map edgeProps = null; - boolean inEdge = false; - Map vertexIdSetMap = new HashMap(); - - while (reader.hasNext()) { - - Integer eventType = reader.next(); - if (eventType.equals(XMLEvent.START_ELEMENT)) { - String elementName = reader.getName().getLocalPart(); - - if (elementName.equals(GraphMLTokens.KEY)) { - String id = reader.getAttributeValue(null, GraphMLTokens.ID); - String attributeName = reader.getAttributeValue(null, GraphMLTokens.ATTR_NAME); - String attributeType = reader.getAttributeValue(null, GraphMLTokens.ATTR_TYPE); - keyMap.put(id, new KeySpec(attributeName, attributeType)); - - } else if (elementName.equals(GraphMLTokens.NODE)) { - vertexId = reader.getAttributeValue(null, GraphMLTokens.ID); - inVertex = true; - vertexProps = new HashMap(); - - } else if (elementName.equals(GraphMLTokens.EDGE)) { - - - edgeId = reader.getAttributeValue(null, GraphMLTokens.ID); - edgeLabel = reader.getAttributeValue(null, GraphMLTokens.LABEL); - edgeLabel = edgeLabel == null ? GraphMLTokens._DEFAULT : edgeLabel; - - String outVertexId = reader.getAttributeValue(null, GraphMLTokens.SOURCE); - String inVertexId = reader.getAttributeValue(null, GraphMLTokens.TARGET); - - edgeOutVertex = graph.vertices(outVertexId).next(); - edgeInVertex = graph.vertices(inVertexId).next(); - - if (null == edgeOutVertex) { - edgeOutVertex = graph.addVertex(outVertexId); - } - if (null == edgeInVertex) { - edgeInVertex = graph.addVertex(inVertexId); - } - - inEdge = true; - edgeProps = new HashMap(); - - } else if (elementName.equals(GraphMLTokens.DATA)) { - String key = reader.getAttributeValue(null, GraphMLTokens.KEY); - KeySpec keySpec = keyMap.get(key); - - if (keySpec != null) { - Object value = readData(reader, keySpec.attrType); - if(value == null) - throw new RuntimeException("Empty data"); - if (inVertex == true) { - vertexProps.put(keySpec.attrName, value); - } else if (inEdge == true) { - edgeProps.put(keySpec.attrName, value); - } - } - - } - } else if (eventType.equals(XMLEvent.END_ELEMENT)) { - String elementName = reader.getName().getLocalPart(); - - if (elementName.equals(GraphMLTokens.NODE)) { - - Vertex currentVertex = graph.vertices(vertexId).next(); - if (currentVertex != null) - throw new RuntimeException("Duplicate vertex ID: "+vertexId); - currentVertex = graph.addVertex(vertexId); - Boolean hasCollection = false; - for (Entry prop : vertexProps.entrySet()) { - // multi-properties need a addProperty and need to use a TitanVertex - BluePrint - // Vertex does not support this - Object value = prop.getValue(); - if (value instanceof Collection) { - hasCollection = true; - vertexIdSetMap.put(currentVertex.id().toString() + "." + prop.getKey(), vertexProps); - currentVertex.property("has-collection", "true"); - } else { - currentVertex.property(prop.getKey(), value); - } - } - if (hasCollection) - System.out.println("---Found node with SET property vertex id:" + vertexId + " properties:" + vertexProps.toString()); - vertexId = null; - vertexProps = null; - inVertex = false; - } else if (elementName.equals(GraphMLTokens.EDGE)) { - Edge currentEdge = edgeOutVertex.addEdge(edgeLabel, edgeInVertex); - //addEdge(edgeId, edgeOutVertex, edgeInVertex, edgeLabel); - - for (Entry prop : edgeProps.entrySet()) { - currentEdge.property(prop.getKey(), prop.getValue()); - } - - edgeId = null; - edgeLabel = null; - edgeInVertex = null; - edgeOutVertex = null; - edgeProps = null; - inEdge = false; - } - - } - - } - - reader.close(); - graph.tx().close(); - - return vertexIdSetMap; - - } - - /** - * Read data. - * - * @param reader the reader - * @param type the type - * @return the object - * @throws XMLStreamException the XML stream exception - */ - private static Object readData(XMLStreamReader reader, String type) throws XMLStreamException { - Collection col = new ArrayList(); - - int pos = type.indexOf('-'); - if(pos < 0) - return typeCastValue(reader.getElementText(), type); - String arrayType = type.substring(0, pos); - type = type.substring(pos+1); - - boolean done = false; - while(!done) { - Integer eventType = reader.next(); - if(eventType.equals(XMLEvent.START_ELEMENT)) { - String text = reader.getElementText(); - Object value = typeCastValue(text, type); - col.add(value); - } - if(eventType.equals(XMLEvent.END_ELEMENT)) { - String elementName = reader.getName().getLocalPart(); - if(elementName.equals(GraphMLTokens.DATA)) { - done = true; - continue; - } - } - } - - if(arrayType.equals(GraphMLTokens.ARRAY)) { - Object arr = Array.newInstance(typeToClass(type), col.size()); - int i = 0; - for(Object obj : col) { - Array.set(arr, i, obj); - i++; - } - return arr; - } - else if(arrayType.equals(GraphMLTokens.SET)) - return new HashSet(col); - else if(type.startsWith(GraphMLTokens.LIST)) - return new HashSet(col); - - return col; - } - - /** - * Type to class. - * - * @param type the type - * @return the class - */ - private static Class typeToClass(String type) { - if (type.equals(GraphMLTokens.STRING)) - return String.class; - else if (type.equals(GraphMLTokens.FLOAT)) - return Float.TYPE; - else if (type.equals(GraphMLTokens.INT)) - return Integer.TYPE; - else if (type.equals(GraphMLTokens.DOUBLE)) - return Double.TYPE; - else if (type.equals(GraphMLTokens.BOOLEAN)) - return Boolean.TYPE; - else if (type.equals(GraphMLTokens.LONG)) - return Long.TYPE; - else - throw new RuntimeException("Unsupported type: "+type); - } - - /** - * Type cast value. - * - * @param value the value - * @param type the type - * @return the object - */ - private static Object typeCastValue(String value, String type) { - if (type.equals(GraphMLTokens.STRING)) - return value; - else if (type.equals(GraphMLTokens.FLOAT)) - return Float.valueOf(value); - else if (type.equals(GraphMLTokens.INT)) - return Integer.valueOf(value); - else if (type.equals(GraphMLTokens.DOUBLE)) - return Double.valueOf(value); - else if (type.equals(GraphMLTokens.BOOLEAN)) - return Boolean.valueOf(value); - else if (type.equals(GraphMLTokens.LONG)) - return Long.valueOf(value); - else - throw new RuntimeException("Unsupported type: "+type); - } - -/* TitanVertex titanVertex = (TitanVertex) titanGraph.getVertex(vertexId); - if (titanVertex != null) - throw new RuntimeException("Duplicate vertex ID: "+vertexId); - titanVertex = (TitanVertex) titanGraph.addVertex(vertexId); - for (Entry prop : vertexProps.entrySet()) { - // multi-properties need a addProperty and need to use a TitanVertex - BluePrint - // Vertex does not support this - Object value = prop.getValue(); - if (value instanceof Collection) { - try { - for(Object obj : ((Collection)value)) { - System.out.println("vertex id:property name:property value="+ vertexId + ":" + prop.getKey() + ":" + obj.toString()); - titanVertex.addProperty(prop.getKey(), obj.toString()); - } - } - catch (Exception e) { - System.out.println("Can't set SET/LIST properties - skipping"); - } - - } else - titanVertex.setProperty(prop.getKey(), prop.getValue()); - }*/ -} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java deleted file mode 100644 index 1704428..0000000 --- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java +++ /dev/null @@ -1,358 +0,0 @@ -/*- - * ============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.dbgen; - - -import java.io.OutputStream; -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tinkerpop.gremlin.structure.Direction; -import org.apache.tinkerpop.gremlin.structure.Edge; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Property; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.VertexProperty; - -/** - * GraphMLWriter writes a Graph to a GraphML OutputStream. - */ -public class GraphMLWriterNew { - - private static class KeySpec { - String attrName; - String attrType; - - /** - * Instantiates a new key spec. - * - * @param name the name - * @param type the type - */ - public KeySpec(String name, String type) { - this.attrName = name; - this.attrType = type; - } - } - - /** - * Write the data in a Graph to a GraphML OutputStream. - * - * @param graph the Graph to pull the data from - * @param graphMLOutputStream the GraphML OutputStream to write the Graph data to - * @throws XMLStreamException thrown if there is an error generating the GraphML data - */ - public static void outputGraph(final Graph graph, final OutputStream graphMLOutputStream) throws XMLStreamException { - Map vertexKeyTypes = new HashMap(); - Map edgeKeyTypes = new HashMap(); - - - Iterator vertices = graph.vertices(); - Vertex vertex = null; - Iterator> propertyIterator = null; - VertexProperty property = null; - while (vertices.hasNext()) { - vertex = vertices.next(); - propertyIterator = vertex.properties(); - while (propertyIterator.hasNext()) { - property = propertyIterator.next(); - Object value = property.value(); - String key = property.key(); - if(value == null) - continue; - String type = getStringType(value); - if(type == null) - continue; - String id = key+"-"+type; - if (!vertexKeyTypes.containsKey(id)) { - vertexKeyTypes.put(id, new KeySpec(key, type)); - } - } - } - Iterator edges = graph.edges(); - Edge edge = null; - Iterator> edgePropertyIterator = null; - Property edgeProperty = null; - - while (edges.hasNext()) { - edge = edges.next(); - edgePropertyIterator = edge.properties(); - while (edgePropertyIterator.hasNext()) { - edgeProperty = edgePropertyIterator.next(); - Object value = edgeProperty.value(); - String key = edgeProperty.key(); - if(value == null) - continue; - String type = getStringType(value); - if(type == null) - continue; - String id = key+"-"+type; - if (!edgeKeyTypes.containsKey(id)) { - edgeKeyTypes.put(id, new KeySpec(key, type)); - } - } - } - outputGraph(graph, graphMLOutputStream, vertexKeyTypes, edgeKeyTypes); - } - - /** - * Write the data in a Graph to a GraphML OutputStream. - * - * @param graph the Graph to pull the data from - * @param graphMLOutputStream the GraphML OutputStream to write the Graph data to - * @param vertexKeyTypes a Map of the data types of the vertex keys - * @param edgeKeyTypes a Map of the data types of the edge keys - * @throws XMLStreamException thrown if there is an error generating the GraphML data - */ - public static void outputGraph(final Graph graph, final OutputStream graphMLOutputStream, final Map vertexKeyTypes, final Map edgeKeyTypes) throws XMLStreamException { - XMLOutputFactory inputFactory = XMLOutputFactory.newInstance(); - XMLStreamWriter writer = inputFactory.createXMLStreamWriter(graphMLOutputStream, "UTF8"); - - writer.writeStartDocument("UTF-8", "1.0"); - writer.writeStartElement(GraphMLTokens.GRAPHML); - writer.writeAttribute(GraphMLTokens.XMLNS, GraphMLTokens.GRAPHML_XMLNS); - // - for (Map.Entry entry : vertexKeyTypes.entrySet()) { - writer.writeStartElement(GraphMLTokens.KEY); - writer.writeAttribute(GraphMLTokens.ID, entry.getKey()); - writer.writeAttribute(GraphMLTokens.FOR, GraphMLTokens.NODE); - writer.writeAttribute(GraphMLTokens.ATTR_NAME, entry.getValue().attrName); - writer.writeAttribute(GraphMLTokens.ATTR_TYPE, entry.getValue().attrType); - writer.writeEndElement(); - } - for (Map.Entry entry : edgeKeyTypes.entrySet()) { - writer.writeStartElement(GraphMLTokens.KEY); - writer.writeAttribute(GraphMLTokens.ID, entry.getKey()); - writer.writeAttribute(GraphMLTokens.FOR, GraphMLTokens.EDGE); - writer.writeAttribute(GraphMLTokens.ATTR_NAME, entry.getValue().attrName); - writer.writeAttribute(GraphMLTokens.ATTR_TYPE, entry.getValue().attrType); - writer.writeEndElement(); - } - - writer.writeStartElement(GraphMLTokens.GRAPH); - writer.writeAttribute(GraphMLTokens.ID, GraphMLTokens.G); - writer.writeAttribute(GraphMLTokens.EDGEDEFAULT, GraphMLTokens.DIRECTED); - Iterator vertices = graph.vertices(); - Vertex vertex = null; - Iterator> propertyIterator = null; - VertexProperty property = null; - while (vertices.hasNext()) { - vertex = vertices.next(); - writer.writeStartElement(GraphMLTokens.NODE); - writer.writeAttribute(GraphMLTokens.ID, vertex.id().toString()); - propertyIterator = vertex.properties(); - while (propertyIterator.hasNext()) { - property = propertyIterator.next(); - String key = property.key(); - writeData(writer, key, property.value()); - } - writer.writeEndElement(); - } - - Iterator edges = graph.edges(); - Edge edge = null; - Iterator> edgePropertyIterator = null; - Property edgeProperty = null; - - while (edges.hasNext()) { - edge = edges.next(); - edgePropertyIterator = edge.properties(); - writer.writeStartElement(GraphMLTokens.EDGE); - writer.writeAttribute(GraphMLTokens.ID, edge.id().toString()); - writer.writeAttribute(GraphMLTokens.SOURCE, edge.outVertex().id().toString()); - writer.writeAttribute(GraphMLTokens.TARGET, edge.inVertex().id().toString()); - writer.writeAttribute(GraphMLTokens.LABEL, edge.label()); - - while (edgePropertyIterator.hasNext()) { - edgeProperty = edgePropertyIterator.next(); - String key = edgeProperty.key(); - writeData(writer, key, edgeProperty.value()); - } - writer.writeEndElement(); - } - - writer.writeEndElement(); // graph - writer.writeEndElement(); // graphml - writer.writeEndDocument(); - - writer.flush(); - writer.close(); - - } - - /** - * Write data. - * - * @param writer the writer - * @param key the key - * @param value the value - * @throws XMLStreamException the XML stream exception - */ - private static void writeData(XMLStreamWriter writer, String key, Object value) throws XMLStreamException { - if(value == null) - return; - String type = getStringType(value); - if(type == null) - return; - String id = key+"-"+type; - - writer.writeStartElement(GraphMLTokens.DATA); - writer.writeAttribute(GraphMLTokens.KEY, id); - if(type.startsWith(GraphMLTokens.ARRAY) || - type.startsWith(GraphMLTokens.LIST) || - type.startsWith(GraphMLTokens.SET)) - writeDataArray(writer, value); - else - writer.writeCharacters(propertyValueToString(value)); - writer.writeEndElement(); - } - - /** - * Write data array. - * - * @param writer the writer - * @param value the value - * @throws XMLStreamException the XML stream exception - */ - private static void writeDataArray(XMLStreamWriter writer, Object value) throws XMLStreamException { - if(value.getClass().isArray()) { - for(int i = 0; i < Array.getLength(value); i++) { - writer.writeStartElement(GraphMLTokens.ITEM); - writer.writeCharacters(Array.get(value, i).toString()); - writer.writeEndElement(); - } - } - else if(value instanceof Collection) { - for(Object obj : ((Collection)value)) { - writer.writeStartElement(GraphMLTokens.ITEM); - writer.writeCharacters(obj.toString()); - writer.writeEndElement(); - } - } - } - - /** - * Gets the string type. - * - * @param object the object - * @return the string type - */ - private static String getStringType(final Object object) { - if(object.getClass().isArray()) - return GraphMLTokens.ARRAY+"-"+getStringType(object.getClass().getComponentType()); - if(object instanceof Collection) { - String colType; - if(object instanceof Set) - colType = GraphMLTokens.SET; - else if(object instanceof List) - colType = GraphMLTokens.LIST; - else - throw new RuntimeException("Unhandled Collection type: "+object.getClass()); - - Collection col = (Collection)object; - if(col.size() == 0) - return null; - return colType+"-"+getStringType(col.iterator().next()); - } - if (object instanceof String) - return GraphMLTokens.STRING; - else if (object instanceof Integer) - return GraphMLTokens.INT; - else if (object instanceof Long) - return GraphMLTokens.LONG; - else if (object instanceof Float) - return GraphMLTokens.FLOAT; - else if (object instanceof Double) - return GraphMLTokens.DOUBLE; - else if (object instanceof Boolean) - return GraphMLTokens.BOOLEAN; - else - throw new RuntimeException("Unsupported type: "+object.getClass()); - } - - /** - * Gets the string type. - * - * @param clazz the clazz - * @return the string type - */ - private static String getStringType(final Class clazz) { - if(clazz.equals(String.class)) - return GraphMLTokens.STRING; - else if(clazz.equals(Integer.TYPE) || clazz.equals(Integer.class)) - return GraphMLTokens.INT; - else if(clazz.equals(Long.TYPE) || clazz.equals(Long.class)) - return GraphMLTokens.LONG; - else if(clazz.equals(Float.TYPE) || clazz.equals(Float.class)) - return GraphMLTokens.FLOAT; - else if(clazz.equals(Double.TYPE) || clazz.equals(Double.class)) - return GraphMLTokens.DOUBLE; - else if(clazz.equals(Boolean.TYPE) || clazz.equals(Boolean.class)) - return GraphMLTokens.BOOLEAN; - else - throw new RuntimeException("Unsupported array item type: "+clazz); - } - - /** - * Property value to string. - * - * @param value the value - * @return the string - */ - private static String propertyValueToString(Object value) { - if(value == null) - return null; - - if(value.getClass().isArray()) { - String str = "["; - for(int i = 0; i < Array.getLength(value); i++) { - if(i > 0) - str += ", "; - str += Array.get(value, i); - } - str += "]"; - return str; - } - else if(value instanceof Collection) { - String str = "["; - int i = 0; - for(Object obj : ((Collection)value)) { - if(i > 0) - str += ", "; - str += obj.toString(); - i++; - } - str += "]"; - return str; - } - return value.toString(); - } - -} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java deleted file mode 100644 index 3f7f351..0000000 --- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java +++ /dev/null @@ -1,317 +0,0 @@ -/*- - * ============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.dbgen; - -import java.util.Iterator; -import java.util.Properties; - -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.VertexProperty; - -import org.openecomp.aai.dbmap.AAIGraph; -import org.openecomp.aai.logging.ErrorLogHelper; -import org.openecomp.aai.util.AAIConfig; -import org.openecomp.aai.util.AAIConstants; -import com.att.eelf.configuration.Configuration; -import com.thinkaurelius.titan.core.PropertyKey; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanProperty; -import com.thinkaurelius.titan.core.TitanVertex; -import com.thinkaurelius.titan.core.schema.TitanManagement; - - -public class PropertyNameChange { - - /** - * The main method. - * - * @param args the arguments - */ - public static void main(String[] args) { - - // Set the logging file properties to be used by EELFManager - Properties props = System.getProperties(); - props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS); - props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); - - // NOTE -- We're just working with properties that are used for NODES for now. - - TitanGraph graph = null; - TitanManagement graphMgt = null;; - Boolean preserveData = true; - String propName = ""; - String targetPropName = ""; - String targetNodeType = ""; - String skipCommit = ""; - boolean noCommit = false; - - - String usageString = "Usage: PropertyNameChange propertyName targetPropertyName nodeType(or NA) skipCommit(true|false) \n"; - if( args.length != 4 ){ - String emsg = "Four Parameters are required. \n" + usageString; - System.out.println( emsg ); - System.exit(1); - } - else { - propName = args[0]; - targetPropName = args[1]; - targetNodeType = args[2]; - skipCommit = args[3]; - if ( skipCommit.toLowerCase().equals("true")) - noCommit = true; - } - - if( propName.equals("") ){ - String emsg = "Bad parameter - propertyName cannot be empty. \n" + usageString; - System.out.println( emsg ); - System.exit(1); - } - - - - try { - AAIConfig.init(); - ErrorLogHelper.loadProperties(); - } - catch( Exception ae ){ - String emsg = "Problem with either AAIConfig.init() or ErrorLogHelper.LoadProperties(). "; - System.out.println( emsg + "[" + ae.getMessage() + "]"); - System.exit(1); - } - - - System.out.println(">>> Processing will begin in 5 seconds (unless interrupted). <<<"); - try { - // Give them a chance to back out of this - Thread.sleep(5000); - } catch ( java.lang.InterruptedException ie) { - System.out.println( " DB Schema Update has been aborted. "); - System.exit(1); - } - - try { - System.out.println(" ---- NOTE --- about to open graph (takes a little while)\n"); - - graph = AAIGraph.getInstance().getGraph(); - if( graph == null ){ - String emsg = "Not able to get a graph object in SchemaMod.java\n"; - System.out.println( emsg ); - System.exit(1); - } - - // Make sure this property is in the DB. - graphMgt = graph.openManagement(); - if( graphMgt == null ){ - String emsg = "Not able to get a graph Management object in SchemaMod.java\n"; - System.out.println( emsg ); - System.exit(1); - } - PropertyKey origPropKey = graphMgt.getPropertyKey(propName); - if( origPropKey == null ){ - String emsg = "The propName = [" + propName + "] is not defined in our graph. "; - System.out.println( emsg ); - System.exit(1); - } - origPropKey = graphMgt.getPropertyKey(targetPropName); - if( origPropKey == null ){ - String emsg = "The targetPropName = [" + targetPropName + "] is not defined in our graph. "; - System.out.println( emsg ); - System.exit(1); - } - - if ( !targetNodeType.equals("NA")) { - if ( graphMgt.getVertexLabel(targetNodeType) == null ) { - String emsg = "The targetNodeType = [" + targetNodeType + "] is not defined in our graph. "; - System.out.println( emsg ); - System.exit(1); - } - } - - // For each node that has this property, update the new from the old and then remove the - // old property from that node - Iterable verts = null; - int vtxCount = 0; - String label; - long longId; - - int propertyCount; - - Iterator> titanProperties = null; - - VertexProperty tmpProperty = null; - Object origVal; - Object targetVal; - - if ( targetNodeType.equals("NA")) { - verts= graph.query().has(propName).vertices(); - Iterator it = verts.iterator(); - - while( it.hasNext() ){ - - TitanVertex tmpVtx = (TitanVertex)it.next(); - String tmpVid = tmpVtx.id().toString(); - - origVal = tmpVtx.property(propName).orElse(null); - targetVal = tmpVtx.property(targetPropName).orElse(null); - - label = tmpVtx.label(); - longId = tmpVtx.longId(); - - if ( targetVal != null ) { - System.out.println( "vertex [" + label + "] id " + tmpVid + " has " + targetPropName + - " with value " + targetVal + ", skip adding with value " + origVal); - continue; - } - vtxCount++; - titanProperties = tmpVtx.properties(); // current properties - - propertyCount = 0; - - while( titanProperties.hasNext() ){ - - tmpProperty = titanProperties.next(); - - if ( propertyCount == 0 ) - System.out.print( "adding to [" + label + "] vertex id " + tmpVid + " with existing properties " + - tmpProperty.toString() ); - else - System.out.print(", " + tmpProperty.toString()); - ++propertyCount; - } - - if ( propertyCount > 0 ) { - System.out.println(""); - - tmpVtx.property(targetPropName,origVal); - System.out.println("INFO -- just did the add using " + longId + - " with label " + label + "] and updated it with the orig value (" + - origVal.toString() + ")"); - titanProperties = tmpVtx.properties(); // current properties - propertyCount = 0; - - - while( titanProperties.hasNext() ){ - tmpProperty = titanProperties.next(); - if ( propertyCount == 0 ) - System.out.print( "new property list for [" + label + "] vertex id " + tmpVid + " with existing properties " + - tmpProperty.toString() ); - else - System.out.print(", " + tmpProperty.toString()); - ++propertyCount; - } - - if ( propertyCount > 0 ) - System.out.println(""); - } - } - } else { - // targetNodeType is NA - - verts= graph.query().has("aai-node-type", targetNodeType).vertices(); - if( verts != null ){ - // We did find some matching vertices - Iterator it = verts.iterator(); - Object propVal; - while( it.hasNext() ){ - TitanVertex v = (TitanVertex)it.next(); - label = v.label(); - longId = v.longId(); - targetVal = v.property(targetPropName).orElse(null); - origVal = v.property(propName).orElse(null); - - if ( origVal == null) - continue; - - if ( targetVal != null ) { - System.out.println( "vertex [" + label + "] id " + longId + " has " + targetPropName + - " with value " + targetVal + ", skip adding with value " + origVal); - continue; - } - titanProperties = v.properties(); // current properties - propertyCount = 0; - if ( v.property(propName).orElse(null) != null ) { - propVal = v.property(propName).orElse(null); - v.property(targetPropName, propVal); - ++vtxCount; - while( titanProperties.hasNext() ){ - - tmpProperty = titanProperties.next(); - if ( propertyCount == 0 ) - System.out.print( "adding to vertex id " + longId + " with existing properties " + - tmpProperty.toString() ); - else - System.out.print(", " + tmpProperty.toString()); - ++propertyCount; - } - - if ( propertyCount > 0 ) - System.out.println(""); - System.out.println("INFO -- just did the add target [" + targetNodeType + "] using " + longId + - " with label " + label + "] and updated it with the orig value (" + - propVal.toString() + ")"); - propertyCount = 0; - while( titanProperties.hasNext() ){ - - tmpProperty = titanProperties.next(); - if ( propertyCount == 0 ) - System.out.print( "new property list for vertex [" + label + "] id " + longId + " with existing properties " + - tmpProperty.toString() ); - else - System.out.print(", " + tmpProperty.toString()); - ++propertyCount; - } - - if ( propertyCount > 0 ) - System.out.println(""); - } - } - } - - } - - System.out.println("added properties data for " + vtxCount + " vertexes. noCommit " + noCommit); - if ( !noCommit ) - graph.tx().commit(); - } - catch (Exception ex) { - System.out.print("Threw a regular Exception:\n"); - System.out.println(ex.getMessage()); - } - finally { - if( graphMgt != null && graphMgt.isOpen() ){ - // Any changes that worked correctly should have already done their commits. - graphMgt.rollback(); - } - if( graph != null ){ - // Any changes that worked correctly should have already done their commits. - graph.tx().rollback(); - graph.close(); - } - } - - System.exit(0); - - }// End of main() - - -} - - diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/GenerateMethodMapper.java b/aai-resources/src/main/java/org/openecomp/aai/util/GenerateMethodMapper.java deleted file mode 100644 index dd72530..0000000 --- a/aai-resources/src/main/java/org/openecomp/aai/util/GenerateMethodMapper.java +++ /dev/null @@ -1,142 +0,0 @@ -/*- - * ============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.util; - -import java.io.FileWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import org.openecomp.aai.audit.ListEndpoints; -import org.openecomp.aai.introspection.Version; - -public class GenerateMethodMapper { - - private final static String filePath = "bundleconfig-local/etc/appprops/methodMapper.properties"; - - /** - * The main method. - * - * @param args the arguments - * @throws Exception the exception - */ - public static void main(String[] args) throws Exception { - - ListEndpoints le = null; - JSONObject jo = new JSONObject(); - JSONArray ja = new JSONArray(); - - for (Version version : Version.values()) { - - le = new ListEndpoints(version); - Map ln = le.getLogicalNames(); - List keys = new ArrayList(ln.keySet()); - Collections.sort(keys); - for (String key : keys) { - addEndpointToJsonArray(key, ln.get(key), ja, version.toString()); - } - - } - - addUniqueEndpoints(ja); - - jo.put("ActiveAndAvailableInventory-CloudNetwork", ja); - try (FileWriter file = new FileWriter(filePath)) { - file.write(jo.toString(4)); - } - - System.exit(0); - - } - - /** - * Adds the unique endpoints. - * - * @param ja the ja - * @throws JSONException the JSON exception - */ - private static void addUniqueEndpoints(JSONArray ja) throws JSONException { - JSONObject joItem = new JSONObject(); - joItem.put("url", "/aai/{version}/service-design-and-creation/models*"); - joItem.put("method", "get"); - joItem.put("logicalName", "GetModel"); - ja.put(joItem); - joItem = new JSONObject(); - joItem.put("url", "/aai/{version}/service-design-and-creation/models*"); - joItem.put("method", "put"); - joItem.put("logicalName", "PutModel"); - ja.put(joItem); - joItem = new JSONObject(); - joItem.put("url", "/aai/{version}/service-design-and-creation/models*"); - joItem.put("method", "delete"); - joItem.put("logicalName", "DeleteModel"); - ja.put(joItem); - joItem = new JSONObject(); - joItem.put("url", "/aai/{version}/service-design-and-creation/named-queries/*"); - joItem.put("method", "get"); - joItem.put("logicalName", "GetNamedQuery"); - ja.put(joItem); - } - - /** - * Adds the endpoint to json array. - * - * @param url the url - * @param name the name - * @param ja the ja - * @param apiVersion the api version - * @throws JSONException the JSON exception - */ - private static void addEndpointToJsonArray(String url, String name, JSONArray ja, String apiVersion) - throws JSONException { - - JSONObject joGet = new JSONObject(); - JSONObject joPut = new JSONObject(); - JSONObject joDel = new JSONObject(); - - if (!url.endsWith("relationship")) { - joGet.put("url", url); - joGet.put("method", "get"); - joGet.put("logicalName", apiVersion + "Get" + name); - ja.put(joGet); - } - - if (url.endsWith("}") || url.endsWith("relationship")) { - joPut.put("url", url); - joPut.put("method", "put"); - joPut.put("logicalName", apiVersion + "Put" + name); - ja.put(joPut); - - joDel.put("url", url); - joDel.put("method", "delete"); - joDel.put("logicalName", apiVersion + "Delete" + name); - ja.put(joDel); - - } - - } - -} diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java b/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java deleted file mode 100644 index 000ebd0..0000000 --- a/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java +++ /dev/null @@ -1,237 +0,0 @@ -/*- - * ============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.util; - -import java.io.FileInputStream; -import java.security.KeyManagementException; -import java.security.KeyStore; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; - -import org.openecomp.aai.domain.yang.Customers; -import org.openecomp.aai.exceptions.AAIException; -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.config.ClientConfig; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.client.filter.LoggingFilter; -import com.sun.jersey.api.json.JSONConfiguration; -import com.sun.jersey.client.urlconnection.HTTPSProperties; - -import static java.util.Base64.getEncoder; - -public class HttpsAuthClient{ - - /** - * The main method. - * - * @param args the arguments - */ - public static void main(String[] args) { - try { - String url = AAIConfig.get(AAIConstants.AAI_SERVER_URL) + "business/customers"; - System.out.println("Making Jersey https call..."); - Client client = HttpsAuthClient.getTwoWaySSLClient(); - - ClientResponse res = client.resource(url) - .accept("application/json") - .header("X-TransactionId", "PROV001") - .header("X-FromAppId", "AAI") - .type("application/json") - .get(ClientResponse.class); - -// System.out.println("Jersey result: "); -// System.out.println(res.getEntity(String.class).toString()); - - Customers customers = res.getEntity(Customers.class); - System.out.println("Jersey result: "); - System.out.println("Number of customers: " + customers.getCustomer().size()); - - } catch (KeyManagementException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * Gets the client. - * - * @return the client - * @throws KeyManagementException the key management exception - */ - public static Client getTwoWaySSLClient() throws KeyManagementException { - - ClientConfig config = new DefaultClientConfig(); - config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); - config.getClasses().add(org.openecomp.aai.restcore.CustomJacksonJaxBJsonProvider.class); - - SSLContext ctx = null; - try { - String truststore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_FILENAME); - String truststore_password = AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_PASSWD); - String keystore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_KEYSTORE_FILENAME); - String keystore_password = AAIConfig.get(AAIConstants.AAI_KEYSTORE_PASSWD); - - System.setProperty("javax.net.ssl.trustStore", truststore_path); - System.setProperty("javax.net.ssl.trustStorePassword", truststore_password); - HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){ - public boolean verify(String string,SSLSession ssls) { - return true; - } - }); - - ctx = SSLContext.getInstance("TLSv1.2"); - KeyManagerFactory kmf = null; - try { - kmf = KeyManagerFactory.getInstance("SunX509"); - FileInputStream fin = new FileInputStream(keystore_path); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char[] pwd = keystore_password.toCharArray(); - ks.load(fin, pwd); - kmf.init(ks, pwd); - } catch (Exception e) { - System.out.println("Error setting up kmf: exiting"); - e.printStackTrace(); - System.exit(1); - } - - ctx.init(kmf.getKeyManagers(), null, null); - config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, - new HTTPSProperties( new HostnameVerifier() { - @Override - public boolean verify( String s, SSLSession sslSession ) { - return true; - } - }, ctx)); - } catch (Exception e) { - System.out.println("Error setting up config: exiting"); - e.printStackTrace(); - System.exit(1); - } - - Client client = Client.create(config); - // uncomment this line to get more logging for the request/response - // client.addFilter(new LoggingFilter(System.out)); - - return client; - } - - public static Client getBasicAuthClient() throws AAIException { - - String truststore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_FILENAME); - System.setProperty("javax.net.ssl.trustStore", truststore_path); - - javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() { - public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) { - return true; - } - }); - - String userName = AAIConfig.get("aai.tools.username"); - String password = AAIConfig.get("aai.tools.password"); - // ClientConfig config = new DefaultClientConfig(); - Client client = Client.create(); - //client.addFilter(new HTTPBasicAuthFilter(userName, password)); - - - - - return client; - } - - public static String getBasicAuthHeaderValue() throws AAIException { - - - String userName = AAIConfig.get("aai.tools.username", ""); - String password = AAIConfig.get("aai.tools.password", ""); - String authString = userName + ":" + password; - byte[] s = getEncoder().encode(authString.getBytes()); - String basicauthStringEnc = new String(s); - - return "Basic " + basicauthStringEnc; - - } - - - public static Client getClient() throws KeyManagementException { - - ClientConfig config = new DefaultClientConfig(); - config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); - config.getClasses().add(org.openecomp.aai.restcore.CustomJacksonJaxBJsonProvider.class); - - SSLContext ctx = null; - try { - String truststore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_FILENAME); - String truststore_password = AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_PASSWD); - String keystore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_KEYSTORE_FILENAME); - String keystore_password = AAIConfig.get(AAIConstants.AAI_KEYSTORE_PASSWD); - - System.setProperty("javax.net.ssl.trustStore", truststore_path); - System.setProperty("javax.net.ssl.trustStorePassword", truststore_password); - HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){ - public boolean verify(String string,SSLSession ssls) { - return true; - } - }); - - ctx = SSLContext.getInstance("TLSv1.2"); - KeyManagerFactory kmf = null; - try { - kmf = KeyManagerFactory.getInstance("SunX509"); - FileInputStream fin = new FileInputStream(keystore_path); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char[] pwd = keystore_password.toCharArray(); - ks.load(fin, pwd); - kmf.init(ks, pwd); - } catch (Exception e) { - System.out.println("Error setting up kmf: exiting"); - e.printStackTrace(); - System.exit(1); - } - - ctx.init(kmf.getKeyManagers(), null, null); - config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, - new HTTPSProperties( new HostnameVerifier() { - @Override - public boolean verify( String s, SSLSession sslSession ) { - return true; - } - }, ctx)); - } catch (Exception e) { - System.out.println("Error setting up config: exiting"); - e.printStackTrace(); - System.exit(1); - } - - Client client = Client.create(config); - // uncomment this line to get more logging for the request/response - // client.addFilter(new LoggingFilter(System.out)); - - return client; - } - -} diff --git a/aai-resources/src/test/java/org/openecomp/aai/AAISetup.java b/aai-resources/src/test/java/org/openecomp/aai/AAISetup.java new file mode 100644 index 0000000..0f2480d --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/AAISetup.java @@ -0,0 +1,37 @@ +package org.openecomp.aai; + +import org.apache.commons.io.IOUtils; +import org.junit.BeforeClass; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; +import org.openecomp.aai.util.AAIConstants; + +import java.io.IOException; +import java.io.InputStream; + +import static org.junit.Assert.assertNotNull; + +public abstract class AAISetup { + + @BeforeClass + public static void setupBundleconfig() throws Exception { + System.setProperty("AJSC_HOME", "."); + System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); + QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), + "src/test/resources/bundleconfig-local/etc/oxm/"); + } + + public String getPayload(String filename) throws IOException { + + InputStream inputStream = getClass() + .getClassLoader() + .getResourceAsStream(filename); + + String message = String.format("Unable to find the %s in src/test/resources", filename); + assertNotNull(message, inputStream); + + String resource = IOUtils.toString(inputStream); + return resource; + } +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java b/aai-resources/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java new file mode 100644 index 0000000..a61feba --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptorTest.java @@ -0,0 +1,39 @@ +package org.openecomp.aai.interceptors; + +import org.apache.cxf.message.Exchange; +import org.apache.cxf.message.ExchangeImpl; +import org.apache.cxf.message.Message; +import org.junit.Before; +import org.junit.Test; +import org.openecomp.aai.AAISetup; + +import java.io.IOException; +import java.io.InputStream; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class AAILogJAXRSInInterceptorTest extends AAISetup { + + private AAILogJAXRSInInterceptor aaiLogJAXRSInInterceptor; + + @Before + public void setup(){ + aaiLogJAXRSInInterceptor = new AAILogJAXRSInInterceptor(); + } + + @Test + public void testHandleMessageWhenNotCamelRequest() throws IOException { + + Message message = mock(Message.class); + Exchange exchange = new ExchangeImpl(); + InputStream is = getClass().getClassLoader().getResourceAsStream("logback.xml"); + + when(message.getExchange()).thenReturn(exchange); + when(message.getContent(InputStream.class)).thenReturn(is); + +// when(message.get(Message.QUERY_STRING)).thenReturn("/somestring"); + when(message.get("CamelHttpUrl")).thenReturn("/somestring"); + aaiLogJAXRSInInterceptor.handleMessage(message); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java b/aai-resources/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java new file mode 100644 index 0000000..dc6879d --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/interceptors/PostAaiAjscInterceptorTest.java @@ -0,0 +1,53 @@ +package org.openecomp.aai.interceptors; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.logging.LoggingContext; + +import javax.servlet.http.HttpServletRequest; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class PostAaiAjscInterceptorTest { + + private PostAaiAjscInterceptor postAaiAjscInterceptor; + + @Before + public void setup(){ + postAaiAjscInterceptor = new PostAaiAjscInterceptor(); + } + + @Test + public void getInstance() throws Exception { + PostAaiAjscInterceptor interceptor = PostAaiAjscInterceptor.getInstance(); + assertNotNull(interceptor); + } + + @Test + public void testAllowOrRejectIfSuccess() throws Exception { + + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + + LoggingContext.put(LoggingContext.LoggingField.RESPONSE_CODE.toString(), "SUCCESS"); + Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("/fadsjoifj")); + + boolean success = postAaiAjscInterceptor.allowOrReject(request, null, null); + + assertTrue("Expecting the post interceptor to return success regardless", success); + } + + @Test + public void testAllowOrRejectIfFailure() throws Exception { + + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + + LoggingContext.put(LoggingContext.LoggingField.RESPONSE_CODE.toString(), "ERR."); + Mockito.when(request.getRequestURL()).thenReturn(new StringBuffer("/fadsjoifj")); + + boolean success = postAaiAjscInterceptor.allowOrReject(request, null, null); + + assertTrue("Expecting the post interceptor to return success regardless", success); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java b/aai-resources/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java new file mode 100644 index 0000000..5debe72 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/interceptors/PreAaiAjscInterceptorTest.java @@ -0,0 +1,41 @@ +package org.openecomp.aai.interceptors; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; + +import javax.servlet.http.HttpServletRequest; + +import static org.junit.Assert.*; +import static org.mockito.Matchers.anyString; + +public class PreAaiAjscInterceptorTest { + + private PreAaiAjscInterceptor preAaiAjscInterceptor; + + @Before + public void setup(){ + preAaiAjscInterceptor = new PreAaiAjscInterceptor(); + } + + @Test + public void getInstance() throws Exception { + PreAaiAjscInterceptor interceptor = PreAaiAjscInterceptor.getInstance(); + assertNotNull(interceptor); + } + + @Test + public void testAllowOrRejectIfSuccess() throws Exception { + + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + + Mockito.when(request.getRequestURI()).thenReturn("/fadsjoifj"); + Mockito.when(request.getHeader(anyString())).thenReturn("JUNIT-Test"); + Mockito.when(request.getMethod()).thenReturn("GET"); + + boolean success = preAaiAjscInterceptor.allowOrReject(request, null, null); + + assertTrue("Expecting the post interceptor to return success regardless", success); + } + +} \ No newline at end of file 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 5b71cf7..71e3827 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 @@ -20,26 +20,15 @@ package org.openecomp.aai.migration; -import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import java.io.UnsupportedEncodingException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - +import com.thinkaurelius.titan.core.Cardinality; +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.schema.TitanManagement; 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.junit.*; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.dbmap.DBConnectionType; import org.openecomp.aai.introspection.Loader; @@ -51,36 +40,36 @@ 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.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.schema.TitanManagement; +import java.io.UnsupportedEncodingException; +import java.util.*; + +import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; @Ignore -public class VertexMergeTest { +public class VertexMergeTest extends AAISetup { private final static Version version = Version.v10; private final static ModelType introspectorFactoryType = ModelType.MOXY; private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; private final static DBConnectionType type = DBConnectionType.REALTIME; - private static Loader loader; - private static TransactionalGraphEngine dbEngine; - private static TitanGraph graph; - private static EdgeRules rules; - private static GraphTraversalSource g; - private static Graph tx; - @BeforeClass - public static void setUp() throws NoSuchFieldException, SecurityException, Exception { + private Loader loader; + private TransactionalGraphEngine dbEngine; + private TitanGraph graph; + private EdgeRules rules; + private GraphTraversalSource g; + private Graph tx; + + @Before + public void setUp() throws Exception { graph = TitanFactory.build().set("storage.backend","inmemory").open(); tx = graph.newTransaction(); 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/"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, @@ -164,8 +153,9 @@ public class VertexMergeTest { VertexMerge merge = new VertexMerge.Builder(loader, spy, serializer).build(); merge.performMerge(pserverCanopi, pserverSkeleton, forceCopy); } - @AfterClass - public static void cleanUp() { + + @After + public void cleanUp() { tx.tx().rollback(); graph.close(); } diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/BulkAddConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/BulkAddConsumerTest.java new file mode 100644 index 0000000..2804566 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/BulkAddConsumerTest.java @@ -0,0 +1,168 @@ +package org.openecomp.aai.rest; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.apache.commons.io.IOUtils; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.introspection.Version; + +import javax.ws.rs.core.*; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class BulkAddConsumerTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + protected static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + protected BulkConsumer bulkConsumer; + + protected HttpHeaders httpHeaders; + + protected UriInfo uriInfo; + + protected MultivaluedMap headersMultiMap; + protected MultivaluedMap queryParameters; + + protected List aaiRequestContextList; + + protected List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(BulkAddConsumerTest.class.getName()); + + @BeforeClass + public static void setupRest(){ + AAIGraph.getInstance(); + ModelInjestor.getInstance(); + } + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + bulkConsumer = getConsumer(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testBulkAdd() throws IOException { + + String uri = "/aai/v11/bulkadd"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + String payload = getBulkPayload("pserver-transactions"); + Response response = bulkConsumer.bulkAdd( + payload, + Version.getLatest().toString(), + httpHeaders, + uriInfo, + null + ); + + System.out.println("Code: " + response.getStatus() + "\tResponse: " + response.getEntity()); + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + } + + @Test + public void testBulkAddThrowExceptionWhenPayloadContainsNoTransactions(){ + + String uri = "/aai/v11/bulkadd"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + String payload = "{\"transactions\":[]}"; + Response response = bulkConsumer.bulkAdd( + payload, + Version.getLatest().toString(), + httpHeaders, + uriInfo, + null + ); + + System.out.println("Code: " + response.getStatus() + "\tResponse: " + response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } + + @Test + public void testBulkAddThrowExceptionWhenInvalidJson() throws IOException { + + String uri = "/aai/v11/bulkadd"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + String payload = "{"; + Response response = bulkConsumer.bulkAdd( + payload, + Version.getLatest().toString(), + httpHeaders, + uriInfo, + null + ); + + System.out.println("Code: " + response.getStatus() + "\tResponse: " + response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + + // TODO - Verify the result output and check if it contains an 400 in the list + } + + public String getBulkPayload(String bulkName) throws IOException { + return getPayload("payloads/bulk/" + bulkName + ".json"); + } + + public BulkConsumer getConsumer(){ + return new BulkAddConsumer(); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/BulkProcessConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/BulkProcessConsumerTest.java new file mode 100644 index 0000000..64639d4 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/BulkProcessConsumerTest.java @@ -0,0 +1,54 @@ +package org.openecomp.aai.rest; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.apache.commons.io.IOUtils; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.introspection.Version; + +import javax.ws.rs.core.*; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class BulkProcessConsumerTest extends BulkAddConsumerTest { + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(BulkProcessConsumerTest.class.getName()); + + @Test + public void testBulkAddCreatedWhenOneTransactionInPayloadContainsNotAllowedVerb() throws IOException { + + String uri = "/aai/v11/bulkadd"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + String payload = getBulkPayload("pserver-transactions-invalid"); + Response response = bulkConsumer.bulkAdd( + payload, + Version.getLatest().toString(), + httpHeaders, + uriInfo, + null + ); + + System.out.println("Code: " + response.getStatus() + "\tResponse: " + response.getEntity()); + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + } + + @Override + public BulkConsumer getConsumer(){ + return new BulkProcessConsumer(); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/ExampleConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/ExampleConsumerTest.java new file mode 100644 index 0000000..28d5527 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/ExampleConsumerTest.java @@ -0,0 +1,131 @@ +package org.openecomp.aai.rest; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.introspection.Version; + +import javax.ws.rs.core.*; + +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class ExampleConsumerTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private ExampleConsumer exampleConsumer; + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(LegacyMoxyConsumerTest.class.getName()); + + @BeforeClass + public static void setupRest(){ + AAIGraph.getInstance(); + ModelInjestor.getInstance(); + } + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + exampleConsumer = new ExampleConsumer(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testGetExampleRespondsWithOkStatusForValidObject(){ + + Response response = exampleConsumer.getExample( + Version.getLatest().toString(), + "pserver", + httpHeaders, + uriInfo, + null); + + assertNotNull("Response from the example consumer returned null", response); + + int code = Response.Status.OK.getStatusCode(); + + assertEquals(response.getStatus(), code); + } + + @Test + public void testGetExampleFailureForInvalidObject(){ + + when(uriInfo.getPath()).thenReturn("examples/fakeObject"); + when(uriInfo.getPath(false)).thenReturn("examples/fakeObject"); + + Response response = exampleConsumer.getExample( + Version.getLatest().toString(), + "testRandomCrazyObject", + httpHeaders, + uriInfo, + null); + + assertNotNull("Response from the example consumer returned null", response); + + int code = Response.Status.BAD_REQUEST.getStatusCode(); + + assertEquals(response.getStatus(), code); + } + +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java new file mode 100644 index 0000000..2c47a2e --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/ExceptionHandlerTest.java @@ -0,0 +1,138 @@ +package org.openecomp.aai.rest; + +import com.fasterxml.jackson.core.JsonLocation; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.sun.istack.SAXParseException2; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.aai.AAISetup; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class ExceptionHandlerTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + @Mock + private HttpHeaders httpHeaders; + + @Mock + private HttpServletRequest request; + + @InjectMocks + private ExceptionHandler handler = new ExceptionHandler(); + + @Before + public void setup(){ + MockitoAnnotations.initMocks(this); + + MultivaluedHashMap headersMultiMap = new MultivaluedHashMap<>(); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + List outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + } + + @Test + public void testConversionOfWebApplicationResponse() throws Exception { + + Exception exception = new WebApplicationException(); + Response response = handler.toResponse(exception); + + assertNotNull(response); + assertNull(response.getEntity()); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus()); + } + + @Test + public void testConversionOfWebApplicationResponseWhenUmarshalExceptionResultBadRequest() throws Exception { + + SAXParseException2 mockSaxParseException = mock(SAXParseException2.class); + Exception exception = new WebApplicationException(mockSaxParseException); + Response response = handler.toResponse(exception); + + assertNotNull(response); + assertNotNull(response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } + + @Test + public void testConversionWhenJsonParseExceptionResultBadRequest() throws Exception { + + JsonLocation jsonLocation = mock(JsonLocation.class); + Exception exception = new JsonParseException("", jsonLocation); + Response response = handler.toResponse(exception); + + assertNotNull(response); + assertNotNull(response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } + + @Test + public void testConversionWhenJsonMappingExceptionResultBadRequest() throws Exception { + + JsonLocation jsonLocation = mock(JsonLocation.class); + Exception exception = new JsonMappingException("", jsonLocation); + Response response = handler.toResponse(exception); + + assertNotNull(response); + assertNotNull(response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } + + @Test + public void testConversionWhenUnknownExceptionResultBadRequest() throws Exception { + + Exception exception = mock(Exception.class); + Response response = handler.toResponse(exception); + + when(request.getMethod()).thenReturn("GET"); + + assertNotNull(response); + assertNotNull(response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + + + } + + @Test + public void testConversionWhenUnknownExceptionResultBadRequestForXmlResponseType() throws Exception { + + List outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(MediaType.valueOf("application/xml")); + when(request.getMethod()).thenReturn("GET"); + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + + Exception exception = mock(Exception.class); + Response response = handler.toResponse(exception); + + assertNotNull(response); + assertNotNull(response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/LegacyMoxyConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/LegacyMoxyConsumerTest.java new file mode 100644 index 0000000..1620f3e --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/LegacyMoxyConsumerTest.java @@ -0,0 +1,617 @@ +package org.openecomp.aai.rest; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.introspection.Version; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.*; +import java.io.IOException; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class LegacyMoxyConsumerTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private LegacyMoxyConsumer legacyMoxyConsumer; + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(LegacyMoxyConsumerTest.class.getName()); + + @BeforeClass + public static void setupRest(){ + AAIGraph.getInstance(); + ModelInjestor.getInstance(); + } + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + legacyMoxyConsumer = new LegacyMoxyConsumer(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testResponsePutGetDeleteOnResource() throws JSONException, IOException, AAIException { + + String uri = getUri(); + String payload = getResourcePayload(getObjectName()); + + assertNotNull("Introspector returned invalid string when marshalling the object", payload); + assertNotNull("Introspector failed to return a valid uri", uri); + + if(uri.length() != 0 && uri.charAt(0) == '/'){ + uri = uri.substring(1); + } + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + + response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + + queryParameters.add("depth", "10000"); + + response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "10000", + "false", + httpHeaders, + uriInfo, + null + ); + + code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + String pserverEntity = response.getEntity().toString(); + JSONObject pserverJsonbject = new JSONObject(pserverEntity); + + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + + JSONAssert.assertEquals(payload, pserverEntity, false); + + String resourceVersion = pserverJsonbject.getString("resource-version"); + + queryParameters.add("resource-version", resourceVersion); + + response = legacyMoxyConsumer.delete( + "v11", + uri, + httpHeaders, + uriInfo, + "", + null + ); + + code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); + + response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + } + + @Test + public void testPutPserverAndCloudRegionRelationship() throws IOException, JSONException { + + String pserverData = getRelationshipPayload("pserver"); + String complexData = getRelationshipPayload("complex"); + + String hostname = "590a8943-1200-43b3-825b-75dde6b8f44a"; + String physicalLocationId ="e13d4587-19ad-4bf5-80f5-c021efb5b61c"; + + String pserverUri = String.format("cloud-infrastructure/pservers/pserver/%s", hostname); + String cloudRegionUri = String.format("cloud-infrastructure/complexes/complex/%s", physicalLocationId); + + doSetupResource(pserverUri, pserverData); + doSetupResource(cloudRegionUri, complexData); + + String cloudToPserverRelationshipData = getRelationshipPayload("pserver-complex-relationship"); + String cloudToPserverRelationshipUri = String.format( + "cloud-infrastructure/pservers/pserver/%s/relationship-list/relationship", hostname); + + Response response = legacyMoxyConsumer.updateRelationship( + cloudToPserverRelationshipData, + Version.getLatest().toString(), + cloudToPserverRelationshipUri, + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Response from the legacy moxy consumer returned null", response); + int code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals("Expected to return status created from the response", + Response.Status.OK.getStatusCode(), response.getStatus()); + logger.info("Response Code: " + code + "\tEntity: " + response.getEntity()); + + // TODO - Need to actually verify the relationship between pserver and cloud-region + + response = legacyMoxyConsumer.deleteRelationship( + cloudToPserverRelationshipData, + Version.getLatest().toString(), + cloudToPserverRelationshipUri, + httpHeaders, + uriInfo, + null + ); + + code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); + } + + @Test + public void testPutPassWithEmptyData() throws JSONException { + + String payload = "{}"; + String pserverUri = String.format("cloud-infrastructure/pservers/pserver/%s", UUID.randomUUID().toString()); + + doSetupResource(pserverUri, payload); + + payload = ""; + pserverUri = String.format("cloud-infrastructure/pservers/pserver/%s", UUID.randomUUID().toString()); + doSetupResource(pserverUri, payload); + } + + @Test + public void testFailureWithInvalidUri() throws JSONException { + + String payload = "{}"; + String uri = "fake-infrastructure/pservers/pserver/fajsidj"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), code); + } + + @Test + public void testInvalidUriThrowRandomException() throws JSONException { + + String payload = "{}"; + String uri = "fake-infrastructure/pservers/pserver/fajsidj"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenThrow(new IllegalArgumentException()); + + Response response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + assertNotNull("Response from the legacy moxy consumer returned null", response); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + + response = legacyMoxyConsumer.updateRelationship( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + code = response.getStatus(); + assertNotNull("Response from the legacy moxy consumer returned null", response); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + + response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Response from the legacy moxy consumer returned null", response); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + + response = legacyMoxyConsumer.delete( + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + "", + null + ); + + code = response.getStatus(); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + + response = legacyMoxyConsumer.deleteRelationship( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + code = response.getStatus(); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + } + + @Test + public void testInvalidUriContainingRelatedToShouldThrowAAIException() throws JSONException { + + String payload = "{}"; + String uri = "cloud-infrastructure/related-to/fsdf"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + + response = legacyMoxyConsumer.updateRelationship( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + code = response.getStatus(); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + + response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Response from the legacy moxy consumer returned null", response); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + + queryParameters.add("resource-version", "3434394839483"); + response = legacyMoxyConsumer.delete( + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + "", + null + ); + + code = response.getStatus(); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), code); + + response = legacyMoxyConsumer.deleteRelationship( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + code = response.getStatus(); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); + } + + @Test + @Ignore("Unable to test this method due to WRITE_BIGDECIMAL_AS_PLAIN error") + public void testPatchWithValidData() throws IOException { + + String payload = getResourcePayload("pserver-patch-test"); + String uri = getUri("pserver-patch-test"); + + if(uri.length() != 0 && uri.charAt(0) == '/'){ + uri = uri.substring(1); + } + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + + response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + + String patchData = "{\"in-maint\": false}"; + + headersMultiMap.add("Content-Type", "application/json"); + + outputMediaTypes.remove(APPLICATION_JSON); + outputMediaTypes.add(MediaType.valueOf("application/merge-patch+json")); + + response = legacyMoxyConsumer.patch( + patchData, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + code = response.getStatus(); + assertNotNull("Response from the patch returned null", response); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + assertEquals(Response.Status.OK.getStatusCode(), code); + + } + + protected void doSetupResource(String uri, String payload) throws JSONException { + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Response from the legacy moxy consumer returned null", response); + assertEquals("Expected to not have the data already in memory", + Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + + response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Response from the legacy moxy consumer returned null", response); + int code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + assertEquals("Expected to return status created from the response", + Response.Status.CREATED.getStatusCode(), response.getStatus()); + + queryParameters.add("depth", "10000"); + response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Response from the legacy moxy consumer returned null", response); + assertEquals("Expected to return the pserver data that was just put in memory", + Response.Status.OK.getStatusCode(), response.getStatus()); + + if("".equalsIgnoreCase(payload)){ + payload = "{}"; + } + + JSONAssert.assertEquals(payload, response.getEntity().toString(), false); + } + + @Test + public void testDeleteRelationshipThrowsException(){ + + String payload = ""; + String hostname = "testData"; + String uri = String.format("cloud-infrastructure/pservers/pserver/%s/relationship-list/relationship", hostname); + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.deleteRelationship( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), code); + } + + // TODO - Change this to be abstract and inheritable + public String getObjectName(){ + return "pserver"; + } + + public String getResourcePayload(String resourceName) throws IOException { + return getPayload("payloads/resource/" + resourceName + ".json"); + } + + public String getRelationshipPayload(String relationshipName) throws IOException { + return getPayload("payloads/relationship/" + relationshipName + ".json"); + } + + public String getUri(String hostname){ + return String.format("cloud-infrastructure/pservers/pserver/%s", hostname); + } + + public String getUri(){ + return getUri("pserver-hostname-test"); + } +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/URLFromVertexIdConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/URLFromVertexIdConsumerTest.java new file mode 100644 index 0000000..5ba9ea6 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/URLFromVertexIdConsumerTest.java @@ -0,0 +1,179 @@ +package org.openecomp.aai.rest; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.json.JSONException; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.introspection.Version; + +import javax.ws.rs.core.*; +import java.io.IOException; +import java.util.*; + +import static org.junit.Assert.*; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class URLFromVertexIdConsumerTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private URLFromVertexIdConsumer urlFromVertexIdConsumer; + private LegacyMoxyConsumer legacyMoxyConsumer; + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(LegacyMoxyConsumerTest.class.getName()); + + @BeforeClass + public static void setupRest(){ + AAIGraph.getInstance(); + ModelInjestor.getInstance(); + } + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + urlFromVertexIdConsumer = new URLFromVertexIdConsumer(); + legacyMoxyConsumer = new LegacyMoxyConsumer(); + + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testResponsePutGetDeleteOnResource() throws JSONException, IOException, AAIException { + + String uri = "cloud-infrastructure/pservers/pserver/" + UUID.randomUUID().toString(); + String payload = "{}"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + + response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + + MultivaluedMap responseHeaders = response.getMetadata(); + + assertNotNull("Unable to retrieve the response headers from response object", responseHeaders); + assertTrue("Response doesn't contain the key vertexId", responseHeaders.containsKey("vertex-id")); + + String vertexId = responseHeaders.get("vertex-id").get(0).toString(); + + response = urlFromVertexIdConsumer.generateUrlFromVertexId( + "", + Version.getLatest().toString(), + Long.valueOf(vertexId).longValue(), + httpHeaders, + uriInfo, + null + ); + + assertNotNull(response); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + } + + @Test + public void testObjectNotFoundInDBReturnsNotFoundStatus() throws JSONException, IOException, AAIException { + + String uri = "cloud-infrastructure/pservers/pserver/testRandom"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + String vertexId = "384584"; + + Response response = urlFromVertexIdConsumer.generateUrlFromVertexId( + "", + Version.getLatest().toString(), + Long.valueOf(vertexId).longValue(), + httpHeaders, + uriInfo, + null + ); + + assertNotNull("Check if the response is not null", response); + + assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/VertexIdConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/VertexIdConsumerTest.java new file mode 100644 index 0000000..12e2411 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/VertexIdConsumerTest.java @@ -0,0 +1,158 @@ +package org.openecomp.aai.rest; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.json.JSONException; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.ModelInjestor; +import org.openecomp.aai.introspection.Version; + +import javax.ws.rs.core.*; +import java.io.IOException; +import java.util.*; + +import static org.junit.Assert.*; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class VertexIdConsumerTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private VertexIdConsumer vertexIdConsumer; + private LegacyMoxyConsumer legacyMoxyConsumer; + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(LegacyMoxyConsumerTest.class.getName()); + + @BeforeClass + public static void setupRest(){ + AAIGraph.getInstance(); + ModelInjestor.getInstance(); + } + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + vertexIdConsumer = new VertexIdConsumer(); + legacyMoxyConsumer = new LegacyMoxyConsumer(); + + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testResponsePutGetDeleteOnResource() throws JSONException, IOException, AAIException { + + String uri = "cloud-infrastructure/pservers/pserver/" + UUID.randomUUID().toString(); + String payload = "{}"; + + when(uriInfo.getPath()).thenReturn(uri); + when(uriInfo.getPath(false)).thenReturn(uri); + + Response response = legacyMoxyConsumer.getLegacy( + "", + Version.getLatest().toString(), + uri, + "all", + "false", + httpHeaders, + uriInfo, + null + ); + + assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); + + response = legacyMoxyConsumer.update( + payload, + Version.getLatest().toString(), + uri, + httpHeaders, + uriInfo, + null + ); + + int code = response.getStatus(); + if(!VALID_HTTP_STATUS_CODES.contains(code)){ + System.out.println("Response Code: " + code + "\tEntity: " + response.getEntity()); + } + + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + + MultivaluedMap responseHeaders = response.getMetadata(); + + assertNotNull("Unable to retrieve the response headers from response object", responseHeaders); + assertTrue("Response doesn't contain the key vertexId", responseHeaders.containsKey("vertex-id")); + + String vertexId = responseHeaders.get("vertex-id").get(0).toString(); + + response = vertexIdConsumer.getByVertexId( + "", + Version.getLatest().toString(), + Long.valueOf(vertexId).longValue(), + "10000", + httpHeaders, + uriInfo, + null + ); + + assertNotNull(response); + String pserverObject = response.getEntity().toString(); + + System.out.println(pserverObject); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/retired/RetiredConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/RetiredConsumerTest.java new file mode 100644 index 0000000..1f204f5 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/RetiredConsumerTest.java @@ -0,0 +1,107 @@ +package org.openecomp.aai.rest.retired; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.introspection.Version; + +import javax.ws.rs.core.*; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public abstract class RetiredConsumerTest { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + protected RetiredConsumer retiredConsumer; + protected HttpHeaders httpHeaders; + protected UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(RetiredConsumer.class.getName()); + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + retiredConsumer = getRetiredConsumer(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testRetiredForAllEndPoints(){ + when(uriInfo.getPath()).thenReturn("/aai/v3/cloud-infrastructure/pservers/pserver/test-pserver1"); + + Response response = retiredConsumer.createMessageGet(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessagePost(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessagePatch(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessagePut(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + + response = retiredConsumer.createMessageDelete(Version.getLatest().toString(), httpHeaders, uriInfo, null); + assertNotNull(response); + assertEquals(Response.Status.GONE.getStatusCode(), response.getStatus()); + } + + public abstract RetiredConsumer getRetiredConsumer(); +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V3ThroughV7ConsumerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V3ThroughV7ConsumerTest.java new file mode 100644 index 0000000..8dc1c10 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V3ThroughV7ConsumerTest.java @@ -0,0 +1,9 @@ +package org.openecomp.aai.rest.retired; + +public class V3ThroughV7ConsumerTest extends RetiredConsumerTest { + + @Override + public RetiredConsumer getRetiredConsumer() { + return new V3ThroughV7Consumer(); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8ModelsTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8ModelsTest.java new file mode 100644 index 0000000..b6c340e --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8ModelsTest.java @@ -0,0 +1,9 @@ +package org.openecomp.aai.rest.retired; + +public class V7V8ModelsTest extends RetiredConsumerTest { + + @Override + public RetiredConsumer getRetiredConsumer() { + return new V7V8Models(); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8NamedQueriesTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8NamedQueriesTest.java new file mode 100644 index 0000000..db4d35d --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/retired/V7V8NamedQueriesTest.java @@ -0,0 +1,9 @@ +package org.openecomp.aai.rest.retired; + +public class V7V8NamedQueriesTest extends RetiredConsumerTest { + + @Override + public RetiredConsumer getRetiredConsumer() { + return new V7V8NamedQueries(); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/tools/ModelVersionTransformerTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/tools/ModelVersionTransformerTest.java new file mode 100644 index 0000000..75d25df --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/tools/ModelVersionTransformerTest.java @@ -0,0 +1,116 @@ +package org.openecomp.aai.rest.tools; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.introspection.ModelInjestor; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.*; +import java.util.*; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.when; + +public class ModelVersionTransformerTest extends AAISetup { + + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private ModelVersionTransformer modelVersionTransformer; + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(ModelVersionTransformerTest.class.getName()); + + @BeforeClass + public static void setupRest(){ + AAIGraph.getInstance(); + ModelInjestor.getInstance(); + } + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + modelVersionTransformer = new ModelVersionTransformer(); + httpHeaders = Mockito.mock(HttpHeaders.class); + uriInfo = Mockito.mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Content-Type", "application/xml"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void modelTransform() throws Exception { + + String modelXmlPayload = getPayload("payloads/modeltransforms/model.xml"); + String modelJsonPayload = getPayload("payloads/modeltransforms/model.json"); + + String uri = "modeltransform"; + + when(uriInfo.getPath()).thenReturn(uri); + // Comment the following line for the null pointer exception + when(uriInfo.getPath(false)).thenReturn(uri); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(MediaType.valueOf("application/xml")); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + when(httpHeaders.getMediaType()).thenReturn(MediaType.valueOf("application/xml")); + + Response response = modelVersionTransformer.modelTransform(modelXmlPayload,uri, httpHeaders, uriInfo, null); + + assertNotNull(response); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java new file mode 100644 index 0000000..c4d435a --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/util/EchoResponseTest.java @@ -0,0 +1,116 @@ +package org.openecomp.aai.rest.util; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.aai.AAISetup; + +import javax.ws.rs.core.*; +import java.util.*; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class EchoResponseTest extends AAISetup { + + protected static final MediaType APPLICATION_JSON = MediaType.valueOf("application/json"); + + private static final Set VALID_HTTP_STATUS_CODES = new HashSet<>(); + + static { + VALID_HTTP_STATUS_CODES.add(200); + VALID_HTTP_STATUS_CODES.add(201); + VALID_HTTP_STATUS_CODES.add(204); + } + + private EchoResponse echoResponse; + + private HttpHeaders httpHeaders; + + private UriInfo uriInfo; + + private MultivaluedMap headersMultiMap; + private MultivaluedMap queryParameters; + + private List aaiRequestContextList; + + private List outputMediaTypes; + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(EchoResponseTest.class.getName()); + + @Before + public void setup(){ + logger.info("Starting the setup for the integration tests of Rest Endpoints"); + + echoResponse = new EchoResponse(); + httpHeaders = mock(HttpHeaders.class); + uriInfo = mock(UriInfo.class); + + headersMultiMap = new MultivaluedHashMap<>(); + queryParameters = Mockito.spy(new MultivaluedHashMap<>()); + + headersMultiMap.add("X-FromAppId", "JUNIT"); + headersMultiMap.add("X-TransactionId", UUID.randomUUID().toString()); + headersMultiMap.add("Real-Time", "true"); + headersMultiMap.add("Accept", "application/json"); + headersMultiMap.add("aai-request-context", ""); + + outputMediaTypes = new ArrayList<>(); + outputMediaTypes.add(APPLICATION_JSON); + + aaiRequestContextList = new ArrayList<>(); + aaiRequestContextList.add(""); + + when(httpHeaders.getAcceptableMediaTypes()).thenReturn(outputMediaTypes); + when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); + when(httpHeaders.getRequestHeader("X-FromAppId")).thenReturn(Arrays.asList("JUNIT")); + when(httpHeaders.getRequestHeader("X-TransactionId")).thenReturn(Arrays.asList("JUNIT")); + + when(httpHeaders.getRequestHeader("aai-request-context")).thenReturn(aaiRequestContextList); + + + when(uriInfo.getQueryParameters()).thenReturn(queryParameters); + when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); + + // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable + Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + + when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); + } + + @Test + public void testEchoResultWhenValidHeaders() throws Exception { + + Response response = echoResponse.echoResult(httpHeaders, null, ""); + + assertNotNull(response); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + } + + @Test + public void testEchoResultWhenInValidHeadersThrowsBadRequest() throws Exception { + + httpHeaders = mock(HttpHeaders.class); + Response response = echoResponse.echoResult(httpHeaders, null, ""); + + assertNotNull(response); + assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } + + @Test + public void testEchoResultWhenValidHeadersButMediaTypeWrong() throws Exception { + + when(httpHeaders.getAcceptableMediaTypes()).thenThrow(new IllegalStateException()) + .thenReturn(outputMediaTypes); + + Response response = echoResponse.echoResult(httpHeaders, null, ""); + + assertNotNull(response); + assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus()); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java new file mode 100644 index 0000000..55d8ce3 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/util/LogFormatToolsTest.java @@ -0,0 +1,15 @@ +package org.openecomp.aai.rest.util; + +import org.junit.Test; + +import static org.junit.Assert.assertNotNull; + +public class LogFormatToolsTest { + + @Test + public void testLogFormatTools(){ + + String dateTime = new LogFormatTools().getCurrentDateTime(); + assertNotNull(dateTime); + } +} \ No newline at end of file diff --git a/aai-resources/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java b/aai-resources/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java index 8c6450d..220d7d3 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/rest/util/ValidateEncodingTest.java @@ -20,16 +20,15 @@ package org.openecomp.aai.rest.util; -import static org.junit.Assert.*; - -import java.io.UnsupportedEncodingException; +import org.junit.Test; +import org.mockito.Mockito; import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.UriInfo; +import java.io.UnsupportedEncodingException; -import org.junit.Test; -import org.mockito.Mockito; +import static org.junit.Assert.assertEquals; public class ValidateEncodingTest { diff --git a/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java b/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java index 8e9e322..f76c151 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java @@ -20,36 +20,25 @@ package org.openecomp.aai.schema.db; -import java.io.IOException; - +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.schema.AuditDoc; import org.openecomp.aai.db.schema.AuditOXM; import org.openecomp.aai.db.schema.Auditor; import org.openecomp.aai.db.schema.AuditorFactory; import org.openecomp.aai.introspection.Version; -import com.thinkaurelius.titan.core.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; + +import java.io.IOException; @Ignore("not ready for testing") -public class AuditOXMTest { - - /** - * Before. - */ - @BeforeClass - public static void before() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - - } - +public class AuditOXMTest extends AAISetup { + /** * Gets the graph audit. diff --git a/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java b/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java index 9dade87..c11358f 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java @@ -20,34 +20,27 @@ package org.openecomp.aai.schema.db; -import java.io.IOException; -import java.util.Set; - +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.schema.TitanManagement; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.schema.DBIndex; import org.openecomp.aai.db.schema.ManageTitanSchema; -import com.thinkaurelius.titan.core.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.schema.TitanManagement; + +import java.io.IOException; +import java.util.Set; @Ignore("not ready yet") -public class ManageSchemaTest { +public class ManageSchemaTest extends AAISetup { private TitanGraph graph = null; - @BeforeClass - public static void before() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - - } - + @Before public void beforeTest() { //graph = TitanFactory.open("src/test/resources/inmemory_titan.properties"); diff --git a/aai-resources/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java b/aai-resources/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java index 7df2790..d691545 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java +++ b/aai-resources/src/test/java/org/openecomp/aai/transforms/JoltTestUtil.java @@ -21,13 +21,12 @@ package org.openecomp.aai.transforms; -import java.io.IOException; - -import org.junit.Assert; - import com.bazaarvoice.jolt.ArrayOrderObliviousDiffy; import com.bazaarvoice.jolt.Diffy; import com.bazaarvoice.jolt.JsonUtils; +import org.junit.Assert; + +import java.io.IOException; public class JoltTestUtil { diff --git a/aai-resources/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java b/aai-resources/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java new file mode 100644 index 0000000..4f408b0 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/transforms/LowerHyphenToLowerCamelConverterTest.java @@ -0,0 +1,73 @@ +/*- + * ============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.transforms; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import java.util.Arrays; +import java.util.Collection; + +import static org.junit.Assert.assertEquals; + +@RunWith(Parameterized.class) +public class LowerHyphenToLowerCamelConverterTest { + + private Converter converter = new LowerHyphenToLowerCamelConverter(); + + private String input; + private String expected; + + public LowerHyphenToLowerCamelConverterTest(String input, String expected){ + this.input = input; + this.expected = expected; + } + + /** + * Data Provider for the Lower Hyphen to Camel Converter Tests + * Make sure the capitalization is not lost during the conversion + * @return + */ + @Parameters + public static Collection data(){ + + return Arrays.asList(new Object[][]{ + {null, null}, + {"test-name", "testName"}, + {"test---name", "testName"}, // Case multiple + {"testName", "testName"}, // Case where upper case word shouldn't be lowercased + {"test-name-cool", "testNameCool"}, + {"test-name-Cool", "testNameCool"}, + {"test-name-Cool-Name-wow----Rest", "testNameCoolNameWowRest"}, + {"test-name#fast#", "testName#fast#"}, + {"test-name---", "testName"}, + {"----test-name", "TestName"}, + }); + } + + @Test + public void testIfInputSuccessfullyModified(){ + String actual = converter.convert(input); + assertEquals(expected, actual); + } +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java b/aai-resources/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java new file mode 100644 index 0000000..78fc88d --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/transforms/MapTraverserTest.java @@ -0,0 +1,54 @@ +/*- + * ============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.transforms; + +import com.bazaarvoice.jolt.JsonUtils; +import org.junit.Test; + +import java.io.IOException; +import java.util.Map; + +public class MapTraverserTest { + + private final String testResources = "src/test/resources/maputils/testcases/"; + + private String[] testCases = { "TestCase1.json", "TestCase2.json" }; + private MapTraverser traverser = new MapTraverser(new LowerCamelToLowerHyphenConverter()); + + @Test(expected = NullPointerException.class) + public void testIfMapIsNullThrowNullPointerException(){ + Map map = null; + traverser.convertKeys(map); + } + + @Test + public void runTestCases() throws IOException { + + for(String testCase : testCases){ + Map values = JsonUtils.filepathToMap(testResources + testCase); + + Object input = values.get("input"); + Object actual = traverser.convertKeys((Map)input); + Object output = values.get("output"); + JoltTestUtil.runArrayOrderObliviousDiffy( "failed case " + testCase, output, actual ); + } + } +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAIApiServerURLBaseTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAIApiServerURLBaseTest.java deleted file mode 100644 index 394f636..0000000 --- a/aai-resources/src/test/java/org/openecomp/aai/util/AAIApiServerURLBaseTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.util; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.cxf.message.Message; -import org.apache.cxf.message.MessageImpl; -import org.apache.cxf.phase.PhaseInterceptorChain; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import static org.mockito.Mockito.*; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.modules.agent.PowerMockAgent; -import org.powermock.modules.junit4.PowerMockRunner; -import org.powermock.modules.junit4.rule.PowerMockRule; - -@PrepareForTest({PhaseInterceptorChain.class, AAIConfig.class}) - -public class AAIApiServerURLBaseTest { - @Rule - public PowerMockRule rule = new PowerMockRule(); - - static { - PowerMockAgent.initializeIfNeeded(); - } - - /** - * Test get hostname. - * - * @throws Exception the exception - */ - @Test - public void testGetHostname() throws Exception { - PowerMockito.mockStatic(PhaseInterceptorChain.class); - Map > hm = new HashMap>(); - List host = new ArrayList(); - host.add("my-localhost"); - hm.put("host", host); - - Message outMessage = new MessageImpl(); - outMessage.put(Message.PROTOCOL_HEADERS, hm); - - when(PhaseInterceptorChain.getCurrentMessage()).thenReturn(outMessage); - assertEquals("https://my-localhost/aai/", AAIApiServerURLBase.get()); - } - - /** - * Test get with null hostname. - * - * @throws Exception the exception - */ - @Test - public void testGetWithNullHostname() throws Exception { - PowerMockito.mockStatic(AAIConfig.class); - String defaultHostname = "default-name"; - when(AAIConfig.get(AAIConstants.AAI_SERVER_URL_BASE)).thenReturn(defaultHostname); - assertEquals(defaultHostname, AAIApiServerURLBase.get()); - } -} diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAIApiVersionTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAIApiVersionTest.java deleted file mode 100644 index f82fc5d..0000000 --- a/aai-resources/src/test/java/org/openecomp/aai/util/AAIApiVersionTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/*- - * ============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.util; - -import static org.junit.Assert.*; - -import org.apache.cxf.message.Message; -import org.apache.cxf.message.MessageImpl; -import org.apache.cxf.phase.PhaseInterceptorChain; -import org.junit.Rule; -import org.junit.Test; -import org.powermock.core.classloader.annotations.PrepareForTest; -import static org.mockito.Mockito.*; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.modules.agent.PowerMockAgent; -import org.powermock.modules.junit4.rule.PowerMockRule; - -@PrepareForTest({PhaseInterceptorChain.class, AAIConfig.class}) - -public class AAIApiVersionTest { - @Rule - public PowerMockRule rule = new PowerMockRule(); - - static { PowerMockAgent.initializeIfNeeded();} - - /** - * Test get version. - * - * @throws Exception the exception - */ - @Test - public void testGetVersion() throws Exception { - PowerMockito.mockStatic(PhaseInterceptorChain.class); - Message outMessage = new MessageImpl(); - String msg = "/v2/"; - outMessage.put(Message.REQUEST_URI, msg); - when(PhaseInterceptorChain.getCurrentMessage()).thenReturn(outMessage); - assertEquals("v2", AAIApiVersion.get()); - } - - /** - * Test get with null version. - * - * @throws Exception the exception - */ - @Test - public void testGetWithNullVersion() throws Exception { - PowerMockito.mockStatic(AAIConfig.class); - String defaultURI = "default-v2"; - when(AAIConfig.get(AAIConstants.AAI_DEFAULT_API_VERSION_PROP, AAIConstants.AAI_DEFAULT_API_VERSION)).thenReturn(defaultURI); - assertEquals(defaultURI, AAIApiVersion.get()); - } - - /** - * Test incorrect version pattern. - * - * @throws Exception the exception - */ - @Test - public void testIncorrectVersionPattern() throws Exception { - PowerMockito.mockStatic(PhaseInterceptorChain.class); - PowerMockito.mockStatic(AAIConfig.class); - Message outMessage = new MessageImpl(); - String msg = "2.0.1"; - String defaultURI = "default-v2"; - outMessage.put(Message.REQUEST_URI, msg); - when(PhaseInterceptorChain.getCurrentMessage()).thenReturn(outMessage); - when(AAIConfig.get(AAIConstants.AAI_DEFAULT_API_VERSION_PROP, AAIConstants.AAI_DEFAULT_API_VERSION)).thenReturn(defaultURI); - assertEquals(defaultURI, AAIApiVersion.get()); - } - -} diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java index deafd5b..a148bea 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/AAIAppServletContextListenerTest.java @@ -20,31 +20,28 @@ package org.openecomp.aai.util; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import javax.servlet.ServletContextEvent; - +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.PatternLayout; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.logging.ErrorLogHelper; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.agent.PowerMockAgent; import org.powermock.modules.junit4.rule.PowerMockRule; import org.slf4j.LoggerFactory; -import org.openecomp.aai.dbmap.AAIGraph; -import org.openecomp.aai.logging.ErrorLogHelper; +import javax.servlet.ServletContextEvent; +import java.util.ArrayList; +import java.util.List; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; -import ch.qos.logback.classic.PatternLayout; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.AppenderBase; +import static org.junit.Assert.assertTrue; @PrepareForTest({AAIGraph.class, AAIConfig.class, ErrorLogHelper.class}) public class AAIAppServletContextListenerTest { diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAICSVWriterTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAICSVWriterTest.java index c3e525c..4f2dfd1 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/AAICSVWriterTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/AAICSVWriterTest.java @@ -20,18 +20,6 @@ package org.openecomp.aai.util; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.Writer; -import java.nio.file.Files; -import java.nio.file.Paths; - import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -39,6 +27,13 @@ import org.junit.Test; import org.powermock.modules.agent.PowerMockAgent; import org.powermock.modules.junit4.rule.PowerMockRule; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + public class AAICSVWriterTest { @Rule diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAIConfigPasswordDecodingTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAIConfigPasswordDecodingTest.java deleted file mode 100644 index bdf0fb1..0000000 --- a/aai-resources/src/test/java/org/openecomp/aai/util/AAIConfigPasswordDecodingTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============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.util; - -import static org.junit.Assert.assertEquals; - -import org.junit.BeforeClass; -import org.junit.Test; - -import org.openecomp.aai.exceptions.AAIException; - -public class AAIConfigPasswordDecodingTest { - - /** - * Configure. - * - * @throws AAIException the AAI exception - */ - @BeforeClass - public static void configure() throws AAIException { - System.setProperty("AJSC_HOME", "./src/test/resources/"); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local");; //fake prop file for testing - } - - /** - * Password check. - * - * @throws AAIException the AAI exception - */ - @Test - public void passwordCheck() throws AAIException { - assertEquals("password", "aaiuser123", AAIConfig.get("ecm.auth.password")); - } - -} diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAIRSyncUtilityTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAIRSyncUtilityTest.java index c15a99f..c8765f6 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/AAIRSyncUtilityTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/AAIRSyncUtilityTest.java @@ -21,9 +21,10 @@ package org.openecomp.aai.util; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.openecomp.aai.AAISetup; import java.io.File; import java.lang.reflect.Field; @@ -38,14 +39,10 @@ import java.util.List; import java.util.StringTokenizer; import java.util.UUID; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.openecomp.aai.exceptions.AAIException; +import static org.junit.Assert.*; @Ignore -public class AAIRSyncUtilityTest { +public class AAIRSyncUtilityTest extends AAISetup { AAIRSyncUtility syncUtil; AAIRSyncUtility syncUtilOmitDoCommand; @@ -53,12 +50,6 @@ public class AAIRSyncUtilityTest { String hostName; String transId = UUID.randomUUID().toString(); - @BeforeClass - public static void configure() throws AAIException { - System.setProperty("AJSC_HOME", "./src/test/resources/"); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local");; //fake prop file for testing - } - /** * Initialize. */ diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java index 356010a..860c56c 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java @@ -20,13 +20,13 @@ package org.openecomp.aai.util; -import static org.junit.Assert.assertEquals; - import org.junit.Rule; import org.junit.Test; import org.powermock.modules.agent.PowerMockAgent; import org.powermock.modules.junit4.rule.PowerMockRule; +import static org.junit.Assert.assertEquals; + public class DataConversionHelperTest { @Rule diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/DbTestConfig.java b/aai-resources/src/test/java/org/openecomp/aai/util/DbTestConfig.java index 4f84519..20a4307 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/DbTestConfig.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/DbTestConfig.java @@ -20,17 +20,9 @@ package org.openecomp.aai.util; -import java.util.Date; -import java.util.Enumeration; -import java.util.Properties; -import java.util.TimerTask; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Timer; +import java.io.*; import java.net.InetAddress; +import java.util.*; public class DbTestConfig { diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/DbTestFileWatcher.java b/aai-resources/src/test/java/org/openecomp/aai/util/DbTestFileWatcher.java index 05a4cfe..55caba8 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/DbTestFileWatcher.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/DbTestFileWatcher.java @@ -20,8 +20,8 @@ package org.openecomp.aai.util; -import java.util.*; -import java.io.*; +import java.io.File; +import java.util.TimerTask; public abstract class DbTestFileWatcher extends TimerTask { private long timeStamp; diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/DbTestProcessBuilder.java b/aai-resources/src/test/java/org/openecomp/aai/util/DbTestProcessBuilder.java index 8d8ebe0..306e46e 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/DbTestProcessBuilder.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/DbTestProcessBuilder.java @@ -20,11 +20,7 @@ package org.openecomp.aai.util; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; +import java.io.*; import java.nio.file.attribute.FileTime; import java.text.SimpleDateFormat; import java.util.Arrays; diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/HbaseSaltPrefixerTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/HbaseSaltPrefixerTest.java index 4e19c35..ba15e00 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/HbaseSaltPrefixerTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/HbaseSaltPrefixerTest.java @@ -20,10 +20,10 @@ package org.openecomp.aai.util; -import static org.junit.Assert.*; - import org.junit.Test; +import static org.junit.Assert.assertTrue; + public class HbaseSaltPrefixerTest { /** diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java index e1fb24a..96150da 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java @@ -20,14 +20,14 @@ package org.openecomp.aai.util; -import static org.junit.Assert.*; +import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.junit.Test; +import static org.junit.Assert.assertTrue; public class JettyObfuscationConversionCommandLineUtilTest { diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties index f829b3b..c226e38 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -140,3 +140,5 @@ aai.realtime.clients=RO,SDNC,MSO aai.server.rebind=g aai.run.migrations=false ecm.auth.password.x=OBF:1igd1i9a1jnb1yte1vv11vu91yt81jk71i6o1idt + +aai.jms.enable=false diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-cached.properties b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-cached.properties new file mode 100644 index 0000000..04aca4e --- /dev/null +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-cached.properties @@ -0,0 +1,17 @@ +query.fast-property=true +# the following parameters are not reloaded automatically and require a manual bounce +storage.backend=inmemory +storage.hostname=localhost + +#schema.default=none +storage.lock.wait-time=300 +storage.hbase.table=aaigraph-dev1.dev +storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure +#caching on +cache.db-cache = true +cache.db-cache-clean-wait = 20 +cache.db-cache-time = 180000 +cache.db-cache-size = 0.3 + +#load graphson file on startup +load.snapshot.file=false \ No newline at end of file diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-realtime.properties b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-realtime.properties new file mode 100644 index 0000000..72af2df --- /dev/null +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/titan-realtime.properties @@ -0,0 +1,14 @@ +query.fast-property=true +# the following parameters are not reloaded automatically and require a manual bounce +storage.backend=inmemory +storage.hostname=localhost + +#schema.default=none +storage.lock.wait-time=300 +storage.hbase.table=aaigraph-dev1.dev +storage.hbase.ext.zookeeper.znode.parent=/hbase-unsecure +# Setting db-cache to false ensure the fastest propagation of changes across servers +cache.db-cache = false + +#load graphson file on startup +load.snapshot.file=false \ No newline at end of file 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 01bc525..318e300 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 @@ -19,7 +19,7 @@ ============LICENSE_END========================================================= --> - + @@ -27,14 +27,15 @@ - - - - - - - - + + + + + + + + + @@ -44,24 +45,24 @@ - - - - + + + + - + - + @@ -70,8 +71,8 @@ - - + + @@ -89,9 +90,9 @@ - - - + + + @@ -122,7 +123,7 @@ - + @@ -145,16 +146,16 @@ - - + + - - + + @@ -164,8 +165,8 @@ - - + + @@ -176,9 +177,9 @@ - + - + @@ -186,7 +187,7 @@ - + @@ -212,7 +213,7 @@ - + @@ -231,18 +232,18 @@ - - - - - + + + + + - + @@ -254,7 +255,7 @@ - + @@ -297,19 +298,19 @@ - - - - - - - - - - + + + + + + + + + + - + @@ -322,7 +323,7 @@ - + @@ -369,7 +370,7 @@ - + @@ -383,7 +384,7 @@ - + @@ -400,8 +401,8 @@ - - + + @@ -443,7 +444,7 @@ - + @@ -494,8 +495,8 @@ - - + + @@ -510,7 +511,7 @@ - + @@ -542,7 +543,7 @@ - + @@ -558,7 +559,7 @@ - + @@ -583,8 +584,8 @@ - - + + @@ -602,7 +603,7 @@ - + @@ -651,9 +652,9 @@ - - - + + + @@ -671,7 +672,7 @@ - + @@ -740,12 +741,12 @@ - - - - - - + + + + + + @@ -761,7 +762,7 @@ - + @@ -837,7 +838,7 @@ - + @@ -890,7 +891,7 @@ - + @@ -902,7 +903,7 @@ - + @@ -949,7 +950,7 @@ - + @@ -965,14 +966,13 @@ - - - + + + - - + @@ -1021,7 +1021,7 @@ - + @@ -1036,7 +1036,7 @@ - + @@ -1058,7 +1058,7 @@ - + @@ -1074,7 +1074,7 @@ - + @@ -1136,7 +1136,7 @@ - + @@ -1153,7 +1153,7 @@ - + @@ -1215,7 +1215,7 @@ - + @@ -1233,7 +1233,7 @@ - + @@ -1265,12 +1265,13 @@ - + + @@ -1282,7 +1283,7 @@ - + @@ -1339,8 +1340,8 @@ - - + + @@ -1357,7 +1358,7 @@ - + @@ -1386,7 +1387,7 @@ - + @@ -1408,7 +1409,7 @@ - + @@ -1424,7 +1425,7 @@ - + @@ -1446,7 +1447,7 @@ - + @@ -1462,7 +1463,7 @@ - + @@ -1598,9 +1599,9 @@ - - - + + + @@ -1618,7 +1619,7 @@ - + @@ -1676,8 +1677,8 @@ - - + + @@ -1694,7 +1695,7 @@ - + @@ -1747,8 +1748,8 @@ - - + + @@ -1764,7 +1765,7 @@ - + @@ -1801,7 +1802,7 @@ - + @@ -1818,7 +1819,7 @@ - + @@ -1835,7 +1836,7 @@ - + @@ -1845,7 +1846,7 @@ - + @@ -1861,7 +1862,7 @@ - + @@ -1883,7 +1884,7 @@ - + @@ -1894,8 +1895,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1903,8 +1946,8 @@ - - + + @@ -1914,7 +1957,7 @@ - + @@ -1935,6 +1978,7 @@ + @@ -1942,6 +1986,7 @@ + @@ -1949,7 +1994,7 @@ - + @@ -1962,8 +2007,8 @@ - - + + @@ -1979,7 +2024,7 @@ - + @@ -2010,8 +2055,8 @@ - - + + @@ -2030,7 +2075,7 @@ - + @@ -2052,9 +2097,9 @@ - + - + @@ -2071,7 +2116,7 @@ - + @@ -2092,6 +2137,7 @@ + @@ -2099,6 +2145,7 @@ + @@ -2106,7 +2153,7 @@ - + @@ -2149,11 +2196,6 @@ - - - - - @@ -2174,9 +2216,9 @@ - - - + + + @@ -2195,11 +2237,11 @@ - - - - - + + + + + @@ -2209,16 +2251,17 @@ - + - + + @@ -2246,12 +2289,12 @@ - + - - + + @@ -2263,7 +2306,7 @@ - + @@ -2295,7 +2338,7 @@ - + @@ -2311,7 +2354,7 @@ - + @@ -2333,7 +2376,7 @@ - + @@ -2349,24 +2392,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -2376,7 +2419,7 @@ - + @@ -2405,7 +2448,7 @@ - + @@ -2422,6 +2465,7 @@ + @@ -2429,6 +2473,7 @@ + @@ -2436,7 +2481,7 @@ - + @@ -2484,7 +2529,7 @@ - + @@ -2502,7 +2547,7 @@ - + @@ -2519,8 +2564,8 @@ - - + + @@ -2537,7 +2582,7 @@ - + @@ -2559,8 +2604,8 @@ - - + + @@ -2576,7 +2621,7 @@ - + @@ -2610,7 +2655,7 @@ - + @@ -2618,8 +2663,8 @@ - - + + @@ -2635,7 +2680,7 @@ - + @@ -2662,7 +2707,7 @@ - + @@ -2674,7 +2719,7 @@ - + @@ -2691,11 +2736,6 @@ - - - - - @@ -2711,17 +2751,13 @@ - - - - - - + + @@ -2730,7 +2766,7 @@ - + @@ -2744,7 +2780,7 @@ - + @@ -2777,9 +2813,9 @@ - - - + + + @@ -2795,7 +2831,7 @@ - + @@ -2822,7 +2858,7 @@ - + @@ -2838,7 +2874,7 @@ - + @@ -2880,7 +2916,7 @@ - + @@ -2940,10 +2976,10 @@ - - - - + + + + @@ -2960,7 +2996,7 @@ - + @@ -3022,8 +3058,8 @@ - - + + @@ -3037,7 +3073,7 @@ - + @@ -3054,7 +3090,7 @@ - + @@ -3071,7 +3107,7 @@ - + @@ -3086,11 +3122,13 @@ + + @@ -3130,7 +3168,7 @@ - + @@ -3143,7 +3181,7 @@ - + @@ -3225,6 +3263,7 @@ + @@ -3232,6 +3271,7 @@ + @@ -3239,7 +3279,7 @@ - + @@ -3290,10 +3330,10 @@ - - - - + + + + @@ -3312,7 +3352,7 @@ - + @@ -3338,7 +3378,7 @@ - + @@ -3352,7 +3392,7 @@ - + @@ -3369,7 +3409,7 @@ - + @@ -3381,7 +3421,7 @@ - + @@ -3449,7 +3489,7 @@ - + @@ -3466,7 +3506,7 @@ - + @@ -3509,9 +3549,10 @@ + - + @@ -3529,6 +3570,7 @@ + @@ -3543,7 +3585,7 @@ - + @@ -3568,32 +3610,32 @@ - + - + - + - + - + - + @@ -3647,6 +3689,7 @@ + @@ -3654,6 +3697,7 @@ + @@ -3661,7 +3705,7 @@ - + @@ -3714,12 +3758,12 @@ - - - - - - + + + + + + @@ -3730,6 +3774,8 @@ + + @@ -3739,7 +3785,7 @@ - + @@ -3781,6 +3827,7 @@ + @@ -3788,6 +3835,7 @@ + @@ -3795,7 +3843,7 @@ - + @@ -3828,7 +3876,7 @@ - + @@ -3846,7 +3894,7 @@ - + @@ -3863,7 +3911,7 @@ - + @@ -3879,7 +3927,7 @@ - + @@ -3911,7 +3959,7 @@ - + @@ -3956,8 +4004,8 @@ - - + + @@ -3976,7 +4024,7 @@ - + @@ -4023,7 +4071,7 @@ - + @@ -4097,12 +4145,12 @@ - - - + + + - + @@ -4117,7 +4165,7 @@ - + @@ -4167,7 +4215,7 @@ - + @@ -4182,7 +4230,7 @@ - + @@ -4209,7 +4257,7 @@ - + @@ -4222,7 +4270,7 @@ - + @@ -4246,7 +4294,7 @@ - + @@ -4271,7 +4319,7 @@ - + @@ -4301,7 +4349,7 @@ - + @@ -4316,7 +4364,7 @@ - + @@ -4339,8 +4387,8 @@ - - + + @@ -4356,7 +4404,7 @@ - + @@ -4381,8 +4429,8 @@ - - + + @@ -4413,11 +4461,10 @@ - - - - - + + + + @@ -4427,7 +4474,7 @@ - + @@ -4457,8 +4504,8 @@ - - + + @@ -4466,7 +4513,7 @@ - + @@ -4505,16 +4552,16 @@ - - - + + + - + @@ -4551,24 +4598,24 @@ - + - + - + - + @@ -4589,7 +4636,7 @@ - + @@ -4601,7 +4648,7 @@ - + @@ -4624,15 +4671,15 @@ - - + + - + @@ -4655,15 +4702,15 @@ - - + + - + @@ -4686,15 +4733,15 @@ - - + + - + @@ -4718,17 +4765,17 @@ - - - - + + + + - + @@ -4754,14 +4801,14 @@ - + - + @@ -4794,9 +4841,9 @@ - - - + + + @@ -4808,8 +4855,8 @@ - - + + @@ -4859,8 +4906,8 @@ - - + + @@ -4870,7 +4917,7 @@ - + @@ -4891,7 +4938,7 @@ - + @@ -4922,7 +4969,7 @@ - + @@ -4933,7 +4980,7 @@ - + @@ -4946,8 +4993,8 @@ - - + + @@ -4957,7 +5004,7 @@ - + @@ -4965,7 +5012,7 @@ - + @@ -4975,7 +5022,7 @@ - + @@ -4997,7 +5044,7 @@ - + @@ -5016,7 +5063,7 @@ - + @@ -5048,13 +5095,14 @@ - + + @@ -5068,7 +5116,7 @@ - + @@ -5085,7 +5133,7 @@ - + @@ -5101,7 +5149,7 @@ - + @@ -5127,6 +5175,7 @@ + @@ -5134,6 +5183,7 @@ + @@ -5141,7 +5191,7 @@ - + @@ -5169,8 +5219,8 @@ - - + + @@ -5190,7 +5240,7 @@ - + @@ -5227,7 +5277,7 @@ - + @@ -5246,7 +5296,7 @@ - + @@ -5268,7 +5318,7 @@ - + @@ -5285,7 +5335,7 @@ - + @@ -5307,7 +5357,7 @@ - + @@ -5341,7 +5391,7 @@ - + @@ -5360,7 +5410,7 @@ - + @@ -5378,7 +5428,7 @@ - + @@ -5389,6 +5439,41 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 d9e4675..d6bb8d5 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 @@ -21,7 +21,7 @@ - + @@ -30,6 +30,7 @@ + @@ -254,7 +255,7 @@ - + @@ -292,6 +293,12 @@ + + + + + + @@ -307,9 +314,11 @@ + + - + @@ -578,6 +587,11 @@ + + + + + @@ -589,7 +603,7 @@ - + @@ -739,6 +753,22 @@ + + + + + + + + + + + + + + + + @@ -895,7 +925,7 @@ - + @@ -949,7 +979,7 @@ - + @@ -964,6 +994,17 @@ + + + + + + + + + + + @@ -971,8 +1012,7 @@ - - + @@ -1026,7 +1066,7 @@ - + @@ -1215,7 +1255,7 @@ - + @@ -1271,6 +1311,7 @@ + @@ -1598,6 +1639,16 @@ + + + + + + + + + + @@ -1676,7 +1727,13 @@ + + + + + + @@ -1835,7 +1892,7 @@ - + @@ -1894,6 +1951,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1902,7 +2004,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1932,6 +2072,7 @@ + @@ -1939,6 +2080,7 @@ + @@ -1946,7 +2088,7 @@ - + @@ -2020,7 +2162,115 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2085,10 +2335,31 @@ + + + + + + + + + + + + + + + + + + + + + @@ -2096,6 +2367,7 @@ + @@ -2103,7 +2375,7 @@ - + @@ -2146,11 +2418,6 @@ - - - - - @@ -2177,7 +2444,7 @@ - + @@ -2364,9 +2631,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2385,6 +2737,12 @@ + + + + + + @@ -2402,7 +2760,7 @@ - + @@ -2419,6 +2777,7 @@ + @@ -2426,6 +2785,7 @@ + @@ -2433,7 +2793,7 @@ - + @@ -2561,7 +2921,6 @@ - @@ -2688,11 +3047,6 @@ - - - - - @@ -2703,14 +3057,19 @@ - + - + - + - + + + + + + @@ -2718,6 +3077,7 @@ + @@ -2727,7 +3087,7 @@ - + @@ -2877,7 +3237,7 @@ - + @@ -3080,14 +3440,14 @@ - + - + - + - + @@ -3122,15 +3482,31 @@ + + + + + + + + + + + + + + + + - + @@ -3222,6 +3598,7 @@ + @@ -3229,6 +3606,7 @@ + @@ -3236,7 +3614,7 @@ - + @@ -3441,12 +3819,28 @@ + + + + + + + + + + - + + + + + + + @@ -3506,9 +3900,10 @@ + - + @@ -3526,6 +3921,7 @@ + @@ -3644,6 +4040,7 @@ + @@ -3651,6 +4048,7 @@ + @@ -3658,7 +4056,7 @@ - + @@ -3689,6 +4087,7 @@ + @@ -3699,6 +4098,7 @@ + @@ -3710,7 +4110,27 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -3727,6 +4147,8 @@ + + @@ -3778,6 +4200,7 @@ + @@ -3785,6 +4208,7 @@ + @@ -3792,7 +4216,7 @@ - + @@ -3908,7 +4332,7 @@ - + @@ -4158,6 +4582,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -4268,7 +4712,7 @@ - + @@ -4298,7 +4742,7 @@ - + @@ -4410,11 +4854,10 @@ - - - - - + + + + @@ -4954,7 +5397,7 @@ - + @@ -4962,7 +5405,7 @@ - + @@ -5020,6 +5463,23 @@ + + + + + + + + + + + + + + + + + @@ -5052,6 +5512,7 @@ + @@ -5124,6 +5585,7 @@ + @@ -5131,6 +5593,7 @@ + @@ -5138,7 +5601,7 @@ - + @@ -5357,7 +5820,7 @@ - + @@ -5386,6 +5849,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 fd476cd..a3fe382 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 @@ -19,7 +19,7 @@ ============LICENSE_END========================================================= --> - + @@ -27,37 +27,38 @@ - - - - - - - + + + + + + + + - - - - + + + + - + - + @@ -66,8 +67,8 @@ - - + + @@ -85,9 +86,9 @@ - - - + + + @@ -118,7 +119,7 @@ - + @@ -141,16 +142,16 @@ - - + + - - + + @@ -160,8 +161,8 @@ - - + + @@ -172,9 +173,9 @@ - + - + @@ -182,7 +183,7 @@ - + @@ -208,7 +209,7 @@ - + @@ -227,18 +228,18 @@ - - - - - + + + + + - + @@ -247,7 +248,7 @@ - + @@ -290,19 +291,19 @@ - - - - - - - - - - + + + + + + + + + + - + @@ -315,7 +316,7 @@ - + @@ -352,7 +353,7 @@ - + @@ -365,7 +366,7 @@ - + @@ -382,8 +383,8 @@ - - + + @@ -425,7 +426,7 @@ - + @@ -473,8 +474,8 @@ - - + + @@ -489,7 +490,7 @@ - + @@ -521,7 +522,7 @@ - + @@ -537,7 +538,7 @@ - + @@ -559,8 +560,8 @@ - - + + @@ -577,7 +578,7 @@ - + @@ -626,9 +627,9 @@ - - - + + + @@ -646,7 +647,7 @@ - + @@ -698,11 +699,11 @@ - - - - - + + + + + @@ -718,7 +719,7 @@ - + @@ -794,7 +795,7 @@ - + @@ -847,7 +848,7 @@ - + @@ -859,7 +860,7 @@ - + @@ -906,19 +907,18 @@ - + - - - + + + - - + @@ -967,7 +967,7 @@ - + @@ -982,7 +982,7 @@ - + @@ -1004,7 +1004,7 @@ - + @@ -1020,7 +1020,7 @@ - + @@ -1082,7 +1082,7 @@ - + @@ -1099,7 +1099,7 @@ - + @@ -1161,7 +1161,7 @@ - + @@ -1179,7 +1179,7 @@ - + @@ -1211,7 +1211,7 @@ - + @@ -1228,7 +1228,7 @@ - + @@ -1285,8 +1285,8 @@ - - + + @@ -1303,7 +1303,7 @@ - + @@ -1332,7 +1332,7 @@ - + @@ -1354,7 +1354,7 @@ - + @@ -1370,7 +1370,7 @@ - + @@ -1392,7 +1392,7 @@ - + @@ -1408,7 +1408,7 @@ - + @@ -1506,9 +1506,9 @@ - - - + + + @@ -1526,7 +1526,7 @@ - + @@ -1573,8 +1573,8 @@ - - + + @@ -1590,7 +1590,7 @@ - + @@ -1617,8 +1617,8 @@ - - + + @@ -1634,7 +1634,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1688,7 +1688,7 @@ - + @@ -1708,6 +1708,7 @@ + @@ -1715,7 +1716,7 @@ - + @@ -1731,7 +1732,7 @@ - + @@ -1753,7 +1754,7 @@ - + @@ -1764,8 +1765,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1773,8 +1815,8 @@ - - + + @@ -1784,7 +1826,7 @@ - + @@ -1805,6 +1847,7 @@ + @@ -1812,6 +1855,7 @@ + @@ -1819,7 +1863,7 @@ - + @@ -1832,8 +1876,8 @@ - - + + @@ -1849,7 +1893,7 @@ - + @@ -1877,8 +1921,8 @@ - - + + @@ -1897,7 +1941,7 @@ - + @@ -1919,9 +1963,9 @@ - + - + @@ -1937,7 +1981,7 @@ - + @@ -1958,6 +2002,7 @@ + @@ -1965,6 +2010,7 @@ + @@ -1972,7 +2018,7 @@ - + @@ -2015,11 +2061,6 @@ - - - - - @@ -2030,8 +2071,8 @@ - - + + @@ -2050,11 +2091,11 @@ - - - - - + + + + + @@ -2064,16 +2105,17 @@ - + - + + @@ -2101,12 +2143,12 @@ - + - - + + @@ -2118,7 +2160,7 @@ - + @@ -2150,7 +2192,7 @@ - + @@ -2166,7 +2208,7 @@ - + @@ -2188,7 +2230,7 @@ - + @@ -2204,22 +2246,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -2229,7 +2271,7 @@ - + @@ -2258,7 +2300,7 @@ - + @@ -2275,6 +2317,7 @@ + @@ -2282,6 +2325,7 @@ + @@ -2289,7 +2333,7 @@ - + @@ -2322,7 +2366,7 @@ - + @@ -2339,7 +2383,7 @@ - + @@ -2356,8 +2400,8 @@ - - + + @@ -2374,7 +2418,7 @@ - + @@ -2396,8 +2440,8 @@ - - + + @@ -2413,7 +2457,7 @@ - + @@ -2447,7 +2491,7 @@ - + @@ -2455,8 +2499,8 @@ - - + + @@ -2472,7 +2516,7 @@ - + @@ -2499,7 +2543,7 @@ - + @@ -2511,7 +2555,7 @@ - + @@ -2543,7 +2587,7 @@ - + @@ -2565,7 +2609,7 @@ - + @@ -2598,9 +2642,9 @@ - - - + + + @@ -2616,7 +2660,7 @@ - + @@ -2643,7 +2687,7 @@ - + @@ -2659,7 +2703,7 @@ - + @@ -2704,6 +2748,7 @@ + @@ -2761,8 +2806,8 @@ - - + + @@ -2779,7 +2824,7 @@ - + @@ -2841,8 +2886,8 @@ - - + + @@ -2856,7 +2901,7 @@ - + @@ -2873,7 +2918,7 @@ - + @@ -2890,7 +2935,7 @@ - + @@ -2949,7 +2994,7 @@ - + @@ -2961,7 +3006,7 @@ - + @@ -3043,6 +3088,7 @@ + @@ -3050,6 +3096,7 @@ + @@ -3057,7 +3104,7 @@ - + @@ -3093,10 +3140,10 @@ - - - - + + + + @@ -3114,7 +3161,7 @@ - + @@ -3140,7 +3187,7 @@ - + @@ -3153,7 +3200,7 @@ - + @@ -3170,7 +3217,7 @@ - + @@ -3182,7 +3229,7 @@ - + @@ -3250,7 +3297,7 @@ - + @@ -3267,7 +3314,7 @@ - + @@ -3312,6 +3359,7 @@ + @@ -3341,7 +3389,7 @@ - + @@ -3421,30 +3469,11 @@ - - - - - - - - - - - - - - - - - - - - + @@ -3452,6 +3481,7 @@ + @@ -3459,7 +3489,7 @@ - + @@ -3482,10 +3512,10 @@ - - - - + + + + @@ -3505,7 +3535,7 @@ - + @@ -3547,6 +3577,7 @@ + @@ -3554,6 +3585,7 @@ + @@ -3561,7 +3593,7 @@ - + @@ -3579,7 +3611,7 @@ - + @@ -3596,7 +3628,7 @@ - + @@ -3613,7 +3645,7 @@ - + @@ -3629,7 +3661,7 @@ - + @@ -3664,6 +3696,7 @@ + @@ -3706,8 +3739,8 @@ - - + + @@ -3726,7 +3759,7 @@ - + @@ -3770,7 +3803,7 @@ - + @@ -3804,12 +3837,12 @@ - - - + + + - + @@ -3823,7 +3856,7 @@ - + @@ -3870,7 +3903,7 @@ - + @@ -3884,7 +3917,7 @@ - + @@ -3911,7 +3944,7 @@ - + @@ -3924,7 +3957,7 @@ - + @@ -3948,7 +3981,7 @@ - + @@ -3973,7 +4006,7 @@ - + @@ -4003,7 +4036,7 @@ - + @@ -4018,7 +4051,7 @@ - + @@ -4041,8 +4074,8 @@ - - + + @@ -4058,7 +4091,7 @@ - + @@ -4083,8 +4116,8 @@ - - + + @@ -4114,11 +4147,10 @@ - - - - - + + + + @@ -4128,7 +4160,7 @@ - + @@ -4179,16 +4211,16 @@ - - - + + + - + @@ -4225,24 +4257,24 @@ - + - + - + - + @@ -4263,14 +4295,14 @@ - + - + @@ -4293,15 +4325,15 @@ - - + + - + @@ -4324,15 +4356,15 @@ - - + + - + @@ -4355,15 +4387,15 @@ - - + + - + @@ -4387,17 +4419,17 @@ - - - - + + + + - + @@ -4423,14 +4455,14 @@ - + - + @@ -4463,8 +4495,8 @@ - - + + @@ -4475,8 +4507,8 @@ - - + + @@ -4486,7 +4518,7 @@ - + @@ -4518,7 +4550,7 @@ - + @@ -4529,7 +4561,7 @@ - + @@ -4542,8 +4574,8 @@ - - + + @@ -4553,7 +4585,7 @@ - + @@ -4571,7 +4603,7 @@ - + @@ -4593,7 +4625,7 @@ - + @@ -4612,7 +4644,7 @@ - + @@ -4629,7 +4661,7 @@ - + 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 7c4d401..3c02b8a 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 @@ -19,7 +19,7 @@ ============LICENSE_END========================================================= --> - + @@ -27,14 +27,15 @@ - - - - - - - - + + + + + + + + + @@ -44,24 +45,24 @@ - - - - + + + + - + - + @@ -70,8 +71,8 @@ - - + + @@ -89,9 +90,9 @@ - - - + + + @@ -122,7 +123,7 @@ - + @@ -145,16 +146,16 @@ - - + + - - + + @@ -164,8 +165,8 @@ - - + + @@ -176,9 +177,9 @@ - + - + @@ -186,7 +187,7 @@ - + @@ -212,7 +213,7 @@ - + @@ -231,18 +232,18 @@ - - - - - + + + + + - + @@ -254,7 +255,7 @@ - + @@ -297,19 +298,19 @@ - - - - - - - - - - + + + + + + + + + + - + @@ -322,7 +323,7 @@ - + @@ -371,7 +372,7 @@ - + @@ -385,7 +386,7 @@ - + @@ -402,8 +403,8 @@ - - + + @@ -445,7 +446,7 @@ - + @@ -496,8 +497,8 @@ - - + + @@ -512,7 +513,7 @@ - + @@ -544,7 +545,7 @@ - + @@ -560,7 +561,7 @@ - + @@ -585,8 +586,8 @@ - - + + @@ -604,7 +605,7 @@ - + @@ -653,9 +654,9 @@ - - - + + + @@ -673,7 +674,7 @@ - + @@ -730,11 +731,11 @@ - - - - - + + + + + @@ -750,7 +751,7 @@ - + @@ -826,7 +827,7 @@ - + @@ -879,7 +880,7 @@ - + @@ -891,7 +892,7 @@ - + @@ -938,7 +939,7 @@ - + @@ -948,14 +949,13 @@ - - - + + + - - + @@ -1004,7 +1004,7 @@ - + @@ -1019,7 +1019,7 @@ - + @@ -1041,7 +1041,7 @@ - + @@ -1057,7 +1057,7 @@ - + @@ -1119,7 +1119,7 @@ - + @@ -1136,7 +1136,7 @@ - + @@ -1198,7 +1198,7 @@ - + @@ -1216,7 +1216,7 @@ - + @@ -1248,7 +1248,7 @@ - + @@ -1265,7 +1265,7 @@ - + @@ -1322,8 +1322,8 @@ - - + + @@ -1340,7 +1340,7 @@ - + @@ -1369,7 +1369,7 @@ - + @@ -1391,7 +1391,7 @@ - + @@ -1407,7 +1407,7 @@ - + @@ -1429,7 +1429,7 @@ - + @@ -1445,7 +1445,7 @@ - + @@ -1581,9 +1581,9 @@ - - - + + + @@ -1601,7 +1601,7 @@ - + @@ -1653,8 +1653,8 @@ - - + + @@ -1671,7 +1671,7 @@ - + @@ -1718,8 +1718,8 @@ - - + + @@ -1735,7 +1735,7 @@ - + @@ -1772,7 +1772,7 @@ - + @@ -1789,7 +1789,7 @@ - + @@ -1809,6 +1809,7 @@ + @@ -1816,7 +1817,7 @@ - + @@ -1832,7 +1833,7 @@ - + @@ -1854,7 +1855,7 @@ - + @@ -1865,8 +1866,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1874,8 +1917,8 @@ - - + + @@ -1885,7 +1928,7 @@ - + @@ -1906,6 +1949,7 @@ + @@ -1913,6 +1957,7 @@ + @@ -1920,7 +1965,7 @@ - + @@ -1933,8 +1978,8 @@ - - + + @@ -1950,7 +1995,7 @@ - + @@ -1981,8 +2026,8 @@ - - + + @@ -2001,7 +2046,7 @@ - + @@ -2023,9 +2068,9 @@ - + - + @@ -2042,7 +2087,7 @@ - + @@ -2063,6 +2108,7 @@ + @@ -2070,6 +2116,7 @@ + @@ -2077,7 +2124,7 @@ - + @@ -2120,11 +2167,6 @@ - - - - - @@ -2145,9 +2187,9 @@ - - - + + + @@ -2166,11 +2208,11 @@ - - - - - + + + + + @@ -2180,16 +2222,17 @@ - + - + + @@ -2217,12 +2260,12 @@ - + - - + + @@ -2234,7 +2277,7 @@ - + @@ -2266,7 +2309,7 @@ - + @@ -2282,7 +2325,7 @@ - + @@ -2304,7 +2347,7 @@ - + @@ -2320,24 +2363,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -2347,7 +2390,7 @@ - + @@ -2376,7 +2419,7 @@ - + @@ -2393,6 +2436,7 @@ + @@ -2400,6 +2444,7 @@ + @@ -2407,7 +2452,7 @@ - + @@ -2455,7 +2500,7 @@ - + @@ -2473,7 +2518,7 @@ - + @@ -2490,8 +2535,8 @@ - - + + @@ -2508,7 +2553,7 @@ - + @@ -2530,8 +2575,8 @@ - - + + @@ -2547,7 +2592,7 @@ - + @@ -2581,7 +2626,7 @@ - + @@ -2589,8 +2634,8 @@ - - + + @@ -2606,7 +2651,7 @@ - + @@ -2633,7 +2678,7 @@ - + @@ -2645,7 +2690,7 @@ - + @@ -2665,6 +2710,7 @@ + @@ -2682,9 +2728,11 @@ - + + + @@ -2692,7 +2740,7 @@ - + @@ -2715,7 +2763,7 @@ - + @@ -2748,9 +2796,9 @@ - - - + + + @@ -2766,7 +2814,7 @@ - + @@ -2793,7 +2841,7 @@ - + @@ -2809,7 +2857,7 @@ - + @@ -2854,6 +2902,7 @@ + @@ -2911,10 +2960,10 @@ - - - - + + + + @@ -2931,7 +2980,7 @@ - + @@ -2993,8 +3042,8 @@ - - + + @@ -3008,7 +3057,7 @@ - + @@ -3025,7 +3074,7 @@ - + @@ -3042,7 +3091,7 @@ - + @@ -3057,11 +3106,13 @@ + + @@ -3101,7 +3152,7 @@ - + @@ -3114,7 +3165,7 @@ - + @@ -3196,6 +3247,7 @@ + @@ -3203,6 +3255,7 @@ + @@ -3210,7 +3263,7 @@ - + @@ -3257,10 +3310,10 @@ - - - - + + + + @@ -3279,7 +3332,7 @@ - + @@ -3305,7 +3358,7 @@ - + @@ -3319,7 +3372,7 @@ - + @@ -3336,7 +3389,7 @@ - + @@ -3348,7 +3401,7 @@ - + @@ -3416,7 +3469,7 @@ - + @@ -3433,7 +3486,7 @@ - + @@ -3481,6 +3534,7 @@ + @@ -3510,7 +3564,7 @@ - + @@ -3535,32 +3589,32 @@ - + - + - + - + - + - + @@ -3590,30 +3644,11 @@ - - - - - - - - - - - - - - - - - - - - + @@ -3621,6 +3656,7 @@ + @@ -3628,7 +3664,7 @@ - + @@ -3662,12 +3698,12 @@ - - - - - - + + + + + + @@ -3687,7 +3723,7 @@ - + @@ -3729,6 +3765,7 @@ + @@ -3736,6 +3773,7 @@ + @@ -3743,7 +3781,7 @@ - + @@ -3777,7 +3815,7 @@ - + @@ -3795,7 +3833,7 @@ - + @@ -3812,7 +3850,7 @@ - + @@ -3828,7 +3866,7 @@ - + @@ -3863,6 +3901,7 @@ + @@ -3905,8 +3944,8 @@ - - + + @@ -3925,7 +3964,7 @@ - + @@ -3972,7 +4011,7 @@ - + @@ -4046,12 +4085,12 @@ - - - + + + - + @@ -4066,7 +4105,7 @@ - + @@ -4116,7 +4155,7 @@ - + @@ -4131,7 +4170,7 @@ - + @@ -4158,7 +4197,7 @@ - + @@ -4171,7 +4210,7 @@ - + @@ -4195,7 +4234,7 @@ - + @@ -4220,7 +4259,7 @@ - + @@ -4250,7 +4289,7 @@ - + @@ -4265,7 +4304,7 @@ - + @@ -4288,8 +4327,8 @@ - - + + @@ -4305,7 +4344,7 @@ - + @@ -4330,8 +4369,8 @@ - - + + @@ -4362,11 +4401,10 @@ - - - - - + + + + @@ -4376,7 +4414,7 @@ - + @@ -4406,8 +4444,8 @@ - - + + @@ -4415,7 +4453,7 @@ - + @@ -4454,16 +4492,16 @@ - - - + + + - + @@ -4500,24 +4538,24 @@ - + - + - + - + @@ -4538,7 +4576,7 @@ - + @@ -4550,7 +4588,7 @@ - + @@ -4573,15 +4611,15 @@ - - + + - + @@ -4604,15 +4642,15 @@ - - + + - + @@ -4635,15 +4673,15 @@ - - + + - + @@ -4667,17 +4705,17 @@ - - - - + + + + - + @@ -4703,14 +4741,14 @@ - + - + @@ -4743,9 +4781,9 @@ - - - + + + @@ -4757,8 +4795,8 @@ - - + + @@ -4808,8 +4846,8 @@ - - + + @@ -4819,7 +4857,7 @@ - + @@ -4840,7 +4878,7 @@ - + @@ -4871,7 +4909,7 @@ - + @@ -4882,7 +4920,7 @@ - + @@ -4895,8 +4933,8 @@ - - + + @@ -4906,7 +4944,7 @@ - + @@ -4924,7 +4962,7 @@ - + @@ -4946,7 +4984,7 @@ - + @@ -4965,7 +5003,7 @@ - + @@ -4997,7 +5035,7 @@ - + @@ -5017,7 +5055,7 @@ - + @@ -5034,7 +5072,7 @@ - + @@ -5050,7 +5088,7 @@ - + @@ -5076,6 +5114,7 @@ + @@ -5083,6 +5122,7 @@ + @@ -5090,7 +5130,7 @@ - + @@ -5104,8 +5144,8 @@ - - + + @@ -5125,7 +5165,7 @@ - + @@ -5162,7 +5202,7 @@ - + @@ -5181,7 +5221,7 @@ - + @@ -5203,7 +5243,7 @@ - + @@ -5220,7 +5260,7 @@ - + @@ -5242,7 +5282,7 @@ - + @@ -5276,7 +5316,7 @@ - + @@ -5295,7 +5335,7 @@ - + @@ -5313,7 +5353,7 @@ - + diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/graphson/resource.graphson b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/graphson/resource.graphson new file mode 100644 index 0000000..257916a --- /dev/null +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/graphson/resource.graphson @@ -0,0 +1,2 @@ +{"id": 386506928,"label": "vertex","properties": {"aai-last-mod-ts": [{"id": "ob632u-6e46nk-5j45","value": 1488308500413}],"aai-uri": [{"id": "ob6712-6e46nk-5lhh","value": "/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-987654321-9922/cloud-region-id-987654320-9922/tenants/tenant/tenant-987654321-9999/vservers/vserver/vserver-987654321-9999"}],"prov-status": [{"id": "ob651y-6e46nk-1kw5","value": "example-prov-status-val-7367"}],"aai-created-ts": [{"id": "ob62ae-6e46nk-5gqt","value": 1488308500413}],"source-of-truth": [{"id": "ob61w6-6e46nk-5jwl","value": "FitNesse-Test"}],"vserver-selflink": [{"id": "ob65g6-6e46nk-3xfp","value": "example-vserver-selflink-val-7367"}],"aai-node-type": [{"id": "ob61hy-6e46nk-5f5x","value": "vserver"}],"in-maint": [{"id": "ob65ue-6e46nk-20p1","value": false}],"resource-version": [{"id": "ob62om-6e46nk-23ut","value": "1488308500413"}],"vserver-name": [{"id": "ob649i-6e46nk-3u9x","value": "example-vserver-name-val-7367vserver-987654321-9999"}],"vserver-id": [{"id": "ob63va-6e46nk-3sp1","value": "vserver-987654321-9999"}],"last-mod-source-of-truth": [{"id": "ob63h2-6e46nk-5edh","value": "FitNesse-Test"}],"vserver-name2": [{"id": "ob64nq-6e46nk-3vut","value": "example-vserver-name2-val-7367"}],"is-closed-loop-disabled": [{"id": "ob668m-6e46nk-229x","value": false}]}} +{"id": 2461872,"label": "vertex","properties": {"aai-last-mod-ts": [{"id": "21hqu-1grlc-5j45","value": 1467901600}],"in-maint": [{"id": "21i52-1grlc-20p1","value": false}],"resource-version": [{"id": "21ija-1grlc-23ut","value": "1467901600"}],"vserver-name": [{"id": "21ixi-1grlc-3u9x","value": "PerfTest_VServerFix0027TenantPez002701611467901587187Name"}],"aai-created-ts": [{"id": "21jbq-1grlc-5gqt","value": 1467901600}],"vserver-id": [{"id": "21jpy-1grlc-3sp1","value": "PerfTest_VServerFix0027TenantPez002701611467901587187"}],"last-mod-source-of-truth": [{"id": "21k46-1grlc-5edh","value": "MSO"}],"vserver-name2": [{"id": "21kie-1grlc-3vut","value": "PerfTest_VServerFix0027TenantPez002701611467901587187-VM Name2 optional"}],"source-of-truth": [{"id": "21kwm-1grlc-5jwl","value": "MSO"}],"vserver-selflink": [{"id": "21lau-1grlc-3xfp","value": "http://testvserverLink.com/.html?vserv=VserverLink"}],"is-closed-loop-disabled": [{"id": "21lp2-1grlc-229x","value": false}],"aai-node-type": [{"id": "21m3a-1grlc-5f5x","value": "vserver"}],"aai-uri": [{"id": "21m3a-1grlc-5a5x","value": "/vservers/vserver/test1"}]}} diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource-format.json b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource-format.json new file mode 100644 index 0000000..c7e4255 --- /dev/null +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource-format.json @@ -0,0 +1,13 @@ +{ + "results": [ + { + "vserver": { + + } + }, + { + "vserver": { + } + } + ] +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource_and_url-format.json b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource_and_url-format.json new file mode 100644 index 0000000..80d6560 --- /dev/null +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/resource_and_url-format.json @@ -0,0 +1,16 @@ +{ + "results": [ + { + "url" : "/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-987654321-9922/cloud-region-id-987654321-9922/tenants/tenant/tenant-987654321-9999/vservers/vserver/vserver-987654321-9999", + "vserver": { + + } + }, + { + "url" : "/vservers/vserver/test1", + "vserver": { + + } + } + ] +} diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/simple-format.json b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/simple-format.json new file mode 100644 index 0000000..dd34261 --- /dev/null +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/queryformats/simple-format.json @@ -0,0 +1,43 @@ +{ + "results" : [{ + "id" : "0", + "node-type" : "generic-vnf", + "url" : "urimissing", + "properties" : { + "vnf-name" : "myVnf" + }, + "related-to" : [{ + "node-type" : "vserver", + "id" : "1", + "url" : "urimissing" + }] + } , { + "id" : "1", + "node-type" : "vserver", + "url" : "urimissing", + "properties" : { + "vserver-name" : "myVserver" + }, + "related-to" : [{ + "node-type" : "generic-vnf", + "id" : "0", + "url" : "urimissing" + },{ + "node-type" : "pserver", + "id" : "2", + "url" : "/pservers/pserver/key1" + }] + },{ + "id" : "2", + "node-type" : "pserver", + "url" : "/pservers/pserver/key1", + "properties" : { + "hostname" : "myPserver" + }, + "related-to" : [{ + "node-type" : "vserver", + "id" : "1", + "url" : "urimissing" + }] + }] +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/log4j.properties b/aai-resources/src/test/resources/log4j.properties deleted file mode 100644 index 2e68f61..0000000 --- a/aai-resources/src/test/resources/log4j.properties +++ /dev/null @@ -1,3 +0,0 @@ -log4j.logger.org.apache.zookeeper=WARN -log4j.logger.org.apache.hadoop.hbase.zookeeper=WARN -log4j.logger.org.apache.hadoop.hbase.client=WARN \ No newline at end of file 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 deleted file mode 100644 index 176a02c..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml +++ /dev/null @@ -1,5794 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index e59df6c..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml +++ /dev/null @@ -1,5793 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml b/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml deleted file mode 100644 index 1eb8f9c..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 126f286..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml +++ /dev/null @@ -1,5574 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-resources/src/test/resources/org/openecomp/aai/introspection/sideeffect/nested-case.json b/aai-resources/src/test/resources/org/openecomp/aai/introspection/sideeffect/nested-case.json deleted file mode 100644 index 40a0493..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/introspection/sideeffect/nested-case.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "global-customer-id": "key1", - "subscriber-name": "44IPZu0Ri", - "subscriber-type": "gIgOtou5Np5u", - "service-subscriptions": { - "service-subscription" : [ { - "service-type" : "key2", - "temp-ub-sub-account-id" : "JJYRez", - "service-instances" : { - "service-instance" : [ { - "service-instance-id" : "nested-instance-key", - "model-invariant-id" : "key1", - "model-version-id" : "key2" - }] - } - }] - } - } \ No newline at end of file diff --git a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/resource.graphson b/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/resource.graphson deleted file mode 100644 index 257916a..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/resource.graphson +++ /dev/null @@ -1,2 +0,0 @@ -{"id": 386506928,"label": "vertex","properties": {"aai-last-mod-ts": [{"id": "ob632u-6e46nk-5j45","value": 1488308500413}],"aai-uri": [{"id": "ob6712-6e46nk-5lhh","value": "/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-987654321-9922/cloud-region-id-987654320-9922/tenants/tenant/tenant-987654321-9999/vservers/vserver/vserver-987654321-9999"}],"prov-status": [{"id": "ob651y-6e46nk-1kw5","value": "example-prov-status-val-7367"}],"aai-created-ts": [{"id": "ob62ae-6e46nk-5gqt","value": 1488308500413}],"source-of-truth": [{"id": "ob61w6-6e46nk-5jwl","value": "FitNesse-Test"}],"vserver-selflink": [{"id": "ob65g6-6e46nk-3xfp","value": "example-vserver-selflink-val-7367"}],"aai-node-type": [{"id": "ob61hy-6e46nk-5f5x","value": "vserver"}],"in-maint": [{"id": "ob65ue-6e46nk-20p1","value": false}],"resource-version": [{"id": "ob62om-6e46nk-23ut","value": "1488308500413"}],"vserver-name": [{"id": "ob649i-6e46nk-3u9x","value": "example-vserver-name-val-7367vserver-987654321-9999"}],"vserver-id": [{"id": "ob63va-6e46nk-3sp1","value": "vserver-987654321-9999"}],"last-mod-source-of-truth": [{"id": "ob63h2-6e46nk-5edh","value": "FitNesse-Test"}],"vserver-name2": [{"id": "ob64nq-6e46nk-3vut","value": "example-vserver-name2-val-7367"}],"is-closed-loop-disabled": [{"id": "ob668m-6e46nk-229x","value": false}]}} -{"id": 2461872,"label": "vertex","properties": {"aai-last-mod-ts": [{"id": "21hqu-1grlc-5j45","value": 1467901600}],"in-maint": [{"id": "21i52-1grlc-20p1","value": false}],"resource-version": [{"id": "21ija-1grlc-23ut","value": "1467901600"}],"vserver-name": [{"id": "21ixi-1grlc-3u9x","value": "PerfTest_VServerFix0027TenantPez002701611467901587187Name"}],"aai-created-ts": [{"id": "21jbq-1grlc-5gqt","value": 1467901600}],"vserver-id": [{"id": "21jpy-1grlc-3sp1","value": "PerfTest_VServerFix0027TenantPez002701611467901587187"}],"last-mod-source-of-truth": [{"id": "21k46-1grlc-5edh","value": "MSO"}],"vserver-name2": [{"id": "21kie-1grlc-3vut","value": "PerfTest_VServerFix0027TenantPez002701611467901587187-VM Name2 optional"}],"source-of-truth": [{"id": "21kwm-1grlc-5jwl","value": "MSO"}],"vserver-selflink": [{"id": "21lau-1grlc-3xfp","value": "http://testvserverLink.com/.html?vserv=VserverLink"}],"is-closed-loop-disabled": [{"id": "21lp2-1grlc-229x","value": false}],"aai-node-type": [{"id": "21m3a-1grlc-5f5x","value": "vserver"}],"aai-uri": [{"id": "21m3a-1grlc-5a5x","value": "/vservers/vserver/test1"}]}} diff --git a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource-format.json b/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource-format.json deleted file mode 100644 index c7e4255..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource-format.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "results": [ - { - "vserver": { - - } - }, - { - "vserver": { - } - } - ] -} \ No newline at end of file diff --git a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource_and_url-format.json b/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource_and_url-format.json deleted file mode 100644 index 80d6560..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/resource_and_url-format.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "results": [ - { - "url" : "/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner-987654321-9922/cloud-region-id-987654321-9922/tenants/tenant/tenant-987654321-9999/vservers/vserver/vserver-987654321-9999", - "vserver": { - - } - }, - { - "url" : "/vservers/vserver/test1", - "vserver": { - - } - } - ] -} diff --git a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/simple-format.json b/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/simple-format.json deleted file mode 100644 index dd34261..0000000 --- a/aai-resources/src/test/resources/org/openecomp/aai/serialization/queryformats/simple-format.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "results" : [{ - "id" : "0", - "node-type" : "generic-vnf", - "url" : "urimissing", - "properties" : { - "vnf-name" : "myVnf" - }, - "related-to" : [{ - "node-type" : "vserver", - "id" : "1", - "url" : "urimissing" - }] - } , { - "id" : "1", - "node-type" : "vserver", - "url" : "urimissing", - "properties" : { - "vserver-name" : "myVserver" - }, - "related-to" : [{ - "node-type" : "generic-vnf", - "id" : "0", - "url" : "urimissing" - },{ - "node-type" : "pserver", - "id" : "2", - "url" : "/pservers/pserver/key1" - }] - },{ - "id" : "2", - "node-type" : "pserver", - "url" : "/pservers/pserver/key1", - "properties" : { - "hostname" : "myPserver" - }, - "related-to" : [{ - "node-type" : "vserver", - "id" : "1", - "url" : "urimissing" - }] - }] -} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/bulk/pserver-transactions-invalid.json b/aai-resources/src/test/resources/payloads/bulk/pserver-transactions-invalid.json new file mode 100644 index 0000000..baf8392 --- /dev/null +++ b/aai-resources/src/test/resources/payloads/bulk/pserver-transactions-invalid.json @@ -0,0 +1,44 @@ +{ + "transactions": [ + { + "put": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + "hostname": "pserver-hostname-11", + "fqdn": "fake-fqdn-11" + } + } + ] + }, + { + "patch": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + "fqdn": "fake-fqdn-12" + } + } + ] + }, + { + "delete": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + "hostname": "pserver-hostname-11" + } + } + ] + }, + { + "get": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + } + } + ] + } + ] +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/bulk/pserver-transactions.json b/aai-resources/src/test/resources/payloads/bulk/pserver-transactions.json new file mode 100644 index 0000000..cf0698c --- /dev/null +++ b/aai-resources/src/test/resources/payloads/bulk/pserver-transactions.json @@ -0,0 +1,35 @@ +{ + "transactions": [ + { + "put": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + "hostname": "pserver-hostname-11", + "fqdn": "fake-fqdn-11" + } + } + ] + }, + { + "patch": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + "fqdn": "fake-fqdn-12" + } + } + ] + }, + { + "delete": [ + { + "uri": "/cloud-infrastructure/pservers/pserver/pserver-hostname-11", + "body": { + "hostname": "pserver-hostname-11" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/modeltransforms/model.json b/aai-resources/src/test/resources/payloads/modeltransforms/model.json new file mode 100644 index 0000000..731dd8c --- /dev/null +++ b/aai-resources/src/test/resources/payloads/modeltransforms/model.json @@ -0,0 +1,38 @@ +{ + "model-invariant-id": "fe8aac07-ce6c-4f9f-aa0d-b561c77da9e8-test01", + "model-type": "resource", + "model-vers": { + "model-ver": [ + { + "model-version-id": "0d23052d-8ffe-433e-a25d-da5da027bb7c", + "model-name": "vDbe", + "model-version": "v1.0", + "model-elements": { + "model-element": [ + { + "new-data-del-flag": "F", + "cardinality": "unbounded", + "relationship-list": { + "relationship": [ + { + "related-to": "model-ver", + "relationship-data": [ + { + "relationship-key": "model.model-invariant-id", + "relationship-value": "6dcdbbc8-23b6-42c3-ac9f-2c0a3fe8cfba" + }, + { + "relationship-key": "model-ver.model-version-id", + "relationship-value": "22382f81-70cb-470d-8ab2-3e1b9fad10df" + } + ] + } + ] + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/modeltransforms/model.xml b/aai-resources/src/test/resources/payloads/modeltransforms/model.xml new file mode 100644 index 0000000..ea16fda --- /dev/null +++ b/aai-resources/src/test/resources/payloads/modeltransforms/model.xml @@ -0,0 +1,22 @@ + +fe8aac07-ce6c-4f9f-aa0d-b561c77da9e8-test01 +resource +vDbe +v1.0 +0d23052d-8ffe-433e-a25d-da5da027bb7c + + + F + unbounded + + + model + + model.model-name-version-id + 22382f81-70cb-470d-8ab2-3e1b9fad10df + + + + + + \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/relationship/complex.json b/aai-resources/src/test/resources/payloads/relationship/complex.json new file mode 100644 index 0000000..77c3c21 --- /dev/null +++ b/aai-resources/src/test/resources/payloads/relationship/complex.json @@ -0,0 +1,16 @@ +{ + "physical-location-id" : "e13d4587-19ad-4bf5-80f5-c021efb5b61c", + "physical-location-type" : "uug", + "street1" : "kDv5Ge6dr", + "city" : "KpEa5IjqY0u82", + "postal-code" : "6CRqacfEW2", + "country" : "P0ho", + "region" : "Sk2QevPYRBjT", + "ctag-pools" : { + "ctag-pool" : [ { + "target-pe" : "5dbe73c6-cedf-4e68-a7c5-699ba6d90e1d", + "availability-zone-name" : "819ec2fa-fb9f-49f0-8fd8-5feb941aad1f", + "ctag-pool-purpose" : "4TMeWI" + } ] + } +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship.json b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship.json new file mode 100644 index 0000000..07d1625 --- /dev/null +++ b/aai-resources/src/test/resources/payloads/relationship/pserver-complex-relationship.json @@ -0,0 +1,8 @@ +{ + "related-to" : "complex", + "related-link" : "/aai/v11/cloud-infrastructure/complexes/complex/e13d4587-19ad-4bf5-80f5-c021efb5b61c", + "relationship-data" : [{ + "relationship-key" : "complex.physical-location-id", + "relationship-value" : "e13d4587-19ad-4bf5-80f5-c021efb5b61c" + }] +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/relationship/pserver.json b/aai-resources/src/test/resources/payloads/relationship/pserver.json new file mode 100644 index 0000000..661648a --- /dev/null +++ b/aai-resources/src/test/resources/payloads/relationship/pserver.json @@ -0,0 +1,4 @@ +{ + "hostname" : "590a8943-1200-43b3-825b-75dde6b8f44a", + "in-maint" : false +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/resource/pserver-patch-test.json b/aai-resources/src/test/resources/payloads/resource/pserver-patch-test.json new file mode 100644 index 0000000..8d7aa93 --- /dev/null +++ b/aai-resources/src/test/resources/payloads/resource/pserver-patch-test.json @@ -0,0 +1,28 @@ +{ + "hostname": "pserver-patch-test", + "ptnii-equip-name": "example-ptnii-equip-name-val-36969", + "number-of-cpus": 62220, + "disk-in-gigabytes": 872, + "ram-in-megabytes": 35331, + "equip-type": "example-equip-type-val-22986", + "equip-vendor": "example-equip-vendor-val-37452", + "equip-model": "example-equip-model-val-14665", + "fqdn": "example-fqdn-val-33429", + "pserver-selflink": "example-pserver-selflink-val-10125", + "ipv4-oam-address": "example-ipv4-oam-address-val-3155", + "serial-number": "example-serial-number-val-12010", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-77686", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-17856", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-33665", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-6210", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-40977", + "inv-status": "example-inv-status-val-3682", + "pserver-id": "example-pserver-id-val-82142", + "internet-topology": "example-internet-topology-val-56425", + "in-maint": true, + "pserver-name2": "example-pserver-name2-val-53802", + "purpose": "example-purpose-val-90218", + "prov-status": "example-prov-status-val-11642", + "management-option": "example-management-option-val-91111", + "host-profile": "example-host-profile-val-36247" +} \ No newline at end of file diff --git a/aai-resources/src/test/resources/payloads/resource/pserver.json b/aai-resources/src/test/resources/payloads/resource/pserver.json new file mode 100644 index 0000000..51c25a8 --- /dev/null +++ b/aai-resources/src/test/resources/payloads/resource/pserver.json @@ -0,0 +1,28 @@ +{ + "hostname": "pserver-hostname-test", + "ptnii-equip-name": "example-ptnii-equip-name-val-36969", + "number-of-cpus": 62220, + "disk-in-gigabytes": 872, + "ram-in-megabytes": 35331, + "equip-type": "example-equip-type-val-22986", + "equip-vendor": "example-equip-vendor-val-37452", + "equip-model": "example-equip-model-val-14665", + "fqdn": "example-fqdn-val-33429", + "pserver-selflink": "example-pserver-selflink-val-10125", + "ipv4-oam-address": "example-ipv4-oam-address-val-3155", + "serial-number": "example-serial-number-val-12010", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-77686", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-17856", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-33665", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-6210", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-40977", + "inv-status": "example-inv-status-val-3682", + "pserver-id": "example-pserver-id-val-82142", + "internet-topology": "example-internet-topology-val-56425", + "in-maint": true, + "pserver-name2": "example-pserver-name2-val-53802", + "purpose": "example-purpose-val-90218", + "prov-status": "example-prov-status-val-11642", + "management-option": "example-management-option-val-91111", + "host-profile": "example-host-profile-val-36247" +} \ No newline at end of file -- cgit 1.2.3-korg