diff options
author | Venkata Harish K Kajur <vk250x@att.com> | 2017-08-15 09:58:15 -0400 |
---|---|---|
committer | Venkata Harish K Kajur <vk250x@att.com> | 2017-08-15 09:59:55 -0400 |
commit | fbb825ab807725146a9f01aed5c85367f6df609e (patch) | |
tree | 3e226386427a008709d08899504d3dff84dc48a3 /aai-core/src/test | |
parent | a84e52f06e453e9fb405c3dcb0e3e4d5e6ffbd1a (diff) |
[AAI-169 Amsterdam] Add ability for older versions
Change-Id: Ica6c4962e9cc7d98634606c010c3555e5a0a2f67
Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-core/src/test')
-rw-r--r-- | aai-core/src/test/java/org/openecomp/aai/serialization/db/EdgeRulesTest.java | 15 |
1 files changed, 14 insertions, 1 deletions
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<String, EdgeRule> 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")); + } } |