From f94c995d4d2b5ffd7f7fa7cf6ec10cdcbf4932a7 Mon Sep 17 00:00:00 2001 From: "Threefoot, Jane (jt6620)" Date: Fri, 8 Sep 2017 09:34:19 -0400 Subject: [PATCH] EdgeRules throws descriptive error on invalid rule Also added test coverage, including refactoring of test resources to simplify test suites. Issue-ID: AAI-277 Change-Id: Ibfdc81342a139d121740f10bccc66a7420b61945 Signed-off-by: Threefoot, Jane (jt6620) --- aai-annotations/.gitignore | 1 + .../openecomp/aai/annotations/AnnotationsTest.java | 1 + aai-core/.gitignore | 1 + aai-core/pom.xml | 6 + .../aai/dmaap/AAIDmaapEventJMSProducer.java | 17 +- .../aai/serialization/db/EdgeProperty.java | 6 + .../openecomp/aai/serialization/db/EdgeRules.java | 125 +- .../src/test/java/org/openecomp/aai/AAISetup.java | 34 + .../aai/dbmodel/DbEdgeRulesConverterTest.java | 17 +- .../openecomp/aai/exceptions/AAIExceptionTest.java | 16 +- .../aai/exceptions/AAIExceptionWithInfoTest.java | 13 +- .../aai/introspection/IntrospectorTestSpec.java | 11 +- .../aai/introspection/MoxyEngineTest.java | 25 - .../aai/introspection/PojoInjestorTest.java | 14 +- .../aai/introspection/PojoLoaderTest.java | 18 +- .../aai/introspection/PojoStrategyTest.java | 5 +- .../aai/introspection/PropertyPredicatesTest.java | 37 +- .../aai/introspection/ReflectionEngineTest.java | 19 - .../aai/introspection/sideeffect/DataCopyTest.java | 49 +- .../aai/introspection/sideeffect/DataLinkTest.java | 36 +- .../validation/IntrospectorValidationTest.java | 15 +- .../openecomp/aai/logging/LoggingContextTest.java | 13 +- .../aai/parsers/query/GraphTraversalTest.java | 56 +- .../aai/parsers/query/LegacyQueryTest.java | 33 +- .../query/RelationshipGremlinQueryTest.java | 41 +- .../aai/parsers/query/RelationshipQueryTest.java | 42 +- .../parsers/query/UniqueRelationshipQueryTest.java | 41 +- .../aai/parsers/query/UniqueURIQueryTest.java | 29 +- .../relationship/RelationshipToURITest.java | 44 +- .../openecomp/aai/parsers/uri/URIParserTest.java | 35 +- .../openecomp/aai/parsers/uri/URIToDBKeyTest.java | 85 +- .../parsers/uri/URIToExtensionInformationTest.java | 94 + .../openecomp/aai/parsers/uri/URIToObjectTest.java | 45 +- .../parsers/uri/URIToRelationshipObjectTest.java | 45 +- .../aai/query/builder/SimplePathTest.java | 19 +- .../aai/query/builder/TraversalQueryTest.java | 36 +- .../org/openecomp/aai/query/builder/UntilTest.java | 21 +- .../aai/serialization/db/DbAliasTest.java | 65 +- .../aai/serialization/db/DbSerializerTest.java | 19 +- .../aai/serialization/db/EdgePropertyMapTest.java | 43 + .../aai/serialization/db/EdgeRulesTest.java | 163 +- .../queryformats/QueryFormatTestHelper.java | 15 +- .../queryformats/SimpleFormatTest.java | 32 +- .../queryformats/utils/QueryParamInjectorTest.java | 10 +- .../queryformats/utils/UrlBuilderTest.java | 35 +- .../tinkerpop/TreeBackedVertexTest.java | 28 +- .../java/org/openecomp/aai/util/CNNameTest.java | 7 +- .../aai/util/CustomLogPatternLayoutTest.java | 9 +- .../aai/workarounds/RemoveDME2QueryParamsTest.java | 6 +- .../bundleconfig-local/etc/oxm/aai_oxm_v10.xml | 2676 ++++----- .../bundleconfig-local/etc/oxm/aai_oxm_v11.xml | 706 ++- .../bundleconfig-local/etc/oxm/aai_oxm_v2.xml | 1726 ++++++ .../bundleconfig-local/etc/oxm/aai_oxm_v8.xml | 3018 +--------- .../bundleconfig-local/etc/oxm/aai_oxm_v9.xml | 916 +-- .../etc/oxm}/sideeffect/nested-case.json | 0 .../etc/queryformarts}/graphson/resource.graphson | 0 .../etc/queryformarts}/resource-format.json | 0 .../queryformarts}/resource_and_url-format.json | 0 .../etc/queryformarts}/simple-format.json | 0 .../etc}/relationship/ambiguous-relationship.json | 0 .../etc}/relationship/both-failv10-successv9.json | 0 .../etc}/relationship/both-successv10-failv9.json | 0 .../etc}/relationship/only-related-link.json | 0 .../etc}/relationship/only-relationship-data.json | 0 .../relationship/too-many-items-relationship.json | 0 .../top-level-two-keys-relationship.json | 0 .../relationship/two-top-level-relationship.json | 0 .../resources/dbedgerules/DbEdgeRules_test.json | 37 + .../dbedgerules/DbEdgeRules_test_broken.json | 35 + .../openecomp/aai/introspection/aai_oxm_v11.xml | 5932 -------------------- aai-schema/.gitignore | 1 + 71 files changed, 5024 insertions(+), 11600 deletions(-) create mode 100644 aai-core/src/test/java/org/openecomp/aai/AAISetup.java create mode 100644 aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToExtensionInformationTest.java create mode 100644 aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgePropertyMapTest.java create mode 100644 aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml rename aai-core/src/test/resources/{org/openecomp/aai/introspection => bundleconfig-local/etc/oxm}/sideeffect/nested-case.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/serialization/queryformats => bundleconfig-local/etc/queryformarts}/graphson/resource.graphson (100%) rename aai-core/src/test/resources/{org/openecomp/aai/serialization/queryformats => bundleconfig-local/etc/queryformarts}/resource-format.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/serialization/queryformats => bundleconfig-local/etc/queryformarts}/resource_and_url-format.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/serialization/queryformats => bundleconfig-local/etc/queryformarts}/simple-format.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/ambiguous-relationship.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/both-failv10-successv9.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/both-successv10-failv9.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/only-related-link.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/only-relationship-data.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/too-many-items-relationship.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/top-level-two-keys-relationship.json (100%) rename aai-core/src/test/resources/{org/openecomp/aai/parsers => bundleconfig-local/etc}/relationship/two-top-level-relationship.json (100%) create mode 100644 aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json create mode 100644 aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml diff --git a/aai-annotations/.gitignore b/aai-annotations/.gitignore index ae3c1726..2f30844c 100644 --- a/aai-annotations/.gitignore +++ b/aai-annotations/.gitignore @@ -1 +1,2 @@ /bin/ +/.checkstyle diff --git a/aai-annotations/src/test/java/org/openecomp/aai/annotations/AnnotationsTest.java b/aai-annotations/src/test/java/org/openecomp/aai/annotations/AnnotationsTest.java index 848d8b08..e97cdef8 100644 --- a/aai-annotations/src/test/java/org/openecomp/aai/annotations/AnnotationsTest.java +++ b/aai-annotations/src/test/java/org/openecomp/aai/annotations/AnnotationsTest.java @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.openecomp.aai.annotations; import org.openecomp.aai.annotations.Metadata; diff --git a/aai-core/.gitignore b/aai-core/.gitignore index 574ae547..2db7c680 100644 --- a/aai-core/.gitignore +++ b/aai-core/.gitignore @@ -9,3 +9,4 @@ bundleconfig-local/etc/logback.xml /.pydevproject /test_csvWriter.csv /bin/ +/.checkstyle diff --git a/aai-core/pom.xml b/aai-core/pom.xml index 3fa131f7..7248f491 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -428,6 +428,12 @@ com.att.nsa dmaapClient 0.2.12 + + + com.att.aft + dme2 + + org.apache.camel diff --git a/aai-core/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSProducer.java b/aai-core/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSProducer.java index 06a4fa0f..89ed9348 100644 --- a/aai-core/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSProducer.java +++ b/aai-core/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSProducer.java @@ -23,6 +23,7 @@ package org.openecomp.aai.dmaap; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.command.ActiveMQQueue; import org.json.JSONObject; +import org.openecomp.aai.util.AAIConfig; import org.springframework.jms.connection.CachingConnectionFactory; import org.springframework.jms.core.JmsTemplate; @@ -31,14 +32,18 @@ public class AAIDmaapEventJMSProducer { private JmsTemplate jmsTemplate; public AAIDmaapEventJMSProducer() { - this.jmsTemplate = new JmsTemplate(); - this.jmsTemplate.setConnectionFactory(new CachingConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61447"))); - this.jmsTemplate.setDefaultDestination(new ActiveMQQueue("IN_QUEUE")); + if(AAIConfig.get("aai.jms.enable", "true").equals("true")){ + this.jmsTemplate = new JmsTemplate(); + this.jmsTemplate.setConnectionFactory(new CachingConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61447"))); + this.jmsTemplate.setDefaultDestination(new ActiveMQQueue("IN_QUEUE")); + } } public void sendMessageToDefaultDestination(JSONObject finalJson) { - jmsTemplate.convertAndSend(finalJson.toString()); - CachingConnectionFactory ccf = (CachingConnectionFactory)this.jmsTemplate.getConnectionFactory(); - ccf.destroy(); + if(jmsTemplate != null){ + jmsTemplate.convertAndSend(finalJson.toString()); + CachingConnectionFactory ccf = (CachingConnectionFactory) this.jmsTemplate.getConnectionFactory(); + ccf.destroy(); + } } } diff --git a/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeProperty.java b/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeProperty.java index 29461bcf..21f07451 100644 --- a/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeProperty.java +++ b/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeProperty.java @@ -21,10 +21,16 @@ package org.openecomp.aai.serialization.db; public enum EdgeProperty { + FROM("from"), + TO("to"), + LABEL("label"), + DIRECTION("direction"), + MULTIPLICITY("multiplicity"), CONTAINS("contains-other-v"), DELETE_OTHER_V("delete-other-v"), SVC_INFRA("SVC-INFRA"), PREVENT_DELETE("prevent-delete"); + private final String name; private EdgeProperty(String name) { diff --git a/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeRules.java b/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeRules.java index 0aeafabc..22a94554 100644 --- a/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeRules.java +++ b/aai-core/src/main/java/org/openecomp/aai/serialization/db/EdgeRules.java @@ -40,7 +40,6 @@ import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.dbmodel.DbEdgeRules; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Version; import org.openecomp.aai.serialization.db.exceptions.EdgeMultiplicityException; @@ -58,8 +57,6 @@ public class EdgeRules { private EELFLogger logger = EELFManager.getInstance().getLogger(EdgeRules.class); - private Multimap deleteScope = DbEdgeRules.DefaultDeleteScope; - private DocumentContext rulesDoc; /** @@ -74,22 +71,28 @@ public class EdgeRules { } + private EdgeRules(String rulesFilename) { + String json = this.getEdgeRuleJson(rulesFilename); + rulesDoc = JsonPath.parse(json); + } + + private String getEdgeRuleJson(String rulesFilename) { + InputStream is = getClass().getResourceAsStream(rulesFilename); + + Scanner scanner = new Scanner(is); + String json = scanner.useDelimiter("\\Z").next(); + scanner.close(); + + return json; + } + /** * Loads the versioned DbEdgeRules json file for later parsing. */ @SuppressWarnings("unchecked") private EdgeRules(Version version) { - String json = this.getEdgeRuleJson(version); rulesDoc = JsonPath.parse(json); - - if (!Version.isLatest(version)) { - try { - Class dbEdgeRules = Class.forName("org.openecomp.aai.dbmodel." + version.toString() + ".gen.DbEdgeRules"); - this.deleteScope = (Multimap)dbEdgeRules.getDeclaredField("DefaultDeleteScope").get(null); - } catch (Exception e) { - } - } } private String getEdgeRuleJson(Version version) { @@ -105,6 +108,11 @@ public class EdgeRules { private static class Helper { private static final EdgeRules INSTANCE = new EdgeRules(); private static final Map INSTANCEMAP = new ConcurrentHashMap<>(); + + private static EdgeRules getEdgeRulesByFilename(String rulesFilename) { + return new EdgeRules(rulesFilename); + } + private static EdgeRules getVersionedEdgeRules(Version v) { if (Version.isLatest(v)) { return INSTANCE; @@ -136,6 +144,16 @@ public class EdgeRules { } + /** + * Loads edge rules from the given file. + * + * @param rulesFilename - name of the file to load rules from + * @return the EdgeRules instance + */ + public static EdgeRules getInstance(String rulesFilename) { + return Helper.getEdgeRulesByFilename(rulesFilename); + } + /** * Adds the tree edge. * @@ -252,8 +270,8 @@ public class EdgeRules { where("from").is(nodeB).and("to").is(nodeA) ); - List results = rulesDoc.read("$.rules.[?]", aToB); - results.addAll(rulesDoc.read("$.rules.[?]", bToA)); + List> results = readRules(aToB); + results.addAll(readRules(bToA)); return !results.isEmpty(); @@ -300,6 +318,8 @@ public class EdgeRules { return result; } + + /** * Gets the edge rule of the given type that exists between A and B. * Will check B|A as well, and flips the direction accordingly if that succeeds @@ -313,19 +333,21 @@ public class EdgeRules { */ public EdgeRule getEdgeRule(EdgeType type, String nodeA, String nodeB) throws AAIException { //try A to B - List> aToBEdges = rulesDoc.read("$.rules.[?]", buildFilter(type, nodeA, nodeB)); + List> aToBEdges = readRules(buildFilter(type, nodeA, nodeB)); if (!aToBEdges.isEmpty()) { //lazily stop iterating if we find a match //should there be a mismatch between type and isParent, //the caller will receive something. //this operates on the assumption that there are at most two rules //for a given vertex pair + verifyRule(aToBEdges.get(0)); return buildRule(aToBEdges.get(0)); } //we get here if there was nothing for A to B, so let's try B to A - List> bToAEdges = rulesDoc.read("$.rules.[?]", buildFilter(type, nodeB, nodeA)); + List> bToAEdges = readRules(buildFilter(type, nodeB, nodeA)); if (!bToAEdges.isEmpty()) { + verifyRule(bToAEdges.get(0)); return flipDirection(buildRule(bToAEdges.get(0))); //bc we need to return as A|B, so flip the direction to match } @@ -467,6 +489,61 @@ public class EdgeRules { } + /** + * Verifies that all required properties are defined in the given edge rule. + * If they are not, throws a RuntimeException. + * + * @param rule - Map representing + * an edge rule + */ + private void verifyRule(Map rule) { + for (EdgeProperty prop : EdgeProperty.values()) { + if (!rule.containsKey(prop.toString())) { + /* Throws RuntimeException as rule definition errors + * cannot be recovered from, and should never happen anyway + * because these are configuration files, so requiring all + * downstream code to check for this exception seems inappropriate. + * It's instantiated with an AAIException to make sure all + * relevant information is present in the error message. + */ + throw new RuntimeException(new AAIException("AAI_4005", + "Rule between " + rule.get("from") + " and " + rule.get("to") + + " is missing property " + prop + ".")); + } + } + } + + /** + * Reads all the edge rules from the loaded json file. + * + * @return List> + * Each map represents a rule read from the json. + */ + private List> readRules() { + return readRules(null); + } + + /** + * Reads the edge rules from the loaded json file, using the given filter + * to get specific rules. If filter is null, will get all rules. + * + * @param filter - may be null to indicate get all + * @return List> + * Each map represents a rule read from the json. + */ + private List> readRules(Filter filter) { + List> results; + if (filter == null) { //no filter means get all + results = rulesDoc.read("$.rules.*"); + } else { + results = rulesDoc.read("$.rules.[?]", filter); + } + for (Map result : results) { + verifyRule(result); + } + return results; + } + /** * Gets all the edge rules we define. * @@ -475,7 +552,7 @@ public class EdgeRules { public Multimap getAllRules() { Multimap result = ArrayListMultimap.create(); - List> rules = rulesDoc.read("$.rules.*"); + List> rules = readRules(); for (Map rule : rules) { EdgeRule er = buildRule(rule); String name = rule.get("from") + "|" + rule.get("to"); @@ -485,19 +562,23 @@ public class EdgeRules { return result; } - public Multimap getDeleteSemantics() { - return this.deleteScope; - } - + /** + * Gets all edge rules that define a child relationship from + * the given node type. + * + * @param nodeType + * @return + */ public Set getChildren(String nodeType) { final Filter filter = filter( where("from").is(nodeType).and(EdgeProperty.CONTAINS.toString()).is("${direction}") ).or(where("to").is(nodeType).and(EdgeProperty.CONTAINS.toString()).is("!${direction}")); - final List> rules = rulesDoc.read("$.rules.[?]", filter); + final List> rules = readRules(filter); final Set result = new HashSet<>(); rules.forEach(item -> { + verifyRule(item); result.add(buildRule(item)); }); diff --git a/aai-core/src/test/java/org/openecomp/aai/AAISetup.java b/aai-core/src/test/java/org/openecomp/aai/AAISetup.java new file mode 100644 index 00000000..b0fce58d --- /dev/null +++ b/aai-core/src/test/java/org/openecomp/aai/AAISetup.java @@ -0,0 +1,34 @@ +/*- + * ============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; + +import org.junit.BeforeClass; +import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; +import org.openecomp.aai.util.AAIConstants; + +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/"); + } +} diff --git a/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java b/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java index 3a1d9cc1..7cf5ac71 100644 --- a/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java @@ -20,22 +20,15 @@ package org.openecomp.aai.dbmodel; -import static org.junit.Assert.*; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.util.Map.Entry; - +import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.Multimap; import org.apache.commons.io.FileUtils; import org.junit.Test; -import com.google.common.collect.ImmutableSetMultimap; -import com.google.common.collect.Multimap; +import java.io.*; +import java.util.Map.Entry; -import freemarker.template.TemplateException; +import static org.junit.Assert.*; public class DbEdgeRulesConverterTest { diff --git a/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionTest.java b/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionTest.java index 862f6911..554b6418 100644 --- a/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionTest.java @@ -20,26 +20,18 @@ package org.openecomp.aai.exceptions; +import org.junit.Test; +import org.openecomp.aai.AAISetup; + import static org.junit.Assert.assertEquals; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; +public class AAIExceptionTest extends AAISetup { -public class AAIExceptionTest { private static final String code = "4004"; private static final String details = "This is a detailed description of the exception."; private static final Throwable cause = new RuntimeException("This is a runtime exception."); private static final Throwable noMessage = new RuntimeException(); - @BeforeClass - public static void configure() throws NoSuchFieldException, SecurityException, 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/org/openecomp/aai/introspection/"); - } - /** * Test constructor with 0 params. * diff --git a/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionWithInfoTest.java b/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionWithInfoTest.java index b6357e43..41841ac7 100644 --- a/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionWithInfoTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/exceptions/AAIExceptionWithInfoTest.java @@ -20,16 +20,14 @@ package org.openecomp.aai.exceptions; -import org.junit.BeforeClass; import org.junit.Test; -import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; +import org.openecomp.aai.AAISetup; import java.util.HashMap; import static org.junit.Assert.assertEquals; -public class AAIExceptionWithInfoTest { +public class AAIExceptionWithInfoTest extends AAISetup { private static final HashMap map = new HashMap(); @@ -45,13 +43,6 @@ public class AAIExceptionWithInfoTest { private static final String details = "This is a detailed description of the exception."; private static final Throwable cause = new RuntimeException("This is a runtime exception."); - @BeforeClass - public static void configure() throws NoSuchFieldException, SecurityException, 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/org/openecomp/aai/introspection/"); - } - /** * Test constructor with 2 params. * diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/IntrospectorTestSpec.java b/aai-core/src/test/java/org/openecomp/aai/introspection/IntrospectorTestSpec.java index 47fef7ee..1ecc6923 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/IntrospectorTestSpec.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/IntrospectorTestSpec.java @@ -20,15 +20,12 @@ package org.openecomp.aai.introspection; -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.Set; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import com.google.common.collect.Sets; -public class IntrospectorTestSpec { +import static org.junit.Assert.assertEquals; + +public class IntrospectorTestSpec extends AAISetup { diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/MoxyEngineTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/MoxyEngineTest.java index 9504c46b..0f67ddfc 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/MoxyEngineTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/MoxyEngineTest.java @@ -20,36 +20,11 @@ package org.openecomp.aai.introspection; -import java.io.StringReader; - -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - -import org.eclipse.persistence.dynamic.DynamicEntity; -import org.eclipse.persistence.jaxb.UnmarshallerProperties; -import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; -import org.junit.BeforeClass; import org.junit.Test; - import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; public class MoxyEngineTest extends IntrospectorTestSpec { - /** - * Configure. - * @throws Exception - * @throws SecurityException - * @throws NoSuchFieldException - */ - @BeforeClass - public static void configure() throws NoSuchFieldException, SecurityException, Exception { - 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/"); - } - /** * Container object. * @throws AAIUnknownObjectException diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/PojoInjestorTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/PojoInjestorTest.java index 34a6279b..b820cfef 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/PojoInjestorTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/PojoInjestorTest.java @@ -20,25 +20,17 @@ package org.openecomp.aai.introspection; -import static org.junit.Assert.*; +import org.junit.Test; +import org.openecomp.aai.db.props.AAIProperties; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; -import org.junit.BeforeClass; -import org.junit.Test; - -import org.openecomp.aai.db.props.AAIProperties; +import static org.junit.Assert.*; public class PojoInjestorTest { - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - } - @Test public void getVersionTest() { String latestVersion = "org.openecomp.aai.yang.VnfImage"; diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/PojoLoaderTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/PojoLoaderTest.java index 0eeb966b..e4e58b60 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/PojoLoaderTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/PojoLoaderTest.java @@ -20,24 +20,18 @@ package org.openecomp.aai.introspection; -import static org.junit.Assert.*; - -import org.junit.BeforeClass; import org.junit.Test; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.domain.yang.v9.VnfImage; import org.openecomp.aai.introspection.exceptions.AAIUnmarshallingException; import org.openecomp.aai.restcore.MediaType; -public class PojoLoaderTest { +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class PojoLoaderTest extends AAISetup { + - - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - } - @Test public void test() { Loader pojoLoader = LoaderFactory.createLoaderForVersion(ModelType.POJO, Version.v9); diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/PojoStrategyTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/PojoStrategyTest.java index 4843b10d..0bd61178 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/PojoStrategyTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/PojoStrategyTest.java @@ -20,14 +20,13 @@ package org.openecomp.aai.introspection; -import static org.junit.Assert.*; - import org.junit.Test; - import org.openecomp.aai.domain.yang.CloudRegion; import org.openecomp.aai.domain.yang.VolumeGroup; import org.openecomp.aai.schema.enums.ObjectMetadata; +import static org.junit.Assert.assertEquals; + public class PojoStrategyTest { @Test diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/PropertyPredicatesTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/PropertyPredicatesTest.java index ac430e1b..50aea8fe 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/PropertyPredicatesTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/PropertyPredicatesTest.java @@ -20,34 +20,29 @@ package org.openecomp.aai.introspection; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; -import java.util.Set; - -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; -import org.junit.Ignore; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; -@Ignore -public class PropertyPredicatesTest { +import java.util.Set; +import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertThat; + +public class PropertyPredicatesTest extends AAISetup { + + private final Version version = Version.getLatest(); + + private Loader loader; + private ModelType introspectorFactoryType = ModelType.MOXY; + private Introspector obj; - private final static Version version = Version.v10; - private static Loader loader; - private final static ModelType introspectorFactoryType = ModelType.MOXY; - private static Introspector obj; - - @BeforeClass - public static void setup() throws NoSuchFieldException, SecurityException, Exception { - System.setProperty("AJSC_HOME", "./src/test/resources/"); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/"); + @Before + public void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); obj = loader.introspectorFromName("test-object"); - } @Test diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/ReflectionEngineTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/ReflectionEngineTest.java index 8781d59c..d7cd7b18 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/ReflectionEngineTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/ReflectionEngineTest.java @@ -20,30 +20,11 @@ package org.openecomp.aai.introspection; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; - -import javax.xml.bind.JAXBException; - -import org.junit.BeforeClass; import org.junit.Test; - import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; -import org.openecomp.aai.restcore.CustomJacksonJaxBJsonProvider; public class ReflectionEngineTest extends IntrospectorTestSpec { - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "./src/test/resources"); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - } - /** * Container object. * diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataCopyTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataCopyTest.java index 0d40f89f..8e37fe05 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataCopyTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataCopyTest.java @@ -20,17 +20,8 @@ package org.openecomp.aai.introspection.sideeffect; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; - +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; import org.apache.commons.io.IOUtils; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Graph; @@ -43,11 +34,7 @@ import org.mockito.MockitoAnnotations; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.dbmap.DBConnectionType; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.introspection.sideeffect.exceptions.AAIMissingRequiredPropertyException; import org.openecomp.aai.parsers.query.QueryParser; import org.openecomp.aai.serialization.db.DBSerializer; @@ -55,17 +42,22 @@ import org.openecomp.aai.serialization.db.EdgeProperty; 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.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.InvocationTargetException; +import java.net.MalformedURLException; +import java.net.URISyntaxException; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; -@Ignore public class DataCopyTest { private static TitanGraph graph; - private final static Version version = Version.v10; + private final static Version version = Version.getLatest(); private final static ModelType introspectorFactoryType = ModelType.MOXY; private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; private final static DBConnectionType type = DBConnectionType.REALTIME; @@ -83,7 +75,6 @@ public class DataCopyTest { graph = TitanFactory.build().set("storage.backend","inmemory").open(); 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/org/openecomp/aai/introspection/"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, @@ -112,7 +103,7 @@ public class DataCopyTest { @Test public void runPopulatePersonaModelVer() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException { - final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v10); + final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); final Introspector obj = loader.introspectorFromName("test-object"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key1"); @@ -168,7 +159,7 @@ public class DataCopyTest { @Test public void verifyNestedSideEffect() throws URISyntaxException, AAIException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, IOException { - final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v10); + final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); final Introspector obj = loader.unmarshal("customer", this.getJsonString("nested-case.json")); System.out.println(obj.marshal(true)); TransactionalGraphEngine spy = spy(dbEngine); @@ -194,7 +185,7 @@ public class DataCopyTest { @Test public void expectedMissingPropertyExceptionInURI() throws AAIException, UnsupportedEncodingException { - final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v10); + final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); final Introspector obj = loader.introspectorFromName("test-object"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key1"); @@ -217,7 +208,7 @@ public class DataCopyTest { @Test public void expectedMissingPropertyExceptionForResultingObject() throws AAIException, UnsupportedEncodingException { - final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v10); + final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); final Introspector obj = loader.introspectorFromName("test-object"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key3"); @@ -241,7 +232,7 @@ public class DataCopyTest { @Test public void expectNoProcessingWithNoProperties() throws AAIException, UnsupportedEncodingException { - final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v10); + final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); final Introspector obj = loader.introspectorFromName("test-object"); obj.setValue("vnf-id", "myId"); @@ -267,7 +258,7 @@ public class DataCopyTest { private String getJsonString(String filename) throws IOException { - FileInputStream is = new FileInputStream("src/test/resources/org/openecomp/aai/introspection/sideeffect/" + filename); + FileInputStream is = new FileInputStream("src/test/resources/bundleconfig-local/etc/oxm/sideeffect/" + filename); String s = IOUtils.toString(is, "UTF-8"); IOUtils.closeQuietly(is); diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataLinkTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataLinkTest.java index 4aafe460..8220b86c 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataLinkTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/sideeffect/DataLinkTest.java @@ -20,16 +20,8 @@ package org.openecomp.aai.introspection.sideeffect; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import java.io.UnsupportedEncodingException; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.util.List; - +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -41,28 +33,28 @@ import org.mockito.MockitoAnnotations; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.dbmap.DBConnectionType; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.parsers.query.QueryParser; import org.openecomp.aai.serialization.db.DBSerializer; import org.openecomp.aai.serialization.db.EdgeProperty; 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.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.InvocationTargetException; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; -@Ignore public class DataLinkTest { private static TitanGraph graph; - private final static Version version = Version.v10; + private final static Version version = Version.getLatest(); private final static ModelType introspectorFactoryType = ModelType.MOXY; private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; private final static DBConnectionType type = DBConnectionType.REALTIME; @@ -80,7 +72,6 @@ public class DataLinkTest { graph = TitanFactory.build().set("storage.backend","inmemory").open(); 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/org/openecomp/aai/introspection/"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, @@ -184,6 +175,7 @@ public class DataLinkTest { GraphTraversalSource traversal = g.traversal(); when(spy.asAdmin()).thenReturn(adminSpy); when(adminSpy.getTraversalSource()).thenReturn(traversal); + when(adminSpy.getReadOnlyTraversalSource()).thenReturn(traversal); when(spy.tx()).thenReturn(g); when(self.property(AAIProperties.AAI_URI)).thenReturn(prop); when(prop.orElse(null)).thenReturn(obj.getURI()); diff --git a/aai-core/src/test/java/org/openecomp/aai/introspection/validation/IntrospectorValidationTest.java b/aai-core/src/test/java/org/openecomp/aai/introspection/validation/IntrospectorValidationTest.java index d3a9492f..8b76967a 100644 --- a/aai-core/src/test/java/org/openecomp/aai/introspection/validation/IntrospectorValidationTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/introspection/validation/IntrospectorValidationTest.java @@ -20,27 +20,22 @@ package org.openecomp.aai.introspection.validation; -import static org.junit.Assert.assertEquals; - -import java.util.List; - import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.introspection.tools.IntrospectorValidator; import org.openecomp.aai.introspection.tools.Issue; import org.openecomp.aai.introspection.tools.IssueType; import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; import org.openecomp.aai.util.AAIConstants; +import java.util.List; + +import static org.junit.Assert.assertEquals; + public class IntrospectorValidationTest { diff --git a/aai-core/src/test/java/org/openecomp/aai/logging/LoggingContextTest.java b/aai-core/src/test/java/org/openecomp/aai/logging/LoggingContextTest.java index 3fe2098c..9cc522eb 100644 --- a/aai-core/src/test/java/org/openecomp/aai/logging/LoggingContextTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/logging/LoggingContextTest.java @@ -20,18 +20,11 @@ package org.openecomp.aai.logging; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import org.junit.Test; -import java.util.Collections; -import java.util.Deque; -import java.util.LinkedList; -import java.util.Map; -import java.util.UUID; +import java.util.*; -import org.junit.Test; +import static org.junit.Assert.*; public class LoggingContextTest { diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java index b22a98e6..a4070b02 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/GraphTraversalTest.java @@ -20,30 +20,15 @@ package org.openecomp.aai.parsers.query; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriBuilder; - import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.BeforeClass; -import org.junit.Ignore; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.LoaderFactory; @@ -53,15 +38,24 @@ import org.openecomp.aai.rest.RestTokens; 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; -@Ignore -public class GraphTraversalTest { +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriBuilder; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; - private static TransactionalGraphEngine dbEngine; - - private static TransactionalGraphEngine dbEnginev9; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; + +public class GraphTraversalTest extends AAISetup { + + private TransactionalGraphEngine dbEngine; + private TransactionalGraphEngine dbEnginev9; @Rule public ExpectedException thrown = ExpectedException.none(); @@ -72,12 +66,9 @@ public class GraphTraversalTest { * @throws SecurityException * @throws NoSuchFieldException */ - @BeforeClass - public static void configure() throws NoSuchFieldException, SecurityException, 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/org/openecomp/aai/introspection/"); - dbEngine = + @Before + public void configure() throws Exception { + dbEngine = new TitanDBEngine(QueryStyle.TRAVERSAL, LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST), false); @@ -693,7 +684,6 @@ public class GraphTraversalTest { assertEquals("dependent",true, query.isDependent()); } - @Ignore @Test public void pluralCousin() throws UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("cloud-infrastructure/complexes/complex/key1/related-to/pservers").build(); @@ -728,7 +718,6 @@ public class GraphTraversalTest { assertEquals("dependent",true, query.isDependent()); } - @Ignore @Test public void specificCousin() throws UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("cloud-infrastructure/complexes/complex/key1/related-to/pservers/pserver/key2").build(); @@ -764,7 +753,6 @@ public class GraphTraversalTest { assertEquals("dependent",true, query.isDependent()); } - @Ignore @Test public void doubleSpecificCousin() throws UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("cloud-infrastructure/complexes/complex/key1/related-to/pservers/pserver/key2/related-to/vservers/vserver/key3").build(); @@ -804,7 +792,6 @@ public class GraphTraversalTest { assertEquals("dependent",true, query.isDependent()); } - @Ignore @Test public void traversalEndsInRelatedTo() throws UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("cloud-infrastructure/complexes/complex/key1/related-to").build(); @@ -815,7 +802,6 @@ public class GraphTraversalTest { } - @Ignore @Test public void pluralCousinToPluralCousin() throws UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("cloud-infrastructure/complexes/related-to/pservers").build(); diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java index 2a1f94b4..5c68fc67 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/LegacyQueryTest.java @@ -20,19 +20,10 @@ package org.openecomp.aai.parsers.query; -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; - -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBException; - import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.LoaderFactory; import org.openecomp.aai.introspection.ModelInjestor; @@ -42,10 +33,19 @@ import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import javax.ws.rs.core.UriBuilder; +import javax.xml.bind.JAXBException; +import java.io.UnsupportedEncodingException; +import java.net.URI; + +import static org.junit.Assert.assertEquals; + @Ignore -public class LegacyQueryTest { +public class LegacyQueryTest extends AAISetup { + private ModelInjestor injestor = ModelInjestor.getInstance(); + private TransactionalGraphEngine dbEngine = new TitanDBEngine(QueryStyle.GREMLIN_TRAVERSAL, LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v8), @@ -53,16 +53,7 @@ public class LegacyQueryTest { private final Version version = Version.v8; private DynamicJAXBContext context = injestor.getContextForVersion(version); - - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - + /** * Parent query. * diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipGremlinQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipGremlinQueryTest.java index 3ab45379..0aad09c4 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipGremlinQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipGremlinQueryTest.java @@ -20,38 +20,31 @@ package org.openecomp.aai.parsers.query; -import static org.hamcrest.CoreMatchers.containsString; -import static org.junit.Assert.assertEquals; - -import java.io.StringReader; -import java.io.UnsupportedEncodingException; - -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.stream.StreamSource; - import org.eclipse.persistence.dynamic.DynamicEntity; import org.eclipse.persistence.jaxb.UnmarshallerProperties; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.IntrospectorFactory; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelInjestor; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.junit.Assert.assertEquals; + @Ignore -public class RelationshipGremlinQueryTest { +public class RelationshipGremlinQueryTest extends AAISetup { private ModelInjestor injestor = ModelInjestor.getInstance(); private TransactionalGraphEngine dbEngine = @@ -64,16 +57,6 @@ public class RelationshipGremlinQueryTest { @Rule public ExpectedException thrown = ExpectedException.none(); - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - - /** * Parent query. * diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipQueryTest.java index 25369338..94fe0c59 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/RelationshipQueryTest.java @@ -20,35 +20,29 @@ package org.openecomp.aai.parsers.query; -import static org.junit.Assert.assertEquals; - -import java.io.StringReader; -import java.io.UnsupportedEncodingException; - -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.stream.StreamSource; - import org.eclipse.persistence.dynamic.DynamicEntity; import org.eclipse.persistence.jaxb.UnmarshallerProperties; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.IntrospectorFactory; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelInjestor; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; + +import static org.junit.Assert.assertEquals; + @Ignore -public class RelationshipQueryTest { +public class RelationshipQueryTest extends AAISetup { + private ModelInjestor injestor = ModelInjestor.getInstance(); private TransactionalGraphEngine dbEngine = @@ -57,17 +51,7 @@ public class RelationshipQueryTest { false); private final Version version = Version.v8; private DynamicJAXBContext context = injestor.getContextForVersion(version); - - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - - + /** * Parent query. * diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueRelationshipQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueRelationshipQueryTest.java index 50bbbd0e..870bbd36 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueRelationshipQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueRelationshipQueryTest.java @@ -20,15 +20,6 @@ package org.openecomp.aai.parsers.query; -import static org.junit.Assert.assertEquals; - -import java.io.StringReader; -import java.io.UnsupportedEncodingException; - -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.stream.StreamSource; - import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -36,22 +27,26 @@ import org.eclipse.persistence.dynamic.DynamicEntity; import org.eclipse.persistence.jaxb.UnmarshallerProperties; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; 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.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.IntrospectorFactory; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelInjestor; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; + +import static org.junit.Assert.assertEquals; + @Ignore -public class UniqueRelationshipQueryTest { +public class UniqueRelationshipQueryTest extends AAISetup { + private ModelInjestor injestor = ModelInjestor.getInstance(); private TransactionalGraphEngine dbEngine = new TitanDBEngine(QueryStyle.GREMLIN_UNIQUE, @@ -61,16 +56,6 @@ public class UniqueRelationshipQueryTest { private DynamicJAXBContext context = injestor.getContextForVersion(version); private Unmarshaller unmarshaller = null; - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - } - - /** * Setup. * diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueURIQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueURIQueryTest.java index 9bf4919b..e1be7f25 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueURIQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/query/UniqueURIQueryTest.java @@ -20,21 +20,13 @@ package org.openecomp.aai.parsers.query; -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; - -import javax.ws.rs.core.UriBuilder; - import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.LoaderFactory; import org.openecomp.aai.introspection.ModelInjestor; @@ -44,8 +36,15 @@ import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import javax.ws.rs.core.UriBuilder; +import java.io.UnsupportedEncodingException; +import java.net.URI; + +import static org.junit.Assert.assertEquals; + @Ignore -public class UniqueURIQueryTest { +public class UniqueURIQueryTest extends AAISetup { + private ModelInjestor injestor = ModelInjestor.getInstance(); private TransactionalGraphEngine dbEngine = new TitanDBEngine(QueryStyle.GREMLIN_UNIQUE, @@ -54,16 +53,6 @@ public class UniqueURIQueryTest { private final Version version = Version.v8; private DynamicJAXBContext context = injestor.getContextForVersion(version); - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - } - - /** * Parent query. * diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/relationship/RelationshipToURITest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/relationship/RelationshipToURITest.java index 6fac3427..bc20af11 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/relationship/RelationshipToURITest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/relationship/RelationshipToURITest.java @@ -20,38 +20,28 @@ package org.openecomp.aai.parsers.relationship; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertEquals; - -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - import org.apache.commons.io.IOUtils; -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.parsers.exceptions.AAIIdentityMapParseException; import org.openecomp.aai.parsers.exceptions.AmbiguousMapAAIException; -import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; -@Ignore -public class RelationshipToURITest { +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; + +public class RelationshipToURITest extends AAISetup { - - private final ModelType modelType = ModelType.MOXY; private final Version version10 = Version.v10; private final Version version9 = Version.v9; @@ -59,14 +49,6 @@ public class RelationshipToURITest { @Rule public ExpectedException thrown = ExpectedException.none(); - @BeforeClass - public static void setup() throws NoSuchFieldException, SecurityException, 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/org/openecomp/aai/introspection/"); - - } - @Test public void onlyLink() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); @@ -223,7 +205,7 @@ public class RelationshipToURITest { private String getJsonString(String filename) throws IOException { - FileInputStream is = new FileInputStream("src/test/resources/org/openecomp/aai/parsers/relationship/" + filename); + FileInputStream is = new FileInputStream("src/test/resources/bundleconfig-local/etc/relationship/" + filename); String s = IOUtils.toString(is, "UTF-8"); IOUtils.closeQuietly(is); diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIParserTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIParserTest.java index 1fa3aea2..da863c1e 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIParserTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIParserTest.java @@ -20,44 +20,31 @@ package org.openecomp.aai.parsers.uri; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; - -import java.io.UnsupportedEncodingException; -import java.net.URI; - -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBException; - -import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Loader; import org.openecomp.aai.introspection.LoaderFactory; import org.openecomp.aai.introspection.ModelType; import org.openecomp.aai.introspection.Version; -@Ignore -public class URIParserTest { +import javax.ws.rs.core.UriBuilder; +import javax.xml.bind.JAXBException; +import java.io.UnsupportedEncodingException; +import java.net.URI; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; + +public class URIParserTest extends AAISetup { private Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v8); @Rule public ExpectedException thrown = ExpectedException.none(); - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - /** * Invalid path. * @@ -71,7 +58,7 @@ public class URIParserTest { URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/network/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build(); thrown.expect(AAIException.class); - thrown.expect(hasProperty("code", is("AAI_3001"))); + thrown.expect(hasProperty("code", is("AAI_3000"))); new URIToDBKey(loader, uri); } diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToDBKeyTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToDBKeyTest.java index 5ba47119..9aabdf1a 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToDBKeyTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToDBKeyTest.java @@ -20,34 +20,28 @@ package org.openecomp.aai.parsers.uri; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; - -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBException; - -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.*; import org.powermock.core.classloader.annotations.PrepareForTest; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelInjestor; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import javax.ws.rs.core.UriBuilder; +import javax.xml.bind.JAXBException; +import java.io.UnsupportedEncodingException; +import java.net.URI; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; @Ignore @PrepareForTest(ModelInjestor.class) -public class URIToDBKeyTest { +public class URIToDBKeyTest extends AAISetup { private Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v8); @@ -55,13 +49,45 @@ public class URIToDBKeyTest { public ExpectedException thrown = ExpectedException.none(); /** - * Configure. + * Uri. + * + * @throws JAXBException the JAXB exception + * @throws AAIException the AAI exception + * @throws IllegalArgumentException the illegal argument exception + * @throws UnsupportedEncodingException the unsupported encoding exception + */ + @Test + public void uri() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException { + URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/cloud-infrastructure/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build(); + URIToDBKey parse = new URIToDBKey(loader, uri); + Object result = parse.getResult(); + + String expected = "cloud-region/att-aic/AAIAIC25/tenant/key1/vserver/key2/l-interface/key3"; + + assertEquals("blah", expected, result); + + } + + /** + * Uri no version. + * + * @throws JAXBException the JAXB exception + * @throws AAIException the AAI exception + * @throws IllegalArgumentException the illegal argument exception + * @throws UnsupportedEncodingException the unsupported encoding exception */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); + @Test + public void uriNoVersion() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException { + URI uri = UriBuilder.fromPath("/cloud-infrastructure/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build(); + URIToDBKey parse = new URIToDBKey(loader, uri); + Object result = parse.getResult(); + + String expected = "cloud-region/att-aic/AAIAIC25/tenant/key1/vserver/key2/l-interface/key3"; + + assertEquals("blah", expected, result); + } + /** * Bad URI. @@ -76,7 +102,7 @@ public class URIToDBKeyTest { URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/cloud-infrastructure/tenants/tenant/key1/vservers/vserver/key2/l-interadsfaces/l-interface/key3").build(); thrown.expect(AAIException.class); - thrown.expect(hasProperty("code", is("AAI_3001"))); + thrown.expect(hasProperty("code", is("AAI_3000"))); new URIToDBKey(loader, uri); } @@ -107,6 +133,17 @@ public class URIToDBKeyTest { * @throws IllegalArgumentException the illegal argument exception * @throws UnsupportedEncodingException the unsupported encoding exception */ + @Test + public void startsWithValidNamespace() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException { + URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/cloud-infrastructure/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build(); + + URIToDBKey parse = new URIToDBKey(loader, uri); + Object result = parse.getResult(); + + String expected = "cloud-region/att-aic/AAIAIC25/tenant/key1/vserver/key2/l-interface/key3"; + + assertEquals("blah", expected, result); + } /** * Naming exceptions. diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToExtensionInformationTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToExtensionInformationTest.java new file mode 100644 index 00000000..ee665d31 --- /dev/null +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToExtensionInformationTest.java @@ -0,0 +1,94 @@ +/*- + * ============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.parsers.uri; + +import org.junit.Ignore; +import org.junit.Test; +import org.openecomp.aai.AAISetup; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.Loader; +import org.openecomp.aai.introspection.LoaderFactory; +import org.openecomp.aai.introspection.ModelType; +import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.restcore.HttpMethod; + +import javax.ws.rs.core.UriBuilder; +import javax.xml.bind.JAXBException; +import java.io.UnsupportedEncodingException; +import java.net.URI; + +import static org.junit.Assert.assertEquals; + +@Ignore +public class URIToExtensionInformationTest extends AAISetup { + + private Loader v8Loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v8); + + /** + * Vservers V 7. + * + * @throws JAXBException the JAXB exception + * @throws AAIException the AAI exception + * @throws IllegalArgumentException the illegal argument exception + * @throws UnsupportedEncodingException the unsupported encoding exception + */ + @Test + public void vserversV8() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException { + URI uri = UriBuilder.fromPath("/aai/" + v8Loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/key1/vservers/vserver/key2").build(); + URIToExtensionInformation parse = new URIToExtensionInformation(v8Loader, uri); + + String namespace = "cloudInfrastructure"; + String preMethodName = "DynamicAddCloudInfrastructureCloudRegionsCloudRegionTenantsTenantVserversVserverPreProc"; + String postMethodName = "DynamicAddCloudInfrastructureCloudRegionsCloudRegionTenantsTenantVserversVserverPostProc"; + String topLevel = "CloudRegion"; + testSpec(parse, HttpMethod.PUT, namespace, preMethodName, postMethodName, topLevel); + + } + + /** + * Test spec. + * + * @param info the info + * @param httpMethod the http method + * @param namespace the namespace + * @param preMethodName the pre method name + * @param postMethodName the post method name + * @param topLevel the top level + */ + private void testSpec(URIToExtensionInformation info, HttpMethod httpMethod, String namespace, String preMethodName, String postMethodName, String topLevel) { + + + String namespaceResult = info.getNamespace(); + String methodNameResult = info.getMethodName(httpMethod, true); + + assertEquals("namespace", namespace, namespaceResult); + assertEquals("preprocess method name", preMethodName, methodNameResult); + methodNameResult = info.getMethodName(httpMethod, false); + + assertEquals("postprocess method name", postMethodName, methodNameResult); + + String topLevelResult = info.getTopObject(); + + assertEquals("topLevel", topLevel, topLevelResult); + } + + +} diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToObjectTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToObjectTest.java index 3bbc00fd..7261a2dc 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToObjectTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToObjectTest.java @@ -20,52 +20,37 @@ package org.openecomp.aai.parsers.uri; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.util.HashMap; - -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBException; - -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; +import javax.ws.rs.core.UriBuilder; +import javax.xml.bind.JAXBException; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.util.HashMap; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; + @Ignore -public class URIToObjectTest { +public class URIToObjectTest extends AAISetup { private Version version = Version.v8; private Version currentVersion = AAIProperties.LATEST; private Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, version); + @Rule public ExpectedException thrown = ExpectedException.none(); - - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - - + /** * Uri. * diff --git a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToRelationshipObjectTest.java b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToRelationshipObjectTest.java index ed278243..42c602ba 100644 --- a/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToRelationshipObjectTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/parsers/uri/URIToRelationshipObjectTest.java @@ -20,50 +20,35 @@ package org.openecomp.aai.parsers.uri; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertTrue; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBException; - -import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; + +import javax.ws.rs.core.UriBuilder; +import javax.xml.bind.JAXBException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertTrue; @Ignore -public class URIToRelationshipObjectTest { +public class URIToRelationshipObjectTest extends AAISetup { private Version latest = AAIProperties.LATEST; private Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, latest); @Rule public ExpectedException thrown = ExpectedException.none(); - - /** - * Configure. - */ - @BeforeClass - public static void configure() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - + /** * Uri. * diff --git a/aai-core/src/test/java/org/openecomp/aai/query/builder/SimplePathTest.java b/aai-core/src/test/java/org/openecomp/aai/query/builder/SimplePathTest.java index 072ba694..e57fb0e5 100644 --- a/aai-core/src/test/java/org/openecomp/aai/query/builder/SimplePathTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/query/builder/SimplePathTest.java @@ -17,20 +17,17 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.openecomp.aai.query.builder; - -import static org.junit.Assert.*; -import java.util.List; +package org.openecomp.aai.query.builder; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.junit.Before; import org.junit.Test; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Loader; import org.openecomp.aai.introspection.LoaderFactory; @@ -38,15 +35,17 @@ import org.openecomp.aai.introspection.ModelType; import org.openecomp.aai.introspection.Version; import org.openecomp.aai.serialization.db.EdgeRules; import org.openecomp.aai.serialization.db.EdgeType; -import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; -public class SimplePathTest { +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class SimplePathTest extends AAISetup { + public Loader loader; @Before - public void setup() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); + public void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); } diff --git a/aai-core/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java b/aai-core/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java index 0ea9a11c..f8418bd1 100644 --- a/aai-core/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java @@ -20,40 +20,36 @@ package org.openecomp.aai.query.builder; -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; - import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.mockito.Mock; - +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; import org.openecomp.aai.introspection.Loader; import org.openecomp.aai.introspection.LoaderFactory; import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; -public class TraversalQueryTest { +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.junit.Assert.assertEquals; + +public class TraversalQueryTest extends AAISetup { - public static Loader loader; - @Mock public GraphTraversalSource g; - @BeforeClass - public static void configure() throws NoSuchFieldException, SecurityException, 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/org/openecomp/aai/introspection/"); + private Loader loader; + + @Mock + private GraphTraversalSource g; + + @Before + public void configure() throws Exception { loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); } diff --git a/aai-core/src/test/java/org/openecomp/aai/query/builder/UntilTest.java b/aai-core/src/test/java/org/openecomp/aai/query/builder/UntilTest.java index fa434b44..b6c6025a 100644 --- a/aai-core/src/test/java/org/openecomp/aai/query/builder/UntilTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/query/builder/UntilTest.java @@ -17,12 +17,9 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.openecomp.aai.query.builder; -import static org.junit.Assert.assertTrue; +package org.openecomp.aai.query.builder; -import java.util.ArrayList; -import java.util.List; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; @@ -30,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.junit.Before; import org.junit.Test; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Loader; @@ -38,15 +36,18 @@ import org.openecomp.aai.introspection.ModelType; import org.openecomp.aai.serialization.db.EdgeRules; import org.openecomp.aai.serialization.db.EdgeType; -public class UntilTest { - public Loader loader; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class UntilTest extends AAISetup { + + private Loader loader; @Before - public void setup(){ - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); + public void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); - } private QueryBuilder buildTestQuery(QueryBuilder qb) throws AAIException{ diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbAliasTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbAliasTest.java index cc419c67..d4793939 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbAliasTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbAliasTest.java @@ -20,71 +20,63 @@ package org.openecomp.aai.serialization.db; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import java.io.UnsupportedEncodingException; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Collections; -import java.util.Map; - +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; 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.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.dbmap.DBConnectionType; import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.introspection.*; import org.openecomp.aai.parsers.query.QueryParser; import org.openecomp.aai.schema.enums.PropertyMetadata; import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -import com.thinkaurelius.titan.core.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.InvocationTargetException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Collections; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; -@Ignore -public class DbAliasTest { +public class DbAliasTest extends AAISetup { - - private TitanGraph graph; + private final Version version = Version.v9; private final ModelType introspectorFactoryType = ModelType.MOXY; private final QueryStyle queryStyle = QueryStyle.TRAVERSAL; private final DBConnectionType type = DBConnectionType.REALTIME; private Loader loader; private TransactionalGraphEngine dbEngine; + @Before - public void setup() throws NoSuchFieldException, SecurityException, Exception { + public void setup() throws Exception { graph = TitanFactory.build().set("storage.backend","inmemory").open(); - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, type, loader); } - + @After public void tearDown() { graph.tx().rollback(); graph.close(); } - + @Test public void checkOnWrite() throws AAIException, UnsupportedEncodingException, URISyntaxException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, NoSuchMethodException, InterruptedException { final String property = "persona-model-customization-id"; @@ -109,17 +101,17 @@ public class DbAliasTest { if (map.containsKey(PropertyMetadata.DB_ALIAS)) { dbPropertyName = map.get(PropertyMetadata.DB_ALIAS); } - + assertEquals("dbAlias is ", "model-customization-id", dbPropertyName); assertEquals("dbAlias property exists", "hello", v.property(dbPropertyName).orElse("")); assertEquals("model property does not", "missing", v.property(property).orElse("missing")); - + } - + @Test public void checkOnRead() throws AAIException, UnsupportedEncodingException, URISyntaxException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, NoSuchMethodException, InterruptedException, MalformedURLException { final String property = "persona-model-customization-id"; - + TransactionalGraphEngine spy = spy(dbEngine); TransactionalGraphEngine.Admin adminSpy = spy(dbEngine.asAdmin()); Vertex v = graph.traversal().addV("vnf-id", "key1", "model-customization-id", "hello").next(); @@ -131,9 +123,10 @@ public class DbAliasTest { DBSerializer serializer = new DBSerializer(version, spy, introspectorFactoryType, "AAI_TEST"); Introspector obj = loader.introspectorFromName("generic-vnf"); serializer.dbToObject(Collections.singletonList(v), obj, 0, true, "false"); - + assertEquals("dbAlias property exists", "hello", obj.getValue(property)); - + } - + + } diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbSerializerTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbSerializerTest.java index b100b014..3c3ec789 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbSerializerTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/db/DbSerializerTest.java @@ -20,17 +20,14 @@ package org.openecomp.aai.serialization.db; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - +import com.thinkaurelius.titan.core.TitanFactory; 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.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.dbmap.DBConnectionType; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Loader; @@ -41,10 +38,12 @@ import org.openecomp.aai.serialization.engines.QueryStyle; import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; -import com.thinkaurelius.titan.core.TitanFactory; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + +public class DbSerializerTest extends AAISetup { -@Ignore -public class DbSerializerTest { protected Graph graph; protected final EdgeRules rules = EdgeRules.getInstance(); @@ -58,10 +57,8 @@ public class DbSerializerTest { TransactionalGraphEngine.Admin adminSpy; @Before - public void setup() throws NoSuchFieldException, SecurityException, Exception { + public void setup() throws Exception { graph = TitanFactory.build().set("storage.backend", "inmemory").open(); - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine(queryStyle, type, loader); spy = spy(dbEngine); diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgePropertyMapTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgePropertyMapTest.java new file mode 100644 index 00000000..fb3c0469 --- /dev/null +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgePropertyMapTest.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.serialization.db; + +import org.junit.Test; + +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +public class EdgePropertyMapTest { + + @Test + public void run() { + Map map = new EdgePropertyMap<>(); + map.put("direction", "OUT"); + map.put("test", "hello"); + map.put("isParent", "${direction}"); + map.put("SVC-INFRA", "!${direction}"); + + assertEquals("normal retrieval", "hello", map.get("test")); + assertEquals("variable retrieval", "OUT", map.get("isParent")); + assertEquals("negate variable retrieval", "IN", map.get("SVC-INFRA")); + } +} diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java index faa4d28e..87bb6ca7 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java @@ -20,26 +20,37 @@ package org.openecomp.aai.serialization.db; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.junit.Test; +import org.openecomp.aai.AAISetup; import static org.junit.Assert.assertEquals; import java.util.Map; +import java.util.Set; + +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.T; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.Rule; +import org.junit.rules.ExpectedException; -import org.apache.tinkerpop.gremlin.structure.Direction; -import org.junit.BeforeClass; -import org.junit.Test; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.serialization.db.exceptions.EdgeMultiplicityException; import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; -public class EdgeRulesTest { +import com.google.common.collect.Multimap; + +public class EdgeRulesTest extends AAISetup { + + //set thrown.expect to whatever a specific test needs + //this establishes a default of expecting no exceptions to be thrown + @Rule + public ExpectedException thrown = ExpectedException.none(); - @BeforeClass - public static void setup() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - - @Test public void verifyOutDirection() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); @@ -93,4 +104,134 @@ public class EdgeRulesTest { assertEquals(false, EdgeRules.getInstance(Version.v8).hasEdgeRule("model-element", "model-ver")); } + @Test + public void hasEdgeRuleVertexTest() { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex("aai-node-type", "cloud-region"); + Vertex v2 = graph.addVertex("aai-node-type", "tenant"); + assertEquals(true, EdgeRules.getInstance().hasEdgeRule(v1, v2)); + } + + @Test + public void getEdgeRuleByTypeAndVertices() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex("aai-node-type", "cloud-region"); + Vertex v2 = graph.addVertex("aai-node-type", "tenant"); + EdgeRules rules = EdgeRules.getInstance(); + EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, v1, v2); + assertEquals(true, "OUT".equalsIgnoreCase(rule.getContains())); + assertEquals(true, "NONE".equalsIgnoreCase(rule.getDeleteOtherV())); + assertEquals(true, MultiplicityRule.ONE2MANY.equals(rule.getMultiplicityRule())); + assertEquals(true, "IN".equalsIgnoreCase(rule.getServiceInfrastructure())); + assertEquals(true, "OUT".equalsIgnoreCase(rule.getPreventDelete())); + } + + @Test + public void addTreeEdgeTest() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "cloud-region"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "tenant"); + EdgeRules rules = EdgeRules.getInstance(); + GraphTraversalSource g = graph.traversal(); + rules.addTreeEdge(g, v1, v2); + assertEquals(true, g.V(v1).out("has").has("aai-node-type", "tenant").hasNext()); + + Vertex v3 = graph.addVertex(T.id, "2", "aai-node-type", "cloud-region"); + assertEquals(null, rules.addTreeEdgeIfPossible(g, v3, v2)); + } + + @Test + public void addCousinEdgeTest() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "flavor"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "vserver"); + EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); + GraphTraversalSource g = graph.traversal(); + rules.addEdge(g, v1, v2); + assertEquals(true, g.V(v2).out("hasFlavor").has("aai-node-type", "flavor").hasNext()); + + Vertex v3 = graph.addVertex(T.id, "2", "aai-node-type", "flavor"); + assertEquals(null, rules.addEdgeIfPossible(g, v3, v2)); + } + + @Test + public void multiplicityViolationTest() throws AAIException { + thrown.expect(EdgeMultiplicityException.class); + thrown.expectMessage("multiplicity rule violated: only one edge can exist with label: uses between vf-module and volume-group"); + + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "vf-module"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "volume-group"); + EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); + GraphTraversalSource g = graph.traversal(); + + rules.addEdge(g, v2, v1); + Vertex v3 = graph.addVertex(T.id, "3", "aai-node-type", "vf-module"); + rules.addEdge(g, v2, v3); + } + + @Test + public void getChildrenTest() { + EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); + Set children = rules.getChildren("foo"); + assertEquals(2, children.size()); + boolean sawBazRule = false; + boolean sawQuuxRule = false; + for (EdgeRule r : children) { + if ("isVeryHappyAbout".equals(r.getLabel())) { + sawBazRule = true; + } else if ("dancesWith".equals(r.getLabel())) { + sawQuuxRule = true; + } + } + assertEquals(true, sawBazRule && sawQuuxRule); + } + + @Test + public void getAllRulesTest() { + EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); + Multimap allRules = rules.getAllRules(); + assertEquals(3, allRules.size()); + assertEquals(true, allRules.containsKey("foo|bar")); + assertEquals(true, allRules.containsKey("foo|bar")); + assertEquals(true, allRules.containsKey("quux|foo")); + } + + @Test + public void getAllRulesMissingPropertyTest() { + EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test_broken.json"); + + thrown.expect(RuntimeException.class); + thrown.expectMessage("org.openecomp.aai.exceptions.AAIException: Rule between foo and bar is missing property delete-other-v."); + rules.getAllRules(); + } + + @Test + public void getChildrenMissingPropertyTest() { + EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test_broken.json"); + + thrown.expect(RuntimeException.class); + thrown.expectMessage("org.openecomp.aai.exceptions.AAIException: Rule between quux and foo is missing property SVC-INFRA."); + rules.getChildren("foo"); + } + + @Test + public void getEdgeRuleMissingPropertyTest() throws AAIException { + EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test_broken.json"); + + thrown.expect(RuntimeException.class); + thrown.expectMessage("org.openecomp.aai.exceptions.AAIException: Rule between quux and foo is missing property SVC-INFRA."); + rules.getEdgeRules("foo", "quux"); + } + + @Test + public void verifyAllRules() { + // This will cause every rule in the real json files to be verified + // so if any required properties are missing, the verification builds + // will catch it and incorrect rules can't get merged in. + for (Version v : Version.values()) { + EdgeRules rules = EdgeRules.getInstance(v); + rules.getAllRules(); + } + } } diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java index 8b6d4913..f9a511a2 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/QueryFormatTestHelper.java @@ -20,24 +20,23 @@ package org.openecomp.aai.serialization.queryformats; -import static org.mockito.Matchers.isA; -import static org.mockito.Mockito.when; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.io.IoCore; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; - import org.openecomp.aai.db.props.AAIProperties; import org.openecomp.aai.serialization.queryformats.exceptions.AAIFormatVertexException; import org.openecomp.aai.serialization.queryformats.utils.UrlBuilder; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import static org.mockito.Matchers.isA; +import static org.mockito.Mockito.when; + public class QueryFormatTestHelper { diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/SimpleFormatTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/SimpleFormatTest.java index 51ccd363..766274cd 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/SimpleFormatTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/SimpleFormatTest.java @@ -20,19 +20,7 @@ package org.openecomp.aai.serialization.queryformats; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyBoolean; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import java.io.UnsupportedEncodingException; - +import com.google.gson.JsonObject; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy; import org.apache.tinkerpop.gremlin.structure.Graph; @@ -57,9 +45,15 @@ import org.openecomp.aai.serialization.engines.TitanDBEngine; import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; import org.openecomp.aai.serialization.queryformats.exceptions.AAIFormatVertexException; import org.openecomp.aai.serialization.queryformats.utils.UrlBuilder; -import org.openecomp.aai.util.AAIConstants; -import com.google.gson.JsonObject; +import java.io.UnsupportedEncodingException; + +import static org.junit.Assert.*; +import static org.mockito.Matchers.anyBoolean; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.*; public class SimpleFormatTest { @@ -72,9 +66,6 @@ public class SimpleFormatTest { private DBSerializer serializer; private RawFormat simpleFormat; private Vertex vfModule; - - - private final ModelType factoryType = ModelType.MOXY; @Before @@ -82,11 +73,6 @@ public class SimpleFormatTest { MockitoAnnotations.initMocks(this); - System.setProperty("AJSC_HOME", "src/test/resources"); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); - QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), - "src/test/resources/org/openecomp/aai/introspection/"); - graph = TinkerGraph.open(); vfModule = graph.addVertex( diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/QueryParamInjectorTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/QueryParamInjectorTest.java index d5a09ece..3eade856 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/QueryParamInjectorTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/QueryParamInjectorTest.java @@ -20,11 +20,6 @@ package org.openecomp.aai.serialization.queryformats.utils; -import static org.junit.Assert.assertEquals; - -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; - import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -34,6 +29,11 @@ import org.openecomp.aai.serialization.db.DBSerializer; import org.openecomp.aai.serialization.queryformats.Resource; import org.openecomp.aai.serialization.queryformats.Resource.Builder; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.MultivaluedMap; + +import static org.junit.Assert.assertEquals; + public class QueryParamInjectorTest { diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/UrlBuilderTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/UrlBuilderTest.java index dd22c0b5..605bbcd9 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/UrlBuilderTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/queryformats/utils/UrlBuilderTest.java @@ -19,40 +19,37 @@ */ package org.openecomp.aai.serialization.queryformats.utils; -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import org.openecomp.aai.AAISetup; import org.openecomp.aai.introspection.Version; import org.openecomp.aai.serialization.db.DBSerializer; import org.openecomp.aai.serialization.queryformats.exceptions.AAIFormatVertexException; import org.openecomp.aai.util.AAIConstants; -public class UrlBuilderTest { +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.when; + +public class UrlBuilderTest extends AAISetup { + + @Mock + private DBSerializer serializer; + @Mock + private Vertex v; - @Mock private DBSerializer serializer; - @Mock private Vertex v; private static final String uri = "/test/uri"; private static final Object vId = new Long(123); private static final String protocolAndHost = "http://localhost/aai/"; - @BeforeClass - public static void setUp() { - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); - } - @Before public void before() throws UnsupportedEncodingException, URISyntaxException { MockitoAnnotations.initMocks(this); @@ -60,7 +57,6 @@ public class UrlBuilderTest { when(v.id()).thenReturn(vId); } - @Ignore @Test public void v11Pathed() throws UnsupportedEncodingException, URISyntaxException, AAIFormatVertexException { Version version = Version.v11; @@ -71,7 +67,6 @@ public class UrlBuilderTest { } - @Ignore @Test public void v11Id() throws UnsupportedEncodingException, URISyntaxException, AAIFormatVertexException { Version version = Version.v11; diff --git a/aai-core/src/test/java/org/openecomp/aai/serialization/tinkerpop/TreeBackedVertexTest.java b/aai-core/src/test/java/org/openecomp/aai/serialization/tinkerpop/TreeBackedVertexTest.java index 7a0a1693..c4440527 100644 --- a/aai-core/src/test/java/org/openecomp/aai/serialization/tinkerpop/TreeBackedVertexTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/serialization/tinkerpop/TreeBackedVertexTest.java @@ -20,33 +20,29 @@ package org.openecomp.aai.serialization.tinkerpop; -import static org.junit.Assert.assertEquals; - import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; -import org.apache.tinkerpop.gremlin.structure.Direction; -import org.apache.tinkerpop.gremlin.structure.Element; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.T; -import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.*; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.openecomp.aai.serialization.db.EdgeProperty; import org.openecomp.aai.serialization.engines.query.GraphTraversalQueryEngine; +import static org.junit.Assert.assertEquals; + @Ignore public class TreeBackedVertexTest { - - private static Graph graph = TinkerGraph.open(); - private static Object startKey = null; - private static Tree tree = null; - private static Tree treeDepth1 = null; - private static Tree treeDepth0NodeOnly = null; - @BeforeClass - public static void configure() { + private Graph graph = TinkerGraph.open(); + private Object startKey = null; + private Tree tree = null; + private Tree treeDepth1 = null; + private Tree treeDepth0NodeOnly = null; + + @Before + public void configure() { GraphTraversalSource g = graph.traversal(); startKey = g.addV(T.label, "vserver").as("v1").property("test", "hello") diff --git a/aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java b/aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java index 6b2536c9..f5b67233 100644 --- a/aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/util/CNNameTest.java @@ -21,11 +21,11 @@ package org.openecomp.aai.util; import ch.qos.logback.access.spi.IAccessEvent; -import org.openecomp.aai.logging.CNName; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.mockito.Mockito; +import org.openecomp.aai.logging.CNName; +import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.agent.PowerMockAgent; @@ -55,9 +55,10 @@ public class CNNameTest { * Initialize. */ @Before - public void initialize(){ + public void initialize() 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/"); mockAccEvent = Mockito.mock(IAccessEvent.class); mockHttpServletRequest = Mockito.mock(HttpServletRequest.class); cert = Mockito.mock(X509Certificate.class); diff --git a/aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java b/aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java index 090f9101..31a7b5e4 100644 --- a/aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/util/CustomLogPatternLayoutTest.java @@ -20,16 +20,13 @@ package org.openecomp.aai.util; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Ignore; import org.junit.Test; - import org.openecomp.aai.logging.CNName; import org.openecomp.aai.logging.CustomLogPatternLayout; -@Ignore +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + public class CustomLogPatternLayoutTest { /** diff --git a/aai-core/src/test/java/org/openecomp/aai/workarounds/RemoveDME2QueryParamsTest.java b/aai-core/src/test/java/org/openecomp/aai/workarounds/RemoveDME2QueryParamsTest.java index 61ba275d..51636271 100644 --- a/aai-core/src/test/java/org/openecomp/aai/workarounds/RemoveDME2QueryParamsTest.java +++ b/aai-core/src/test/java/org/openecomp/aai/workarounds/RemoveDME2QueryParamsTest.java @@ -20,13 +20,13 @@ package org.openecomp.aai.workarounds; -import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Test; import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.MultivaluedMap; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class RemoveDME2QueryParamsTest { diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml index 568b2ad3..2d09ff0f 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml @@ -8,7 +8,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +19,7 @@ ============LICENSE_END========================================================= --> - + @@ -25,381 +27,290 @@ - - - - - - - - + + + + + + + + + + - - - - + + + + + - + + - + + - - - - - - - - - - - - + + + + + - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - + + + - - - - - + + - - - - - - - - - - - - - - - + + + + - + + - - + - - + + + - - + + + - - + + + - - - - - - - - - - - - + + + + + - - - - - - + + + - - - - - - - - - - + + + - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - + + + + + + - + - + + - - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + - + @@ -412,61 +323,54 @@ - + + - - - - - - - - - + @@ -476,173 +380,123 @@ + - + + - - - - + + + - - + - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -653,46 +507,43 @@ + - + + - - - - - - + @@ -701,41 +552,40 @@ + - + + - - - - - + + @@ -746,71 +596,65 @@ + - + + - - - - - - + - - + - - - - - + + + @@ -821,98 +665,88 @@ + - + + - - - - - - - - - + - - + - + - - + - - + - - - - - - - - + + + + + + + @@ -921,13 +755,14 @@ + - + @@ -936,88 +771,74 @@ - - - - - - - - - - - - - - - + @@ -1026,58 +847,51 @@ + - - - - - - - - - + @@ -1085,86 +899,76 @@ + - + + - - - - - - - - - + - - - - + - + - - - - - + + + + @@ -1174,58 +978,51 @@ + - - - - - - - - - + @@ -1233,37 +1030,36 @@ + - + + - - - - + @@ -1272,85 +1068,76 @@ + - + + - - - - - - - - - - - - + @@ -1360,85 +1147,76 @@ + - - + + + - - - - - - - - - - - - + @@ -1447,51 +1225,48 @@ - + + - + + - - - + - - - + - - - + + @@ -1500,81 +1275,73 @@ - + + - + + - - - - - - - - - - - - + + @@ -1584,32 +1351,25 @@ + - + + - - - - - - - - - - + + - @@ -1620,37 +1380,36 @@ + - + + - - - - + @@ -1659,37 +1418,36 @@ + - + + - - - - + @@ -1698,271 +1456,152 @@ + - + + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1973,81 +1612,73 @@ + - + + - - - - - - - - - - + - - - + + @@ -2057,75 +1688,68 @@ + - + + - - - + - - - - - - - + - - - + + @@ -2134,55 +1758,51 @@ + - + + - - - - - - - + @@ -2192,43 +1812,41 @@ + - + + - - - - - + @@ -2237,37 +1855,36 @@ + - + + - - - - + @@ -2277,38 +1894,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + + - - @@ -2316,7 +1979,6 @@ - @@ -2324,7 +1986,6 @@ - @@ -2332,23 +1993,20 @@ - - - - - + + @@ -2357,48 +2015,46 @@ + - + + - - - - - - + + @@ -2410,38 +2066,38 @@ + - + + - - - - - - + + + + - - - + + + @@ -2451,28 +2107,28 @@ + - + + - - @@ -2480,7 +2136,6 @@ - @@ -2488,7 +2143,6 @@ - @@ -2496,90 +2150,76 @@ - - - - - - - - - - - - - - - - - + + + @@ -2591,120 +2231,114 @@ + - - - - - + + + + + + - + + - + - - - - - - - + - - + + + - + + - - - - - - + @@ -2713,37 +2347,36 @@ + - + + - - - - + @@ -2752,84 +2385,82 @@ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + + - - - - - - + - - @@ -2837,7 +2468,6 @@ - @@ -2845,7 +2475,6 @@ - @@ -2853,64 +2482,54 @@ - - - - - - - - - + - - - + @@ -2921,32 +2540,32 @@ + - + + - - - - + + @@ -2956,38 +2575,37 @@ + - + + - - - - - + + @@ -2996,62 +2614,57 @@ + - + + - - - - - - - + - + - - - + + @@ -3060,43 +2673,41 @@ + - + + - - - - - + @@ -3104,53 +2715,60 @@ + - + + - - + + + + + - - - + + + + + - - - + + + @@ -3159,63 +2777,90 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - + - - - - - - - - + + + @@ -3224,43 +2869,41 @@ + - + + - - - - - + @@ -3269,136 +2912,119 @@ + - + + - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -3411,83 +3037,74 @@ + - + + - - - - - - - - - - - - - + + @@ -3497,28 +3114,28 @@ + - + + - - - + @@ -3526,81 +3143,75 @@ + + + - + + - - - - - - - + - - + - - - - + @@ -3609,98 +3220,86 @@ + - + + - - - - - - - + - - - - - - - - @@ -3708,7 +3307,6 @@ - @@ -3716,7 +3314,6 @@ - @@ -3724,70 +3321,60 @@ - - - - - - + - - + - - + - - - - - - - + + + + @@ -3806,7 +3393,7 @@ - + @@ -3815,28 +3402,24 @@ - - - - - + @@ -3850,25 +3433,24 @@ - + + - - - + @@ -3876,89 +3458,79 @@ + - + + - - - - - - - - - + - - - - - + @@ -3968,221 +3540,188 @@ + - + + - - - - - - - - - - - - - - - - - + - - - - - - + - - + - - + - - + - - + - - + - + - - + - - - - - - - - @@ -4190,7 +3729,6 @@ - @@ -4198,7 +3736,6 @@ - @@ -4206,75 +3743,64 @@ - - - - - - - - - + - - + - - + - - - - - - - - + + + + + + + @@ -4285,57 +3811,51 @@ - - + - + + - - - - - + - - @@ -4343,7 +3863,6 @@ - @@ -4351,7 +3870,6 @@ - @@ -4359,46 +3877,39 @@ - - - - - - - - + @@ -4408,31 +3919,32 @@ + + - + + - - - + @@ -4441,104 +3953,92 @@ + - + + - - - - - - - - - - - - - - - - + + @@ -4550,160 +4050,140 @@ + - + + - - - - - - - - - + - - - + - - - - - - - - - - - - - - - + + + - + @@ -4711,70 +4191,64 @@ + - + + - - - - - - - - + - - + @@ -4785,40 +4259,38 @@ + - + + - - + - - + - - - + @@ -4827,149 +4299,129 @@ + - + + - - - - - + - - - - - - - - - - - - - - - + - - - - - - + + @@ -4979,93 +4431,39 @@ + + - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -5076,41 +4474,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -5121,57 +4491,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + + @@ -5186,31 +4526,31 @@ - - - - - + + + + - + + @@ -5224,44 +4564,41 @@ - - - - - - - - + + + + - + + @@ -5276,51 +4613,46 @@ - - - - - - - + - - + - + - + + - + + @@ -5335,29 +4667,25 @@ - - - - - - - + + - + - + + @@ -5372,34 +4700,23 @@ - - - - - - - - - - - - - - - - - - + + + + + + - + + @@ -5414,34 +4731,23 @@ - - - - - - - - - - - - - - - - - - + + + + + + - + + @@ -5453,47 +4759,26 @@ - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - + + + + + - + + @@ -5508,41 +4793,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + + @@ -5557,48 +4827,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - + + @@ -5613,62 +4860,40 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - + + + + + + - - + + + @@ -5678,64 +4903,58 @@ - - - - - - - - - - + + + - + + @@ -5746,15 +4965,17 @@ + - + + @@ -5764,33 +4985,28 @@ + - - - - - - - - - - + + + - + + @@ -5798,9 +5014,10 @@ - + + @@ -5808,68 +5025,62 @@ - - - - - + - - + + + - + + - - - - - + + - + + - - - - + + @@ -5879,50 +5090,48 @@ + - + + - - - - + - - - + + @@ -5932,31 +5141,32 @@ + + - + + - - - + @@ -5965,34 +5175,33 @@ + - + + - - - @@ -6000,7 +5209,6 @@ - @@ -6008,7 +5216,6 @@ - @@ -6016,42 +5223,37 @@ - - - - - - - - + + + @@ -6061,57 +5263,54 @@ - + + - + + - - - - - - - + + @@ -6121,37 +5320,36 @@ + - + + - - - - + @@ -6160,37 +5358,37 @@ + + - + + - - - - + @@ -6199,13 +5397,13 @@ + - + - @@ -6217,55 +5415,51 @@ + - + + - - - - - - - + @@ -6276,42 +5470,368 @@ - + - + - + - + + + + - - + + - + - - + - + - - + - + - - + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml index 1c49cf18..3822a54b 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml @@ -30,6 +30,7 @@ + @@ -254,7 +255,7 @@ - + @@ -309,7 +310,7 @@ - + @@ -359,7 +360,7 @@ - + @@ -717,19 +718,32 @@ - + - + + + + + + + + + + + + + + @@ -935,7 +949,7 @@ - + @@ -946,6 +960,12 @@ + + + + + + @@ -1127,7 +1147,7 @@ - + @@ -1135,9 +1155,9 @@ - + - + @@ -1205,9 +1225,9 @@ - + - + @@ -1217,7 +1237,7 @@ - + @@ -1230,7 +1250,7 @@ - + @@ -1240,12 +1260,12 @@ - + - + @@ -1255,7 +1275,7 @@ - + @@ -1651,6 +1671,12 @@ + + + + + + @@ -1685,7 +1711,7 @@ - + @@ -1716,13 +1742,19 @@ + + + + + + - - + + @@ -1863,6 +1895,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1897,14 +1974,25 @@ - + + + + + + + + + + + + @@ -1922,7 +2010,7 @@ - + @@ -2043,14 +2131,25 @@ - + + + + + + + + + + + + @@ -2124,7 +2223,7 @@ - + @@ -2160,7 +2259,7 @@ - + @@ -2194,8 +2293,8 @@ - - + + @@ -2308,6 +2407,11 @@ + + + + @@ -2346,7 +2450,7 @@ - + @@ -2359,14 +2463,25 @@ - + + + + + + + + + + + + @@ -2418,7 +2533,7 @@ - + @@ -2542,7 +2657,7 @@ - + @@ -2651,6 +2766,8 @@ + + @@ -2667,7 +2784,41 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3151,14 +3302,25 @@ - + + + + + + + + + + + + @@ -3221,7 +3383,7 @@ - + @@ -3562,14 +3724,25 @@ - + + + + + + + + + + + + @@ -3606,22 +3779,22 @@ - + - + - + - + @@ -3632,7 +3805,7 @@ - + @@ -3685,14 +3858,25 @@ - + + + + + + + + + + + + @@ -3729,7 +3913,7 @@ - + @@ -4058,7 +4242,7 @@ - + @@ -4168,7 +4352,7 @@ - + @@ -4198,7 +4382,7 @@ - + @@ -4366,7 +4550,7 @@ - + @@ -4781,7 +4965,7 @@ - + @@ -4791,7 +4975,7 @@ - + @@ -4865,7 +5049,7 @@ - + @@ -4875,7 +5059,7 @@ - + @@ -4896,7 +5080,7 @@ - + @@ -4906,7 +5090,7 @@ - + @@ -4916,7 +5100,7 @@ - + @@ -4947,7 +5131,7 @@ - + @@ -4957,7 +5141,7 @@ - + @@ -4968,7 +5152,7 @@ - + @@ -4991,7 +5175,7 @@ - + @@ -5001,7 +5185,7 @@ - + @@ -5020,14 +5204,25 @@ - + + + + + + + + + + + + @@ -5058,18 +5253,18 @@ - + - + - - + + @@ -5079,7 +5274,7 @@ - + @@ -5115,7 +5310,7 @@ - + @@ -5125,7 +5320,7 @@ - + @@ -5135,7 +5330,7 @@ - + @@ -5159,12 +5354,12 @@ - + - - + + @@ -5174,7 +5369,7 @@ - + @@ -5198,11 +5393,11 @@ - + - + @@ -5220,7 +5415,7 @@ - + @@ -5275,6 +5470,369 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml new file mode 100644 index 00000000..c3b30b45 --- /dev/null +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml @@ -0,0 +1,1726 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml index d8f81533..b5a64c87 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml @@ -19,312 +19,51 @@ ============LICENSE_END========================================================= --> - + - + - - + + - - - - - - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - + - - - - + + + + + - - + @@ -333,16 +72,16 @@ - + - + - - + + @@ -367,7 +106,7 @@ - + @@ -377,2700 +116,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml index 22c0d4ae..f53bd860 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml @@ -8,7 +8,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +19,7 @@ ============LICENSE_END========================================================= --> - + @@ -25,14 +27,15 @@ - - - - - - - - + + + + + + + + + @@ -42,24 +45,24 @@ - - - - + + + + - + - + @@ -68,8 +71,8 @@ - - + + @@ -87,9 +90,9 @@ - - - + + + @@ -120,7 +123,7 @@ - + @@ -143,16 +146,16 @@ - - + + - - + + @@ -162,8 +165,8 @@ - - + + @@ -174,9 +177,9 @@ - + - + @@ -184,7 +187,7 @@ - + @@ -210,7 +213,7 @@ - + @@ -229,18 +232,18 @@ - - - - - + + + + + - + @@ -252,7 +255,7 @@ - + @@ -295,19 +298,19 @@ - - - - - - - - - - + + + + + + + + + + - + @@ -320,7 +323,7 @@ - + @@ -369,7 +372,7 @@ - + @@ -383,7 +386,7 @@ - + @@ -400,8 +403,8 @@ - - + + @@ -443,7 +446,7 @@ - + @@ -494,8 +497,8 @@ - - + + @@ -510,7 +513,7 @@ - + @@ -542,7 +545,7 @@ - + @@ -558,7 +561,7 @@ - + @@ -583,8 +586,8 @@ - - + + @@ -602,7 +605,7 @@ - + @@ -651,9 +654,9 @@ - - - + + + @@ -671,7 +674,7 @@ - + @@ -728,11 +731,11 @@ - - - - - + + + + + @@ -748,7 +751,7 @@ - + @@ -824,7 +827,7 @@ - + @@ -877,7 +880,7 @@ - + @@ -889,7 +892,7 @@ - + @@ -947,9 +950,9 @@ - - - + + + @@ -1003,7 +1006,7 @@ - + @@ -1018,7 +1021,7 @@ - + @@ -1040,7 +1043,7 @@ - + @@ -1056,7 +1059,7 @@ - + @@ -1118,7 +1121,7 @@ - + @@ -1135,7 +1138,7 @@ - + @@ -1197,7 +1200,7 @@ - + @@ -1215,7 +1218,7 @@ - + @@ -1247,7 +1250,7 @@ - + @@ -1264,7 +1267,7 @@ - + @@ -1321,8 +1324,8 @@ - - + + @@ -1339,7 +1342,7 @@ - + @@ -1368,7 +1371,7 @@ - + @@ -1390,7 +1393,7 @@ - + @@ -1406,7 +1409,7 @@ - + @@ -1428,7 +1431,7 @@ - + @@ -1444,7 +1447,7 @@ - + @@ -1580,9 +1583,9 @@ - - - + + + @@ -1600,7 +1603,7 @@ - + @@ -1652,8 +1655,8 @@ - - + + @@ -1670,7 +1673,7 @@ - + @@ -1717,8 +1720,8 @@ - - + + @@ -1734,7 +1737,7 @@ - + @@ -1771,7 +1774,7 @@ - + @@ -1788,7 +1791,7 @@ - + @@ -1808,6 +1811,7 @@ + @@ -1815,7 +1819,7 @@ - + @@ -1831,7 +1835,7 @@ - + @@ -1853,7 +1857,7 @@ - + @@ -1864,8 +1868,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1873,8 +1919,8 @@ - - + + @@ -1884,7 +1930,7 @@ - + @@ -1932,8 +1978,8 @@ - - + + @@ -1949,7 +1995,7 @@ - + @@ -1980,8 +2026,8 @@ - - + + @@ -2000,7 +2046,7 @@ - + @@ -2022,9 +2068,9 @@ - + - + @@ -2041,7 +2087,7 @@ - + @@ -2119,11 +2165,6 @@ - - - - - @@ -2144,9 +2185,9 @@ - - - + + + @@ -2165,11 +2206,11 @@ - - - - - + + + + + @@ -2179,14 +2220,14 @@ - + - + @@ -2216,12 +2257,12 @@ - + - - + + @@ -2233,7 +2274,7 @@ - + @@ -2265,7 +2306,7 @@ - + @@ -2281,7 +2322,7 @@ - + @@ -2303,7 +2344,7 @@ - + @@ -2319,24 +2360,25 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -2346,7 +2388,7 @@ - + @@ -2375,7 +2417,7 @@ - + @@ -2454,7 +2496,7 @@ - + @@ -2472,7 +2514,7 @@ - + @@ -2489,8 +2531,8 @@ - - + + @@ -2507,7 +2549,7 @@ - + @@ -2529,8 +2571,8 @@ - - + + @@ -2546,7 +2588,7 @@ - + @@ -2580,7 +2622,7 @@ - + @@ -2588,8 +2630,8 @@ - - + + @@ -2605,7 +2647,7 @@ - + @@ -2632,7 +2674,7 @@ - + @@ -2644,7 +2686,7 @@ - + @@ -2694,7 +2736,7 @@ - + @@ -2717,7 +2759,7 @@ - + @@ -2750,9 +2792,9 @@ - - - + + + @@ -2768,7 +2810,7 @@ - + @@ -2795,7 +2837,7 @@ - + @@ -2811,7 +2853,7 @@ - + @@ -2856,6 +2898,7 @@ + @@ -2913,10 +2956,10 @@ - - - - + + + + @@ -2933,7 +2976,7 @@ - + @@ -2995,8 +3038,8 @@ - - + + @@ -3010,7 +3053,7 @@ - + @@ -3027,7 +3070,7 @@ - + @@ -3044,7 +3087,7 @@ - + @@ -3103,7 +3146,7 @@ - + @@ -3116,7 +3159,7 @@ - + @@ -3259,10 +3302,10 @@ - - - - + + + + @@ -3281,7 +3324,7 @@ - + @@ -3307,7 +3350,7 @@ - + @@ -3321,7 +3364,7 @@ - + @@ -3338,7 +3381,7 @@ - + @@ -3350,7 +3393,7 @@ - + @@ -3418,7 +3461,7 @@ - + @@ -3435,7 +3478,7 @@ - + @@ -3483,6 +3526,7 @@ + @@ -3512,7 +3556,7 @@ - + @@ -3537,32 +3581,32 @@ - + - + - + - + - + - + @@ -3644,12 +3688,12 @@ - - - - - - + + + + + + @@ -3669,7 +3713,7 @@ - + @@ -3759,7 +3803,7 @@ - + @@ -3777,7 +3821,7 @@ - + @@ -3794,7 +3838,7 @@ - + @@ -3810,7 +3854,7 @@ - + @@ -3845,6 +3889,7 @@ + @@ -3887,8 +3932,8 @@ - - + + @@ -3907,7 +3952,7 @@ - + @@ -3954,7 +3999,7 @@ - + @@ -4028,12 +4073,12 @@ - - - + + + - + @@ -4048,7 +4093,7 @@ - + @@ -4098,7 +4143,7 @@ - + @@ -4113,7 +4158,7 @@ - + @@ -4140,7 +4185,7 @@ - + @@ -4153,7 +4198,7 @@ - + @@ -4177,7 +4222,7 @@ - + @@ -4202,7 +4247,7 @@ - + @@ -4232,7 +4277,7 @@ - + @@ -4247,7 +4292,7 @@ - + @@ -4270,8 +4315,8 @@ - - + + @@ -4287,7 +4332,7 @@ - + @@ -4312,8 +4357,8 @@ - - + + @@ -4358,7 +4403,7 @@ - + @@ -4388,8 +4433,8 @@ - - + + @@ -4397,7 +4442,7 @@ - + @@ -4436,16 +4481,16 @@ - - - + + + - + @@ -4482,24 +4527,24 @@ - + - + - + - + @@ -4520,7 +4565,7 @@ - + @@ -4532,7 +4577,7 @@ - + @@ -4555,15 +4600,15 @@ - - + + - + @@ -4586,15 +4631,15 @@ - - + + - + @@ -4617,15 +4662,15 @@ - - + + - + @@ -4649,17 +4694,17 @@ - - - - + + + + - + @@ -4685,14 +4730,14 @@ - + - + @@ -4725,9 +4770,9 @@ - - - + + + @@ -4739,8 +4784,8 @@ - - + + @@ -4790,8 +4835,8 @@ - - + + @@ -4801,7 +4846,7 @@ - + @@ -4822,7 +4867,7 @@ - + @@ -4853,7 +4898,7 @@ - + @@ -4864,7 +4909,7 @@ - + @@ -4877,8 +4922,8 @@ - - + + @@ -4888,7 +4933,7 @@ - + @@ -4906,7 +4951,7 @@ - + @@ -4928,7 +4973,7 @@ - + @@ -4947,7 +4992,7 @@ - + @@ -4979,7 +5024,7 @@ - + @@ -4999,7 +5044,7 @@ - + @@ -5016,7 +5061,7 @@ - + @@ -5032,7 +5077,7 @@ - + @@ -5086,8 +5131,8 @@ - - + + @@ -5107,7 +5152,7 @@ - + @@ -5144,7 +5189,7 @@ - + @@ -5163,7 +5208,7 @@ - + @@ -5185,7 +5230,7 @@ - + @@ -5202,7 +5247,7 @@ - + @@ -5224,7 +5269,7 @@ - + @@ -5258,7 +5303,7 @@ - + @@ -5295,7 +5340,7 @@ - + @@ -5306,6 +5351,249 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/org/openecomp/aai/introspection/sideeffect/nested-case.json b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/sideeffect/nested-case.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/introspection/sideeffect/nested-case.json rename to aai-core/src/test/resources/bundleconfig-local/etc/oxm/sideeffect/nested-case.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/resource.graphson b/aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/graphson/resource.graphson similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/graphson/resource.graphson rename to aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/graphson/resource.graphson diff --git a/aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/resource-format.json b/aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/resource-format.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/resource-format.json rename to aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/resource-format.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/resource_and_url-format.json b/aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/resource_and_url-format.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/resource_and_url-format.json rename to aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/resource_and_url-format.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/simple-format.json b/aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/simple-format.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/serialization/queryformats/simple-format.json rename to aai-core/src/test/resources/bundleconfig-local/etc/queryformarts/simple-format.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/ambiguous-relationship.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/ambiguous-relationship.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/both-failv10-successv9.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/both-failv10-successv9.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/both-successv10-failv9.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/both-successv10-failv9.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/only-related-link.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/only-related-link.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/only-relationship-data.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/only-relationship-data.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/too-many-items-relationship.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/too-many-items-relationship.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/too-many-items-relationship.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/too-many-items-relationship.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/top-level-two-keys-relationship.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/top-level-two-keys-relationship.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/top-level-two-keys-relationship.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/top-level-two-keys-relationship.json diff --git a/aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/two-top-level-relationship.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/two-top-level-relationship.json similarity index 100% rename from aai-core/src/test/resources/org/openecomp/aai/parsers/relationship/two-top-level-relationship.json rename to aai-core/src/test/resources/bundleconfig-local/etc/relationship/two-top-level-relationship.json diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json new file mode 100644 index 00000000..0031d1f0 --- /dev/null +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json @@ -0,0 +1,37 @@ +{ + "rules": [ + { + "from": "foo", + "to": "bar", + "label": "eats", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE" + }, + { + "from": "foo", + "to": "baz", + "label": "isVeryHappyAbout", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "${direction}", + "delete-other-v": "${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE" + }, + { + "from": "quux", + "to": "foo", + "label": "dancesWith", + "direction": "IN", + "multiplicity": "One2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE" + } + ] +} \ No newline at end of file diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json new file mode 100644 index 00000000..d4b7f7f3 --- /dev/null +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json @@ -0,0 +1,35 @@ +{ + "rules": [ + { + "from": "foo", + "to": "bar", + "label": "eats", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE" + }, + { + "from": "foo", + "to": "baz", + "label": "isVeryHappyAbout", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "${direction}", + "delete-other-v": "${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE" + }, + { + "from": "quux", + "to": "foo", + "label": "dancesWith", + "direction": "IN", + "multiplicity": "One2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "${direction}", + "prevent-delete": "NONE" + } + ] +} \ No newline at end of file diff --git a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml b/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml deleted file mode 100644 index a4899974..00000000 --- a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v11.xml +++ /dev/null @@ -1,5932 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-schema/.gitignore b/aai-schema/.gitignore index ae3c1726..2f30844c 100644 --- a/aai-schema/.gitignore +++ b/aai-schema/.gitignore @@ -1 +1,2 @@ /bin/ +/.checkstyle -- 2.16.6