diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2022-09-29 11:35:24 +0200 |
---|---|---|
committer | Fiete Ostkamp <fiete.ostkamp@telekom.de> | 2022-09-29 09:52:21 +0000 |
commit | 8183d5972a9f1a4b0515c99a87047a5d12db5af2 (patch) | |
tree | 87d264f3a17715c89564c0d0b9dedb7af8a43a93 /aai-core/src | |
parent | 989faa9b2e38ea16b0dee0da26d6434170faeaa5 (diff) |
Replace deprecated Gremlin query in aai-common
addInE and addOutE are deprecated since Gremlin 3.1.0.
Issue-ID: AAI-3534
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: I4c4db97d8075e9c75b13ee206c27b8c01b5e0cf4
Diffstat (limited to 'aai-core/src')
-rw-r--r-- | aai-core/src/test/java/org/onap/aai/serialization/tinkerpop/TreeBackedVertexTest.java | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/tinkerpop/TreeBackedVertexTest.java b/aai-core/src/test/java/org/onap/aai/serialization/tinkerpop/TreeBackedVertexTest.java index 8eed7c64..c509ab43 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/tinkerpop/TreeBackedVertexTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/tinkerpop/TreeBackedVertexTest.java @@ -24,7 +24,10 @@ 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.*; +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.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.junit.Before; import org.junit.Ignore; @@ -45,21 +48,27 @@ public class TreeBackedVertexTest { public void configure() { GraphTraversalSource g = graph.traversal(); - startKey = g.addV(T.label, "vserver").as("v1").property("test", "hello").addV(T.label, "vserver").as("v2") - .addV(T.label, "interface").property("name", "interface 1").as("v10").addInE("hasChild", "v2") - .property(EdgeProperty.CONTAINS.toString(), true).addV(T.label, "pserver").property("name", "pserver 1") - .as("v4").addOutE("runsOn", "v1").property(EdgeProperty.CONTAINS.toString(), false) - .addV(T.label, "interface").property("name", "interface 2").as("v3").addInE("hasChild", "v1") - .property(EdgeProperty.CONTAINS.toString(), true).addV(T.label, "address").property("name", "address 1") - .addInE("hasChild", "v3").property(EdgeProperty.CONTAINS.toString(), true).addV(T.label, "address") - .property("name", "address 2").addInE("hasChild", "v3").property(EdgeProperty.CONTAINS.toString(), true) - .addV(T.label, "complex").property("name", "complex 1").addInE("locatedIn", "v4") - .property(EdgeProperty.CONTAINS.toString(), false).addV(T.label, "interface") - .property("name", "interface 3").addInE("hasChild", "v4") - .property(EdgeProperty.CONTAINS.toString(), true).addV(T.label, "subnet").property("name", "subnet 1") - .as("v5").addInE("in", "v3").property(EdgeProperty.CONTAINS.toString(), false).addV(T.label, "address") - .property("name", "address 3").as("v6").addInE("hasChild", "v5") - .property(EdgeProperty.CONTAINS.toString(), true).select("v1").next(); + startKey = g.addV("vserver").as("v1").property("test", "hello") + .addV("vserver").as("v2") + .addV("interface").property("name", "interface 1").as("v10") + .addE("hasChild").from("v2").property(EdgeProperty.CONTAINS.toString(), true) + .addV("pserver").property("name", "pserver 1").as("v4") + .addE("runsOn").to("v1").property(EdgeProperty.CONTAINS.toString(), false) + .addV("interface").property("name", "interface 2").as("v3") + .addE("hasChild").from("v1").property(EdgeProperty.CONTAINS.toString(), true) + .addV("address").property("name", "address 1") + .addE("hasChild").from("v3").property(EdgeProperty.CONTAINS.toString(), true) + .addV("address").property("name", "address 2") + .addE("hasChild").from("v3").property(EdgeProperty.CONTAINS.toString(), true) + .addV("complex").property("name", "complex 1") + .addE("locatedIn").from("v4").property(EdgeProperty.CONTAINS.toString(), false) + .addV("interface").property("name", "interface 3") + .addE("hasChild").from("v4").property(EdgeProperty.CONTAINS.toString(), true) + .addV("subnet").property("name", "subnet 1").as("v5") + .addE("in").from("v3").property(EdgeProperty.CONTAINS.toString(), false) + .addV("address").property("name", "address 3").as("v6") + .addE("hasChild").from("v5").property(EdgeProperty.CONTAINS.toString(), true) + .select("v1").next(); tree = new GraphTraversalQueryEngine(g).findSubGraph((Vertex) startKey); treeDepth1 = new GraphTraversalQueryEngine(g).findSubGraph((Vertex) startKey, 1, false); |