You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/03/09 22:09:05 UTC

incubator-tinkerpop git commit: g->graph and g->GraphTraversalContext.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/newapi 0584da7e5 -> ce0929f3d


g->graph and g->GraphTraversalContext.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/ce0929f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/ce0929f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/ce0929f3

Branch: refs/heads/newapi
Commit: ce0929f3d4708dc4ca60bd24650746a7637647dc
Parents: 0584da7
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Mar 9 15:09:03 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Mar 9 15:09:03 2015 -0600

----------------------------------------------------------------------
 .../tinkerpop/gremlin/AbstractGremlinTest.java  | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ce0929f3/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 2f30eda..2507934 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin;
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.Traversal;
+import org.apache.tinkerpop.gremlin.process.graph.traversal.GraphTraversalContext;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -52,7 +53,8 @@ import static org.junit.Assume.assumeThat;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public abstract class AbstractGremlinTest {
-    protected Graph g;
+    protected Graph graph;
+    protected GraphTraversalContext g;
     protected Configuration config;
     protected GraphStrategy[] strategiesToTest;
     protected GraphProvider graphProvider;
@@ -78,7 +80,8 @@ public abstract class AbstractGremlinTest {
         graphProvider.clear(config);
 
         // not sure how the strategy can ever be null, but it seems to happen in the performance tests
-        g = graphProvider.openTestGraph(config, strategiesToTest);
+        graph = graphProvider.openTestGraph(config, strategiesToTest);
+        g = graph.traversal();
 
         final Method testMethod = this.getClass().getMethod(cleanMethodName(name.getMethodName()));
 
@@ -104,19 +107,19 @@ public abstract class AbstractGremlinTest {
                 //System.out.println(String.format("Assume that %s meets Feature Requirement - %s - with %s", fr.featureClass().getSimpleName(), fr.feature(), fr.supported()));
                 assumeThat(String.format("%s does not support all of the features required by this test so it will be ignored: %s.%s=%s",
                                 g.getClass().getSimpleName(), fr.featureClass().getSimpleName(), fr.feature(), fr.supported()),
-                        g.features().supports(fr.featureClass(), fr.feature()), is(fr.supported()));
+                        graph.features().supports(fr.featureClass(), fr.feature()), is(fr.supported()));
             } catch (NoSuchMethodException nsme) {
                 throw new NoSuchMethodException(String.format("[supports%s] is not a valid feature on %s", fr.feature(), fr.featureClass()));
             }
         }
 
-        beforeLoadGraphWith(g);
+        beforeLoadGraphWith(graph);
 
         // load a graph with sample data if the annotation is present on the test
         final LoadGraphWith loadGraphWith = loadGraphWiths.length == 0 ? null : loadGraphWiths[0];
-        graphProvider.loadGraphData(g, loadGraphWith, this.getClass(), name.getMethodName());
+        graphProvider.loadGraphData(graph, loadGraphWith, this.getClass(), name.getMethodName());
 
-        afterLoadGraphWith(g);
+        afterLoadGraphWith(graph);
     }
 
     protected void beforeLoadGraphWith(final Graph g) throws Exception {
@@ -130,7 +133,7 @@ public abstract class AbstractGremlinTest {
     @After
     public void tearDown() throws Exception {
         if (null != graphProvider) {
-            graphProvider.clear(g, config);
+            graphProvider.clear(graph, config);
             g = null;
             config = null;
             strategiesToTest = null;
@@ -145,7 +148,7 @@ public abstract class AbstractGremlinTest {
      * @return the id as generated by the graph
      */
     public Object convertToVertexId(final String vertexName) {
-        return convertToVertexId(g, vertexName);
+        return convertToVertexId(graph, vertexName);
     }
 
     /**
@@ -165,7 +168,7 @@ public abstract class AbstractGremlinTest {
     }
 
     public Object convertToEdgeId(final String outVertexName, String edgeLabel, final String inVertexName) {
-        return convertToEdgeId(g, outVertexName, edgeLabel, inVertexName);
+        return convertToEdgeId(graph, outVertexName, edgeLabel, inVertexName);
     }
 
     public Object convertToEdgeId(final Graph graph, final String outVertexName, String edgeLabel, final String inVertexName) {