From fbb825ab807725146a9f01aed5c85367f6df609e Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Tue, 15 Aug 2017 09:58:15 -0400 Subject: [AAI-169 Amsterdam] Add ability for older versions Change-Id: Ica6c4962e9cc7d98634606c010c3555e5a0a2f67 Signed-off-by: Venkata Harish K Kajur --- .../org/openecomp/aai/serialization/db/EdgeRulesTest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'aai-core/src/test') 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 287761e6..87f52eb2 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 @@ -28,8 +28,8 @@ import org.apache.tinkerpop.gremlin.structure.Direction; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; - import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.Version; import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; @Ignore @@ -87,4 +87,17 @@ public class EdgeRulesTest { Map ruleMap = rules.getEdgeRules("availability-zone", "complex"); assertEquals("has groupsResourcesIn rule", "groupsResourcesIn", ruleMap.get("groupsResourcesIn").getLabel()); } + + @Test + public void verifyOldEdgeRule() throws AAIException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { + assertEquals(true, EdgeRules.getInstance().hasEdgeRule("model-element", "model-ver")); + assertEquals(true, EdgeRules.getInstance(Version.v8).hasEdgeRule("pserver", "complex")); + assertEquals(false, EdgeRules.getInstance(Version.v8).hasEdgeRule("model-element", "model-ver")); + } + + @Test + public void verifyOldEdgeDeleteSemantics() throws AAIException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { + assertEquals(DeleteSemantic.ERROR_4_IN_EDGES_OR_CASCADE, EdgeRules.getInstance().getDeleteSemantic("model")); + assertEquals(DeleteSemantic.CASCADE_TO_CHILDREN, EdgeRules.getInstance(Version.v8).getDeleteSemantic("model")); + } } -- cgit 1.2.3-korg