Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1DBAC200D15 for ; Wed, 20 Sep 2017 12:32:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1AD881609EB; Wed, 20 Sep 2017 10:32:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8156E160BDB for ; Wed, 20 Sep 2017 12:32:11 +0200 (CEST) Received: (qmail 79938 invoked by uid 500); 20 Sep 2017 10:32:10 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 79787 invoked by uid 99); 20 Sep 2017 10:32:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Sep 2017 10:32:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 506FCF584D; Wed, 20 Sep 2017 10:32:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jorgebg@apache.org To: commits@tinkerpop.apache.org Date: Wed, 20 Sep 2017 10:32:28 -0000 Message-Id: <1ee3250678414eaa91dd61ce4a002fb4@git.apache.org> In-Reply-To: <92bc0e497780466f8b25aa1a314b15ca@git.apache.org> References: <92bc0e497780466f8b25aa1a314b15ca@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [21/50] [abbrv] tinkerpop git commit: Moved traversal parameters out of the traversal maker method CTR archived-at: Wed, 20 Sep 2017 10:32:13 -0000 Moved traversal parameters out of the traversal maker method CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cc964e0c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cc964e0c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cc964e0c Branch: refs/heads/TINKERPOP-1730 Commit: cc964e0caac1abdb4b250ec201ed22a1c927c3c0 Parents: 2c74df0 Author: Stephen Mallette Authored: Wed Sep 13 10:48:05 2017 -0400 Committer: Stephen Mallette Committed: Wed Sep 13 10:48:05 2017 -0400 ---------------------------------------------------------------------- .../process/traversal/step/map/AddEdgeTest.java | 28 +++++++++----------- 1 file changed, 13 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc964e0c/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeTest.java ---------------------------------------------------------------------- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeTest.java index a12f5a8..59ac1e9 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeTest.java @@ -62,11 +62,11 @@ public abstract class AddEdgeTest extends AbstractGremlinProcessTest { public abstract Traversal get_g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX(); - public abstract Traversal get_g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X(final Vertex a, final Vertex v2); + public abstract Traversal get_g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X(final Vertex a, final Vertex b); - public abstract Traversal get_g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X(); + public abstract Traversal get_g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X(final Vertex a, final Vertex b); - public abstract Traversal get_g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X(); + public abstract Traversal get_g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X(final Vertex a, final Vertex b); /////// @@ -221,7 +221,10 @@ public abstract class AddEdgeTest extends AbstractGremlinProcessTest { @LoadGraphWith(MODERN) @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES) public void g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X() { - final Traversal traversal = get_g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X(); + final Vertex a = g.V().has("name", "marko").next(); + final Vertex b = g.V().has("name", "peter").next(); + + final Traversal traversal = get_g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X(a, b); printTraversalForm(traversal); final Edge edge = traversal.next(); assertEquals(edge.outVertex(), convertToVertex(graph, "marko")); @@ -231,15 +234,16 @@ public abstract class AddEdgeTest extends AbstractGremlinProcessTest { assertEquals(0.1d, edge.value("weight"), 0.1d); assertEquals(6L, g.V().count().next().longValue()); assertEquals(7L, g.E().count().next().longValue()); - - } @Test @LoadGraphWith(MODERN) @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES) public void g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X() { - final Traversal traversal = get_g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X(); + final Vertex a = g.V().has("name", "marko").next(); + final Vertex b = g.V().has("name", "peter").next(); + + final Traversal traversal = get_g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X(a, b); printTraversalForm(traversal); final Edge edge = traversal.next(); assertEquals(edge.outVertex(), convertToVertex(graph, "marko")); @@ -249,8 +253,6 @@ public abstract class AddEdgeTest extends AbstractGremlinProcessTest { assertEquals(0.1d, edge.value("weight"), 0.1d); assertEquals(6L, g.V().count().next().longValue()); assertEquals(7L, g.E().count().next().longValue()); - - } public static class Traversals extends AddEdgeTest { @@ -291,16 +293,12 @@ public abstract class AddEdgeTest extends AbstractGremlinProcessTest { } @Override - public Traversal get_g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X() { - final Vertex a = g.V().has("name", "marko").next(); - final Vertex b = g.V().has("name", "peter").next(); + public Traversal get_g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X(final Vertex a, final Vertex b) { return g.V(a).addE("knows").to(b).property("weight", 0.1d); } @Override - public Traversal get_g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X() { - final Vertex a = g.V().has("name", "marko").next(); - final Vertex b = g.V().has("name", "peter").next(); + public Traversal get_g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X(final Vertex a, final Vertex b) { return g.addE("knows").from(a).to(b).property("weight", 0.1d); } }