You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/04/15 19:47:23 UTC

[01/50] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master' into TINKERPOP3-581

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/variables 7783d4fd5 -> c15ab5e74


Merge remote-tracking branch 'origin/master' into TINKERPOP3-581

Conflicts:
	gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java


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

Branch: refs/heads/variables
Commit: 9716d379df5742dbf3cf1bf681bea0b5043c7d7f
Parents: 4a06aaf c906ee2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 13:10:36 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 13:10:36 2015 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  2 +
 .../tinkerpop/gremlin/structure/Element.java    |  6 --
 .../tinkerpop/gremlin/structure/Graph.java      | 14 ----
 .../tinkerpop/gremlin/structure/Property.java   |  8 +--
 .../gremlin/structure/VertexProperty.java       |  2 -
 .../util/detached/DetachedProperty.java         |  2 +-
 .../util/detached/DetachedVertexProperty.java   |  3 +-
 .../util/reference/ReferenceProperty.java       |  2 +-
 .../util/reference/ReferenceVertexProperty.java |  2 +-
 .../gremlin/structure/util/star/StarGraph.java  |  2 +-
 .../tinkerpop/gremlin/AbstractGremlinSuite.java | 71 --------------------
 .../gremlin/structure/FeatureSupportTest.java   | 14 ++--
 12 files changed, 20 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9716d379/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9716d379/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9716d379/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------


[06/50] incubator-tinkerpop git commit: Add tests for g.V/E where string values of the id are present as a filter.

Posted by sp...@apache.org.
Add tests for g.V/E where string values of the id are present as a filter.


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

Branch: refs/heads/variables
Commit: 0c16dc8650f7f0f149c4c2c5b315bd2b481f8073
Parents: f273a56
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 16:22:36 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 16:22:36 2015 -0400

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/util/HasContainer.java     | 4 +++-
 .../tinkerpop/gremlin/structure/util/ElementHelper.java       | 7 +++++--
 .../process/traversal/step/map/GroovyVertexTest.groovy        | 4 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c16dc86/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
index cc98041..c69e90b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java
@@ -62,8 +62,10 @@ public final class HasContainer implements Serializable {
 
     public boolean test(final Element element) {
         if (null != this.value) {
+            // it is OK to evaluate equality of ids via toString() now given that the toString() the test suite
+            // enforces the value of id.()toString() to be a first class representation of the identifier
             if (this.key.equals(T.id.getAccessor()))
-                return this.predicate.test(element.id(), this.value);
+                return this.predicate.test(element.id().toString(), this.value.toString());
             else if (this.key.equals(T.label.getAccessor()))
                 return this.predicate.test(element.label(), this.value);
             else if (element instanceof VertexProperty && this.key.equals(T.value.getAccessor()))

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c16dc86/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index 94d4a5b..e6a39a6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -503,10 +503,13 @@ public final class ElementHelper {
 
     public static boolean idExists(final Object id, final Object... providedIds) {
         if (0 == providedIds.length) return true;
-        if (1 == providedIds.length) return id.equals(providedIds[0]);
+
+        // it is OK to evaluate equality of ids via toString() now given that the toString() the test suite
+        // enforces the value of id.()toString() to be a first class representation of the identifier
+        if (1 == providedIds.length) return id.toString().equals(providedIds[0].toString());
         else {
             for (final Object temp : providedIds) {
-                if (temp.equals(id))
+                if (temp.toString().equals(id.toString()))
                     return true;
             }
             return false;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c16dc86/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
index 4edb264..bb3506c 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
@@ -62,7 +62,7 @@ public abstract class GroovyVertexTest {
         }
 
         @Override
-        public Traversal<Edge, Edge> get_g_EX11X(Object e11Id) {
+        public Traversal<Edge, Edge> get_g_EX11X(final Object e11Id) {
             g.E(e11Id);
         }
 
@@ -196,7 +196,7 @@ public abstract class GroovyVertexTest {
         }
 
         @Override
-        public Traversal<Edge, Edge> get_g_EX11X(Object e11Id) {
+        public Traversal<Edge, Edge> get_g_EX11X(final Object e11Id) {
             ComputerTestHelper.compute("g.E($e11Id)", g)
         }
 


[16/50] incubator-tinkerpop git commit: Update javadoc in all test suites.

Posted by sp...@apache.org.
Update javadoc in all test suites.

Tried to make the text a bit more friendly for vendors who are trying to figure out what they are and if they need to be implemented.


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

Branch: refs/heads/variables
Commit: cc0b8488638b22ba6adb858083559d47ea084381
Parents: 982780e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 08:26:08 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 08:26:08 2015 -0400

----------------------------------------------------------------------
 .../groovy/GroovyEnvironmentIntegrateSuite.java | 11 ++++++++
 .../GroovyEnvironmentPerformanceSuite.java      | 12 ++++++++
 .../gremlin/groovy/GroovyEnvironmentSuite.java  |  9 ++++++
 .../process/GroovyProcessComputerSuite.java     | 11 ++++++++
 .../process/GroovyProcessStandardSuite.java     |  8 +++++-
 .../gremlin/process/ProcessComputerSuite.java   | 29 +++++++-------------
 .../process/ProcessPerformanceSuite.java        | 25 +++++------------
 .../gremlin/process/ProcessStandardSuite.java   | 26 ++++--------------
 .../structure/StructurePerformanceSuite.java    | 23 +++-------------
 .../structure/StructureStandardSuite.java       | 27 +++++++++---------
 10 files changed, 91 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
index c0d3ea7..7f1daf3 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
@@ -24,6 +24,8 @@ import org.apache.tinkerpop.gremlin.GraphManager;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineIntegrateTest;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -33,6 +35,15 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
+ * The {@code GroovyEnvironmentIntegrateSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
+ * {@link Graph} implementation.  This test suite covers ensures that a vendor implementation is compliant with
+ * the Groovy "environment" which will typically ensure that the {@link Graph} will work as expected in the Gremlin
+ * Console, Gremlin Server, and other Groovy environments.
+ * <br/>
+ * Note that this suite contains "long-run" tests.  At this time, this suite can be considered optional to vendors.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GroovyEnvironmentIntegrateSuite extends AbstractGremlinSuite {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
index 5934cbb..70439a3 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
@@ -25,6 +25,8 @@ import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutorPerformanceTest
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoaderPerformanceTest;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -34,6 +36,16 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
+ * The {@code GroovyEnvironmentPerformanceSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
+ * {@link Graph} implementation.  This test suite covers ensures that a vendor implementation is compliant with
+ * the Groovy "environment" which will typically ensure that the {@link Graph} will work as expected in the Gremlin
+ * Console, Gremlin Server, and other Groovy environments.
+ * <br/>
+ * Note that this suite contains "long-run" tests.  At this time, this suite can be considered optional to vendors
+ * as the functionality that it provides is generally covered elsewhere.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GroovyEnvironmentPerformanceSuite extends AbstractGremlinSuite {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
index 2e0a114..b1b4d1c 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
@@ -27,6 +27,8 @@ import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoaderTest;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoaderTest;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -36,6 +38,13 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
+ * The {@code GroovyEnvironmentSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
+ * {@link Graph} implementation.  This test suite covers ensures that a vendor implementation is compliant with
+ * the Groovy "environment" which will typically ensure that the {@link Graph} will work as expected in the Gremlin
+ * Console, Gremlin Server, and other Groovy environments.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GroovyEnvironmentSuite extends AbstractGremlinSuite {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
index 6fbf70c..b5d49a5 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.GraphManager;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.ranking.PageRankVertexProgramTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyBranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyChooseTest;
@@ -65,10 +66,20 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovySack
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovySideEffectCapTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyStoreTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyTreeTest;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
 /**
+ * The {@code GroovyProcessComputerSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
+ * {@link Graph} implementation.  This test suite covers traversal operations around {@link GraphComputer} and should
+ * be implemented by vendors to validate that their implementations are compliant with the Groovy flavor of the
+ * Gremlin language. Implementations that use this test suite should return {@code true} for
+ * {@link Graph.Features.GraphFeatures#supportsComputer()}.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GroovyProcessComputerSuite extends ProcessComputerSuite {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
index 67bd21b..71e1a7b 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
@@ -73,11 +73,17 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovySide
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyStoreTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovySubgraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyTreeTest;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
 /**
- * The test suite for the Groovy implementation of Gremlin Process.
+ * The {@code GroovyProcessStandardSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
+ * {@link Graph} implementation.  This test suite covers traversal operations and should be implemented by vendors
+ * to validate that their implementations are compliant with the Groovy flavor of the Gremlin language.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 9e693dc..498d8b0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest;
 import org.apache.tinkerpop.gremlin.process.computer.ranking.PageRankVertexProgramTest;
 import org.apache.tinkerpop.gremlin.process.computer.util.ComputerGraphTest;
@@ -70,6 +71,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.TraversalVerificationStrategyTest;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -79,27 +82,15 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
- * The {@code ProcessComputerStandardSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
- * {@link org.apache.tinkerpop.gremlin.structure.Graph} implementation.  This specialized test suite and runner is for use
- * by Gremlin implementers to test their {@link org.apache.tinkerpop.gremlin.structure.Graph} implementations.  The
- * {@code ProcessComputerStandardSuite} ensures consistency and validity of the implementations that they test.
- * <p/>
- * To use the {@code ProcessComputerStandardSuite} define a class in a test module.  Simple naming would expect the
- * name of the implementation followed by "ProcessComputerStandardSuite".  This class should be annotated as follows
- * (note that the "Suite" implements ProcessComputerStandardSuite.GraphProvider as a convenience only. It could be
- * implemented in a separate class file):
- * <code>
+ * The {@code ProcessComputerSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
+ * {@link Graph} implementation.  This test suite covers traversal operations around {@link GraphComputer} and should
+ * be implemented by vendors to validate that their implementations are compliant with that Gremlin language.
+ * Implementations that use this test suite should return {@code true} for
+ * {@link Graph.Features.GraphFeatures#supportsComputer()}.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
- * @RunWith(ProcessComputerSuite.class)
- * @ProcessComputerSuite.GraphProviderClass(TinkerGraphProcessComputerTest.class) public class TinkerGraphProcessComputerTest implements GraphProvider {
- * }
- * </code>
- * Implementing {@link org.apache.tinkerpop.gremlin.GraphProvider} provides a way for the {@code ProcessComputerStandardSuite}
- * to instantiate {@link org.apache.tinkerpop.gremlin.structure.Graph} instances from the implementation being tested to
- * inject into tests in the suite.  The {@code ProcessComputerStandardSuite} will utilized Features defined in the
- * suite to determine which tests will be executed.
- * <br/>
  */
 public class ProcessComputerSuite extends AbstractGremlinSuite {
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
index 0bd8b20..be6a3f5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
@@ -19,31 +19,20 @@
 package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
+import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.GraphReadPerformanceTest;
 import org.apache.tinkerpop.gremlin.structure.GraphWritePerformanceTest;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
 /**
  * The {@code ProcessPerformanceSuite} is a JUnit test runner that executes the Gremlin Test Suite over a Graph
- * implementation.  This specialized test suite and runner is for use by Gremlin implementers to test their
- * Graph implementations traversal speeds.
- * <p/>
- * To use the {@code ProcessPerformanceSuite} define a class in a test module.  Simple naming would expect the name of
- * the implementation followed by "ProcessPerformanceTest".  This class should be annotated as follows (note that
- * the "Suite" implements {@link org.apache.tinkerpop.gremlin.GraphProvider} as a convenience only. It could be implemented in
- * a separate class file):
- * <code>
- * @RunWith(ProcessPerformanceSuite.class)
- * @SProcessPerformanceSuite.GraphProviderClass(TinkerGraphProcessPerformanceTest.class)
- * public class TinkerGraphProcessPerformanceTest implements GraphProvider {
- * }
- * </code>
- * Implementing {@link org.apache.tinkerpop.gremlin.GraphProvider} provides a way for the {@code ProcessPerformanceSuite} to
- * instantiate {@link org.apache.tinkerpop.gremlin.structure.Graph} instances from the implementation being tested to inject
- * into tests in the suite.  The {@code ProcessPerformanceSuite} will utilized
- * {@link org.apache.tinkerpop.gremlin.structure.Graph.Features} defined in the suite to determine which tests will be
- * executed.
+ * implementation.  This suite contains "long-run" tests that produce reports on the traversal execution
+ * performance of a vendor implementation {@link Graph}. Its usage is optional to vendors as the tests are
+ * somewhat redundant to those found elsewhere in other required test suites.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
index 518273c..2bed41d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
@@ -79,6 +79,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.Partit
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.TraversalVerificationStrategyTest;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -89,28 +91,12 @@ import java.util.stream.Stream;
 
 /**
  * The {@code ProcessStandardSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
- * {@link org.apache.tinkerpop.gremlin.structure.Graph} implementation.  This specialized test suite and runner is for use
- * by Gremlin implementers to test their {@link org.apache.tinkerpop.gremlin.structure.Graph} implementations.  The
- * {@code ProcessStandardSuite} ensures consistency and validity of the implementations that they test.
- * <p/>
- * To use the {@code ProcessStandardSuite} define a class in a test module.  Simple naming would expect the name of the
- * implementation followed by "ProcessStandardSuite".  This class should be annotated as follows (note that the "Suite"
- * implements {@link org.apache.tinkerpop.gremlin.GraphProvider} as a convenience only. It could be implemented in a
- * separate class file):
- * <p/>
- * <code>
+ * {@link Graph} implementation.  This test suite covers traversal operations and should be implemented by vendors
+ * to validate that their implementations are compliant with the Gremlin language.
+ * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
- * @RunWith(ProcessStandardSuite.class)
- * @ProcessStandardSuite.GraphProviderClass(TinkerGraphProcessStandardTest.class) public class TinkerGraphProcessStandardTest implements GraphProvider {
- * }
- * </code>
- * <p/>
- * Implementing {@link org.apache.tinkerpop.gremlin.GraphProvider} provides a way for the {@code ProcessStandardSuite} to
- * instantiate {@link org.apache.tinkerpop.gremlin.structure.Graph} instances from the implementation being tested to inject
- * into tests in the suite.  The ProcessStandardSuite will utilized
- * {@link org.apache.tinkerpop.gremlin.structure.Graph.Features} defined in the suite to determine which tests will be executed.
- * <br/>
  */
 public class ProcessStandardSuite extends AbstractGremlinSuite {
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
index 360b829..4280c6b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
@@ -24,26 +24,11 @@ import org.junit.runners.model.RunnerBuilder;
 
 /**
  * The {@code StructurePerformanceSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
- * {@link org.apache.tinkerpop.gremlin.structure.Graph} implementation.  This specialized test suite and runner is for use
- * by Gremlin Structure implementers to test their {@link org.apache.tinkerpop.gremlin.structure.Graph}implementations.
- * The {@code StructurePerformanceSuite} runs more complex testing scenarios over
- * {@link org.apache.tinkerpop.gremlin.structure.Graph} implementations than the standard {@code StructurePerformanceSuite}.
- * <p/>
- * To use the {@code StructurePerformanceSuite} define a class in a test module.  Simple naming would expect the name
- * of the implementation followed by "StructurePerformanceTest".  This class should be annotated as follows (note that
- * the "Suite" implements {@link org.apache.tinkerpop.gremlin.GraphProvider} as a convenience only. It could be implemented
- * in a separate class file):
- * <code>
- * @RunWith(StructurePerformanceSuite.class)
- * @StructurePerformanceSuite.GraphProviderClass(TinkerGraphStructurePerformanceTest.class) public class TinkerGraphStructurePerformanceTest implements GraphProvider {
- * }
- * </code>
- * Implementing {@link org.apache.tinkerpop.gremlin.GraphProvider} provides a way for the {@code StructurePerformanceSuite}
- * to instantiate {@link org.apache.tinkerpop.gremlin.structure.Graph} instances from the implementation being tested to
- * inject into tests in the suite.  The {@code StructurePerformanceSuite} will utilized
- * {@link org.apache.tinkerpop.gremlin.structure.Graph.Features} defined in the suite to determine which tests will be
- * executed.
+ * {@link Graph} implementation. This suite contains "long-run" tests that produce reports on the read/write
+ * performance of a vendor implementation {@link Graph}. Its usage is optional to vendors as the tests are
+ * somewhat redundant to those found elsewhere in other required test suites.
  * <br/>
+ * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cc0b8488/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
index 3211f6b..b6e7f73 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.structure;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
+import org.apache.tinkerpop.gremlin.GraphProvider;
 import org.apache.tinkerpop.gremlin.algorithm.generator.CommunityGeneratorTest;
 import org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGeneratorTest;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest;
@@ -39,29 +40,29 @@ import java.util.stream.Stream;
 
 /**
  * The {@code StructureStandardSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
- * {@link org.apache.tinkerpop.gremlin.structure.Graph} implementation.  This specialized test suite and runner is for use by
- * Gremlin implementers to test their {@link org.apache.tinkerpop.gremlin.structure.Graph} implementations.  The
- * {@code StructureStandardSuite} ensures consistency and validity of the implementations that they test.
+ * {@link Graph} implementation.  This specialized test suite and runner is for use by
+ * vendors to test their {@link Graph} implementations.  The {@code StructureStandardSuite} ensures consistency and
+ * validity of the implementations that they test.  Successful execution of this test suite is critical to proper
+ * operations of a vendor implementation.
  * <p/>
  * To use the {@code StructureStandardSuite} define a class in a test module.  Simple naming would expect the name of
  * the implementation followed by "StructureStandardSuite".  This class should be annotated as follows (note that the
- * "Suite" implements {@link org.apache.tinkerpop.gremlin.GraphProvider} as a convenience only. It could be implemented in a
+ * "Suite" implements {@link GraphProvider} as a convenience only. It could be implemented in a
  * separate class file):
  * <code>
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
  * @RunWith(StructureStandardSuite.class)
- * @StructureStandardSuite.GraphProviderClass(TinkerGraphStructureStandardTest.class) public class TinkerGraphStructureStandardTest implements GraphProvider {
+ * @StructureStandardSuite.GraphProviderClass(TinkerGraphStructureStandardTest.class)
+ * public class TinkerGraphStructureStandardTest implements GraphProvider {
  * }
  * </code>
- * Implementing {@link org.apache.tinkerpop.gremlin.GraphProvider} provides a way for the {@code StructureStandardSuite} to
- * instantiate {@link org.apache.tinkerpop.gremlin.structure.Graph} instances from the implementation being tested to inject
- * into tests in the suite.  The {@code StructureStandardSuite} will utilized Features defined in the suite to
- * determine which tests will be executed.
+ * Implementing {@link GraphProvider} provides a way for the {@code StructureStandardSuite} to instantiate
+ * {@link Graph} instances from the implementation being tested to inject into tests in the suite.  The
+ * {@code StructureStandardSuite} will utilized Features defined in the suite to determine which tests will be executed.
  * <br/>
- * Set the {@code gremlin.structure.tests} environment variable to a comma separated list of test classes to execute.
+ * Set the {@code gremlin.tests} environment variable to a comma separated list of test classes to execute.
  * This setting can be helpful to restrict execution of tests to specific ones being focused on during development.
- * <br/>
+
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class StructureStandardSuite extends AbstractGremlinSuite {
 


[08/50] incubator-tinkerpop git commit: added string interning to StarGraph.

Posted by sp...@apache.org.
added string interning to StarGraph.


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

Branch: refs/heads/variables
Commit: 70aaea789be2570412b06f5854c1401201d52c81
Parents: 8d968fd
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Apr 13 14:34:07 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Apr 13 14:34:07 2015 -0600

----------------------------------------------------------------------
 .../gremlin/structure/util/star/StarGraph.java        | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/70aaea78/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
index 59c2556..e3971a3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
@@ -65,11 +65,21 @@ public final class StarGraph implements Graph {
 
     private final Map<Object, Map<String, Object>> edgeProperties = new HashMap<>();
     private final Map<Object, Map<String, Object>> metaProperties = new HashMap<>();
+    private final Map<String, String> keysAndLabels = new HashMap<>();
 
     public StarVertex getStarVertex() {
         return this.starVertex;
     }
 
+    private String getKeyOrLabel(final String keyOrLabel) {
+        String intern = this.keysAndLabels.get(keyOrLabel);
+        if (null == intern) {
+            this.keysAndLabels.put(keyOrLabel, keyOrLabel);
+            intern = keyOrLabel.intern();
+        }
+        return intern;
+    }
+
     @Override
     public Vertex addVertex(final Object... keyValues) {
         return null == this.starVertex ?
@@ -203,7 +213,7 @@ public final class StarGraph implements Graph {
 
         protected StarElement(final Object id, final String label) {
             this.id = id;
-            this.label = label;
+            this.label = StarGraph.this.getKeyOrLabel(label);
         }
 
         @Override
@@ -615,7 +625,7 @@ public final class StarGraph implements Graph {
         private final Element element;
 
         public StarProperty(final String key, final V value, final Element element) {
-            this.key = key;
+            this.key = StarGraph.this.getKeyOrLabel(key);
             this.value = value;
             this.element = element;
         }


[49/50] incubator-tinkerpop git commit: a little clean up on the Iterators for HadoopLoader.

Posted by sp...@apache.org.
a little clean up on the Iterators for HadoopLoader.


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

Branch: refs/heads/variables
Commit: d09ffa895a5f22a26d03a540003ab05e5f82d684
Parents: 9f7ce82
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Apr 15 10:19:47 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Apr 15 10:19:47 2015 -0600

----------------------------------------------------------------------
 .../gremlin/util/iterator/IteratorUtils.java    |  3 +-
 .../util/iterator/IteratorUtilsTest.java        | 24 +++++
 .../hadoop/groovy/plugin/HadoopLoader.groovy    | 30 ++++---
 .../structure/io/VertexWritableIterator.java    | 95 ++++++++++++++++++++
 4 files changed, 138 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d09ffa89/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
index c0facae..769e76a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
@@ -86,8 +86,7 @@ public final class IteratorUtils {
 
             @Override
             public S next() {
-                this.count++;
-                if (this.count >= limit)
+                if (this.count++ >= limit)
                     throw FastNoSuchElementException.instance();
                 return iterator.next();
             }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d09ffa89/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
index e060fc9..6f3640f 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
@@ -21,6 +21,7 @@ package org.apache.tinkerpop.gremlin.util.iterator;
 import org.junit.Test;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -448,6 +449,29 @@ public class IteratorUtilsTest {
         assertEquals(new Integer(16), IteratorUtils.reduce(iterable, 10, (accumulator, val) -> accumulator + Integer.parseInt(val)));
     }
 
+    @Test
+    public void shouldLimitIterator() {
+        List<String> list = Arrays.asList("a","b","c","d","e");
+        Iterator<String> itty = IteratorUtils.limit(list.iterator(),3);
+        assertTrue(itty.hasNext());
+        assertEquals("a", itty.next());
+        assertTrue(itty.hasNext());
+        assertEquals("b", itty.next());
+        assertTrue(itty.hasNext());
+        assertEquals("c", itty.next());
+        assertFalse(itty.hasNext());
+
+        list = Arrays.asList("a","b","c");
+        itty = IteratorUtils.limit(list.iterator(),4);
+        assertTrue(itty.hasNext());
+        assertEquals("a", itty.next());
+        assertTrue(itty.hasNext());
+        assertEquals("b", itty.next());
+        assertTrue(itty.hasNext());
+        assertEquals("c", itty.next());
+        assertFalse(itty.hasNext());
+    }
+
     public <S> void assertIterator(final Iterator<S> itty, final int size) {
         for (int ix = 0; ix < size; ix++) {
             assertEquals("test" + (ix + 1), itty.next());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d09ffa89/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy b/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
index ecbe9d3..962fc0d 100644
--- a/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
+++ b/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
@@ -27,6 +27,8 @@ import org.apache.tinkerpop.gremlin.hadoop.structure.hdfs.HiddenFileFilter
 import org.apache.tinkerpop.gremlin.hadoop.structure.hdfs.TextIterator
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritableIterator
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritableIterator
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils
 
 /**
@@ -100,28 +102,21 @@ class HadoopLoader {
         }
 
         FileSystem.metaClass.head = { final String path, final long totalLines ->
-            return ((FileSystem) delegate).head(path, Long.MAX_VALUE, Text.class);
+            return headMaker((FileSystem) delegate, path, totalLines, Text.class);
         }
 
         FileSystem.metaClass.head = { final String path ->
-            return ((FileSystem) delegate).head(path, Long.MAX_VALUE, Text.class);
+            return headMaker((FileSystem) delegate, path, Long.MAX_VALUE, Text.class);
         }
 
         FileSystem.metaClass.head = {
             final String path, final Class<org.apache.hadoop.io.Writable> writableClass ->
-                return ((FileSystem) delegate).head(path, Long.MAX_VALUE, writableClass);
+                return headMaker((FileSystem) delegate, path, Long.MAX_VALUE, writableClass);
         }
 
         FileSystem.metaClass.head = {
-            final String path, final long totalKeyValues, final Class<org.apache.hadoop.io.Writable> writableClass ->
-                // if(writableClass.equals(org.apache.giraph.graph.Vertex.class)) {
-                /// return StreamFactory.stream(new GiraphVertexIterator(((FileSystem) delegate).getConf(), new Path(path))).limit(totalKeyValues).iterator();
-                // } else
-                if (writableClass.equals(ObjectWritable.class)) {
-                    return IteratorUtils.limit(new ObjectWritableIterator(((FileSystem) delegate).getConf(), new Path(path)), totalKeyValues);
-                } else {
-                    return IteratorUtils.limit(new TextIterator(((FileSystem) delegate).getConf(), new Path(path)), totalKeyValues);
-                }
+            final String path, final long totalLines, final Class<org.apache.hadoop.io.Writable> writableClass ->
+                return headMaker((FileSystem) delegate, path, totalLines, writableClass);
         }
 
         /*FileSystem.metaClass.unzip = { final String from, final String to, final boolean deleteZip ->
@@ -129,4 +124,15 @@ class HadoopLoader {
         }*/
 
     }
+
+    private static Iterator headMaker(
+            final FileSystem fs,
+            final String path, final long totalLines, final Class<org.apache.hadoop.io.Writable> writableClass) {
+        if (writableClass.equals(ObjectWritable.class))
+            return IteratorUtils.limit(new ObjectWritableIterator(fs.getConf(), new Path(path)), totalLines.intValue());
+        else if (writableClass.equals(VertexWritable.class))
+            return IteratorUtils.limit(new VertexWritableIterator(fs.getConf(), new Path(path)), totalLines.intValue());
+        else
+            return IteratorUtils.limit(new TextIterator(fs.getConf(), new Path(path)), totalLines.intValue());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d09ffa89/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableIterator.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableIterator.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableIterator.java
new file mode 100644
index 0000000..6933ae4
--- /dev/null
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/VertexWritableIterator.java
@@ -0,0 +1,95 @@
+/*
+ *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  * http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *
+ */
+
+package org.apache.tinkerpop.gremlin.hadoop.structure.io;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.SequenceFile;
+import org.apache.tinkerpop.gremlin.hadoop.structure.hdfs.HiddenFileFilter;
+import org.apache.tinkerpop.gremlin.process.traversal.FastNoSuchElementException;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Queue;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class VertexWritableIterator implements Iterator<Vertex> {
+
+    private final VertexWritable value = new VertexWritable();
+    private boolean available = false;
+    private final Queue<SequenceFile.Reader> readers = new LinkedList<>();
+
+    public VertexWritableIterator(final Configuration configuration, final Path path) throws IOException {
+        final FileSystem fs = FileSystem.get(configuration);
+        for (final FileStatus status : fs.listStatus(path, HiddenFileFilter.instance())) {
+            this.readers.add(new SequenceFile.Reader(fs, status.getPath(), configuration));
+        }
+    }
+
+    @Override
+    public boolean hasNext() {
+        try {
+            if (this.available) {
+                return true;
+            } else {
+                while (true) {
+                    if (this.readers.isEmpty())
+                        return false;
+                    if (this.readers.peek().next(this.value)) {
+                        this.available = true;
+                        return true;
+                    } else
+                        this.readers.remove();
+                }
+            }
+        } catch (final IOException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public Vertex next() {
+        try {
+            if (this.available) {
+                this.available = false;
+                return this.value.get();
+            } else {
+                while (true) {
+                    if (this.readers.isEmpty())
+                        throw FastNoSuchElementException.instance();
+                    if (this.readers.peek().next(this.value)) {
+                        return this.value.get();
+                    } else
+                        this.readers.remove();
+                }
+            }
+        } catch (final IOException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file


[21/50] incubator-tinkerpop git commit: TINKERPOP3-632 Enforce gremlin.tests env var in AbstractGremlinSuite

Posted by sp...@apache.org.
TINKERPOP3-632 Enforce gremlin.tests env var in AbstractGremlinSuite


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

Branch: refs/heads/variables
Commit: 4e9c94ac3cc5b96117dfc2a7829d5a103e46e88c
Parents: e0574a3
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Tue Apr 14 10:11:14 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Tue Apr 14 10:11:14 2015 -0700

----------------------------------------------------------------------
 .../groovy/GroovyEnvironmentIntegrateSuite.java | 23 +++-------------
 .../GroovyEnvironmentPerformanceSuite.java      | 25 ++++-------------
 .../gremlin/groovy/GroovyEnvironmentSuite.java  | 25 ++++-------------
 .../process/GroovyProcessComputerSuite.java     |  4 +--
 .../process/GroovyProcessStandardSuite.java     |  4 +--
 .../tinkerpop/gremlin/AbstractGremlinSuite.java | 29 ++++++++++++++++++--
 .../gremlin/process/ProcessComputerSuite.java   | 21 +-------------
 .../process/ProcessPerformanceSuite.java        |  5 ++--
 .../gremlin/process/ProcessStandardSuite.java   | 21 +-------------
 .../structure/StructurePerformanceSuite.java    |  5 ++--
 .../structure/StructureStandardSuite.java       | 25 ++++-------------
 11 files changed, 58 insertions(+), 129 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
index 7f1daf3..f85f40d 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
@@ -48,31 +48,16 @@ import java.util.stream.Stream;
  */
 public class GroovyEnvironmentIntegrateSuite extends AbstractGremlinSuite {
 
-    private static final Class<?>[] allTests = new Class<?>[]{
-            GremlinGroovyScriptEngineIntegrateTest.class
-    };
-
     /**
      * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
      * as needed to enforce tests upon implementations.
      */
-    private static final Class<?>[] testsToExecute;
-
-    static {
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
-        if (override.equals(""))
-            testsToExecute = allTests;
-        else {
-            final List<String> filters = Arrays.asList(override.split(","));
-            final List<Class<?>> allowed = Stream.of(allTests)
-                    .filter(c -> filters.contains(c.getName()))
-                    .collect(Collectors.toList());
-            testsToExecute = allowed.toArray(new Class<?>[allowed.size()]);
-        }
-    }
+    private static final Class<?>[] allTests = new Class<?>[]{
+            GremlinGroovyScriptEngineIntegrateTest.class
+    };
 
     public GroovyEnvironmentIntegrateSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute);
+        super(klass, builder, allTests);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
index 70439a3..d79ebb6 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
@@ -50,32 +50,17 @@ import java.util.stream.Stream;
  */
 public class GroovyEnvironmentPerformanceSuite extends AbstractGremlinSuite {
 
-    private static final Class<?>[] allTests = new Class<?>[]{
-            GremlinExecutorPerformanceTest.class,
-            SugarLoaderPerformanceTest.class
-    };
-
     /**
      * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
      * as needed to enforce tests upon implementations.
      */
-    private static final Class<?>[] testsToExecute;
-
-    static {
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
-        if (override.equals(""))
-            testsToExecute = allTests;
-        else {
-            final List<String> filters = Arrays.asList(override.split(","));
-            final List<Class<?>> allowed = Stream.of(allTests)
-                    .filter(c -> filters.contains(c.getName()))
-                    .collect(Collectors.toList());
-            testsToExecute = allowed.toArray(new Class<?>[allowed.size()]);
-        }
-    }
+    private static final Class<?>[] allTests = new Class<?>[]{
+            GremlinExecutorPerformanceTest.class,
+            SugarLoaderPerformanceTest.class
+    };
 
     public GroovyEnvironmentPerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute);
+        super(klass, builder, allTests);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
index b1b4d1c..01b5280 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
@@ -49,6 +49,10 @@ import java.util.stream.Stream;
  */
 public class GroovyEnvironmentSuite extends AbstractGremlinSuite {
 
+    /**
+     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
+     * as needed to enforce tests upon implementations.
+     */
     private static final Class<?>[] allTests = new Class<?>[]{
             GremlinGroovyScriptEngineOverGraphTest.class,
             GremlinExecutorOverGraphTest.class,
@@ -56,27 +60,8 @@ public class GroovyEnvironmentSuite extends AbstractGremlinSuite {
             SugarLoaderTest.class,
     };
 
-    /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
-     */
-    private static final Class<?>[] testsToExecute;
-
-    static {
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
-        if (override.equals(""))
-            testsToExecute = allTests;
-        else {
-            final List<String> filters = Arrays.asList(override.split(","));
-            final List<Class<?>> allowed = Stream.of(allTests)
-                    .filter(c -> filters.contains(c.getName()))
-                    .collect(Collectors.toList());
-            testsToExecute = allowed.toArray(new Class<?>[allowed.size()]);
-        }
-    }
-
     public GroovyEnvironmentSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute);
+        super(klass, builder, allTests);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
index b5d49a5..43ceb19 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
@@ -88,7 +88,7 @@ public class GroovyProcessComputerSuite extends ProcessComputerSuite {
      * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
      * as needed to enforce tests upon implementations.
      */
-    private static final Class<?>[] testsToExecute = new Class<?>[]{
+    private static final Class<?>[] allTests = new Class<?>[]{
 
             //branch
             GroovyBranchTest.ComputerTraversals.class,
@@ -152,7 +152,7 @@ public class GroovyProcessComputerSuite extends ProcessComputerSuite {
     };
 
     public GroovyProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToExecute);
+        super(klass, builder, allTests, allTests);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
index 71e1a7b..a660f7e 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
@@ -93,7 +93,7 @@ public class GroovyProcessStandardSuite extends ProcessStandardSuite {
      * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
      * as needed to enforce tests upon implementations.
      */
-    private static final Class<?>[] testsToExecute = new Class<?>[]{
+    private static final Class<?>[] allTests = new Class<?>[]{
             // branch
             GroovyBranchTest.StandardTraversals.class,
             GroovyChooseTest.StandardTraversals.class,
@@ -155,7 +155,7 @@ public class GroovyProcessStandardSuite extends ProcessStandardSuite {
 
 
     public GroovyProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToExecute, true);
+        super(klass, builder, allTests, allTests, true);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
index f988add..6a7cbd9 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
@@ -97,7 +97,7 @@ public abstract class AbstractGremlinSuite extends Suite {
         this(klass, builder, testsToExecute, testsToEnforce, gremlinFlavorSuite, TraversalEngine.Type.STANDARD);
     }
 
-    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce,
+    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, Class<?>[] testsToExecute, final Class<?>[] testsToEnforce,
                                 final boolean gremlinFlavorSuite, TraversalEngine.Type traversalEngineType) throws InitializationError {
         super(builder, klass, enforce(testsToExecute, testsToEnforce));
 
@@ -144,7 +144,12 @@ public abstract class AbstractGremlinSuite extends Suite {
         }
     }
 
-    private static Class<?>[] enforce(final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce) {
+    private static Class<?>[] enforce(final Class<?>[] unfilteredTestsToExecute, final Class<?>[] unfilteredTestsToEnforce) {
+        // Allow env var to filter the test lists.
+        final Class<?>[] testsToExecute = filterSpecifiedTests(unfilteredTestsToExecute);
+        final Class<?>[] testsToEnforce = filterSpecifiedTests(unfilteredTestsToEnforce);
+
+        // If there are no tests specified to enforce, enforce them all.
         if (null == testsToEnforce) return testsToExecute;
 
         // examine each test to enforce and ensure an instance of it is in the list of testsToExecute
@@ -158,6 +163,26 @@ public abstract class AbstractGremlinSuite extends Suite {
         return testsToExecute;
     }
 
+    /**
+     * Filter a list of test classes through the gremlin.tests environment variable list.
+     */
+    private static Class<?>[] filterSpecifiedTests(Class<?>[] allTests) {
+        if (null == allTests) return allTests;
+
+        Class<?>[] filteredTests;
+        final String override = System.getenv().getOrDefault("gremlin.tests", "");
+        if (override.equals(""))
+            filteredTests = allTests;
+        else {
+            final List<String> filters = Arrays.asList(override.split(","));
+            final List<Class<?>> allowed = Stream.of(allTests)
+                    .filter(c -> filters.contains(c.getName()))
+                    .collect(Collectors.toList());
+            filteredTests = allowed.toArray(new Class<?>[allowed.size()]);
+        }
+        return filteredTests;
+    }
+
     public static Pair<Class<? extends GraphProvider>, Class<? extends Graph>> getGraphProviderClass(final Class<?> klass) throws InitializationError {
         final GraphProviderClass annotation = klass.getAnnotation(GraphProviderClass.class);
         if (null == annotation)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 498d8b0..86ab157 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -175,27 +175,8 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
             SubgraphStrategyProcessTest.class
     };
 
-    /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
-     */
-    private static final Class<?>[] testsToExecute;
-
-    static {
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
-        if (override.equals(""))
-            testsToExecute = allTests;
-        else {
-            final List<String> filters = Arrays.asList(override.split(","));
-            final List<Class<?>> allowed = Stream.of(allTests)
-                    .filter(c -> filters.contains(c.getName()))
-                    .collect(Collectors.toList());
-            testsToExecute = allowed.toArray(new Class<?>[allowed.size()]);
-        }
-    }
-
     public ProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToExecute, false, TraversalEngine.Type.COMPUTER);
+        super(klass, builder, allTests, allTests, false, TraversalEngine.Type.COMPUTER);
     }
 
     public ProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce) throws InitializationError {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
index be6a3f5..e0619b1 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
@@ -37,16 +37,17 @@ import org.junit.runners.model.RunnerBuilder;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class ProcessPerformanceSuite extends AbstractGremlinSuite {
+
     /**
      * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
      * as needed to enforce tests upon implementations.
      */
-    private static final Class<?>[] testsToExecute = new Class<?>[]{
+    private static final Class<?>[] allTests = new Class<?>[]{
             TraversalPerformanceTest.class
     };
 
     public ProcessPerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute);
+        super(klass, builder, allTests);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
index 2bed41d..645e599 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
@@ -184,27 +184,8 @@ public class ProcessStandardSuite extends AbstractGremlinSuite {
             SubgraphStrategyProcessTest.class
     };
 
-    /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
-     */
-    private static final Class<?>[] testsToExecute;
-
-    static {
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
-        if (override.equals(""))
-            testsToExecute = allTests;
-        else {
-            final List<String> filters = Arrays.asList(override.split(","));
-            final List<Class<?>> allowed = Stream.of(allTests)
-                    .filter(c -> filters.contains(c.getName()))
-                    .collect(Collectors.toList());
-            testsToExecute = allowed.toArray(new Class<?>[allowed.size()]);
-        }
-    }
-
     public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToExecute);
+        super(klass, builder, allTests, allTests);
     }
 
     public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce) throws InitializationError {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
index 4280c6b..5ef20cc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
@@ -33,17 +33,18 @@ import org.junit.runners.model.RunnerBuilder;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class StructurePerformanceSuite extends AbstractGremlinSuite {
+
     /**
      * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
      * as needed to enforce tests upon implementations.
      */
-    private static final Class<?>[] testsToExecute = new Class<?>[]{
+    private static final Class<?>[] allTests = new Class<?>[]{
             GraphWritePerformanceTest.class,
             GraphReadPerformanceTest.class
     };
 
     public StructurePerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute);
+        super(klass, builder, allTests);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4e9c94ac/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
index b6e7f73..37cbe29 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
@@ -66,6 +66,10 @@ import java.util.stream.Stream;
  */
 public class StructureStandardSuite extends AbstractGremlinSuite {
 
+    /**
+     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
+     * as needed to enforce tests upon implementations.
+     */
     private static final Class<?>[] allTests = new Class<?>[]{
             BatchTest.class,
             CommunityGeneratorTest.class,
@@ -91,26 +95,7 @@ public class StructureStandardSuite extends AbstractGremlinSuite {
             VertexTest.class
     };
 
-    /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
-     */
-    private static final Class<?>[] testsToExecute;
-
-    static {
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
-        if (override.equals(""))
-            testsToExecute = allTests;
-        else {
-            final List<String> filters = Arrays.asList(override.split(","));
-            final List<Class<?>> allowed = Stream.of(allTests)
-                    .filter(c -> filters.contains(c.getName()))
-                    .collect(Collectors.toList());
-            testsToExecute = allowed.toArray(new Class<?>[allowed.size()]);
-        }
-    }
-
     public StructureStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, testsToExecute);
+        super(klass, builder, allTests);
     }
 }


[19/50] incubator-tinkerpop git commit: Merge branch 'TINKERPOP3-630' of https://github.com/BrynCooke/incubator-tinkerpop

Posted by sp...@apache.org.
Merge branch 'TINKERPOP3-630' of https://github.com/BrynCooke/incubator-tinkerpop


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

Branch: refs/heads/variables
Commit: fe7c56c30ff1df0c5a100f930936a1c4a20ef3ea
Parents: 13b936e 58fde21
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 09:09:16 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 09:09:16 2015 -0400

----------------------------------------------------------------------
 .../groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[09/50] incubator-tinkerpop git commit: Add test for has() step to cover a lookup over a toString'd id.

Posted by sp...@apache.org.
Add test for has() step to cover a lookup over a toString'd id.


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

Branch: refs/heads/variables
Commit: 3e05764955c8974ac5eed17e1121d4e29e70a1f4
Parents: bb86121
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 16:37:42 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 16:37:42 2015 -0400

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/filter/HasTest.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3e057649/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
index 7e898de..b26af93 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
@@ -153,6 +153,17 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
     @LoadGraphWith(MODERN)
     public void g_VX1X_out_hasXid_2X() {
         final Traversal<Vertex, Vertex> traversal = get_g_VX1X_out_hasIdX2X(convertToVertexId("marko"), convertToVertexId("vadas"));
+        assert_g_VX1X_out_hasXid_2X(traversal);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_VX1AsStringX_out_hasXid_2AsStringX() {
+        final Traversal<Vertex, Vertex> traversal = get_g_VX1X_out_hasIdX2X(convertToVertexId("marko").toString(), convertToVertexId("vadas").toString());
+        assert_g_VX1X_out_hasXid_2X(traversal);
+    }
+
+    private void assert_g_VX1X_out_hasXid_2X(Traversal<Vertex, Vertex> traversal) {
         printTraversalForm(traversal);
         assertTrue(traversal.hasNext());
         assertEquals(convertToVertexId("vadas"), traversal.next().id());


[03/50] incubator-tinkerpop git commit: Finalize some local variables in CoreTraversalTest.

Posted by sp...@apache.org.
Finalize some local variables in CoreTraversalTest.


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

Branch: refs/heads/variables
Commit: fe65dec76c6adcd4da7c23539da172474fb69ecd
Parents: 975004c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 13:47:09 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 13:47:09 2015 -0400

----------------------------------------------------------------------
 .../process/traversal/CoreTraversalTest.java    | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/fe65dec7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/CoreTraversalTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/CoreTraversalTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/CoreTraversalTest.java
index 75216a1..c98489a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/CoreTraversalTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/CoreTraversalTest.java
@@ -53,9 +53,9 @@ public class CoreTraversalTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void shouldLoadVerticesViaIds() {
-        List<Vertex> vertices = g.V().toList();
-        List<Object> ids = vertices.stream().map(v->v.id()).collect(Collectors.toList());
-        List<Vertex> verticesReloaded = g.V(ids.toArray()).toList();
+        final List<Vertex> vertices = g.V().toList();
+        final List<Object> ids = vertices.stream().map(v->v.id()).collect(Collectors.toList());
+        final List<Vertex> verticesReloaded = g.V(ids.toArray()).toList();
         assertEquals(vertices.size(), verticesReloaded.size());
         assertEquals(new HashSet<>(vertices), new HashSet<>(verticesReloaded));
     }
@@ -63,9 +63,9 @@ public class CoreTraversalTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void shouldLoadEdgesViaIds() {
-        List<Edge> edges = g.E().toList();
-        List<Object> ids = edges.stream().map(e->e.id()).collect(Collectors.toList());
-        List<Edge> edgesReloaded = g.E(ids.toArray()).toList();
+        final List<Edge> edges = g.E().toList();
+        final List<Object> ids = edges.stream().map(e->e.id()).collect(Collectors.toList());
+        final List<Edge> edgesReloaded = g.E(ids.toArray()).toList();
         assertEquals(edges.size(), edgesReloaded.size());
         assertEquals(new HashSet<>(edges), new HashSet<>(edgesReloaded));
     }
@@ -73,8 +73,8 @@ public class CoreTraversalTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void shouldLoadVerticesViaVertices() {
-        List<Vertex> vertices = g.V().toList();
-        List<Vertex> verticesReloaded = g.V(vertices.toArray()).toList();
+        final List<Vertex> vertices = g.V().toList();
+        final List<Vertex> verticesReloaded = g.V(vertices.toArray()).toList();
         assertEquals(vertices.size(), verticesReloaded.size());
         assertEquals(new HashSet<>(vertices), new HashSet<>(verticesReloaded));
     }
@@ -82,8 +82,8 @@ public class CoreTraversalTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void shouldLoadEdgesViaEdges() {
-        List<Edge> edges = g.E().toList();
-        List<Edge> edgesReloaded = g.E(edges.toArray()).toList();
+        final List<Edge> edges = g.E().toList();
+        final List<Edge> edgesReloaded = g.E(edges.toArray()).toList();
         assertEquals(edges.size(), edgesReloaded.size());
         assertEquals(new HashSet<>(edges), new HashSet<>(edgesReloaded));
     }
@@ -91,7 +91,7 @@ public class CoreTraversalTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void shouldThrowExceptionWhenIdsMixed() {
-        List<Vertex> vertices = g.V().toList();
+        final List<Vertex> vertices = g.V().toList();
         try {
             g.V(vertices.get(0), vertices.get(1).id()).toList();
         } catch (Exception ex) {


[26/50] incubator-tinkerpop git commit: Update changelog.

Posted by sp...@apache.org.
Update changelog.


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

Branch: refs/heads/variables
Commit: f86aaaa45457c36d5acdcc5e3cf54978d05db7c6
Parents: 60c2e70
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 13:58:56 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 13:58:56 2015 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f86aaaa4/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 5c884ba..8e0bf18 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ TinkerPop 3.0.0.M9 (NOT OFFICIALLY RELEASED YET)
 * Removed `back()`-step as `select()`-step provides the same behavior with more intelligent optimizations and `by()`-modulation.
 * Removed `Graph.Helper` method annotation and related infrastructure in tests.
 * Moved `Exceptions.propertyRemovalNotSupported` from `Element` to `Property` for consistency.
+* Provided a method for Gremlin Server to bind `TraversalSource` objects for use in scripts.
 * Modified the reference implementation for dealing with "custom" identifier serialization in GraphSON - See `IoTest.CustomId` for the example.
 * Modified `g.vertices/edges` and related methods and tests to support non-type specific querying (e.g. `g.V(1)` and `g.V(1L)` should both return the same result now).
 * `TinkerGraph` supports an `IdManager` which helps enforce identifier types and improve flexibility in terms of how it will respond to queries around identifiers.


[27/50] incubator-tinkerpop git commit: added Ketria acknowledgment and logo.

Posted by sp...@apache.org.
added Ketria acknowledgment and logo.


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

Branch: refs/heads/variables
Commit: 8c131e121a5ee309084ef41996f6ba3de02178ff
Parents: f86aaaa
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 14 12:21:33 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 14 12:21:41 2015 -0600

----------------------------------------------------------------------
 docs/src/acknowledgements.asciidoc        |   2 +-
 docs/static/images/ketrina-tinkerpop3.png | Bin 0 -> 646438 bytes
 2 files changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8c131e12/docs/src/acknowledgements.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/acknowledgements.asciidoc b/docs/src/acknowledgements.asciidoc
index ec2f81a..4b151de 100644
--- a/docs/src/acknowledgements.asciidoc
+++ b/docs/src/acknowledgements.asciidoc
@@ -22,6 +22,6 @@ image:yourkit-logo.png[width=200,float=left] YourKit supports the TinkerPop open
 
 image:egg-logo.png[width=200,float=left] link:http://incubator.apache.org/projects/tinkerpop.html[Apache TinkerPop] is an effort undergoing incubation at link:http://apache.org[The Apache Software Foundation] (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. Apache TinkerPop is distributed under the Apache License v2.0.
 
-link:http://ketrinayim.com[Ketrina Yim] -- The TinkerPop's cartoonist and logo designer.
+image:ketrina-tinkerpop3.png[width=150,float=right] link:http://ketrinayim.tumblr.com[Ketrina Yim] -- Designing Gremlin and his friends for TinkerPop was one of my first major projects as a freelancer, and it's delightful to see them on the Web and all over the documentation! Drawing and tweaking the characters over time is like watching them grow up. They've gone from sketches on paper to full-color logos, and from logos to living characters that cheerfully greet visitors to the TinkerPop website. And it's been a great time all throughout!
 
 ...in the beginning. 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8c131e12/docs/static/images/ketrina-tinkerpop3.png
----------------------------------------------------------------------
diff --git a/docs/static/images/ketrina-tinkerpop3.png b/docs/static/images/ketrina-tinkerpop3.png
new file mode 100644
index 0000000..af8c1ed
Binary files /dev/null and b/docs/static/images/ketrina-tinkerpop3.png differ


[36/50] incubator-tinkerpop git commit: Use GREMLIN_TESTS because uppercase env var is more normal

Posted by sp...@apache.org.
Use GREMLIN_TESTS because uppercase env var is more normal


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

Branch: refs/heads/variables
Commit: 5d8224a8bf75ec760bf8bfebeeaeff16e9b28f9c
Parents: 5675fed
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Tue Apr 14 22:10:31 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Tue Apr 14 22:10:31 2015 -0700

----------------------------------------------------------------------
 README.asciidoc                                                  | 4 ++--
 .../java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5d8224a8/README.asciidoc
----------------------------------------------------------------------
diff --git a/README.asciidoc b/README.asciidoc
index e0d3948..92d966c 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -31,10 +31,10 @@ Building and Testing
 ~~~~~~~~~~~~~~~~~~~~
 
 * Build Project: `mvn clean install`
-** Specify specific tests in a TinkerPop Suite to run with the `gremlin_tests` environment variable, along with the Maven project list argument, e.g.:
+** Specify specific tests in a TinkerPop Suite to run with the `GREMLIN_TESTS` environment variable, along with the Maven project list argument, e.g.:
 +
 ----
-export gremlin_tests='org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest$Traversals,org.apache.tinkerpop.gremlin.process.traversal.step.util.PathTest'
+export GREMLIN_TESTS='org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest$Traversals,org.apache.tinkerpop.gremlin.process.traversal.step.util.PathTest'
 mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
 ----
 *** Including a specific test may require its inner class implementation (e.g. `org.apache.tinkerpop.gremlin....UnionTest$ComputerTest`).

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5d8224a8/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
index c3edeed..4d0cfa6 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
@@ -164,13 +164,13 @@ public abstract class AbstractGremlinSuite extends Suite {
     }
 
     /**
-     * Filter a list of test classes through the gremlin_tests environment variable list.
+     * Filter a list of test classes through the GREMLIN_TESTS environment variable list.
      */
     private static Class<?>[] filterSpecifiedTests(Class<?>[] allTests) {
         if (null == allTests) return allTests;
 
         Class<?>[] filteredTests;
-        final String override = System.getenv().getOrDefault("gremlin_tests", "");
+        final String override = System.getenv().getOrDefault("GREMLIN_TESTS", "");
         if (override.equals(""))
             filteredTests = allTests;
         else {


[47/50] incubator-tinkerpop git commit: added ShellGraph so Graph.empty() is no longer needed. Its a placeholder for the graphClass and computer in OLAP situations.

Posted by sp...@apache.org.
added ShellGraph so Graph.empty() is no longer needed. Its a placeholder for the graphClass and computer in OLAP situations.


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

Branch: refs/heads/variables
Commit: 23c95c3e792d3842d2b036a1b136ceafb2c8a14b
Parents: 6318053
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Apr 15 09:26:24 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Apr 15 09:26:33 2015 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../traversal/TraversalScriptSupplier.java      |   3 +-
 .../process/computer/util/ShellGraph.java       | 283 +++++++++++++++++++
 .../process/traversal/TraversalStrategies.java  |  13 +-
 .../dsl/graph/GraphTraversalSource.java         |   5 +-
 .../traversal/util/DefaultTraversal.java        |   2 +-
 .../tinkerpop/gremlin/structure/Graph.java      |   8 -
 .../computer/example/TraversalSupplier1.java    |   3 +-
 .../computer/example/TraversalSupplier2.java    |   3 +-
 .../computer/example/TraversalSupplier3.java    |   3 +-
 .../gremlin/hadoop/structure/HadoopGraph.java   |   6 -
 11 files changed, 305 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7fcf628..db78b78 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.0.M9 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `Graph.empty()` no longer required with the introduction of `ShellGraph` which is a placeholder for a graph class and computer.
 * `VertexProperty.Cardinality` default is now vendor chosen. If the vendor has not preference, they should use `Cardinality.single`.
 * `Messenger.receiveMessages()` no longer takes a `MessageScope` and thus, consistent behavior between message-passing and message-pulling systems.
 * Changed the `gremlin.tests` environment variable for test filtering to the more standard convention of `GREMLIN_TESTS` and made it work for all test suites.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
index 03e0afc..3e5179d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.computer.traversal;
 
+import org.apache.tinkerpop.gremlin.process.computer.util.ShellGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.computer.util.ScriptEngineCache;
@@ -50,7 +51,7 @@ public final class TraversalScriptSupplier<S, E> implements Supplier<Traversal.A
         try {
             final ScriptEngine engine = ScriptEngineCache.get(this.scriptEngineName);
             final Bindings bindings = engine.createBindings();
-            bindings.put("g", this.traversalContextBuilder.create(Graph.empty(this.graphClass)));
+            bindings.put("g", this.traversalContextBuilder.create(new ShellGraph(this.graphClass)));
             return (Traversal.Admin<S, E>) engine.eval(this.traversalScript, bindings);
         } catch (final ScriptException e) {
             throw new IllegalStateException(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
new file mode 100644
index 0000000..e03be95
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
@@ -0,0 +1,283 @@
+/*
+ *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  * http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *
+ */
+
+package org.apache.tinkerpop.gremlin.process.computer.util;
+
+import org.apache.commons.configuration.BaseConfiguration;
+import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.process.computer.ComputerResult;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
+import org.apache.tinkerpop.gremlin.process.computer.MapReduce;
+import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.concurrent.Future;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class ShellGraph implements Graph, Serializable {
+
+    private final Class<? extends Graph> graphClass;
+    public static final String SHELL_GRAPH_CLASS = "shell.graphClass";
+
+    public ShellGraph(final Class<? extends Graph> graphClass) {
+        this.graphClass = graphClass;
+    }
+
+    @Override
+    public Vertex addVertex(final Object... keyValues) {
+        throw Exceptions.vertexAdditionsNotSupported();
+    }
+
+    @Override
+    public <C extends GraphComputer> C compute(final Class<C> graphComputerClass) throws IllegalArgumentException {
+        return (C) ShellGraphComputer.instance();
+    }
+
+    @Override
+    public GraphComputer compute() throws IllegalArgumentException {
+        return ShellGraphComputer.instance();
+    }
+
+    @Override
+    public Iterator<Vertex> vertices(final Object... vertexIds) {
+        return Collections.emptyIterator();
+    }
+
+    @Override
+    public Iterator<Edge> edges(final Object... edgeIds) {
+        return Collections.emptyIterator();
+    }
+
+    @Override
+    public Transaction tx() {
+        throw Exceptions.transactionsNotSupported();
+    }
+
+    @Override
+    public Variables variables() {
+        throw Exceptions.variablesNotSupported();
+    }
+
+    @Override
+    public Configuration configuration() {
+        final Configuration configuration = new BaseConfiguration();
+        configuration.setProperty(Graph.GRAPH, ShellGraph.class.getName());
+        configuration.setProperty(SHELL_GRAPH_CLASS, this.graphClass);
+        return configuration;
+    }
+
+    @Override
+    public void close() throws Exception {
+
+    }
+
+    public Class<? extends Graph> getGraphClass() {
+        return this.graphClass;
+    }
+
+    public static ShellGraph open(final Configuration configuration) {
+        return new ShellGraph((Class<? extends Graph>) configuration.getProperty(SHELL_GRAPH_CLASS));
+    }
+
+    public static ShellGraph of(final Class<? extends Graph> graphClass) {
+        return new ShellGraph(graphClass);
+    }
+
+    private static class ShellGraphComputer implements GraphComputer {
+
+        private static final ShellGraphComputer INSTANCE = new ShellGraphComputer();
+
+        @Override
+        public GraphComputer isolation(final Isolation isolation) {
+            return this;
+        }
+
+        @Override
+        public GraphComputer result(final ResultGraph resultGraph) {
+            return this;
+        }
+
+        @Override
+        public GraphComputer persist(final Persist persist) {
+            return this;
+        }
+
+        @Override
+        public GraphComputer program(final VertexProgram vertexProgram) {
+            return this;
+        }
+
+        @Override
+        public GraphComputer mapReduce(final MapReduce mapReduce) {
+            return this;
+        }
+
+        @Override
+        public Future<ComputerResult> submit() {
+            throw new UnsupportedOperationException(ShellGraphComputer.class.getCanonicalName() + " can not be executed as it is simply a placeholder");
+        }
+
+        public static ShellGraphComputer instance() {
+            return INSTANCE;
+        }
+    }
+
+    public class Features implements Graph.Features {
+
+        @Override
+        public GraphFeatures graph() {
+            return new GraphFeatures() {
+                @Override
+                public boolean supportsComputer() {
+                    return true;
+                }
+
+                @Override
+                public boolean supportsPersistence() {
+                    return false;
+                }
+
+                @Override
+                public boolean supportsTransactions() {
+                    return false;
+                }
+
+                @Override
+                public boolean supportsThreadedTransactions() {
+                    return false;
+                }
+
+                @Override
+                public VariableFeatures variables() {
+                    return new VariableFeatures() {
+                        @Override
+                        public boolean supportsVariables() {
+                            return false;
+                        }
+                    };
+                }
+            };
+        }
+
+        @Override
+        public VertexFeatures vertex() {
+            return new VertexFeatures() {
+                @Override
+                public boolean supportsAddVertices() {
+                    return false;
+                }
+
+                @Override
+                public boolean supportsRemoveVertices() {
+                    return false;
+                }
+
+                @Override
+                public boolean supportsMultiProperties() {
+                    return false;
+                }
+
+                @Override
+                public boolean supportsMetaProperties() {
+                    return false;
+                }
+
+                @Override
+                public VertexPropertyFeatures properties() {
+                    return new VertexPropertyFeatures() {
+                        @Override
+                        public boolean supportsAddProperty() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsRemoveProperty() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsUserSuppliedIds() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsNumericIds() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsStringIds() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsUuidIds() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsCustomIds() {
+                            return false;
+                        }
+
+                        @Override
+                        public boolean supportsAnyIds() {
+                            return false;
+                        }
+                    };
+                }
+            };
+        }
+
+        @Override
+        public EdgeFeatures edge() {
+            return new EdgeFeatures() {
+                @Override
+                public boolean supportsAddEdges() {
+                    return false;
+                }
+
+                @Override
+                public boolean supportsRemoveEdges() {
+                    return false;
+                }
+
+                @Override
+                public EdgePropertyFeatures properties() {
+                    return new EdgePropertyFeatures() {
+                        @Override
+                        public boolean supportsProperties() {
+                            return false;
+                        }
+                    };
+                }
+            };
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index 8bd3446..92bc7b5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -18,18 +18,19 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal;
 
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComparatorHolderRemovalStrategy;
+import org.apache.tinkerpop.gremlin.process.computer.util.ShellGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.ConjunctionStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.DedupOptimizerStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EngineDependentStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IdentityRemovalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LabeledEndStepStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchWhereStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.ProfileStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RangeByIsCountStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComparatorHolderRemovalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EngineDependentStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LabeledEndStepStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.TraversalVerificationStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory;
+import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
 import org.apache.tinkerpop.gremlin.util.tools.MultiMap;
@@ -190,6 +191,10 @@ public interface TraversalStrategies extends Serializable, Cloneable {
             }
             return traversalStrategies;
         }
+
+        public static Class<? extends Graph> getGraphClass(final Graph graph) {
+            return graph instanceof ShellGraph ? ((ShellGraph) graph).getGraphClass() : graph.getClass();
+        }
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index 00090e8..0dd884f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -68,7 +68,7 @@ public class GraphTraversalSource implements TraversalSource {
         this.engine = engine;
         this.withStrategies = withStrategies;
         this.withoutStrategies = withoutStrategies;
-        final TraversalStrategies tempStrategies = TraversalStrategies.GlobalCache.getStrategies(this.graph.getClass());
+        final TraversalStrategies tempStrategies = TraversalStrategies.GlobalCache.getStrategies(TraversalStrategies.GlobalCache.getGraphClass(this.graph));
         this.strategies = withStrategies.isEmpty() && withoutStrategies.isEmpty() ?
                 tempStrategies :
                 tempStrategies.clone()
@@ -137,7 +137,8 @@ public class GraphTraversalSource implements TraversalSource {
         private List<TraversalStrategy> withStrategies = null;
         private List<Class<? extends TraversalStrategy>> withoutStrategies = null;
 
-        private Builder() {}
+        private Builder() {
+        }
 
         @Override
         public Builder engine(final TraversalEngine.Builder engineBuilder) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
index 71e286d..6e9f653 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
@@ -58,7 +58,7 @@ public class DefaultTraversal<S, E> implements Traversal.Admin<S, E> {
 
     public DefaultTraversal(final Graph graph) {
         this.graph = graph;
-        this.setStrategies(TraversalStrategies.GlobalCache.getStrategies(this.graph.getClass()));
+        this.setStrategies(TraversalStrategies.GlobalCache.getStrategies(TraversalStrategies.GlobalCache.getGraphClass(this.graph)));
         this.traversalEngine = StandardTraversalEngine.instance(); // TODO: remove and then clean up v.outE
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
index 8c0acf5..f01441c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
@@ -108,14 +108,6 @@ public interface Graph extends AutoCloseable {
         }
     }
 
-    public static <G extends Graph> G empty(final Class<G> graphClass) {
-        try {
-            return (G) graphClass.getMethod("empty").invoke(null);
-        } catch (final Exception e) {
-            throw new IllegalArgumentException(e.getMessage(), e);
-        }
-    }
-
     /**
      * Add a {@link Vertex} to the graph given an optional series of key/value pairs.  These key/values
      * must be provided in an even number where the odd numbered arguments are {@link String} property keys and the

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier1.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier1.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier1.java
index 4429a4b..f5d19c2 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier1.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier1.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.hadoop.process.computer.example;
 
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.process.computer.util.ShellGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 
 import java.util.function.Supplier;
@@ -29,6 +30,6 @@ import java.util.function.Supplier;
 public class TraversalSupplier1 implements Supplier<Traversal> {
     @Override
     public Traversal get() {
-        return HadoopGraph.empty().traversal().V().out().out().values("name");
+        return ShellGraph.of(HadoopGraph.class).traversal().V().out().out().values("name");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier2.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier2.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier2.java
index 2bb0cf2..7636495 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier2.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier2.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.hadoop.process.computer.example;
 
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.process.computer.util.ShellGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 
 import java.util.function.Supplier;
@@ -29,6 +30,6 @@ import java.util.function.Supplier;
 public class TraversalSupplier2 implements Supplier<Traversal> {
     @Override
     public Traversal get() {
-        return HadoopGraph.empty().traversal().V().<String>values("name").map(s -> s.get().length()).groupCount().<Integer>by(i -> i + 100);
+        return ShellGraph.of(HadoopGraph.class).traversal().V().<String>values("name").map(s -> s.get().length()).groupCount().<Integer>by(i -> i + 100);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier3.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier3.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier3.java
index 1d768f2..296937f 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier3.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/example/TraversalSupplier3.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.hadoop.process.computer.example;
 
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.process.computer.util.ShellGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 
 import java.util.Collection;
@@ -30,6 +31,6 @@ import java.util.function.Supplier;
 public class TraversalSupplier3 implements Supplier<Traversal> {
     @Override
     public Traversal get() {
-        return HadoopGraph.empty().traversal().V().<String>values("name").group().<String>by(s -> s.substring(1, 2)).by(v -> v).<Collection>by(Collection::size);
+        return ShellGraph.of(HadoopGraph.class).traversal().V().<String>values("name").group().<String>by(s -> s.substring(1, 2)).by(v -> v).<Collection>by(Collection::size);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/23c95c3e/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
index e1fa5b3..3999d80 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
@@ -126,8 +126,6 @@ public class HadoopGraph implements Graph {
 
     public static final Logger LOGGER = LoggerFactory.getLogger(HadoopGraph.class);
 
-    private static final HadoopGraph EMPTY = HadoopGraph.open();
-
     private static final Configuration EMPTY_CONFIGURATION = new BaseConfiguration() {{
         this.setProperty(Graph.GRAPH, HadoopGraph.class.getName());
     }};
@@ -138,10 +136,6 @@ public class HadoopGraph implements Graph {
         this.configuration = new HadoopConfiguration(configuration);
     }
 
-    public static HadoopGraph empty() {
-        return EMPTY;
-    }
-
     public static HadoopGraph open() {
         return HadoopGraph.open(null);
     }


[17/50] incubator-tinkerpop git commit: TINKERPOP3-630 Remove hard coded id from groovy script that causes graphs other then TinkerGraph to fail.

Posted by sp...@apache.org.
TINKERPOP3-630
Remove hard coded id from groovy script that causes graphs other then TinkerGraph to fail.


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

Branch: refs/heads/variables
Commit: 58fde21c1703c526d88e329197a0039766d97250
Parents: cc0b848
Author: Bryn Cooke <br...@gmail.com>
Authored: Tue Apr 14 13:49:02 2015 +0100
Committer: Bryn Cooke <br...@gmail.com>
Committed: Tue Apr 14 13:49:02 2015 +0100

----------------------------------------------------------------------
 .../groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/58fde21c/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
index 92bdf27..da24479 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
@@ -255,7 +255,7 @@ public class GremlinGroovyScriptEngineOverGraphTest extends AbstractGremlinTest
 
         }
 
-        assertEquals(true, engine.eval("def isMarko(v){v.value('name')=='marko'}; isMarko(g.V(1).next())", bindings));
+        assertEquals(true, engine.eval("def isMarko(v){v.value('name')=='marko'}; isMarko(g.V(" + convertToVertexId("marko") + ").next())", bindings));
 
         try {
             engine.eval("isMarko(g.V(" + convertToVertexId("marko") + ").next())", bindings);


[37/50] incubator-tinkerpop git commit: Fixed GraphTest mis-types to properly assert edges instad of vertices per TINKERPOP3-637

Posted by sp...@apache.org.
Fixed GraphTest mis-types to properly assert edges instad of vertices per TINKERPOP3-637


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

Branch: refs/heads/variables
Commit: c13c9ba7b7682cac82545b680dc5213003f88ba7
Parents: 294c1d5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 07:24:00 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 07:24:00 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/tinkerpop/gremlin/structure/GraphTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c13c9ba7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index 13062b8..457e235 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -1209,7 +1209,7 @@ public class GraphTest extends AbstractGremlinTest {
         final Edge e2 = v.addEdge("self", v);
         v.addEdge("self", v);
         tryCommit(graph, graph -> {
-            assertEquals(2, IteratorUtils.count(graph.vertices(e1, e2)));
+            assertEquals(2, IteratorUtils.count(graph.edges(e1, e2)));
         });
     }
 
@@ -1223,7 +1223,7 @@ public class GraphTest extends AbstractGremlinTest {
         final Edge e2 = v.addEdge("self", v);
         v.addEdge("self", v);
         tryCommit(graph, graph -> {
-            assertEquals(2, IteratorUtils.count(graph.vertices(e1.id(), e2.id())));
+            assertEquals(2, IteratorUtils.count(graph.edges(e1.id(), e2.id())));
         });
     }
 
@@ -1237,7 +1237,7 @@ public class GraphTest extends AbstractGremlinTest {
         final Edge e2 = v.addEdge("self", v);
         v.addEdge("self", v);
         tryCommit(graph, graph -> {
-            assertEquals(2, IteratorUtils.count(graph.vertices(e1.id().toString(), e2.id().toString())));
+            assertEquals(2, IteratorUtils.count(graph.edges(e1.id().toString(), e2.id().toString())));
         });
     }
 


[24/50] incubator-tinkerpop git commit: Update instructions for running selected tests

Posted by sp...@apache.org.
Update instructions for running selected tests


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

Branch: refs/heads/variables
Commit: 5675fed98512a6a5fcecce77abe509fb09ef2937
Parents: 6556e19
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Tue Apr 14 10:28:20 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Tue Apr 14 10:57:01 2015 -0700

----------------------------------------------------------------------
 README.asciidoc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5675fed9/README.asciidoc
----------------------------------------------------------------------
diff --git a/README.asciidoc b/README.asciidoc
index 8b0373e..e0d3948 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -31,7 +31,13 @@ Building and Testing
 ~~~~~~~~~~~~~~~~~~~~
 
 * Build Project: `mvn clean install`
-** Specify specific tests in a TinkerPop Suite to run: `mvn test -Dgremlin.tests={test class 1, test class 2...}` - note that including a specific test may require its inner class implementation (e.g. `org.apache.tinkerpop.gremlin....UnionTest$ComputerTest`)
+** Specify specific tests in a TinkerPop Suite to run with the `gremlin_tests` environment variable, along with the Maven project list argument, e.g.:
++
+----
+export gremlin_tests='org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest$Traversals,org.apache.tinkerpop.gremlin.process.traversal.step.util.PathTest'
+mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
+----
+*** Including a specific test may require its inner class implementation (e.g. `org.apache.tinkerpop.gremlin....UnionTest$ComputerTest`).
 ** Clean the `.groovy/grapes/org.apache.tinkerpop` directory on build: `mvn clean install -DcleanGrapes`
 * Regenerate test data (only necessary given changes to IO classes): `mvn clean install -Dio` from `tinkergraph-gremlin` directory
 * Check license headers are present: `mvn apache-rat:check`


[40/50] incubator-tinkerpop git commit: Removed line regarding referencing a specific test case.

Posted by sp...@apache.org.
Removed line regarding referencing a specific test case.

It is implied in the example code above.


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

Branch: refs/heads/variables
Commit: 976cb5e7bcefe885deaecba27d011be5b68b57d4
Parents: 2fd0598
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 08:23:35 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 08:23:35 2015 -0400

----------------------------------------------------------------------
 README.asciidoc | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/976cb5e7/README.asciidoc
----------------------------------------------------------------------
diff --git a/README.asciidoc b/README.asciidoc
index 92d966c..d3d81b8 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -37,7 +37,6 @@ Building and Testing
 export GREMLIN_TESTS='org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest$Traversals,org.apache.tinkerpop.gremlin.process.traversal.step.util.PathTest'
 mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
 ----
-*** Including a specific test may require its inner class implementation (e.g. `org.apache.tinkerpop.gremlin....UnionTest$ComputerTest`).
 ** Clean the `.groovy/grapes/org.apache.tinkerpop` directory on build: `mvn clean install -DcleanGrapes`
 * Regenerate test data (only necessary given changes to IO classes): `mvn clean install -Dio` from `tinkergraph-gremlin` directory
 * Check license headers are present: `mvn apache-rat:check`


[43/50] incubator-tinkerpop git commit: Accidentally removed an OptIn on the last commit while testing - added back.

Posted by sp...@apache.org.
Accidentally removed an OptIn on the last commit while testing - added back.


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

Branch: refs/heads/variables
Commit: bf7779353934296646ad905300b6113657dab25d
Parents: ea4a49d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 10:19:29 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 10:19:29 2015 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf777935/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
index 9a29bae..5eb317d 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
@@ -56,6 +56,7 @@ import java.util.stream.Stream;
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD)
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER)
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_PERFORMANCE)
+@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_STANDARD)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_COMPUTER)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE)


[38/50] incubator-tinkerpop git commit: Used convertId in GraphTest checks of NoSuchElementException on Graph.vertices/edges #TINKERPOP3-633

Posted by sp...@apache.org.
Used convertId in GraphTest checks of NoSuchElementException on Graph.vertices/edges #TINKERPOP3-633

Remove two redundant tests from EdgeTest and VertexTest.


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

Branch: refs/heads/variables
Commit: db11d3b758376e596584e66ae781b2b7e3989109
Parents: c13c9ba
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 07:42:26 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 07:42:26 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/EdgeTest.java      |  6 ------
 .../tinkerpop/gremlin/structure/GraphTest.java     | 17 +++++++----------
 .../tinkerpop/gremlin/structure/VertexTest.java    |  6 ------
 3 files changed, 7 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/db11d3b7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
index 1511b75..ab41925 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
@@ -146,12 +146,6 @@ public class EdgeTest {
             }
         }
 
-        @Test(expected = NoSuchElementException.class)
-        @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
-        public void shouldThrowNoSuchElementExceptionIfEdgeWithIdNotPresent() {
-            g.E(graphProvider.convertId(100, Edge.class)).next();
-        }
-
         @Test
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/db11d3b7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index 457e235..4ca7eb0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -92,30 +92,28 @@ public class GraphTest extends AbstractGremlinTest {
     @Test
     public void shouldHaveExceptionConsistencyWhenFindVertexByIdThatIsNonExistentViaIterator() {
         try {
-            graph.vertices(10000l).next();
-            fail("Call to g.V(10000l) should throw an exception");
+            graph.vertices(graphProvider.convertId(10000l, Vertex.class)).next();
+            fail("Call to g.vertices(10000l) should throw an exception");
         } catch (Exception ex) {
-            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Vertex.class, 10000l).getClass()));
+            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Vertex.class, graphProvider.convertId(10000l, Vertex.class)).getClass()));
         }
-
     }
 
     @Test
     public void shouldHaveExceptionConsistencyWhenFindEdgeByIdThatIsNonExistentViaIterator() {
         try {
-            graph.edges(10000l).next();
-            fail("Call to g.E(10000l) should throw an exception");
+            graph.edges(graphProvider.convertId(10000l, Edge.class)).next();
+            fail("Call to g.edges(10000l) should throw an exception");
         } catch (Exception ex) {
-            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Edge.class, 10000l).getClass()));
+            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Edge.class, graphProvider.convertId(10000l, Edge.class)).getClass()));
         }
-
     }
 
     @Test
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
     public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnVertex() {
-        final Object o = GraphManager.getGraphProvider().convertId("1", Vertex.class);
+        final Object o = graphProvider.convertId("1", Vertex.class);
         graph.addVertex(T.id, o);
         try {
             graph.addVertex(T.id, o);
@@ -123,7 +121,6 @@ public class GraphTest extends AbstractGremlinTest {
         } catch (Exception ex) {
             assertThat(ex, instanceOf(Graph.Exceptions.vertexWithIdAlreadyExists(0).getClass()));
         }
-
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/db11d3b7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index b991762..6b52699 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -255,12 +255,6 @@ public class VertexTest {
             }
         }
 
-        @Test(expected = NoSuchElementException.class)
-        @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
-        public void shouldThrowNoSuchElementExceptionIfVertexWithIdNotPresent() {
-            graph.vertices(graphProvider.convertId(100, Vertex.class)).next();
-        }
-
         @Test
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)


[11/50] incubator-tinkerpop git commit: added string interning to StarGraph.

Posted by sp...@apache.org.
added string interning to StarGraph.


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

Branch: refs/heads/variables
Commit: 6a2a350c570094185912d2bc74c11baa2fbeed37
Parents: 36ce514
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Apr 13 14:41:16 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Apr 13 14:48:55 2015 -0600

----------------------------------------------------------------------
 .../gremlin/structure/util/star/StarGraph.java        | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6a2a350c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
index e3971a3..db7251b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
@@ -65,21 +65,11 @@ public final class StarGraph implements Graph {
 
     private final Map<Object, Map<String, Object>> edgeProperties = new HashMap<>();
     private final Map<Object, Map<String, Object>> metaProperties = new HashMap<>();
-    private final Map<String, String> keysAndLabels = new HashMap<>();
 
     public StarVertex getStarVertex() {
         return this.starVertex;
     }
 
-    private String getKeyOrLabel(final String keyOrLabel) {
-        String intern = this.keysAndLabels.get(keyOrLabel);
-        if (null == intern) {
-            this.keysAndLabels.put(keyOrLabel, keyOrLabel);
-            intern = keyOrLabel.intern();
-        }
-        return intern;
-    }
-
     @Override
     public Vertex addVertex(final Object... keyValues) {
         return null == this.starVertex ?
@@ -213,7 +203,7 @@ public final class StarGraph implements Graph {
 
         protected StarElement(final Object id, final String label) {
             this.id = id;
-            this.label = StarGraph.this.getKeyOrLabel(label);
+            this.label = label.intern();
         }
 
         @Override
@@ -625,7 +615,7 @@ public final class StarGraph implements Graph {
         private final Element element;
 
         public StarProperty(final String key, final V value, final Element element) {
-            this.key = StarGraph.this.getKeyOrLabel(key);
+            this.key = key.intern();
             this.value = value;
             this.element = element;
         }


[41/50] incubator-tinkerpop git commit: Update changelog.

Posted by sp...@apache.org.
Update changelog.


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

Branch: refs/heads/variables
Commit: af20879d33be82d089f05c1fb4ad360034e6d3f8
Parents: 976cb5e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 08:28:11 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 08:28:11 2015 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/af20879d/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 394641c..7fcf628 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ TinkerPop 3.0.0.M9 (NOT OFFICIALLY RELEASED YET)
 
 * `VertexProperty.Cardinality` default is now vendor chosen. If the vendor has not preference, they should use `Cardinality.single`.
 * `Messenger.receiveMessages()` no longer takes a `MessageScope` and thus, consistent behavior between message-passing and message-pulling systems.
+* Changed the `gremlin.tests` environment variable for test filtering to the more standard convention of `GREMLIN_TESTS` and made it work for all test suites.
 * Removed `back()`-step as `select()`-step provides the same behavior with more intelligent optimizations and `by()`-modulation.
 * Removed `Graph.Helper` method annotation and related infrastructure in tests.
 * Moved `Exceptions.propertyRemovalNotSupported` from `Element` to `Property` for consistency.


[12/50] incubator-tinkerpop git commit: Add edge related HasStep tests to enforce queries on edge id.

Posted by sp...@apache.org.
Add edge related HasStep tests to enforce queries on edge id.


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

Branch: refs/heads/variables
Commit: 54d909f8e5be41abe45c75eee9060e2297123eed
Parents: 6a2a350
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 17:04:42 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 17:04:42 2015 -0400

----------------------------------------------------------------------
 .../traversal/step/filter/GroovyHasTest.groovy  | 10 ++++++
 .../process/traversal/step/filter/HasTest.java  | 36 ++++++++++++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/54d909f8/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
index d4512cb..b587a30 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step.filter
 
+import org.apache.tinkerpop.gremlin.process.traversal.T
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal
 import org.apache.tinkerpop.gremlin.process.computer.ComputerTestHelper
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine
@@ -35,6 +36,11 @@ public abstract class GroovyHasTest {
     public static class StandardTraversals extends HasTest {
 
         @Override
+        public Traversal<Edge, Edge> get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e8Id) {
+            g.E(e11Id).outV.outE.has(T.id, e8Id);
+        }
+
+        @Override
         public Traversal<Vertex, String> get_g_V_outXknowsX_hasXoutXcreatedXX_name() {
             g.V.out('knows').has(__.out('created')).name
         }
@@ -112,6 +118,10 @@ public abstract class GroovyHasTest {
 
     @UseEngine(TraversalEngine.Type.COMPUTER)
     public static class ComputerTraversals extends HasTest {
+        @Override
+        public Traversal<Edge, Edge> get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e8Id) {
+            ComputerTestHelper.compute("g.E($e11Id).outV.outE.has(T.id, $e8Id)", g);
+        }
 
         @Override
         public Traversal<Vertex, String> get_g_V_outXknowsX_hasXoutXcreatedXX_name() {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/54d909f8/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
index b26af93..c036c1b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.filter;
 
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
+import org.apache.tinkerpop.gremlin.process.traversal.T;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.UseEngine;
@@ -27,12 +28,10 @@ import org.apache.tinkerpop.gremlin.structure.Compare;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.util.StreamFactory;
 import org.junit.Test;
 
 import java.util.Arrays;
 import java.util.List;
-import java.util.stream.Collectors;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.CREW;
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
@@ -68,6 +67,8 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Edge, Edge> get_g_E_hasLabelXknowsX();
 
+    public abstract Traversal<Edge, Edge> get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e8Id);
+
     public abstract Traversal<Edge, Edge> get_g_E_hasLabelXuses_traversesX();
 
     public abstract Traversal<Vertex, Vertex> get_g_V_hasLabelXperson_software_blahX();
@@ -255,10 +256,41 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
         assertFalse(traversal.hasNext());
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_EX11X_outV_outE_hasXid_10X() {
+        final Object edgeId11 = convertToEdgeId("josh", "created", "lop");
+        final Object edgeId10 = convertToEdgeId("josh", "created", "ripple");
+        final Traversal<Edge, Edge> traversal = get_g_EX11X_outV_outE_hasXid_10X(edgeId11, edgeId10);
+        assert_g_EX11X(edgeId10, traversal);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_EX11X_outV_outE_hasXid_10AsStringX() {
+        final Object edgeId11 = convertToEdgeId("josh", "created", "lop");
+        final Object edgeId10 = convertToEdgeId("josh", "created", "ripple");
+        final Traversal<Edge, Edge> traversal = get_g_EX11X_outV_outE_hasXid_10X(edgeId11.toString(), edgeId10.toString());
+        assert_g_EX11X(edgeId10, traversal);
+    }
+
+    private void assert_g_EX11X(final Object edgeId, final Traversal<Edge, Edge> traversal) {
+        printTraversalForm(traversal);
+        assertTrue(traversal.hasNext());
+        final Edge e = traversal.next();
+        assertEquals(edgeId, e.id());
+        assertFalse(traversal.hasNext());
+    }
+
     @UseEngine(TraversalEngine.Type.STANDARD)
     @UseEngine(TraversalEngine.Type.COMPUTER)
     public static class Traversals extends HasTest {
         @Override
+        public Traversal<Edge, Edge> get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e8Id) {
+            return g.E(e11Id).outV().outE().has(T.id, e8Id);
+        }
+
+        @Override
         public Traversal<Vertex, String> get_g_V_outXknowsX_hasXoutXcreatedXX_name() {
             return g.V().out("knows").has(out("created")).values("name");
         }


[46/50] incubator-tinkerpop git commit: Add test to make Groovy tests compliant with test enforcement of java tests.

Posted by sp...@apache.org.
Add test to make Groovy tests compliant with test enforcement of java tests.


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

Branch: refs/heads/variables
Commit: 63180535052e4f5c1782bee20270c493468aa802
Parents: 0f4fb31
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 10:41:11 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 10:41:11 2015 -0400

----------------------------------------------------------------------
 .../GroovyTraversalSideEffectsTest.groovy       | 35 ++++++++++++++++++++
 .../process/GroovyProcessStandardSuite.java     |  4 +++
 2 files changed, 39 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/63180535/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/GroovyTraversalSideEffectsTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/GroovyTraversalSideEffectsTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/GroovyTraversalSideEffectsTest.groovy
new file mode 100644
index 0000000..0f35473
--- /dev/null
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/GroovyTraversalSideEffectsTest.groovy
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.process.traversal
+
+import org.apache.tinkerpop.gremlin.process.UseEngine
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+abstract class GroovyTraversalSideEffectsTest {
+
+    @UseEngine(TraversalEngine.Type.STANDARD)
+    public static class StandardTraversals extends TraversalSideEffectsTest {
+        @Override
+        TraversalSideEffects get_g_V_asAdmin_getSideEffects() {
+            g.V.asAdmin().sideEffects
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/63180535/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
index 5fea4bc..e8303b2 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.GraphManager;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
 import org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest;
+import org.apache.tinkerpop.gremlin.process.traversal.GroovyTraversalSideEffectsTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyBranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyLocalTest;
@@ -149,6 +150,9 @@ public class GroovyProcessStandardSuite extends ProcessStandardSuite {
             GroovySubgraphTest.StandardTraversals.class,
             GroovyTreeTest.StandardTraversals.class,
 
+            // util
+            GroovyTraversalSideEffectsTest.StandardTraversals.class,
+
             // compliance
             CoreTraversalTest.class,
     };


[10/50] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master'

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/variables
Commit: 36ce5143da3bc602eb46d381c69ce1c8782c038d
Parents: 3e05764 70aaea7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 16:38:22 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 16:38:22 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/util/star/StarGraph.java        | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[33/50] incubator-tinkerpop git commit: CHANGELOG on Messenger.receivedMessages().

Posted by sp...@apache.org.
CHANGELOG on Messenger.receivedMessages().


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

Branch: refs/heads/variables
Commit: d86626c3a8e36150cb48209748ec29e13c528e53
Parents: daec1c3
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 14 16:25:59 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 14 16:25:59 2015 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d86626c3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 8e0bf18..b386d1d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.0.M9 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `Messenger.receiveMessages()` no longer takes a `MessageScope` and thus, consistent behavior between message-passing and message-pulling systems.
 * Removed `back()`-step as `select()`-step provides the same behavior with more intelligent optimizations and `by()`-modulation.
 * Removed `Graph.Helper` method annotation and related infrastructure in tests.
 * Moved `Exceptions.propertyRemovalNotSupported` from `Element` to `Property` for consistency.


[22/50] incubator-tinkerpop git commit: Change gremlin.tests to gremlin_tests

Posted by sp...@apache.org.
Change gremlin.tests to gremlin_tests

Bash env var names in the "export" syntax must be alphanumeric plus underscore.
Workarounds involving "env" syntax are cumbersome.


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

Branch: refs/heads/variables
Commit: 6556e1918750850fcd23fae918fa9b73e98531a9
Parents: 4e9c94a
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Tue Apr 14 10:18:29 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Tue Apr 14 10:18:29 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6556e191/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
index 6a7cbd9..c3edeed 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
@@ -164,13 +164,13 @@ public abstract class AbstractGremlinSuite extends Suite {
     }
 
     /**
-     * Filter a list of test classes through the gremlin.tests environment variable list.
+     * Filter a list of test classes through the gremlin_tests environment variable list.
      */
     private static Class<?>[] filterSpecifiedTests(Class<?>[] allTests) {
         if (null == allTests) return allTests;
 
         Class<?>[] filteredTests;
-        final String override = System.getenv().getOrDefault("gremlin.tests", "");
+        final String override = System.getenv().getOrDefault("gremlin_tests", "");
         if (override.equals(""))
             filteredTests = allTests;
         else {


[05/50] incubator-tinkerpop git commit: Add more tests to enforce type relaxation on queries in a traversal.

Posted by sp...@apache.org.
Add more tests to enforce type relaxation on queries in a traversal.


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

Branch: refs/heads/variables
Commit: f273a5655e6aa1ad5a0189d83c4f9f232954f847
Parents: 8d968fd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 14:07:05 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 14:07:05 2015 -0400

----------------------------------------------------------------------
 .../traversal/step/map/GroovyVertexTest.groovy  | 10 ++++++
 .../process/traversal/step/map/VertexTest.java  | 38 ++++++++++++++++++++
 2 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f273a565/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
index 2951c47..4edb264 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
@@ -62,6 +62,11 @@ public abstract class GroovyVertexTest {
         }
 
         @Override
+        public Traversal<Edge, Edge> get_g_EX11X(Object e11Id) {
+            g.E(e11Id);
+        }
+
+        @Override
         public Traversal<Vertex, Edge> get_g_VX1X_outE(final Object v1Id) {
             g.V(v1Id).outE
         }
@@ -191,6 +196,11 @@ public abstract class GroovyVertexTest {
         }
 
         @Override
+        public Traversal<Edge, Edge> get_g_EX11X(Object e11Id) {
+            ComputerTestHelper.compute("g.E($e11Id)", g)
+        }
+
+        @Override
         public Traversal<Vertex, Edge> get_g_VX1X_outE(final Object v1Id) {
             ComputerTestHelper.compute("g.V(${v1Id}).outE", g);
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f273a565/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
index 90a07ec..098615c 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
@@ -55,6 +55,8 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Edge, Edge> get_g_E();
 
+    public abstract Traversal<Edge, Edge> get_g_EX11X(final Object e11Id);
+
     public abstract Traversal<Vertex, Edge> get_g_VX1X_outE(final Object v1Id);
 
     public abstract Traversal<Vertex, Edge> get_g_VX2X_inE(final Object v2Id);
@@ -190,6 +192,30 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
+    public void g_EX11X() {
+        final Object edgeId = convertToEdgeId("josh", "created", "lop");
+        final Traversal<Edge, Edge> traversal = get_g_EX11X(edgeId);
+        assert_g_EX11X(edgeId, traversal);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_EX11AsStringX() {
+        final Object edgeId = convertToEdgeId("josh", "created", "lop");
+        final Traversal<Edge, Edge> traversal = get_g_EX11X(edgeId.toString());
+        assert_g_EX11X(edgeId, traversal);
+    }
+
+    private void assert_g_EX11X(final Object edgeId, final Traversal<Edge, Edge> traversal) {
+        printTraversalForm(traversal);
+        assertTrue(traversal.hasNext());
+        final Edge e = traversal.next();
+        assertEquals(edgeId, e.id());
+        assertFalse(traversal.hasNext());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
     public void g_VX1X_outE() {
         final Traversal<Vertex, Edge> traversal = get_g_VX1X_outE(convertToVertexId("marko"));
         printTraversalForm(traversal);
@@ -384,6 +410,13 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         assert_g_v1_outXknowsX(traversal);
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_VX1X_outXknowsAsStringIdX() {
+        final Traversal<Vertex, Vertex> traversal = get_g_VX1X_outXknowsX(convertToVertexId("marko").toString());
+        assert_g_v1_outXknowsX(traversal);
+    }
+
     private void assert_g_v1_outXknowsX(final Traversal<Vertex, Vertex> traversal) {
         printTraversalForm(traversal);
         int counter = 0;
@@ -609,5 +642,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         public Traversal<Vertex, Vertex> get_g_VX1X_to_XOUT_knowsX(final Object v1Id) {
             return g.V(v1Id).to(Direction.OUT, "knows");
         }
+
+        @Override
+        public Traversal<Edge, Edge> get_g_EX11X(final Object e11Id) {
+            return g.E(e11Id);
+        }
     }
 }


[35/50] incubator-tinkerpop git commit: minor fix -- but its a hack. sucks. will fix later.

Posted by sp...@apache.org.
minor fix -- but its a hack. sucks. will fix later.


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

Branch: refs/heads/variables
Commit: 294c1d5bd4bd316db363201a0e1e5f11faf6cb95
Parents: 46683cf
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 14 17:28:20 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 14 17:28:20 2015 -0600

----------------------------------------------------------------------
 .../gremlin/structure/util/detached/DetachedVertexProperty.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/294c1d5b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
index 484db13..8ee0759 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
@@ -129,7 +129,7 @@ public class DetachedVertexProperty<V> extends DetachedElement<Property<V>> impl
     }
 
     public static <V> VertexProperty<V> addTo(final Vertex vertex, final DetachedVertexProperty<V> detachedVertexProperty) {
-        final VertexProperty<V> vertexProperty = vertex.property(VertexProperty.Cardinality.list, detachedVertexProperty.key(), detachedVertexProperty.value());
+        final VertexProperty<V> vertexProperty = vertex.property(VertexProperty.Cardinality.single, detachedVertexProperty.key(), detachedVertexProperty.value()); // TODO: this isn't right, is it? (need to remove views from Spark/Giraph)
         detachedVertexProperty.properties().forEachRemaining(property -> vertexProperty.property(property.key(), property.value()));
         return vertexProperty;
     }


[15/50] incubator-tinkerpop git commit: Use Graph.io() to generate the GraphWriter implementations in performance tests.

Posted by sp...@apache.org.
Use Graph.io() to generate the GraphWriter implementations in performance tests.

This fixes a problem where vendors who implement this test would see failures due to their custom classes not being registered.


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

Branch: refs/heads/variables
Commit: 982780e80b2e866af6f73682d125ba2b40090e3f
Parents: b427960
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 07:57:06 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 07:57:06 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/GraphWritePerformanceTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/982780e8/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
index 1a9e4b0..28171be 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
@@ -95,7 +95,7 @@ public class GraphWritePerformanceTest {
         @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
         @BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 0, concurrency = BenchmarkOptions.CONCURRENCY_SEQUENTIAL)
         public void writeGryo() throws Exception {
-            final GraphWriter writer = GryoWriter.build().create();
+            final GraphWriter writer = graph.io().gryoWriter().create();
             final OutputStream os = new ByteArrayOutputStream();
             writer.writeGraph(os, graph);
         }
@@ -104,7 +104,7 @@ public class GraphWritePerformanceTest {
         @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
         @BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 0, concurrency = BenchmarkOptions.CONCURRENCY_SEQUENTIAL)
         public void writeGraphML() throws Exception {
-            final GraphWriter writer = GraphMLWriter.build().create();
+            final GraphWriter writer = graph.io().graphMLWriter().create();
             final OutputStream os = new ByteArrayOutputStream();
             writer.writeGraph(os, graph);
         }
@@ -113,7 +113,7 @@ public class GraphWritePerformanceTest {
         @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
         @BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 0, concurrency = BenchmarkOptions.CONCURRENCY_SEQUENTIAL)
         public void writeGraphSON() throws Exception {
-            final GraphWriter writer = GraphSONWriter.build().create();
+            final GraphWriter writer = graph.io().graphSONWriter().create();
             final OutputStream os = new ByteArrayOutputStream();
             writer.writeGraph(os, graph);
         }


[07/50] incubator-tinkerpop git commit: Add tests to enforce Element equality.

Posted by sp...@apache.org.
Add tests to enforce Element equality.

This makes it so that both the id() and id().toString() both can be used to evaluate equality.  The toString() of an id() is now a first-class representation of an identifier.  See TINKERPOP3-581 for more details


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

Branch: refs/heads/variables
Commit: bb86121ae7bd24bf2da030d300d5fcf5b65049db
Parents: 0c16dc8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 16:32:59 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 16:32:59 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/EdgeTest.java   | 29 ++++++++++++++++++
 .../gremlin/structure/VertexPropertyTest.java   | 31 ++++++++++++++++++++
 .../tinkerpop/gremlin/structure/VertexTest.java | 25 ++++++++++++++++
 3 files changed, 85 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb86121a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
index 67eedf3..54368a6 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
@@ -54,6 +54,35 @@ public class EdgeTest {
     })
     public static class BasicEdgeTest extends AbstractGremlinTest {
         @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+        public void shouldValidateEquality() {
+            final Vertex v = graph.addVertex();
+            final Edge e1 = v.addEdge("self", v);
+            final Edge e2 = v.addEdge("self", v);
+
+            assertEquals(e1, e1);
+            assertEquals(e2, e2);
+            assertNotEquals(e1, e2);
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+        public void shouldValidateIdEquality() {
+            final Vertex v = graph.addVertex();
+            final Edge e1 = v.addEdge("self", v);
+            final Edge e2 = v.addEdge("self", v);
+
+            assertEquals(e1.id(), e1.id());
+            assertEquals(e2.id(), e2.id());
+            assertEquals(e1.id().toString(), e1.id().toString());
+            assertEquals(e2.id().toString(), e2.id().toString());
+            assertNotEquals(e1.id(), e2.id());
+            assertNotEquals(e1.id().toString(), e2.id().toString());
+        }
+
+        @Test
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         public void shouldHaveStandardStringRepresentation() {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb86121a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
index 35fbf73..099108d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
@@ -49,6 +49,37 @@ import static org.junit.Assert.*;
 @RunWith(Enclosed.class)
 public class VertexPropertyTest extends AbstractGremlinTest {
 
+    public static class BasicVertexProperty extends AbstractGremlinTest {
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_INTEGER_VALUES)
+        public void shouldValidateEquality() {
+            final Vertex v = graph.addVertex();
+            final VertexProperty vp1 = v.property("x", 0);
+            final VertexProperty vp2 = v.property("y", 1);
+
+            assertEquals(vp1, vp1);
+            assertEquals(vp2, vp2);
+            assertNotEquals(vp1, vp2);
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_INTEGER_VALUES)
+        public void shouldValidateIdEquality() {
+            final Vertex v = graph.addVertex();
+            final VertexProperty vp1 = v.property("x", 0);
+            final VertexProperty vp2 = v.property("y", 1);
+
+            assertEquals(vp1.id(), vp1.id());
+            assertEquals(vp2.id(), vp2.id());
+            assertEquals(vp1.id().toString(), vp1.id().toString());
+            assertEquals(vp2.id().toString(), vp2.id().toString());
+            assertNotEquals(vp1.id(), vp2.id());
+            assertNotEquals(vp1.id().toString(), vp2.id().toString());
+        }
+    }
+
     public static class VertexPropertyAddition extends AbstractGremlinTest {
 
         @Test

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb86121a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index de2a20e..bbbf184 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -164,6 +164,31 @@ public class VertexTest {
     public static class BasicVertexTest extends AbstractGremlinTest {
         @Test
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        public void shouldValidateEquality() {
+            final Vertex v1 = graph.addVertex();
+            final Vertex v2 = graph.addVertex();
+
+            assertEquals(v1, v1);
+            assertEquals(v2, v2);
+            assertNotEquals(v1, v2);
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        public void shouldValidateIdEquality() {
+            final Vertex v1 = graph.addVertex();
+            final Vertex v2 = graph.addVertex();
+
+            assertEquals(v1.id(), v1.id());
+            assertEquals(v2.id(), v2.id());
+            assertEquals(v1.id().toString(), v1.id().toString());
+            assertEquals(v2.id().toString(), v2.id().toString());
+            assertNotEquals(v1.id(), v2.id());
+            assertNotEquals(v1.id().toString(), v2.id().toString());
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         public void shouldHaveExceptionConsistencyWhenUsingNullVertexLabel() {
             try {
                 graph.addVertex(T.label, null);


[04/50] incubator-tinkerpop git commit: Finalize some variables in the process VertexTest

Posted by sp...@apache.org.
Finalize some variables in the process VertexTest


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

Branch: refs/heads/variables
Commit: 8d968fdabdfc7ddbb39961fe7bfe27790a5d8887
Parents: fe65dec
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 13:54:29 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 13:54:29 2015 -0400

----------------------------------------------------------------------
 .../process/traversal/step/map/VertexTest.java  | 56 ++++++++++----------
 1 file changed, 27 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8d968fda/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
index 60557cf..90a07ec 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
@@ -103,7 +103,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_V();
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Vertex> vertices = new HashSet<>();
+        final Set<Vertex> vertices = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
             vertices.add(traversal.next());
@@ -122,7 +122,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
     private void assert_g_v1_out(final Traversal<Vertex, Vertex> traversal) {
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Vertex> vertices = new HashSet<>();
+        final Set<Vertex> vertices = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
             Vertex vertex = traversal.next();
@@ -158,10 +158,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_VX4X_both(convertToVertexId("josh"));
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Vertex> vertices = new HashSet<>();
+        final Set<Vertex> vertices = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Vertex vertex = traversal.next();
+            final Vertex vertex = traversal.next();
             vertices.add(vertex);
             assertTrue(vertex.value("name").equals("marko") ||
                     vertex.value("name").equals("ripple") ||
@@ -179,7 +179,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Edge, Edge> traversal = get_g_E();
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Edge> edges = new HashSet<>();
+        final Set<Edge> edges = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
             edges.add(traversal.next());
@@ -194,10 +194,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Edge> traversal = get_g_VX1X_outE(convertToVertexId("marko"));
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Edge> edges = new HashSet<>();
+        final Set<Edge> edges = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Edge edge = traversal.next();
+            final Edge edge = traversal.next();
             edges.add(edge);
             assertTrue(edge.label().equals("knows") || edge.label().equals("created"));
         }
@@ -224,10 +224,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Edge> traversal = get_g_VX4X_bothEXcreatedX(convertToVertexId("josh"));
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Edge> edges = new HashSet<>();
+        final Set<Edge> edges = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Edge edge = traversal.next();
+            final Edge edge = traversal.next();
             edges.add(edge);
             assertTrue(edge.label().equals("created"));
             assertEquals(edge.outVertex().id(), convertToVertexId("josh"));
@@ -242,10 +242,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Edge> traversal = get_g_VX4X_bothE(convertToVertexId("josh"));
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Edge> edges = new HashSet<>();
+        final Set<Edge> edges = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Edge edge = traversal.next();
+            final Edge edge = traversal.next();
             edges.add(edge);
             assertTrue(edge.label().equals("knows") || edge.label().equals("created"));
         }
@@ -275,7 +275,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_V_outE_hasXweight_1X_outV();
         printTraversalForm(traversal);
         int counter = 0;
-        Map<Object, Integer> counts = new HashMap<>();
+        final Map<Object, Integer> counts = new HashMap<>();
         while (traversal.hasNext()) {
             final Object id = traversal.next().id();
             int previousCount = counts.getOrDefault(id, 0);
@@ -296,10 +296,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, String> traversal = get_g_V_out_outE_inV_inE_inV_both_name();
         printTraversalForm(traversal);
         int counter = 0;
-        Map<String, Integer> counts = new HashMap<>();
+        final Map<String, Integer> counts = new HashMap<>();
         while (traversal.hasNext()) {
             final String key = traversal.next();
-            int previousCount = counts.getOrDefault(key, 0);
+            final int previousCount = counts.getOrDefault(key, 0);
             counts.put(key, previousCount + 1);
             counter++;
         }
@@ -317,7 +317,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
     public void g_VX1X_outEXknowsX_bothV_name() {
         final Traversal<Vertex, String> traversal = get_g_VX1X_outEXknowsX_bothV_name(convertToVertexId("marko"));
         printTraversalForm(traversal);
-        List<String> names = traversal.toList();
+        final List<String> names = traversal.toList();
         assertEquals(4, names.size());
         assertTrue(names.contains("marko"));
         assertTrue(names.contains("josh"));
@@ -338,10 +338,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_VX1X_outE_otherV(convertToVertexId("marko"));
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Vertex> vertices = new HashSet<>();
+        final Set<Vertex> vertices = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Vertex vertex = traversal.next();
+            final Vertex vertex = traversal.next();
             vertices.add(vertex);
             assertTrue(vertex.value("name").equals("vadas") ||
                     vertex.value("name").equals("josh") ||
@@ -384,13 +384,13 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         assert_g_v1_outXknowsX(traversal);
     }
 
-    private void assert_g_v1_outXknowsX(Traversal<Vertex, Vertex> traversal) {
+    private void assert_g_v1_outXknowsX(final Traversal<Vertex, Vertex> traversal) {
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Vertex> vertices = new HashSet<>();
+        final Set<Vertex> vertices = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Vertex vertex = traversal.next();
+            final Vertex vertex = traversal.next();
             vertices.add(vertex);
             assertTrue(vertex.value("name").equals("vadas") ||
                     vertex.value("name").equals("josh"));
@@ -426,10 +426,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_V_out_out();
         printTraversalForm(traversal);
         int counter = 0;
-        Set<Vertex> vertices = new HashSet<>();
+        final Set<Vertex> vertices = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            Vertex vertex = traversal.next();
+            final Vertex vertex = traversal.next();
             vertices.add(vertex);
             assertTrue(vertex.value("name").equals("lop") ||
                     vertex.value("name").equals("ripple"));
@@ -453,10 +453,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, String> traversal = get_g_VX1X_out_name(convertToVertexId("marko"));
         printTraversalForm(traversal);
         int counter = 0;
-        Set<String> names = new HashSet<>();
+        final Set<String> names = new HashSet<>();
         while (traversal.hasNext()) {
             counter++;
-            String name = traversal.next();
+            final String name = traversal.next();
             names.add(name);
             assertTrue(name.equals("vadas") ||
                     name.equals("josh") ||
@@ -474,14 +474,12 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         int counter = 0;
         while (traversal.hasNext()) {
             counter++;
-            Vertex vertex = traversal.next();
-            String name = vertex.value("name");
-            assertTrue(name.equals("vadas") ||
-                    name.equals("josh"));
+            final Vertex vertex = traversal.next();
+            final String name = vertex.value("name");
+            assertTrue(name.equals("vadas") || name.equals("josh"));
         }
         assertEquals(2, counter);
         assertFalse(traversal.hasNext());
-
     }
 
     @UseEngine(TraversalEngine.Type.STANDARD)


[30/50] incubator-tinkerpop git commit: GraphProvider needed to convertId for each Element type.

Posted by sp...@apache.org.
GraphProvider needed to convertId for each Element type.

Previously assumed that all extension of Element used the same identifier type which really isn't the case.  This change also uncovered a fair number of test bugs in label conversions.


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

Branch: refs/heads/variables
Commit: 6e7c7a1fcdf6faac949a3cea0e195fab78fd5eb2
Parents: c30e100
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 15:46:00 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 15:46:00 2015 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/GraphProvider.java |  2 +-
 .../tinkerpop/gremlin/structure/BatchTest.java  | 22 +++++-----
 .../tinkerpop/gremlin/structure/EdgeTest.java   |  2 +-
 .../gremlin/structure/FeatureSupportTest.java   |  6 +--
 .../tinkerpop/gremlin/structure/GraphTest.java  | 42 ++++++++++----------
 .../gremlin/structure/VertexPropertyTest.java   |  2 +-
 .../tinkerpop/gremlin/structure/VertexTest.java | 20 +++++-----
 7 files changed, 48 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
index 749026d..fbc2cd2 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
@@ -159,7 +159,7 @@ public interface GraphProvider {
      * consistent in the return value such that calling it with "x" should always return the same transformed
      * value.
      */
-    default public Object convertId(final Object id) {
+    default public Object convertId(final Object id, final Class<? extends Element> c) {
         return id;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/BatchTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/BatchTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/BatchTest.java
index c5eaf15..f23a7a8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/BatchTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/BatchTest.java
@@ -50,8 +50,8 @@ public class BatchTest extends AbstractGremlinTest {
         final BatchGraph batchGraph = BatchGraph.build(graph)
                 .incrementalLoading(true)
                 .bufferSize(1).create();
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
-        final Object id2 = GraphManager.getGraphProvider().convertId("2");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Vertex.class);
+        final Object id2 = GraphManager.getGraphProvider().convertId("2", Vertex.class);
         batchGraph.addVertex(T.id, id1, "name", "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, id2, "name", "stephen", "age", 37);
         final Vertex v2 = batchGraph.addVertex(T.id, id1, "name", "marko", "age", 34);
@@ -97,7 +97,7 @@ public class BatchTest extends AbstractGremlinTest {
         final BatchGraph batchGraph = BatchGraph.build(graph)
                 .incrementalLoading(true, Exists.THROW, Exists.IGNORE)
                 .bufferSize(1).create();
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Vertex.class);
         batchGraph.addVertex(T.id, id1, "name", "marko", "age", 29);
         try {
             batchGraph.addVertex(T.id, id1, "name", "marko", "age", 34);
@@ -133,8 +133,8 @@ public class BatchTest extends AbstractGremlinTest {
         final BatchGraph batchGraph = BatchGraph.build(graph)
                 .incrementalLoading(true, Exists.OVERWRITE_SINGLE, Exists.IGNORE)
                 .bufferSize(1).create();
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
-        final Object id2 = GraphManager.getGraphProvider().convertId("2");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Vertex.class);
+        final Object id2 = GraphManager.getGraphProvider().convertId("2", Vertex.class);
         batchGraph.addVertex(T.id, id1, "name", "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, id2, "name", "stephen", "age", 37);
         final Vertex v2 = batchGraph.addVertex(T.id, id1, "name", "marko", "age", 34);
@@ -181,8 +181,8 @@ public class BatchTest extends AbstractGremlinTest {
         final BatchGraph<?> batchGraph = BatchGraph.build(graph)
                 .incrementalLoading(true, Exists.OVERWRITE, Exists.IGNORE)
                 .bufferSize(1).create();
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
-        final Object id2 = GraphManager.getGraphProvider().convertId("2");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Vertex.class);
+        final Object id2 = GraphManager.getGraphProvider().convertId("2", Vertex.class);
         batchGraph.addVertex(T.id, id1, "name", "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, id2, "name", "stephen", "age", 37);
         final Vertex v2 = batchGraph.addVertex(T.id, id1, "name", "marko", "age", 34);
@@ -240,7 +240,7 @@ public class BatchTest extends AbstractGremlinTest {
         final Vertex v2 = batchGraph.addVertex(T.id, "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, "stephen", "age", 37);
 
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Edge.class);
 
         v1.addEdge("knows", v2, "weight", 1.0d, T.id, id1);
         v1.addEdge("knows", v2, "weight", 0.5d, T.id, id1); // second edge is ignored as it already exists
@@ -292,7 +292,7 @@ public class BatchTest extends AbstractGremlinTest {
                 .bufferSize(1).create();
         final Vertex v2 = batchGraph.addVertex(T.id, "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, "stephen", "age", 37);
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Edge.class);
         v1.addEdge("knows", v2, "weight", 1.0d, T.id, id1);
         v1.addEdge("knows", v2, "weight", 0.5d, T.id, id1); // second edge is overwrites properties of the first
         tryCommit(batchGraph);
@@ -343,7 +343,7 @@ public class BatchTest extends AbstractGremlinTest {
                 .bufferSize(1).create();
         final Vertex v2 = batchGraph.addVertex(T.id, "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, "stephen", "age", 37);
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Edge.class);
         v1.addEdge("knows", v2, "weight", 1.0d, T.id, id1);
         v1.addEdge("knows", v2, "weight", 0.5d, T.id, id1); // second edge is overwrites properties of the first
         tryCommit(batchGraph);
@@ -394,7 +394,7 @@ public class BatchTest extends AbstractGremlinTest {
                 .bufferSize(1).create();
         final Vertex v2 = batchGraph.addVertex(T.id, "marko", "age", 29);
         final Vertex v1 = batchGraph.addVertex(T.id, "stephen", "age", 37);
-        final Object id1 = GraphManager.getGraphProvider().convertId("1");
+        final Object id1 = GraphManager.getGraphProvider().convertId("1", Edge.class);
         v1.addEdge("knows", v2, "weight", 1.0d, T.id, id1);
         try {
             v1.addEdge("knows", v2, "weight", 0.5d, T.id, id1); // second edge is overwrites properties of the first

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
index 54368a6..1511b75 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
@@ -149,7 +149,7 @@ public class EdgeTest {
         @Test(expected = NoSuchElementException.class)
         @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
         public void shouldThrowNoSuchElementExceptionIfEdgeWithIdNotPresent() {
-            g.E(graphProvider.convertId(100)).next();
+            g.E(graphProvider.convertId(100, Edge.class)).next();
         }
 
         @Test

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index bcd79a1..05a3da5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -183,7 +183,7 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsIfAnIdCanBeAssignedToVertex() throws Exception {
             try {
-                graph.addVertex(T.id, GraphManager.getGraphProvider().convertId(99999943835l));
+                graph.addVertex(T.id, GraphManager.getGraphProvider().convertId(99999943835l, Vertex.class));
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_USER_SUPPLIED_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsNotSupported(), e);
@@ -358,7 +358,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsIfAnIdCanBeAssignedToEdge() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.addEdge("friend", v, T.id, GraphManager.getGraphProvider().convertId(99999943835l));
+                v.addEdge("friend", v, T.id, GraphManager.getGraphProvider().convertId(99999943835l, Edge.class));
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), EdgeFeatures.FEATURE_USER_SUPPLIED_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsNotSupported(), e);
@@ -624,7 +624,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsIfAnIdCanBeAssigned() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("name", "me", T.id, GraphManager.getGraphProvider().convertId(99999943835l));
+                v.property("name", "me", T.id, GraphManager.getGraphProvider().convertId(99999943835l, VertexProperty.class));
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), VertexPropertyFeatures.FEATURE_USER_SUPPLIED_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsNotSupported(), ex);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index a059f0b..7bd6cd7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -115,7 +115,7 @@ public class GraphTest extends AbstractGremlinTest {
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
     public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnVertex() {
-        final Object o = GraphManager.getGraphProvider().convertId("1");
+        final Object o = GraphManager.getGraphProvider().convertId("1", Vertex.class);
         graph.addVertex(T.id, o);
         try {
             graph.addVertex(T.id, o);
@@ -549,7 +549,7 @@ public class GraphTest extends AbstractGremlinTest {
     public void shouldNotMixTypesForGettingSpecificVerticesWithVertexFirst() {
         final Vertex v1 = graph.addVertex();
         try {
-            graph.vertices(v1, graphProvider.convertId("1"));
+            graph.vertices(v1, graphProvider.convertId("1", Vertex.class));
             fail("Should have thrown an exception because id arguments were mixed.");
         } catch (Exception ex) {
             final Exception expected = Graph.Exceptions.idArgsMustBeEitherIdOrElement();
@@ -563,7 +563,7 @@ public class GraphTest extends AbstractGremlinTest {
     public void shouldNotMixTypesForGettingSpecificVerticesWithStringFirst() {
         final Vertex v1 = graph.addVertex();
         try {
-            graph.vertices(graphProvider.convertId("1"), v1);
+            graph.vertices(graphProvider.convertId("1", Vertex.class), v1);
             fail("Should have thrown an exception because id arguments were mixed.");
         } catch (Exception ex) {
             final Exception expected = Graph.Exceptions.idArgsMustBeEitherIdOrElement();
@@ -814,10 +814,10 @@ public class GraphTest extends AbstractGremlinTest {
         final Vertex c;
         final Vertex d;
         if (graph.features().vertex().supportsUserSuppliedIds()) {
-            a = graph.addVertex(T.id, graphProvider.convertId("1"));
-            b = graph.addVertex(T.id, graphProvider.convertId("2"));
-            c = graph.addVertex(T.id, graphProvider.convertId("3"));
-            d = graph.addVertex(T.id, graphProvider.convertId("4"));
+            a = graph.addVertex(T.id, graphProvider.convertId("1", Vertex.class));
+            b = graph.addVertex(T.id, graphProvider.convertId("2", Vertex.class));
+            c = graph.addVertex(T.id, graphProvider.convertId("3", Vertex.class));
+            d = graph.addVertex(T.id, graphProvider.convertId("4", Vertex.class));
         } else {
             a = graph.addVertex();
             b = graph.addVertex();
@@ -844,10 +844,10 @@ public class GraphTest extends AbstractGremlinTest {
         });
 
         if (graph.features().vertex().supportsUserSuppliedIds()) {
-            final Vertex va = graph.vertices(graphProvider.convertId("1")).next();
-            final Vertex vb = graph.vertices(graphProvider.convertId("2")).next();
-            final Vertex vc = graph.vertices(graphProvider.convertId("3")).next();
-            final Vertex vd = graph.vertices(graphProvider.convertId("4")).next();
+            final Vertex va = graph.vertices(graphProvider.convertId("1", Vertex.class)).next();
+            final Vertex vb = graph.vertices(graphProvider.convertId("2", Vertex.class)).next();
+            final Vertex vc = graph.vertices(graphProvider.convertId("3", Vertex.class)).next();
+            final Vertex vd = graph.vertices(graphProvider.convertId("4", Vertex.class)).next();
 
             assertEquals(a, va);
             assertEquals(b, vb);
@@ -875,12 +875,12 @@ public class GraphTest extends AbstractGremlinTest {
             assertEquals(1l, IteratorUtils.count(vd.edges(Direction.OUT)));
 
             for (Edge x : IteratorUtils.list(a.edges(Direction.OUT))) {
-                assertTrue(x.label().equals(graphProvider.convertId("knows")) || x.label().equals(graphProvider.convertId("hates")));
+                assertTrue(x.label().equals(graphProvider.convertLabel("knows")) || x.label().equals(graphProvider.convertLabel("hates")));
             }
 
-            assertEquals(graphProvider.convertId("hates"), i.label());
-            assertEquals(graphProvider.convertId("2"), i.inVertex().id().toString());
-            assertEquals(graphProvider.convertId("1"), i.outVertex().id().toString());
+            assertEquals(graphProvider.convertLabel("hates"), i.label());
+            assertEquals(graphProvider.convertId("2", Vertex.class).toString(), i.inVertex().id().toString());
+            assertEquals(graphProvider.convertId("1", Vertex.class).toString(), i.outVertex().id().toString());
         }
 
         final Set<Object> vertexIds = new HashSet<>();
@@ -1006,15 +1006,15 @@ public class GraphTest extends AbstractGremlinTest {
         assertEquals(0l, IteratorUtils.count(start.edges(Direction.IN)));
         assertEquals(branchSize, IteratorUtils.count(start.edges(Direction.OUT)));
         for (Edge a : IteratorUtils.list(start.edges(Direction.OUT))) {
-            assertEquals(graphProvider.convertId("test1"), a.label());
+            assertEquals(graphProvider.convertLabel("test1"), a.label());
             assertEquals(branchSize, IteratorUtils.count(a.inVertex().vertices(Direction.OUT)));
             assertEquals(1, IteratorUtils.count(a.inVertex().vertices(Direction.IN)));
             for (Edge b : IteratorUtils.list(a.inVertex().edges(Direction.OUT))) {
-                assertEquals(graphProvider.convertId("test2"), b.label());
+                assertEquals(graphProvider.convertLabel("test2"), b.label());
                 assertEquals(branchSize, IteratorUtils.count(b.inVertex().vertices(Direction.OUT)));
                 assertEquals(1, IteratorUtils.count(b.inVertex().vertices(Direction.IN)));
                 for (Edge c : IteratorUtils.list(b.inVertex().edges(Direction.OUT))) {
-                    assertEquals(graphProvider.convertId("test3"), c.label());
+                    assertEquals(graphProvider.convertLabel("test3"), c.label());
                     assertEquals(0, IteratorUtils.count(c.inVertex().vertices(Direction.OUT)));
                     assertEquals(1, IteratorUtils.count(c.inVertex().vertices(Direction.IN)));
                 }
@@ -1059,7 +1059,7 @@ public class GraphTest extends AbstractGremlinTest {
         }
 
         reopenedGraph.edges().forEachRemaining(edge -> {
-            assertEquals(graphProvider.convertId("collaborator"), edge.label());
+            assertEquals(graphProvider.convertLabel("collaborator"), edge.label());
             if (graph.features().edge().properties().supportsStringValues())
                 assertEquals("internet", edge.property("location").value());
         });
@@ -1458,7 +1458,7 @@ public class GraphTest extends AbstractGremlinTest {
         final Vertex v = graph.addVertex();
         final Edge e1 = v.addEdge("self", v);
         try {
-            graph.edges(e1, graphProvider.convertId("1"));
+            graph.edges(e1, graphProvider.convertId("1", Edge.class));
             fail("Should have thrown an exception because id arguments were mixed.");
         } catch (Exception ex) {
             final Exception expected = Graph.Exceptions.idArgsMustBeEitherIdOrElement();
@@ -1474,7 +1474,7 @@ public class GraphTest extends AbstractGremlinTest {
         final Vertex v = graph.addVertex();
         final Edge e1 = v.addEdge("self", v);
         try {
-            graph.edges(graphProvider.convertId("1"), e1);
+            graph.edges(graphProvider.convertId("1", Edge.class), e1);
             fail("Should have thrown an exception because id arguments were mixed.");
         } catch (Exception ex) {
             final Exception expected = Graph.Exceptions.idArgsMustBeEitherIdOrElement();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
index 099108d..8aab4d0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
@@ -90,7 +90,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_USER_SUPPLIED_IDS)
         public void shouldAllowIdAssignment() {
             final Vertex v = graph.addVertex();
-            final Object id = graphProvider.convertId(123131231l);
+            final Object id = graphProvider.convertId(123131231l, VertexProperty.class);
             v.property("name", "stephen", T.id, id);
 
             tryCommit(graph, g -> assertEquals(id, v.property("name").id()));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6e7c7a1f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index bbbf184..27ed923 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -258,7 +258,7 @@ public class VertexTest {
         @Test(expected = NoSuchElementException.class)
         @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
         public void shouldThrowNoSuchElementExceptionIfVertexWithIdNotPresent() {
-            graph.vertices(graphProvider.convertId(100)).next();
+            graph.vertices(graphProvider.convertId(100, Vertex.class)).next();
         }
 
         @Test
@@ -267,7 +267,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
         public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnEdge() {
             final Vertex v = graph.addVertex();
-            final Object o = GraphManager.getGraphProvider().convertId("1");
+            final Object o = GraphManager.getGraphProvider().convertId("1", Edge.class);
             v.addEdge("label", v, T.id, o);
 
             try {
@@ -367,8 +367,8 @@ public class VertexTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         public void shouldEvaluateVerticesEquivalentWithSuppliedIdsViaTraversal() {
-            final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1"));
-            final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1")).next();
+            final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1", Vertex.class));
+            final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next();
             assertEquals(v, u);
         }
 
@@ -376,8 +376,8 @@ public class VertexTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         public void shouldEvaluateVerticesEquivalentWithSuppliedIdsViaIterators() {
-            final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1"));
-            final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1")).next();
+            final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1", Vertex.class));
+            final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next();
             assertEquals(v, u);
         }
 
@@ -400,8 +400,8 @@ public class VertexTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         public void shouldEvaluateEquivalentVertexHashCodeWithSuppliedIds() {
-            final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1"));
-            final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1")).next();
+            final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1", Vertex.class));
+            final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next();
             assertEquals(v, u);
 
             final Set<Vertex> set = new HashSet<>();
@@ -409,8 +409,8 @@ public class VertexTest {
             set.add(v);
             set.add(u);
             set.add(u);
-            set.add(graph.vertices(GraphManager.getGraphProvider().convertId("1")).next());
-            set.add(graph.vertices(GraphManager.getGraphProvider().convertId("1")).next());
+            set.add(graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next());
+            set.add(graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next());
 
             assertEquals(1, set.size());
             assertEquals(v.hashCode(), u.hashCode());


[02/50] incubator-tinkerpop git commit: Update changelog.

Posted by sp...@apache.org.
Update changelog.


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

Branch: refs/heads/variables
Commit: 975004cc418e4b7351409621f98e45f997d209aa
Parents: 9716d37
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 13 13:45:00 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 13 13:45:00 2015 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/975004cc/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index d3345c2..5c884ba 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,9 @@ TinkerPop 3.0.0.M9 (NOT OFFICIALLY RELEASED YET)
 * Removed `back()`-step as `select()`-step provides the same behavior with more intelligent optimizations and `by()`-modulation.
 * Removed `Graph.Helper` method annotation and related infrastructure in tests.
 * Moved `Exceptions.propertyRemovalNotSupported` from `Element` to `Property` for consistency.
+* Modified the reference implementation for dealing with "custom" identifier serialization in GraphSON - See `IoTest.CustomId` for the example.
+* Modified `g.vertices/edges` and related methods and tests to support non-type specific querying (e.g. `g.V(1)` and `g.V(1L)` should both return the same result now).
+* `TinkerGraph` supports an `IdManager` which helps enforce identifier types and improve flexibility in terms of how it will respond to queries around identifiers.
 * `DetachedXXX` now uses the standard `structure/` exceptions for unsupported operations.
 * Added private constructors to all `Exceptions` inner classes in the respective `structure/` interfaces.
 * Re-introduced `ReferenceXXX` to ensure a smaller data footprint in OLAP situation (`DetachedXXX` uses too much data).


[20/50] incubator-tinkerpop git commit: more default properties for SparkGraphComputer.

Posted by sp...@apache.org.
more default properties for SparkGraphComputer.


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

Branch: refs/heads/variables
Commit: e0574a3e589424541a713210291f74a0334ad295
Parents: fe7c56c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 14 10:12:55 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 14 10:13:02 2015 -0600

----------------------------------------------------------------------
 hadoop-gremlin/conf/hadoop-gryo.properties | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e0574a3e/hadoop-gremlin/conf/hadoop-gryo.properties
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/conf/hadoop-gryo.properties b/hadoop-gremlin/conf/hadoop-gryo.properties
index 0484327..06076c8 100644
--- a/hadoop-gremlin/conf/hadoop-gryo.properties
+++ b/hadoop-gremlin/conf/hadoop-gryo.properties
@@ -45,6 +45,7 @@ spark.master=local[4]
 spark.executor.memory=1g
 spark.serializer=org.apache.spark.serializer.KryoSerializer
 # spark.kryo.registrationRequired=true
-# spark.storage.memoryFraction=0.3
+# spark.storage.memoryFraction=0.2
 # spark.eventLog.enabled=true
 # spark.eventLog.dir=/tmp/spark-event-logs
+# spark.ui.killEnabled=true


[39/50] incubator-tinkerpop git commit: Merge branch 'TINKERPOP3-632-gremlin.tests-env-var' of https://github.com/RedSeal-co/incubator-tinkerpop

Posted by sp...@apache.org.
Merge branch 'TINKERPOP3-632-gremlin.tests-env-var' of https://github.com/RedSeal-co/incubator-tinkerpop


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

Branch: refs/heads/variables
Commit: 2fd0598482316f676d3f19dd866a772d23fb30f3
Parents: db11d3b 5d8224a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 07:59:03 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 07:59:03 2015 -0400

----------------------------------------------------------------------
 README.asciidoc                                 |  8 +++++-
 .../groovy/GroovyEnvironmentIntegrateSuite.java | 23 +++-------------
 .../GroovyEnvironmentPerformanceSuite.java      | 25 ++++-------------
 .../gremlin/groovy/GroovyEnvironmentSuite.java  | 25 ++++-------------
 .../process/GroovyProcessComputerSuite.java     |  4 +--
 .../process/GroovyProcessStandardSuite.java     |  4 +--
 .../tinkerpop/gremlin/AbstractGremlinSuite.java | 29 ++++++++++++++++++--
 .../gremlin/process/ProcessComputerSuite.java   | 21 +-------------
 .../process/ProcessPerformanceSuite.java        |  5 ++--
 .../gremlin/process/ProcessStandardSuite.java   | 21 +-------------
 .../structure/StructurePerformanceSuite.java    |  5 ++--
 .../structure/StructureStandardSuite.java       | 25 ++++-------------
 12 files changed, 65 insertions(+), 130 deletions(-)
----------------------------------------------------------------------



[48/50] incubator-tinkerpop git commit: gutted more StreamFactory uses. Only a few cases left. Added IteratorUtils.limit().

Posted by sp...@apache.org.
gutted more StreamFactory uses. Only a few cases left. Added IteratorUtils.limit().


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

Branch: refs/heads/variables
Commit: 9f7ce828c077cc04161de92468e50be9311feef4
Parents: 23c95c3
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Apr 15 09:43:54 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Apr 15 09:43:54 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/computer/Messenger.java     |  4 +--
 .../traversal/TraversalScriptSupplier.java      |  4 +--
 .../process/computer/util/ComputerGraph.java    |  2 +-
 .../process/computer/util/LambdaHolder.java     |  2 +-
 .../process/computer/util/ShellGraph.java       |  4 +--
 .../tinkerpop/gremlin/util/StreamFactory.java   | 32 --------------------
 .../gremlin/util/iterator/IteratorUtils.java    | 19 ++++++++++++
 .../process/computer/GraphComputerTest.java     | 16 +++++++---
 .../tinkerpop/gremlin/structure/IoTest.java     |  8 ++---
 .../hadoop/groovy/plugin/HadoopLoader.groovy    | 14 ++++-----
 .../process/computer/TinkerMessenger.java       |  5 ++-
 11 files changed, 54 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
index a6746ba..e5eeb11 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
@@ -32,9 +32,9 @@ import java.util.Iterator;
 public interface Messenger<M> {
 
     /**
-     * The currently executing vertex can receive the messages of the provided {@link MessageScope}.
+     * Receive all incoming messages to the currently executing vertex.
      *
-     * @return the messages for that vertex
+     * @return the messages for the vertex
      */
     public Iterator<M> receiveMessages();
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
index 3e5179d..ca187b1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalScriptSupplier.java
@@ -18,10 +18,10 @@
  */
 package org.apache.tinkerpop.gremlin.process.computer.traversal;
 
+import org.apache.tinkerpop.gremlin.process.computer.util.ScriptEngineCache;
 import org.apache.tinkerpop.gremlin.process.computer.util.ShellGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
-import org.apache.tinkerpop.gremlin.process.computer.util.ScriptEngineCache;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 
 import javax.script.Bindings;
@@ -51,7 +51,7 @@ public final class TraversalScriptSupplier<S, E> implements Supplier<Traversal.A
         try {
             final ScriptEngine engine = ScriptEngineCache.get(this.scriptEngineName);
             final Bindings bindings = engine.createBindings();
-            bindings.put("g", this.traversalContextBuilder.create(new ShellGraph(this.graphClass)));
+            bindings.put("g", this.traversalContextBuilder.create(ShellGraph.of(this.graphClass)));
             return (Traversal.Admin<S, E>) engine.eval(this.traversalScript, bindings);
         } catch (final ScriptException e) {
             throw new IllegalStateException(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
index 7f93b50..9671cc2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public class ComputerGraph implements Graph {
+public final class ComputerGraph implements Graph {
 
     public enum State {VERTEX_PROGRAM, MAP_REDUCE, NO_OP}
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/LambdaHolder.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/LambdaHolder.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/LambdaHolder.java
index a4fbdc6..d93d10c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/LambdaHolder.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/LambdaHolder.java
@@ -26,7 +26,7 @@ import java.util.function.Supplier;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public class LambdaHolder<S> implements Supplier<S> {
+public final class LambdaHolder<S> implements Supplier<S> {
 
     public enum Type {
         OBJECT,

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
index e03be95..2a0cbb3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ShellGraph.java
@@ -40,12 +40,12 @@ import java.util.concurrent.Future;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public class ShellGraph implements Graph, Serializable {
+public final class ShellGraph implements Graph, Serializable {
 
     private final Class<? extends Graph> graphClass;
     public static final String SHELL_GRAPH_CLASS = "shell.graphClass";
 
-    public ShellGraph(final Class<? extends Graph> graphClass) {
+    private ShellGraph(final Class<? extends Graph> graphClass) {
         this.graphClass = graphClass;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/StreamFactory.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/StreamFactory.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/StreamFactory.java
index e905d92..f4f02f6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/StreamFactory.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/StreamFactory.java
@@ -32,41 +32,9 @@ import java.util.stream.StreamSupport;
 public class StreamFactory {
 
     /**
-     * Construct a {@link java.util.stream.Stream} from an {@link Iterable}.
-     */
-    public static <T> Stream<T> stream(final Iterable<T> iterable) {
-        return StreamFactory.stream(iterable.iterator());
-    }
-
-    /**
-     * Construct a parallel {@link java.util.stream.Stream} from an {@link Iterable}.
-     */
-    public static <T> Stream<T> parallelStream(final Iterable<T> iterable) {
-        return StreamFactory.parallelStream(iterable.iterator());
-    }
-
-    /**
      * Construct a {@link java.util.stream.Stream} from an {@link java.util.Iterator}.
      */
     public static <T> Stream<T> stream(final Iterator<T> iterator) {
         return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.IMMUTABLE | Spliterator.SIZED), false);
     }
-
-    /**
-     * Construct a parallel {@link java.util.stream.Stream} from an {@link java.util.Iterator}.
-     */
-    public static <T> Stream<T> parallelStream(final Iterator<T> iterator) {
-        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.IMMUTABLE | Spliterator.SIZED), true);
-    }
-
-    /**
-     * Construct an {@link Iterable} from an {@link java.util.stream.Stream}.
-     */
-    public static <T> Iterable<T> iterable(final Stream<T> stream) {
-        return stream::iterator;
-    }
-
-    public static <T> Stream<T> stream(final T t) {
-        return Stream.of(t);
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
index ad3c786..c0facae 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java
@@ -75,6 +75,25 @@ public final class IteratorUtils {
         return fill(iterator, new HashSet<>());
     }
 
+    public static <S> Iterator<S> limit(final Iterator<S> iterator, int limit) {
+        return new Iterator<S>() {
+            private int count = 0;
+
+            @Override
+            public boolean hasNext() {
+                return iterator.hasNext() && this.count < limit;
+            }
+
+            @Override
+            public S next() {
+                this.count++;
+                if (this.count >= limit)
+                    throw FastNoSuchElementException.instance();
+                return iterator.next();
+            }
+        };
+    }
+
     ///////////////////
 
     public static <T> boolean allMatch(final Iterator<T> iterator, final Predicate<T> predicate) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 6998017..d5a2bbc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -644,7 +644,11 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
 
         @Override
         public void reduce(NullObject key, Iterator<Integer> values, ReduceEmitter<NullObject, Integer> emitter) {
-            emitter.emit(StreamFactory.stream(values).mapToInt(i -> i).sum());
+            int sum = 0;
+            while(values.hasNext()) {
+                sum = sum + values.next();
+            }
+            emitter.emit(sum);
         }
 
         @Override
@@ -726,12 +730,16 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
         }
 
         @Override
-        public void reduce(NullObject key, Iterator<Integer> values, ReduceEmitter<NullObject, Integer> emitter) {
-            emitter.emit(StreamFactory.stream(values).mapToInt(i -> i).sum());
+        public void reduce(final NullObject key, final Iterator<Integer> values, final ReduceEmitter<NullObject, Integer> emitter) {
+            int sum = 0;
+            while(values.hasNext()) {
+                sum = sum + values.next();
+            }
+            emitter.emit(sum);
         }
 
         @Override
-        public Integer generateFinalResult(Iterator<KeyValue<NullObject, Integer>> keyValues) {
+        public Integer generateFinalResult(final Iterator<KeyValue<NullObject, Integer>> keyValues) {
             return keyValues.next().getValue();
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
index d4c3e5f..61dfcda 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
@@ -2189,19 +2189,19 @@ public class IoTest extends AbstractGremlinTest {
         final Vertex v9 = (Vertex) g1.traversal().V().has("name", "daniel").next();
         assertEquals("person", v9.label());
         assertEquals(2, v9.keys().size());
-        assertEquals(3, (int) StreamFactory.stream(v9.properties("location")).count());
+        assertEquals(3, (int) IteratorUtils.count(v9.properties("location")));
         v9.properties("location").forEachRemaining(vp -> {
             if (vp.value().equals("spremberg")) {
                 assertEquals(1982, (int) vp.value("startTime"));
                 assertEquals(2005, (int) vp.value("endTime"));
-                assertEquals(2, (int) StreamFactory.stream(vp.properties()).count());
+                assertEquals(2, (int) IteratorUtils.count(vp.properties()));
             } else if (vp.value().equals("kaiserslautern")) {
                 assertEquals(2005, (int) vp.value("startTime"));
                 assertEquals(2009, (int) vp.value("endTime"));
-                assertEquals(2, (int) StreamFactory.stream(vp.properties()).count());
+                assertEquals(2, (int) IteratorUtils.count(vp.properties()));
             } else if (vp.value().equals("aachen")) {
                 assertEquals(2009, (int) vp.value("startTime"));
-                assertEquals(1, (int) StreamFactory.stream(vp.properties()).count());
+                assertEquals(1, (int) IteratorUtils.count(vp.properties()));
             } else {
                 fail("Found a value that should be there");
             }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy b/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
index d9ebd4d..ecbe9d3 100644
--- a/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
+++ b/hadoop-gremlin/src/main/groovy/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopLoader.groovy
@@ -18,16 +18,16 @@
  */
 package org.apache.tinkerpop.gremlin.hadoop.groovy.plugin
 
+import org.apache.hadoop.conf.Configuration
+import org.apache.hadoop.fs.*
+import org.apache.hadoop.io.IOUtils
+import org.apache.hadoop.io.Text
 import org.apache.tinkerpop.gremlin.hadoop.structure.hdfs.HDFSTools
 import org.apache.tinkerpop.gremlin.hadoop.structure.hdfs.HiddenFileFilter
 import org.apache.tinkerpop.gremlin.hadoop.structure.hdfs.TextIterator
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritableIterator
-import org.apache.tinkerpop.gremlin.util.StreamFactory
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.fs.*
-import org.apache.hadoop.io.IOUtils
-import org.apache.hadoop.io.Text
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -118,9 +118,9 @@ class HadoopLoader {
                 /// return StreamFactory.stream(new GiraphVertexIterator(((FileSystem) delegate).getConf(), new Path(path))).limit(totalKeyValues).iterator();
                 // } else
                 if (writableClass.equals(ObjectWritable.class)) {
-                    return StreamFactory.stream(new ObjectWritableIterator(((FileSystem) delegate).getConf(), new Path(path))).limit(totalKeyValues).iterator();
+                    return IteratorUtils.limit(new ObjectWritableIterator(((FileSystem) delegate).getConf(), new Path(path)), totalKeyValues);
                 } else {
-                    return StreamFactory.stream(new TextIterator(((FileSystem) delegate).getConf(), new Path(path))).limit(totalKeyValues).iterator();
+                    return IteratorUtils.limit(new TextIterator(((FileSystem) delegate).getConf(), new Path(path)), totalKeyValues);
                 }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9f7ce828/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
index 673345b..5cd7d28 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
@@ -37,8 +37,11 @@ import java.util.Iterator;
 import java.util.Optional;
 import java.util.Queue;
 import java.util.Set;
+import java.util.Spliterator;
+import java.util.Spliterators;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -64,7 +67,7 @@ public class TinkerMessenger<M> implements Messenger<M> {
                 final Traversal.Admin<Vertex, Edge> incidentTraversal = TinkerMessenger.setVertexStart(localMessageScope.getIncidentTraversal().get().asAdmin(), this.vertex);
                 final Direction direction = TinkerMessenger.getDirection(incidentTraversal);
                 final Edge[] edge = new Edge[1]; // simulates storage side-effects available in Gremlin, but not Java8 streams
-                multiIterator.addIterator(StreamFactory.stream(VertexProgramHelper.reverse(incidentTraversal.asAdmin()))
+                multiIterator.addIterator(StreamSupport.stream(Spliterators.spliteratorUnknownSize(VertexProgramHelper.reverse(incidentTraversal.asAdmin()), Spliterator.IMMUTABLE | Spliterator.SIZED), false)
                         .map(e -> this.messageBoard.receiveMessages.get((edge[0] = e).vertices(direction).next()))
                         .filter(q -> null != q)
                         .flatMap(q -> q.stream())


[31/50] incubator-tinkerpop git commit: A number of FeatureSupportTest items were not properly featured around VertexProperty TINKERPOP3-635

Posted by sp...@apache.org.
A number of FeatureSupportTest items were not properly featured around VertexProperty TINKERPOP3-635


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

Branch: refs/heads/variables
Commit: 8ab0a23bdf3efa2681e36b2c350ef481e5455bed
Parents: 6e7c7a1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 15:58:16 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 15:58:16 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/FeatureSupportTest.java   | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8ab0a23b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index 05a3da5..fa98ef0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -633,8 +633,8 @@ public class FeatureSupportTest {
 
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
@@ -647,8 +647,8 @@ public class FeatureSupportTest {
 
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
@@ -669,8 +669,8 @@ public class FeatureSupportTest {
 
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
@@ -684,8 +684,8 @@ public class FeatureSupportTest {
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
@@ -698,8 +698,8 @@ public class FeatureSupportTest {
 
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportStringIdsIfStringIdsAreGeneratedFromTheGraph() throws Exception {
             final Vertex v = graph.addVertex();
             final VertexProperty p = v.property("name", "stephen");
@@ -709,8 +709,8 @@ public class FeatureSupportTest {
 
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUuidIdsIfUuidIdsAreGeneratedFromTheGraph() throws Exception {
             final Vertex v = graph.addVertex();
             final VertexProperty p = v.property("name", "stephen");
@@ -720,8 +720,8 @@ public class FeatureSupportTest {
 
         @Test
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
-        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS, supported = false)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
         public void shouldSupportNumericIdsIfNumericIdsAreGeneratedFromTheGraph() throws Exception {
             final Vertex v = graph.addVertex();
             final VertexProperty p = v.property("name", "stephen");


[44/50] incubator-tinkerpop git commit: Renamed test for consistency.

Posted by sp...@apache.org.
Renamed test for consistency.


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

Branch: refs/heads/variables
Commit: 05616f21a99c820c223dbedd943bc7ef3eae49b3
Parents: bf77793
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 10:20:20 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 10:20:20 2015 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/process/ProcessComputerSuite.java  | 5 +----
 .../apache/tinkerpop/gremlin/process/ProcessStandardSuite.java  | 2 +-
 .../gremlin/process/traversal/step/filter/ExceptTest.java       | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/05616f21/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 285363d..ebf3a7f 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -76,9 +76,6 @@ import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
@@ -116,7 +113,7 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
             CoinTest.Traversals.class,
             CyclicPathTest.Traversals.class,
             DedupTest.Traversals.class,
-            ExceptTest.StandardTest.class,
+            ExceptTest.Traversals.class,
             FilterTest.Traversals.class,
             HasNotTest.Traversals.class,
             HasTest.Traversals.class,

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/05616f21/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
index eae93f2..3124588 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
@@ -114,7 +114,7 @@ public class ProcessStandardSuite extends AbstractGremlinSuite {
             CyclicPathTest.Traversals.class,
             DedupTest.Traversals.class,
             DropTest.Traversals.class,
-            ExceptTest.StandardTest.class,
+            ExceptTest.Traversals.class,
             FilterTest.Traversals.class,
             HasNotTest.Traversals.class,
             HasTest.Traversals.class,

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/05616f21/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
index cbd498f..e7e64b7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
@@ -146,7 +146,7 @@ public abstract class ExceptTest extends AbstractGremlinProcessTest {
 
     @UseEngine(TraversalEngine.Type.STANDARD)
     @UseEngine(TraversalEngine.Type.COMPUTER)
-    public static class StandardTest extends ExceptTest {
+    public static class Traversals extends ExceptTest {
 
         @Override
         public Traversal<Vertex, Vertex> get_g_VX1X_out_exceptXg_v2X(final Object v1Id, final Object v2Id) {


[32/50] incubator-tinkerpop git commit: GraphComputer Messenger no longer requires the MessageScope on receiveMessages(). If developers want that type of tagging, that would be built into their message object.

Posted by sp...@apache.org.
GraphComputer Messenger no longer requires the MessageScope on receiveMessages(). If developers want that type of tagging, that would be built into their message object.


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

Branch: refs/heads/variables
Commit: daec1c3b5b6d5ce2404eb7962042fcd6e62e47ef
Parents: 8ab0a23
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 14 14:46:38 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 14 14:46:38 2015 -0600

----------------------------------------------------------------------
 docs/src/the-graphcomputer.asciidoc             |  7 ++-
 .../gremlin/process/computer/MessageScope.java  | 31 ++++++++++++--
 .../gremlin/process/computer/Messenger.java     |  3 +-
 .../peerpressure/PeerPressureVertexProgram.java |  4 +-
 .../ranking/pagerank/PageRankVertexProgram.java |  4 +-
 .../computer/traversal/SingleMessenger.java     |  2 +-
 .../computer/traversal/TraverserExecutor.java   |  2 +-
 .../computer/giraph/GiraphMessenger.java        |  4 +-
 .../process/computer/spark/SparkMessenger.java  |  2 +-
 .../process/computer/TinkerGraphComputer.java   |  2 +-
 .../process/computer/TinkerMessageBoard.java    |  7 +++
 .../process/computer/TinkerMessenger.java       | 45 +++++++++++---------
 12 files changed, 74 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/docs/src/the-graphcomputer.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-graphcomputer.asciidoc b/docs/src/the-graphcomputer.asciidoc
index 964fabf..d54b8f2 100644
--- a/docs/src/the-graphcomputer.asciidoc
+++ b/docs/src/the-graphcomputer.asciidoc
@@ -85,7 +85,6 @@ result.memory().get('clusterPopulation')
 g = result.graph().traversal(standard())
 g.V().values(PeerPressureVertexProgram.CLUSTER).groupCount().next()
 g.V().valueMap()
-g.V().valueMap(true,PeerPressureVertexProgram.CLUSTER)
 ----
 
 If there are numerous statistics desired, then its possible to register as many MapReduce jobs as needed. For instance, the `ClusterCountMapReduce` determines how many unique clusters were created by the peer pressure algorithm. Below both `ClusterCountMapReduce` and `ClusterPopulationMapReduce` are computed over the resultant graph.
@@ -189,12 +188,12 @@ public class PageRankVertexProgram implements VertexProgram<Double> { <1>
             messenger.sendMessage(this.countMessageScope, 1.0d);
         } else if (1 == memory.getIteration()) {  <8>
             double initialPageRank = 1.0d / this.vertexCountAsDouble;
-            double edgeCount = IteratorUtils.reduce(messenger.receiveMessages(this.countMessageScope), 0.0d, (a, b) -> a + b);
+            double edgeCount = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
             vertex.property(PAGE_RANK, initialPageRank);
             vertex.property(EDGE_COUNT, edgeCount);
             messenger.sendMessage(this.incidentMessageScope, initialPageRank / edgeCount);
         } else { <9>
-            double newPageRank = IteratorUtils.reduce(messenger.receiveMessages(this.incidentMessageScope), 0.0d, (a, b) -> a + b);
+            double newPageRank = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
             newPageRank = (this.alpha * newPageRank) + ((1.0d - this.alpha) / this.vertexCountAsDouble);
             vertex.property(PAGE_RANK, newPageRank);
             messenger.sendMessage(this.incidentMessageScope, newPageRank / vertex.<Double>value(EDGE_COUNT));
@@ -293,5 +292,5 @@ image::gremlin-without-a-cause.png[width=200,float=right]
  . Traversal sideEffects are represented as a distributed data structure across the graph's vertex set. It is not possible to get a global view of a sideEffect until it is aggregated via a <<mapreduce,MapReduce>> job. In some situations, the local vertex representation of the sideEffect is sufficient to ensure the intended semantics of the traversal are respected. However, this is not generally true so be wary of traversals that require global views of a sideEffect.
  . When evaluating traversals that rely on path information (i.e. the history of the traversal), practical computational limits can easily be reached due the link:http://en.wikipedia.org/wiki/Combinatorial_explosion[combinatoric explosion] of data. With path computing enabled, every traverser is unique and thus, must be enumerated as opposed to being counted/merged. The difference being a collection of paths vs. a single 64-bit long at a single vertex. For more information on this concept, please see link:http://thinkaurelius.com/2012/11/11/faunus-provides-big-graph-data-analytics/[Faunus Provides Big Graph Data].
  . When traversals of the form `x.as('a').y.someSideEffectStep('a').z` are evaluated, the `a` object is stored in the path information of the traverser and thus, such traversals (may) turn on path calculations when executed on a GraphComputer.
- . Steps that are concerned with the global ordering of traversers do not have a meaningful representation in OLAP. For example, what does <<order-step,`order()`>>-step mean when all traversers are being processed in parallel? Even if the traversers were aggregated and ordered, then at the next step they would return to being executed in parallel and thus, in an unpredictable order. Other steps of this nature include <<order-step,`order()`>>. When these steps are executed at the end of a traversal (i.e the final step), the `TraverserMapReduce` job ensures the resultant serial representation is ordered accordingly.
+ . Steps that are concerned with the global ordering of traversers do not have a meaningful representation in OLAP. For example, what does <<order-step,`order()`>>-step mean when all traversers are being processed in parallel? Even if the traversers were aggregated and ordered, then at the next step they would return to being executed in parallel and thus, in an unpredictable order. When `order()`-like steps are executed at the end of a traversal (i.e the final step), the `TraverserMapReduce` job ensures the resultant serial representation is ordered accordingly.
  . Steps that are concerned with providing a global aggregate to the next step of computation do not have a correlate in OLAP. For example, <<fold-step,`fold()`>>-step can only fold up the objects at each executing vertex. Next, even if a global fold was possible, where would it go? Which vertex would be the host of the data structure? The `fold()`-step only makes sense as an end-step whereby a MapReduce job can generate the proper global-to-local data reduction.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MessageScope.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MessageScope.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MessageScope.java
index f72f4ee..1304703 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MessageScope.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MessageScope.java
@@ -18,8 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.process.computer;
 
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramHelper;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 
@@ -67,6 +67,16 @@ public abstract class MessageScope {
         public static Global instance() {
             return INSTANCE;
         }
+
+        @Override
+        public int hashCode() {
+            return 4676576;
+        }
+
+        @Override
+        public boolean equals(final Object other) {
+            return other instanceof Global;
+        }
     }
 
     /**
@@ -82,19 +92,20 @@ public abstract class MessageScope {
     public final static class Local<M> extends MessageScope {
         public final Supplier<? extends Traversal<Vertex, Edge>> incidentTraversal;
         public final BiFunction<M, Edge, M> edgeFunction;
+        private final String toStringOfTraversal;
 
         private Local(final Supplier<? extends Traversal<Vertex, Edge>> incidentTraversal) {
-            this.incidentTraversal = incidentTraversal;
-            this.edgeFunction = (final M m, final Edge e) -> m; // the default is an identity function
+            this(incidentTraversal, (final M m, final Edge e) -> m); // the default is an identity function
         }
 
         private Local(final Supplier<? extends Traversal<Vertex, Edge>> incidentTraversal, final BiFunction<M, Edge, M> edgeFunction) {
             this.incidentTraversal = incidentTraversal;
+            this.toStringOfTraversal = this.incidentTraversal.get().toString();
             this.edgeFunction = edgeFunction;
         }
 
         public static <M> Local<M> of(final Supplier<? extends Traversal<Vertex, Edge>> incidentTraversal) {
-            return new Local(incidentTraversal);
+            return new Local<>(incidentTraversal);
         }
 
         public static <M> Local<M> of(final Supplier<? extends Traversal<Vertex, Edge>> incidentTraversal, final BiFunction<M, Edge, M> edgeFunction) {
@@ -109,6 +120,18 @@ public abstract class MessageScope {
             return this.incidentTraversal;
         }
 
+        @Override
+        public int hashCode() {
+            return this.edgeFunction.hashCode() + this.incidentTraversal.get().toString().hashCode();
+        }
+
+        @Override
+        public boolean equals(final Object other) {
+            return other instanceof Local &&
+                    ((Local<?>) other).toStringOfTraversal.equals(this.toStringOfTraversal) &&
+                    ((Local<?>) other).edgeFunction == this.edgeFunction;
+        }
+
         /**
          * A helper class that can be used to generate the reverse traversal of the traversal within a {@link MessageScope.Local}.
          */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
index 3f04069..a6746ba 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Messenger.java
@@ -34,10 +34,9 @@ public interface Messenger<M> {
     /**
      * The currently executing vertex can receive the messages of the provided {@link MessageScope}.
      *
-     * @param messageScope the message scope of the messages to receive
      * @return the messages for that vertex
      */
-    public Iterator<M> receiveMessages(final MessageScope messageScope);
+    public Iterator<M> receiveMessages();
 
     /**
      * The currently executing vertex can send a message with provided {@link MessageScope}.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
index b1b07ed..0a64cf1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
@@ -136,7 +136,7 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
                 memory.and(VOTE_TO_HALT, false);
             }
         } else if (1 == memory.getIteration() && this.distributeVote) {
-            double voteStrength = 1.0d / IteratorUtils.reduce(IteratorUtils.map(messenger.receiveMessages(this.countScope), Pair::getValue1), 0.0d, (a, b) -> a + b);
+            double voteStrength = 1.0d / IteratorUtils.reduce(IteratorUtils.map(messenger.receiveMessages(), Pair::getValue1), 0.0d, (a, b) -> a + b);
             vertex.property(CLUSTER, vertex.id());
             vertex.property(VOTE_STRENGTH, voteStrength);
             messenger.sendMessage(this.voteScope, new Pair<>((Serializable) vertex.id(), voteStrength));
@@ -144,7 +144,7 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
         } else {
             final Map<Serializable, Double> votes = new HashMap<>();
             votes.put(vertex.value(CLUSTER), vertex.<Double>value(VOTE_STRENGTH));
-            messenger.receiveMessages(this.voteScope).forEachRemaining(message -> MapHelper.incr(votes, message.getValue0(), message.getValue1()));
+            messenger.receiveMessages().forEachRemaining(message -> MapHelper.incr(votes, message.getValue0(), message.getValue1()));
             Serializable cluster = PeerPressureVertexProgram.largestCount(votes);
             if (null == cluster) cluster = (Serializable) vertex.id();
             memory.and(VOTE_TO_HALT, vertex.value(CLUSTER).equals(cluster));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
index 448c560..97529bf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
@@ -128,12 +128,12 @@ public class PageRankVertexProgram extends StaticVertexProgram<Double> {
             messenger.sendMessage(this.countMessageScope, 1.0d);
         } else if (1 == memory.getIteration()) {
             double initialPageRank = 1.0d / this.vertexCountAsDouble;
-            double edgeCount = IteratorUtils.reduce(messenger.receiveMessages(this.countMessageScope), 0.0d, (a, b) -> a + b);
+            double edgeCount = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
             vertex.property(PAGE_RANK, initialPageRank);
             vertex.property(EDGE_COUNT, edgeCount);
             messenger.sendMessage(this.incidentMessageScope, initialPageRank / edgeCount);
         } else {
-            double newPageRank = IteratorUtils.reduce(messenger.receiveMessages(this.incidentMessageScope), 0.0d, (a, b) -> a + b);
+            double newPageRank = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
             newPageRank = (this.alpha * newPageRank) + ((1.0d - this.alpha) / this.vertexCountAsDouble);
             vertex.property(PAGE_RANK, newPageRank);
             messenger.sendMessage(this.incidentMessageScope, newPageRank / vertex.<Double>value(EDGE_COUNT));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/SingleMessenger.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/SingleMessenger.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/SingleMessenger.java
index 953e337..26ed8a4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/SingleMessenger.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/SingleMessenger.java
@@ -38,7 +38,7 @@ public final class SingleMessenger<M> implements Messenger<M> {
     }
 
     @Override
-    public Iterator<M> receiveMessages(final MessageScope messageScope) {
+    public Iterator<M> receiveMessages() {
         return IteratorUtils.of(this.message);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraverserExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraverserExecutor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraverserExecutor.java
index 79175b1..f030dfe 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraverserExecutor.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraverserExecutor.java
@@ -47,7 +47,7 @@ public final class TraverserExecutor {
         final TraverserSet<Object> aliveTraversers = new TraverserSet<>();
         // gather incoming traversers into a traverser set and gain the 'weighted-set' optimization
         final TraversalSideEffects traversalSideEffects = traversalMatrix.getTraversal().getSideEffects();
-        messenger.receiveMessages(MessageScope.Global.instance()).forEachRemaining(traverserSet -> {
+        messenger.receiveMessages().forEachRemaining(traverserSet -> {
             traverserSet.forEach(traverser -> {
                 traverser.setSideEffects(traversalSideEffects);
                 traverser.attach(vertex);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMessenger.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMessenger.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMessenger.java
index dbf5fa4..0041005 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMessenger.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMessenger.java
@@ -19,9 +19,9 @@
 package org.apache.tinkerpop.gremlin.hadoop.process.computer.giraph;
 
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.computer.MessageScope;
 import org.apache.tinkerpop.gremlin.process.computer.Messenger;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StartStep;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
@@ -46,7 +46,7 @@ public class GiraphMessenger<M> implements Messenger<M> {
     }
 
     @Override
-    public Iterator<M> receiveMessages(final MessageScope messageScope) {
+    public Iterator<M> receiveMessages() {
         return IteratorUtils.map(this.messages, ObjectWritable::get);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkMessenger.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkMessenger.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkMessenger.java
index 01153a1..f52843b 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkMessenger.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkMessenger.java
@@ -53,7 +53,7 @@ public final class SparkMessenger<M> implements Messenger<M> {
     }
 
     @Override
-    public Iterator<M> receiveMessages(final MessageScope messageScope) {
+    public Iterator<M> receiveMessages() {
         return this.incomingMessages.iterator();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
index 54f4d82..307722e 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
@@ -140,7 +140,7 @@ public class TinkerGraphComputer implements GraphComputer {
                             while (true) {
                                 final Vertex vertex = vertices.next();
                                 if (null == vertex) return;
-                                vertexProgram.execute(vertex, new TinkerMessenger(vertex, this.messageBoard, vertexProgram.getMessageCombiner()), this.memory);
+                                vertexProgram.execute(vertex, new TinkerMessenger<>(vertex, this.messageBoard, vertexProgram.getMessageCombiner()), this.memory);
                             }
                         });
                         workers.vertexProgramWorkerIterationEnd(this.memory.asImmutable());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessageBoard.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessageBoard.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessageBoard.java
index 9ba4c38..c5ad072 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessageBoard.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessageBoard.java
@@ -18,10 +18,13 @@
  */
 package org.apache.tinkerpop.gremlin.tinkergraph.process.computer;
 
+import org.apache.tinkerpop.gremlin.process.computer.MessageScope;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Queue;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
@@ -31,9 +34,13 @@ class TinkerMessageBoard<M> {
 
     public Map<Vertex, Queue<M>> sendMessages = new ConcurrentHashMap<>();
     public Map<Vertex, Queue<M>> receiveMessages = new ConcurrentHashMap<>();
+    public Set<MessageScope> previousMessageScopes = new HashSet<>();
+    public Set<MessageScope> currentMessageScopes = new HashSet<>();
 
     public void completeIteration() {
         this.receiveMessages = this.sendMessages;
         this.sendMessages = new ConcurrentHashMap<>();
+        this.previousMessageScopes = this.currentMessageScopes;
+        this.currentMessageScopes = new HashSet<>();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/daec1c3b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
index ca7f89e..673345b 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
@@ -30,10 +30,13 @@ import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.util.StreamFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.MultiIterator;
 
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Optional;
 import java.util.Queue;
+import java.util.Set;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.stream.Stream;
 
@@ -46,7 +49,6 @@ public class TinkerMessenger<M> implements Messenger<M> {
     private final TinkerMessageBoard<M> messageBoard;
     private final MessageCombiner<M> combiner;
 
-
     public TinkerMessenger(final Vertex vertex, final TinkerMessageBoard<M> messageBoard, final Optional<MessageCombiner<M>> combiner) {
         this.vertex = vertex;
         this.messageBoard = messageBoard;
@@ -54,30 +56,35 @@ public class TinkerMessenger<M> implements Messenger<M> {
     }
 
     @Override
-    public Iterator<M> receiveMessages(final MessageScope messageScope) {
-        if (messageScope instanceof MessageScope.Local) {
-            final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope;
-            final Traversal.Admin<Vertex, Edge> incidentTraversal = TinkerMessenger.setVertexStart(localMessageScope.getIncidentTraversal().get().asAdmin(), this.vertex);
-            final Direction direction = TinkerMessenger.getDirection(incidentTraversal);
-            final Edge[] edge = new Edge[1]; // simulates storage side-effects available in Gremlin, but not Java8 streams
-            return StreamFactory.stream(VertexProgramHelper.reverse(incidentTraversal.asAdmin()))
-                    .map(e -> this.messageBoard.receiveMessages.get((edge[0] = e).vertices(direction).next()))
-                    .filter(q -> null != q)
-                    .flatMap(q -> q.stream())
-                    .map(message -> localMessageScope.getEdgeFunction().apply(message, edge[0]))
-                    .iterator();
+    public Iterator<M> receiveMessages() {
+        final MultiIterator<M> multiIterator = new MultiIterator<>();
+        for (final MessageScope messageScope : this.messageBoard.previousMessageScopes) {
+            if (messageScope instanceof MessageScope.Local) {
+                final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope;
+                final Traversal.Admin<Vertex, Edge> incidentTraversal = TinkerMessenger.setVertexStart(localMessageScope.getIncidentTraversal().get().asAdmin(), this.vertex);
+                final Direction direction = TinkerMessenger.getDirection(incidentTraversal);
+                final Edge[] edge = new Edge[1]; // simulates storage side-effects available in Gremlin, but not Java8 streams
+                multiIterator.addIterator(StreamFactory.stream(VertexProgramHelper.reverse(incidentTraversal.asAdmin()))
+                        .map(e -> this.messageBoard.receiveMessages.get((edge[0] = e).vertices(direction).next()))
+                        .filter(q -> null != q)
+                        .flatMap(q -> q.stream())
+                        .map(message -> localMessageScope.getEdgeFunction().apply(message, edge[0]))
+                        .iterator());
 
-        } else {
-            return Stream.of(this.vertex)
-                    .map(this.messageBoard.receiveMessages::get)
-                    .filter(q -> null != q)
-                    .flatMap(q -> q.stream())
-                    .iterator();
+            } else {
+                multiIterator.addIterator(Stream.of(this.vertex)
+                        .map(this.messageBoard.receiveMessages::get)
+                        .filter(q -> null != q)
+                        .flatMap(q -> q.stream())
+                        .iterator());
+            }
         }
+        return multiIterator;
     }
 
     @Override
     public void sendMessage(final MessageScope messageScope, final M message) {
+        this.messageBoard.currentMessageScopes.add(messageScope);
         if (messageScope instanceof MessageScope.Local) {
             addMessage(this.vertex, message);
         } else {


[14/50] incubator-tinkerpop git commit: Remove user defined IDs from vertices.

Posted by sp...@apache.org.
Remove user defined IDs from vertices.


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

Branch: refs/heads/variables
Commit: b42796047a340410be408338a025e36d7c837c72
Parents: 0eddf8e
Author: Bryn Cooke <br...@gmail.com>
Authored: Tue Apr 14 11:48:06 2015 +0100
Committer: Bryn Cooke <br...@gmail.com>
Committed: Tue Apr 14 11:48:06 2015 +0100

----------------------------------------------------------------------
 .../groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b4279604/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
index 4be3f98..92bdf27 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
@@ -25,7 +25,6 @@ import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider;
-import org.apache.tinkerpop.gremlin.process.traversal.T;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -350,8 +349,8 @@ public class GremlinGroovyScriptEngineOverGraphTest extends AbstractGremlinTest
     @Test
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     public void shouldProcessUTF8Query() throws Exception {
-        final Vertex nonUtf8 = graph.addVertex(T.id, "1", "name", "marko", "age", 29);
-        final Vertex utf8Name = graph.addVertex(T.id, "2", "name", "轉注", "age", 32);
+        final Vertex nonUtf8 = graph.addVertex("name", "marko", "age", 29);
+        final Vertex utf8Name = graph.addVertex("name", "轉注", "age", 32);
 
         final ScriptEngine engine = new GremlinGroovyScriptEngine();
 


[18/50] incubator-tinkerpop git commit: Add test of has() around id for VertexProperty TINKERPOP3-581

Posted by sp...@apache.org.
Add test of has() around id for VertexProperty TINKERPOP3-581


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

Branch: refs/heads/variables
Commit: 13b936ec24bf68a880e64b8c68e6fcc76e50da12
Parents: cc0b848
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 09:08:31 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 09:08:31 2015 -0400

----------------------------------------------------------------------
 .../step/map/GroovyPropertiesTest.groovy        | 19 +++++++++++----
 .../tinkerpop/gremlin/AbstractGremlinTest.java  | 15 ++++++++++++
 .../traversal/step/map/PropertiesTest.java      | 25 ++++++++++++++++++++
 3 files changed, 55 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/13b936ec/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy
index d9b1d9f..dc4c77c 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step.map
 
+import org.apache.tinkerpop.gremlin.process.traversal.T
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal
 import org.apache.tinkerpop.gremlin.process.computer.ComputerTestHelper
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine
@@ -34,12 +35,17 @@ public abstract class GroovyPropertiesTest {
 
         @Override
         public Traversal<Vertex, Object> get_g_V_hasXageX_propertiesXname_ageX_value() {
-            g.V.has('age').properties('name', 'age').value;
+            g.V.has('age').properties('name', 'age').value
         }
 
         @Override
         public Traversal<Vertex, Object> get_g_V_hasXageX_propertiesXage_nameX_value() {
-            g.V.has('age').properties('age', 'name').value;
+            g.V.has('age').properties('age', 'name').value
+        }
+
+        @Override
+        public Traversal<Vertex, Object> get_g_V_hasXageX_properties_hasXid_nameIdX_value(final Object nameId) {
+            g.V.has('age').properties().has(T.id, nameId).value()
         }
     }
 
@@ -48,12 +54,17 @@ public abstract class GroovyPropertiesTest {
 
         @Override
         public Traversal<Vertex, Object> get_g_V_hasXageX_propertiesXname_ageX_value() {
-            ComputerTestHelper.compute("g.V.has('age').properties('name', 'age').value", g);
+            ComputerTestHelper.compute("g.V.has('age').properties('name', 'age').value", g)
         }
 
         @Override
         public Traversal<Vertex, Object> get_g_V_hasXageX_propertiesXage_nameX_value() {
-            ComputerTestHelper.compute("g.V.has('age').properties('age', 'name').value", g);
+            ComputerTestHelper.compute("g.V.has('age').properties('age', 'name').value", g)
+        }
+
+        @Override
+        public Traversal<Vertex, Object> get_g_V_hasXageX_properties_hasXid_nameIdX_value(final Object nameId) {
+            ComputerTestHelper.compute("g.V.has('age').properties().has(T.id, $nameId).value()", g)
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/13b936ec/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 c348a8b..a5f6a10 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
@@ -21,10 +21,12 @@ package org.apache.tinkerpop.gremlin;
 import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.After;
 import org.junit.Before;
@@ -159,6 +161,19 @@ public abstract class AbstractGremlinTest {
         return graph.traversal().V().has("name", vertexName).next();
     }
 
+    public GraphTraversal<Vertex, Object> convertToVertexPropertyId(final String vertexName, final String vertexPropertyKey) {
+        return convertToVertexPropertyId(graph, vertexName, vertexPropertyKey);
+    }
+
+    public GraphTraversal<Vertex, Object> convertToVertexPropertyId(final Graph g, final String vertexName, final String vertexPropertyKey) {
+        return convertToVertexProperty(g, vertexName, vertexPropertyKey).id();
+    }
+
+    public GraphTraversal<Vertex, VertexProperty<Object>> convertToVertexProperty(final Graph graph, final String vertexName, final String vertexPropertyKey) {
+        // all test graphs have "name" as a unique id which makes it easy to hardcode this...works for now
+        return (GraphTraversal<Vertex, VertexProperty<Object>>) graph.traversal().V().has("name", vertexName).properties(vertexPropertyKey);
+    }
+
     public Object convertToEdgeId(final String outVertexName, String edgeLabel, final String inVertexName) {
         return convertToEdgeId(graph, outVertexName, edgeLabel, inVertexName);
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/13b936ec/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesTest.java
index cf90191..355fef5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesTest.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.map;
 
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
+import org.apache.tinkerpop.gremlin.process.traversal.T;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.UseEngine;
@@ -27,6 +28,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 
 import java.util.Arrays;
+import java.util.Collections;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
 
@@ -39,6 +41,8 @@ public abstract class PropertiesTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Vertex, Object> get_g_V_hasXageX_propertiesXage_nameX_value();
 
+    public abstract Traversal<Vertex, Object> get_g_V_hasXageX_properties_hasXid_nameIdX_value(final Object nameId);
+
     @Test
     @LoadGraphWith(MODERN)
     public void g_V_hasXageX_propertiesXname_ageX_value() {
@@ -48,6 +52,22 @@ public abstract class PropertiesTest extends AbstractGremlinProcessTest {
         });
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_hasXageX_properties_hasXid_nameIdX_value() {
+        final Traversal<Vertex,Object> traversal = get_g_V_hasXageX_properties_hasXid_nameIdX_value(convertToVertexPropertyId("marko", "name").next());
+        printTraversalForm(traversal);
+        checkResults(Collections.singletonList("marko"), traversal);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_hasXageX_properties_hasXid_nameIdAsStringX_value() {
+        final Traversal<Vertex,Object> traversal = get_g_V_hasXageX_properties_hasXid_nameIdX_value(convertToVertexPropertyId("marko", "name").next().toString());
+        printTraversalForm(traversal);
+        checkResults(Collections.singletonList("marko"), traversal);
+    }
+
     @UseEngine(TraversalEngine.Type.STANDARD)
     @UseEngine(TraversalEngine.Type.COMPUTER)
     public static class Traversals extends PropertiesTest {
@@ -60,6 +80,11 @@ public abstract class PropertiesTest extends AbstractGremlinProcessTest {
         public Traversal<Vertex, Object> get_g_V_hasXageX_propertiesXage_nameX_value() {
             return g.V().has("age").properties("age", "name").value();
         }
+
+        @Override
+        public Traversal<Vertex, Object> get_g_V_hasXageX_properties_hasXid_nameIdX_value(final Object nameId) {
+            return g.V().has("age").properties().has(T.id, nameId).value();
+        }
     }
 }
 


[34/50] incubator-tinkerpop git commit: VertexProperty.Cardinality default is determined by the vendor. If the vendor has a graph shcema, use that cardinality defined it the graph schema. If not, the vendor should use Cardinality.single.

Posted by sp...@apache.org.
VertexProperty.Cardinality default is determined by the vendor. If the vendor has a graph shcema, use that cardinality defined it the graph schema. If not, the vendor should use Cardinality.single.


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

Branch: refs/heads/variables
Commit: 46683cfc2f31fb913d56e762e73a820f26117c60
Parents: d86626c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Apr 14 17:19:36 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Apr 14 17:19:36 2015 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../peerpressure/PeerPressureVertexProgram.java | 11 +++++----
 .../ranking/pagerank/PageRankVertexProgram.java |  7 +++---
 .../traversal/TraversalVertexProgram.java       |  3 ++-
 .../util/DefaultTraversalSideEffects.java       |  3 ++-
 .../tinkerpop/gremlin/structure/Vertex.java     | 12 ++++++----
 .../io/graphson/LegacyGraphSONReader.java       |  3 ++-
 .../structure/util/batch/BatchGraph.java        |  5 ++++
 .../structure/util/detached/DetachedVertex.java |  5 ++++
 .../util/detached/DetachedVertexProperty.java   |  2 +-
 .../util/reference/ReferenceVertex.java         |  5 ++++
 .../gremlin/structure/util/star/StarGraph.java  | 10 ++++++++
 .../ser/GryoMessageSerializerV1D0Test.java      |  3 ++-
 .../JsonMessageSerializerGremlinV1d0Test.java   |  3 ++-
 .../ser/JsonMessageSerializerV1d0Test.java      |  3 ++-
 .../generator/CommunityGeneratorTest.java       |  3 ++-
 .../process/computer/GraphComputerTest.java     |  6 ++---
 .../decoration/EventStrategyProcessTest.java    |  8 +++----
 .../gremlin/structure/FeatureSupportTest.java   | 24 ++++++++++----------
 .../tinkerpop/gremlin/structure/GraphTest.java  |  4 ++--
 .../tinkerpop/gremlin/structure/IoTest.java     |  6 ++---
 .../gremlin/structure/PropertyTest.java         |  4 ++--
 .../gremlin/structure/TransactionTest.java      | 10 ++++----
 .../gremlin/structure/VertexPropertyTest.java   | 18 +++++++--------
 .../tinkerpop/gremlin/structure/VertexTest.java | 18 +++++++--------
 .../detached/DetachedVertexPropertyTest.java    | 18 +++++++--------
 .../util/detached/DetachedVertexTest.java       |  2 +-
 .../reference/ReferenceVertexPropertyTest.java  | 14 ++++++------
 .../util/reference/ReferenceVertexTest.java     |  3 ++-
 .../structure/io/script/script-input.groovy     |  8 ++++---
 .../gremlin/hadoop/structure/HadoopVertex.java  |  6 ++++-
 .../tinkergraph/structure/TinkerVertex.java     |  5 ++++
 .../structure/TinkerGraphIdManagerTest.java     |  6 ++---
 33 files changed, 144 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index b386d1d..394641c 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.0.M9 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `VertexProperty.Cardinality` default is now vendor chosen. If the vendor has not preference, they should use `Cardinality.single`.
 * `Messenger.receiveMessages()` no longer takes a `MessageScope` and thus, consistent behavior between message-passing and message-pulling systems.
 * Removed `back()`-step as `select()`-step provides the same behavior with more intelligent optimizations and `by()`-modulation.
 * Removed `Graph.Helper` method annotation and related infrastructure in tests.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
index 0a64cf1..c9070dd 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
@@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.MapHelper;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.javatuples.Pair;
@@ -130,15 +131,15 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
                 messenger.sendMessage(this.countScope, Pair.with('c', 1.0d));
             } else {
                 double voteStrength = 1.0d;
-                vertex.property(CLUSTER, vertex.id());
-                vertex.property(VOTE_STRENGTH, voteStrength);
+                vertex.property(VertexProperty.Cardinality.single, CLUSTER, vertex.id());
+                vertex.property(VertexProperty.Cardinality.single, VOTE_STRENGTH, voteStrength);
                 messenger.sendMessage(this.voteScope, new Pair<>((Serializable) vertex.id(), voteStrength));
                 memory.and(VOTE_TO_HALT, false);
             }
         } else if (1 == memory.getIteration() && this.distributeVote) {
             double voteStrength = 1.0d / IteratorUtils.reduce(IteratorUtils.map(messenger.receiveMessages(), Pair::getValue1), 0.0d, (a, b) -> a + b);
-            vertex.property(CLUSTER, vertex.id());
-            vertex.property(VOTE_STRENGTH, voteStrength);
+            vertex.property(VertexProperty.Cardinality.single, CLUSTER, vertex.id());
+            vertex.property(VertexProperty.Cardinality.single, VOTE_STRENGTH, voteStrength);
             messenger.sendMessage(this.voteScope, new Pair<>((Serializable) vertex.id(), voteStrength));
             memory.and(VOTE_TO_HALT, false);
         } else {
@@ -148,7 +149,7 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
             Serializable cluster = PeerPressureVertexProgram.largestCount(votes);
             if (null == cluster) cluster = (Serializable) vertex.id();
             memory.and(VOTE_TO_HALT, vertex.value(CLUSTER).equals(cluster));
-            vertex.property(CLUSTER, cluster);
+            vertex.property(VertexProperty.Cardinality.single, CLUSTER, cluster);
             messenger.sendMessage(this.voteScope, new Pair<>(cluster, vertex.<Double>value(VOTE_STRENGTH)));
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
index 97529bf..cbd999c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
@@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
@@ -129,13 +130,13 @@ public class PageRankVertexProgram extends StaticVertexProgram<Double> {
         } else if (1 == memory.getIteration()) {
             double initialPageRank = 1.0d / this.vertexCountAsDouble;
             double edgeCount = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
-            vertex.property(PAGE_RANK, initialPageRank);
-            vertex.property(EDGE_COUNT, edgeCount);
+            vertex.property(VertexProperty.Cardinality.single, PAGE_RANK, initialPageRank);
+            vertex.property(VertexProperty.Cardinality.single, EDGE_COUNT, edgeCount);
             messenger.sendMessage(this.incidentMessageScope, initialPageRank / edgeCount);
         } else {
             double newPageRank = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
             newPageRank = (this.alpha * newPageRank) + ((1.0d - this.alpha) / this.vertexCountAsDouble);
-            vertex.property(PAGE_RANK, newPageRank);
+            vertex.property(VertexProperty.Cardinality.single, PAGE_RANK, newPageRank);
             messenger.sendMessage(this.incidentMessageScope, newPageRank / vertex.<Double>value(EDGE_COUNT));
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
index c50e1fd..3fe61c9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
@@ -48,6 +48,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge;
 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.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
@@ -144,7 +145,7 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
         this.traversal.getSideEffects().setLocalVertex(vertex);
         if (memory.isInitialIteration()) {    // ITERATION 1
             final TraverserSet<Object> haltedTraversers = new TraverserSet<>();
-            vertex.property(HALTED_TRAVERSERS, haltedTraversers);
+            vertex.property(VertexProperty.Cardinality.single, HALTED_TRAVERSERS, haltedTraversers);
 
             if (!(this.traversal.getStartStep() instanceof GraphStep))
                 throw new UnsupportedOperationException("TraversalVertexProgram currently only supports GraphStep starts on vertices or edges");

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
index b93185e..fe8f83e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
@@ -21,6 +21,7 @@ package org.apache.tinkerpop.gremlin.process.traversal.util;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.Collections;
@@ -171,7 +172,7 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
             this.objectMap = property.value();
         } else {
             this.objectMap = new HashMap<>();
-            vertex.property(SIDE_EFFECTS, this.objectMap);
+            vertex.property(VertexProperty.Cardinality.single, SIDE_EFFECTS, this.objectMap);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
index 215cfcb..ca71361 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
@@ -40,6 +40,8 @@ public interface Vertex extends Element {
      */
     public static final String DEFAULT_LABEL = "vertex";
 
+    static final Object[] EMPTY_ARGS = new Object[0];
+
     /**
      * Add an outgoing edge to the vertex with provided label and edge properties as key/value pairs.
      * These key/values must be provided in an even number where the odd numbered arguments are {@link String}
@@ -84,11 +86,13 @@ public interface Vertex extends Element {
      */
     @Override
     public default <V> VertexProperty<V> property(final String key, final V value) {
-        return this.property(VertexProperty.Cardinality.single, key, value);
+        return this.property(key, value, EMPTY_ARGS);
     }
 
     /**
-     * Set the provided key to the provided value using {@link VertexProperty.Cardinality#single}.
+     * Set the provided key to the provided value using default {@link VertexProperty.Cardinality} for that key.
+     * The default cardinality can be vendor defined and is usually tied to the graph schema.
+     * If the vendor does not have a preference, then the default cardinality should be {@link VertexProperty.Cardinality#single}.
      * The provided key/values are the properties of the newly created {@link VertexProperty}.
      * These key/values must be provided in an even number where the odd numbered arguments are {@link String}.
      *
@@ -98,9 +102,7 @@ public interface Vertex extends Element {
      * @param <V>       the type of the value of the vertex property
      * @return the newly created vertex property
      */
-    public default <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
-        return this.property(VertexProperty.Cardinality.single, key, value, keyValues);
-    }
+    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues);
 
     /**
      * Create a new vertex property.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
index 0404fab..b35a93b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.GraphReader;
 import org.apache.tinkerpop.gremlin.structure.util.batch.BatchGraph;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
@@ -199,7 +200,7 @@ public class LegacyGraphSONReader implements GraphReader {
             final Vertex v = g.addVertex(T.id, vertexId);
 
             for (Map.Entry<String, Object> entry : props.entrySet()) {
-                v.property(entry.getKey(), entry.getValue());
+                v.property(VertexProperty.Cardinality.list, entry.getKey(), entry.getValue());
             }
 
             return v;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/batch/BatchGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/batch/BatchGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/batch/BatchGraph.java
index f68e2c1..e156815 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/batch/BatchGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/batch/BatchGraph.java
@@ -449,6 +449,11 @@ public class BatchGraph<G extends Graph> implements Graph {
         }
 
         @Override
+        public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+            return getCachedVertex(externalID).property(key, value, keyValues);
+        }
+
+        @Override
         public <V> V value(final String key) throws NoSuchElementException {
             return getCachedVertex(externalID).value(key);
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
index 85b1e3a..a4857ef 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
@@ -94,6 +94,11 @@ public class DetachedVertex extends DetachedElement<Vertex> implements Vertex {
     }
 
     @Override
+    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+        throw Element.Exceptions.propertyAdditionNotSupported();
+    }
+
+    @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
         throw Element.Exceptions.propertyAdditionNotSupported();
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
index 87b8178..484db13 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
@@ -129,7 +129,7 @@ public class DetachedVertexProperty<V> extends DetachedElement<Property<V>> impl
     }
 
     public static <V> VertexProperty<V> addTo(final Vertex vertex, final DetachedVertexProperty<V> detachedVertexProperty) {
-        final VertexProperty<V> vertexProperty = vertex.property(detachedVertexProperty.key(), detachedVertexProperty.value());
+        final VertexProperty<V> vertexProperty = vertex.property(VertexProperty.Cardinality.list, detachedVertexProperty.key(), detachedVertexProperty.value());
         detachedVertexProperty.properties().forEachRemaining(property -> vertexProperty.property(property.key(), property.value()));
         return vertexProperty;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertex.java
index ac57da0..415ca61 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertex.java
@@ -70,6 +70,11 @@ public class ReferenceVertex extends ReferenceElement<Vertex> implements Vertex
     }
 
     @Override
+    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+        throw Element.Exceptions.propertyAdditionNotSupported();
+    }
+
+    @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
         throw Element.Exceptions.propertyAdditionNotSupported();
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
index db7251b..9c7385c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
@@ -256,6 +256,11 @@ public final class StarGraph implements Graph {
             return this.addOutEdge(label, inVertex, keyValues);
         }
 
+        @Override
+        public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+            return this.property(VertexProperty.Cardinality.single, key, value, keyValues);
+        }
+
         protected Edge addOutEdge(final String label, final Vertex inVertex, final Object... keyValues) {
             List<Edge> outE = this.outEdges.get(label);
             if (null == outE) {
@@ -448,6 +453,11 @@ public final class StarGraph implements Graph {
         }
 
         @Override
+        public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+            throw Element.Exceptions.propertyAdditionNotSupported();
+        }
+
+        @Override
         public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
             throw Element.Exceptions.propertyAdditionNotSupported();
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1D0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1D0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1D0Test.java
index a3ea433..978c8a2 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1D0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1D0Test.java
@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.structure.Compare;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
@@ -195,7 +196,7 @@ public class GryoMessageSerializerV1D0Test {
         friends.add(5);
         friends.add(map);
 
-        v.property("friends", friends);
+        v.property(VertexProperty.Cardinality.single, "friends", friends);
 
         final List list = IteratorUtils.list(g.vertices());
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
index 907915f..adf42be 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
@@ -172,7 +173,7 @@ public class JsonMessageSerializerGremlinV1d0Test {
         friends.add(5);
         friends.add(map);
 
-        v.property("friends", friends);
+        v.property(VertexProperty.Cardinality.single, "friends", friends);
 
         final List list = IteratorUtils.list(graph.vertices());
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
index 15eb158..c29d892 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
@@ -224,7 +225,7 @@ public class JsonMessageSerializerV1d0Test {
         friends.add(5);
         friends.add(map);
 
-        v.property("friends", friends);
+        v.property(VertexProperty.Cardinality.single, "friends", friends);
 
         final Iterable iterable = IteratorUtils.list(g.vertices());
         final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java
index 7102ce5..08f1bdc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.util.StreamFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.Test;
@@ -198,7 +199,7 @@ public class CommunityGeneratorTest {
                     .edgeProcessor(e -> e.<String>property("data", "test"))
                     .vertexProcessor((v, m) -> {
                         m.forEach(v::property);
-                        v.property("test", "data");
+                        v.property(VertexProperty.Cardinality.single, "test", "data");
                     })
                     .communityDistribution(dist)
                     .degreeDistribution(dist)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index e2708b1..6998017 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -468,7 +468,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
         @Override
         public void execute(final Vertex vertex, final Messenger<Object> messenger, final Memory memory) {
             try {
-                vertex.property("blah", "blah");
+                vertex.property(VertexProperty.Cardinality.single, "blah", "blah");
                 fail("Should throw an IllegalArgumentException");
             } catch (final IllegalArgumentException e) {
                 assertEquals(GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey("blah").getMessage(), e.getMessage());
@@ -478,7 +478,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
 
             memory.incr("a", 1);
             if (memory.isInitialIteration()) {
-                vertex.property("nameLengthCounter", vertex.<String>value("name").length());
+                vertex.property(VertexProperty.Cardinality.single, "nameLengthCounter", vertex.<String>value("name").length());
                 memory.incr("b", vertex.<String>value("name").length());
             } else {
                 vertex.property(VertexProperty.Cardinality.single, "nameLengthCounter", vertex.<String>value("name").length() + vertex.<Integer>value("nameLengthCounter"));
@@ -750,7 +750,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
 
         @Override
         public void map(final Vertex vertex, final MapEmitter<Integer, Integer> emitter) {
-            vertex.<Integer>property("age").ifPresent(age -> emitter.emit(age,age));
+            vertex.<Integer>property("age").ifPresent(age -> emitter.emit(age, age));
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
index 2103582..12b9b15 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
@@ -141,7 +141,7 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
                 .addListener(listener2).create();
 
         final Vertex vSome = graph.addVertex("some", "thing");
-        vSome.property("that", "thing");
+        vSome.property(VertexProperty.Cardinality.single, "that", "thing");
         final GraphTraversalSource gts = create(eventStrategy);
         gts.V().addV("any", "thing").property(VertexProperty.Cardinality.single, "this", "thing").next();
 
@@ -163,7 +163,7 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
                 .addListener(listener2).create();
 
         final Vertex vSome = graph.addVertex("some", "thing");
-        vSome.property("that", "thing");
+        vSome.property(VertexProperty.Cardinality.single, "that", "thing");
         final GraphTraversalSource gts = create(eventStrategy);
         final Vertex vAny = gts.V().addV("any", "thing").next();
         gts.V(vAny).property(VertexProperty.Cardinality.single, "any", "thing else").next();
@@ -187,7 +187,7 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
                 .addListener(listener2).create();
 
         final Vertex vSome = graph.addVertex("some", "thing");
-        vSome.property("that", "thing", "is", "good");
+        vSome.property(VertexProperty.Cardinality.single, "that", "thing", "is", "good");
         final GraphTraversalSource gts = create(eventStrategy);
         final Vertex vAny = gts.V().addV("any", "thing").next();
         gts.V(vAny).properties("any").property("is", "bad").next();
@@ -345,7 +345,7 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
                 .addListener(listener2).create();
 
         final Vertex vSome = graph.addVertex("some", "thing");
-        vSome.property("that", "thing", "is", "good");
+        vSome.property(VertexProperty.Cardinality.single, "that", "thing", "is", "good");
         final GraphTraversalSource gts = create(eventStrategy);
         final Vertex vAny = gts.V().addV("any", "thing").next();
         gts.V(vAny).properties("any").property("is", "bad").next();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index fa98ef0..aac0b52 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -285,7 +285,7 @@ public class FeatureSupportTest {
         public void shouldSupportAddVertexPropertyIfItCanBeAdded() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("should", "not-add-property");
+                v.property(VertexProperty.Cardinality.single, "should", "not-add-property");
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), VertexFeatures.FEATURE_ADD_PROPERTY));
             } catch (Exception e) {
                 validateException(Element.Exceptions.propertyAdditionNotSupported(), e);
@@ -624,7 +624,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsIfAnIdCanBeAssigned() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("name", "me", T.id, GraphManager.getGraphProvider().convertId(99999943835l, VertexProperty.class));
+                v.property(VertexProperty.Cardinality.single, "name", "me", T.id, GraphManager.getGraphProvider().convertId(99999943835l, VertexProperty.class));
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), VertexPropertyFeatures.FEATURE_USER_SUPPLIED_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsNotSupported(), ex);
@@ -638,7 +638,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("test", v, T.id, "this-is-a-valid-id");
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, "this-is-a-valid-id");
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
@@ -652,7 +652,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("test", v, T.id, 123456);
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, 123456);
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
@@ -660,7 +660,7 @@ public class FeatureSupportTest {
 
             try {
                 final Vertex v = graph.addVertex();
-                v.property("test", v, T.id, 123456l);
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, 123456l);
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
@@ -674,7 +674,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("test", v, T.id, UUID.randomUUID());
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, UUID.randomUUID());
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
@@ -689,7 +689,7 @@ public class FeatureSupportTest {
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("test", v, T.id, new Date());
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, new Date());
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
@@ -702,7 +702,7 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportStringIdsIfStringIdsAreGeneratedFromTheGraph() throws Exception {
             final Vertex v = graph.addVertex();
-            final VertexProperty p = v.property("name", "stephen");
+            final VertexProperty p = v.property(VertexProperty.Cardinality.single, "name", "stephen");
             if (p.id() instanceof String)
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), VertexPropertyFeatures.FEATURE_STRING_IDS));
         }
@@ -713,7 +713,7 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUuidIdsIfUuidIdsAreGeneratedFromTheGraph() throws Exception {
             final Vertex v = graph.addVertex();
-            final VertexProperty p = v.property("name", "stephen");
+            final VertexProperty p = v.property(VertexProperty.Cardinality.single, "name", "stephen");
             if (p.id() instanceof UUID)
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), VertexPropertyFeatures.FEATURE_UUID_IDS));
         }
@@ -724,7 +724,7 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
         public void shouldSupportNumericIdsIfNumericIdsAreGeneratedFromTheGraph() throws Exception {
             final Vertex v = graph.addVertex();
-            final VertexProperty p = v.property("name", "stephen");
+            final VertexProperty p = v.property(VertexProperty.Cardinality.single, "name", "stephen");
             if (p.id() instanceof Number)
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), VertexPropertyFeatures.FEATURE_NUMERIC_IDS));
         }
@@ -737,7 +737,7 @@ public class FeatureSupportTest {
         public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                final VertexProperty p = v.property("name", "me", "test", "this");
+                final VertexProperty p = v.property(VertexProperty.Cardinality.single, "name", "me", "test", "this");
                 p.property("test").remove();
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), VertexPropertyFeatures.FEATURE_REMOVE_PROPERTY));
             } catch (Exception ex) {
@@ -767,7 +767,7 @@ public class FeatureSupportTest {
         public void shouldSupportMetaPropertyIfPropertiesCanBePutOnProperties() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
-                v.property("name", "stephen", "property", "on-property");
+                v.property(VertexProperty.Cardinality.single, "name", "stephen", "property", "on-property");
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), VertexFeatures.FEATURE_META_PROPERTIES));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.metaPropertiesNotSupported(), ex);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index 7bd6cd7..13062b8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -1038,8 +1038,8 @@ public class GraphTest extends AbstractGremlinTest {
         final Vertex v = graph.addVertex();
         final Vertex u = graph.addVertex();
         if (graph.features().edge().properties().supportsStringValues()) {
-            v.property("name", "marko");
-            u.property("name", "pavel");
+            v.property(VertexProperty.Cardinality.single, "name", "marko");
+            u.property(VertexProperty.Cardinality.single, "name", "pavel");
         }
 
         final Edge e = v.addEdge(graphProvider.convertLabel("collaborator"), u);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
index bf36d54..d4c3e5f 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/IoTest.java
@@ -233,7 +233,7 @@ public class IoTest extends AbstractGremlinTest {
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_STRING_IDS)
     public void shouldProperlyEncodeWithGraphML() throws Exception {
         final Vertex v = graph.addVertex(T.id, "1");
-        v.property("text", "\u00E9");
+        v.property(VertexProperty.Cardinality.single, "text", "\u00E9");
 
         final GraphMLWriter w = GraphMLWriter.build().create();
 
@@ -1074,7 +1074,7 @@ public class IoTest extends AbstractGremlinTest {
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldReadWriteVertexMultiPropsNoEdgesToGryo() throws Exception {
         final Vertex v1 = graph.addVertex("name", "marko", "name", "mark", "acl", "rw");
-        v1.property("propsSquared", 123, "x", "a", "y", "b");
+        v1.property(VertexProperty.Cardinality.single, "propsSquared", 123, "x", "a", "y", "b");
         final Vertex v2 = graph.addVertex();
         v1.addEdge("friends", v2, "weight", 0.5d);
 
@@ -1211,7 +1211,7 @@ public class IoTest extends AbstractGremlinTest {
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldReadWriteVertexMultiPropsNoEdgesToGraphSON() throws Exception {
         final Vertex v1 = graph.addVertex("name", "marko", "name", "mark", "acl", "rw");
-        v1.property("propsSquared", 123, "x", "a", "y", "b");
+        v1.property(VertexProperty.Cardinality.single, "propsSquared", 123, "x", "a", "y", "b");
         final Vertex v2 = graph.addVertex();
         v1.addEdge("friends", v2, "weight", 0.5d);
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
index c3ea06f..43218f7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
@@ -259,7 +259,7 @@ public class PropertyTest {
         public void testGraphVertexSetPropertyStandard() throws Exception {
             try {
                 final Vertex v = this.graph.addVertex();
-                v.property(key, val);
+                v.property(VertexProperty.Cardinality.single, key, val);
                 fail(String.format("Call to Vertex.setProperty should have thrown an exception with these arguments [%s, %s]", key, val));
             } catch (Exception ex) {
                 validateException(expectedException, ex);
@@ -376,7 +376,7 @@ public class PropertyTest {
         public void shouldSetValueOnVertex() throws Exception {
             assumeThat(graph.features().supports(VertexPropertyFeatures.class, featureName), is(true));
             final Vertex vertex = graph.addVertex();
-            vertex.property("aKey", value);
+            vertex.property(VertexProperty.Cardinality.single, "aKey", value);
             assertPropertyValue(vertex);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
index c1be0c1..8ba47d5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
@@ -281,7 +281,7 @@ public class TransactionTest extends AbstractGremlinTest {
         assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
         assertEquals(e1.id(), graph.edges(e1.id()).next().id());
 
-        v1.property("name", "marko");
+        v1.property(VertexProperty.Cardinality.single, "name", "marko");
         assertEquals("marko", v1.<String>value("name"));
         assertEquals("marko", graph.vertices(v1.id()).next().<String>value("name"));
         g.tx().commit();
@@ -408,8 +408,8 @@ public class TransactionTest extends AbstractGremlinTest {
                         final Edge e = a.addEdge("friend", b);
 
                         vertices.getAndAdd(2);
-                        a.property("test", this.getId());
-                        b.property("blah", random.nextDouble());
+                        a.property(VertexProperty.Cardinality.single, "test", this.getId());
+                        b.property(VertexProperty.Cardinality.single, "blah", random.nextDouble());
                         e.property("bloop", random.nextInt());
                         edges.getAndAdd(1);
                         graph.tx().commit();
@@ -418,8 +418,8 @@ public class TransactionTest extends AbstractGremlinTest {
                         final Vertex b = graph.addVertex();
                         final Edge e = a.addEdge("friend", b);
 
-                        a.property("test", this.getId());
-                        b.property("blah", random.nextDouble());
+                        a.property(VertexProperty.Cardinality.single, "test", this.getId());
+                        b.property(VertexProperty.Cardinality.single, "blah", random.nextDouble());
                         e.property("bloop", random.nextInt());
 
                         if (random.nextBoolean()) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
index 8aab4d0..d81b2e3 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
@@ -55,8 +55,8 @@ public class VertexPropertyTest extends AbstractGremlinTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_INTEGER_VALUES)
         public void shouldValidateEquality() {
             final Vertex v = graph.addVertex();
-            final VertexProperty vp1 = v.property("x", 0);
-            final VertexProperty vp2 = v.property("y", 1);
+            final VertexProperty vp1 = v.property(VertexProperty.Cardinality.single, "x", 0);
+            final VertexProperty vp2 = v.property(VertexProperty.Cardinality.single, "y", 1);
 
             assertEquals(vp1, vp1);
             assertEquals(vp2, vp2);
@@ -68,8 +68,8 @@ public class VertexPropertyTest extends AbstractGremlinTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexPropertyFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_INTEGER_VALUES)
         public void shouldValidateIdEquality() {
             final Vertex v = graph.addVertex();
-            final VertexProperty vp1 = v.property("x", 0);
-            final VertexProperty vp2 = v.property("y", 1);
+            final VertexProperty vp1 = v.property(VertexProperty.Cardinality.single, "x", 0);
+            final VertexProperty vp2 = v.property(VertexProperty.Cardinality.single, "y", 1);
 
             assertEquals(vp1.id(), vp1.id());
             assertEquals(vp2.id(), vp2.id());
@@ -91,7 +91,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
         public void shouldAllowIdAssignment() {
             final Vertex v = graph.addVertex();
             final Object id = graphProvider.convertId(123131231l, VertexProperty.class);
-            v.property("name", "stephen", T.id, id);
+            v.property(VertexProperty.Cardinality.single, "name", "stephen", T.id, id);
 
             tryCommit(graph, g -> assertEquals(id, v.property("name").id()));
         }
@@ -200,7 +200,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
                 assertTrue(values.contains("marko a. rodriguez"));
                 assertTrue(values.contains("marko rodriguez"));
             });
-            v.property("name", "okram", "acl", "private", "date", 2014);
+            v.property(VertexProperty.Cardinality.single, "name", "okram", "acl", "private", "date", 2014);
             tryCommit(graph, g -> {
                 assertEquals(1, IteratorUtils.count(v.properties("name")));
                 assertEquals(1, IteratorUtils.count(v.properties()));
@@ -218,7 +218,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
             final Vertex u = graph.addVertex("name", "marko", "name", "marko a. rodriguez", "name", "marko rodriguez");
             tryCommit(graph);
             u.properties().forEachRemaining(Property::remove);
-            u.property("name", "okram", "acl", "private", "date", 2014);
+            u.property(VertexProperty.Cardinality.single, "name", "okram", "acl", "private", "date", 2014);
             tryCommit(graph, g -> {
                 assertEquals(1, IteratorUtils.count(u.properties("name")));
                 assertEquals(1, IteratorUtils.count(u.properties()));
@@ -500,7 +500,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
         public void shouldThrowExceptionIfVertexPropertyWasRemoved() {
             final Vertex v1 = graph.addVertex();
-            final VertexProperty p = v1.property("name", "stephen", "year", "2012");
+            final VertexProperty p = v1.property(VertexProperty.Cardinality.single, "name", "stephen", "year", "2012");
             final Object id = p.id();
             p.remove();
             tryCommit(graph, g -> {
@@ -521,7 +521,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
         public void shouldReturnEmptyIfNoMetaProperties() {
             final Vertex v = graph.addVertex();
-            final VertexProperty<String> vp = v.property("name", "marko");
+            final VertexProperty<String> vp = v.property(VertexProperty.Cardinality.single, "name", "marko");
             assertEquals(Property.empty(), vp.property("name"));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index 27ed923..b991762 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -334,7 +334,7 @@ public class VertexTest {
             assertVertexEdgeCounts(1, 0).accept(graph);
 
             v.properties("name").forEachRemaining(Property::remove);
-            v.property("name", "marko rodriguez");
+            v.property(VertexProperty.Cardinality.single, "name", "marko rodriguez");
             assertEquals(34, (int) v.value("age"));
             assertEquals("marko rodriguez", v.<String>value("name"));
             assertEquals(34, (int) v.property("age").value());
@@ -346,7 +346,7 @@ public class VertexTest {
             assertFalse(v.keys().contains("location"));
             assertVertexEdgeCounts(1, 0).accept(graph);
 
-            v.property("location", "santa fe");
+            v.property(VertexProperty.Cardinality.single, "location", "santa fe");
             assertEquals(3, IteratorUtils.count(v.properties()));
             assertEquals(3, v.keys().size());
             assertEquals("santa fe", v.property("location").value());
@@ -421,7 +421,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_VALUES)
         public void shouldAutotypeStringProperties() {
             final Vertex v = graph.addVertex();
-            v.property("string", "marko");
+            v.property(VertexProperty.Cardinality.single, "string", "marko");
             final String name = v.value("string");
             assertEquals(name, "marko");
 
@@ -432,7 +432,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
         public void shouldAutotypIntegerProperties() {
             final Vertex v = graph.addVertex();
-            v.property("integer", 33);
+            v.property(VertexProperty.Cardinality.single, "integer", 33);
             final Integer age = v.value("integer");
             assertEquals(Integer.valueOf(33), age);
         }
@@ -442,7 +442,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_BOOLEAN_VALUES)
         public void shouldAutotypeBooleanProperties() {
             final Vertex v = graph.addVertex();
-            v.property("boolean", true);
+            v.property(VertexProperty.Cardinality.single, "boolean", true);
             final Boolean best = v.value("boolean");
             assertEquals(best, true);
         }
@@ -452,7 +452,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_DOUBLE_VALUES)
         public void shouldAutotypeDoubleProperties() {
             final Vertex v = graph.addVertex();
-            v.property("double", 0.1d);
+            v.property(VertexProperty.Cardinality.single, "double", 0.1d);
             final Double best = v.value("double");
             assertEquals(best, Double.valueOf(0.1d));
         }
@@ -462,7 +462,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_LONG_VALUES)
         public void shouldAutotypeLongProperties() {
             final Vertex v = graph.addVertex();
-            v.property("long", 1l);
+            v.property(VertexProperty.Cardinality.single, "long", 1l);
             final Long best = v.value("long");
             assertEquals(best, Long.valueOf(1l));
         }
@@ -472,7 +472,7 @@ public class VertexTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_FLOAT_VALUES)
         public void shouldAutotypeFloatProperties() {
             final Vertex v = graph.addVertex();
-            v.property("float", 0.1f);
+            v.property(VertexProperty.Cardinality.single, "float", 0.1f);
             final Float best = v.value("float");
             assertEquals(best, Float.valueOf(0.1f));
         }
@@ -556,7 +556,7 @@ public class VertexTest {
                     {"remove()", FunctionUtils.wrapConsumer(Vertex::remove)},
                     {"addEdge()", FunctionUtils.wrapConsumer((Vertex v) -> v.addEdge("self", v))},
                     {"property(k,v)", FunctionUtils.wrapConsumer((Vertex v) -> {
-                        v.property("k", "v");
+                        v.property(VertexProperty.Cardinality.single, "k", "v");
                     })},
                     {"property(single,k,v)", FunctionUtils.wrapConsumer((Vertex v) -> {
                         v.property(VertexProperty.Cardinality.single, "k", "v");

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexPropertyTest.java
index 3ac0131..b9ae3ba 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexPropertyTest.java
@@ -38,7 +38,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldNotConstructNewWithSomethingAlreadyDetached() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty dvp = DetachedFactory.detach(vp, true);
         assertSame(dvp, DetachedFactory.detach(dvp, true));
     }
@@ -47,7 +47,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldConstructDetachedPropertyWithPropertyFromVertex() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty mp = DetachedFactory.detach(vp, true);
         assertEquals("test", mp.key());
         assertEquals("this", mp.value());
@@ -58,7 +58,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldConstructDetachedPropertyWithHiddenFromVertex() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty mp = DetachedFactory.detach(vp, true);
         assertEquals("test", mp.key());
         assertEquals("this", mp.value());
@@ -69,7 +69,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldNotSupportRemove() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         DetachedFactory.detach(vp, true).remove();
     }
 
@@ -77,7 +77,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldBeEqualsPropertiesAsIdIsTheSame() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty mp1 = DetachedFactory.detach(vp, true);
         final DetachedVertexProperty mp2 = DetachedFactory.detach(vp, true);
         assertTrue(mp1.equals(mp2));
@@ -87,9 +87,9 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldNotBeEqualsPropertiesAsIdIsDifferent() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp1 = v.property("test", "this");
+        final VertexProperty vp1 = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty mp1 = DetachedFactory.detach(vp1, true);
-        final VertexProperty vp2 = v.property("testing", "this");
+        final VertexProperty vp2 = v.property(VertexProperty.Cardinality.single, "testing", "this");
         final DetachedVertexProperty mp2 = DetachedFactory.detach(vp2, true);
         assertFalse(mp1.equals(mp2));
     }
@@ -125,7 +125,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldAttachToGraph() {
         final Vertex v = graph.addVertex();
-        final VertexProperty toDetach = v.property("test", "this");
+        final VertexProperty toDetach = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty detached = DetachedFactory.detach(toDetach, true);
         final VertexProperty attached = detached.attach(graph);
 
@@ -137,7 +137,7 @@ public class DetachedVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldAttachToVertex() {
         final Vertex v = graph.addVertex();
-        final VertexProperty toDetach = v.property("test", "this");
+        final VertexProperty toDetach = v.property(VertexProperty.Cardinality.single, "test", "this");
         final DetachedVertexProperty detached = DetachedFactory.detach(toDetach, true);
         final VertexProperty attached = detached.attach(v);
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
index 46542f8..add7797 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
@@ -260,7 +260,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
     public void shouldNotAllowSetProperty() {
         final Vertex v = graph.addVertex();
         final DetachedVertex detachedVertex = DetachedFactory.detach(v, true);
-        detachedVertex.property("test", "test");
+        detachedVertex.property(VertexProperty.Cardinality.single, "test", "test");
     }
 
     @Test(expected = IllegalStateException.class)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexPropertyTest.java
index 500a3ba..95be726 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexPropertyTest.java
@@ -38,7 +38,7 @@ public class ReferenceVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldNotConstructNewWithSomethingAlreadyReferenced() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         final ReferenceVertexProperty dvp = ReferenceFactory.detach(vp);
         assertSame(dvp, ReferenceFactory.detach(dvp));
     }
@@ -47,7 +47,7 @@ public class ReferenceVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldNotSupportRemove() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         ReferenceFactory.detach(vp).remove();
     }
 
@@ -55,7 +55,7 @@ public class ReferenceVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldBeEqualsPropertiesAsIdIsTheSame() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp = v.property("test", "this");
+        final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "this");
         final ReferenceVertexProperty vp1 = ReferenceFactory.detach(vp);
         final ReferenceVertexProperty vp2 = ReferenceFactory.detach(vp);
         assertTrue(vp1.equals(vp2));
@@ -67,9 +67,9 @@ public class ReferenceVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldNotBeEqualsPropertiesAsIdIsDifferent() {
         final Vertex v = graph.addVertex();
-        final VertexProperty vp1 = v.property("test", "this");
+        final VertexProperty vp1 = v.property(VertexProperty.Cardinality.single, "test", "this");
         final ReferenceVertexProperty mp1 = ReferenceFactory.detach(vp1);
-        final VertexProperty vp2 = v.property("testing", "this");
+        final VertexProperty vp2 = v.property(VertexProperty.Cardinality.single, "testing", "this");
         final ReferenceVertexProperty mp2 = ReferenceFactory.detach(vp2);
         assertFalse(mp1.equals(mp2));
     }
@@ -78,7 +78,7 @@ public class ReferenceVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldAttachToGraph() {
         final Vertex v = graph.addVertex();
-        final VertexProperty toReference = v.property("test", "this");
+        final VertexProperty toReference = v.property(VertexProperty.Cardinality.single, "test", "this");
         final ReferenceVertexProperty rvp = ReferenceFactory.detach(toReference);
         final VertexProperty referenced = rvp.attach(graph);
 
@@ -90,7 +90,7 @@ public class ReferenceVertexPropertyTest extends AbstractGremlinTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldAttachToVertex() {
         final Vertex v = graph.addVertex();
-        final VertexProperty toReference = v.property("test", "this");
+        final VertexProperty toReference = v.property(VertexProperty.Cardinality.single, "test", "this");
         final ReferenceVertexProperty rvp = ReferenceFactory.detach(toReference);
         final VertexProperty referenced = rvp.attach(v);
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexTest.java
index 575d151..a2fa663 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceVertexTest.java
@@ -28,6 +28,7 @@ import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.Test;
@@ -141,7 +142,7 @@ public class ReferenceVertexTest extends AbstractGremlinTest {
     public void shouldNotAllowSetProperty() {
         final Vertex v = graph.addVertex();
         final ReferenceVertex rv = ReferenceFactory.detach(v);
-        rv.property("test", "test");
+        rv.property(VertexProperty.Cardinality.single, "test", "test");
     }
 
     @Test(expected = IllegalStateException.class)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/script/script-input.groovy
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/script/script-input.groovy b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/script/script-input.groovy
index e714c90..adb32b7 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/script/script-input.groovy
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/script/script-input.groovy
@@ -1,3 +1,5 @@
+import org.apache.tinkerpop.gremlin.structure.VertexProperty
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,10 +22,10 @@ def parse(line, factory) {
     def parts = line.split(/\t/)
     def (id, label, name, x) = parts[0].split(/:/).toList()
     def v1 = factory.vertex(id, label)
-    if (name != null) v1.property("name", name)
+    if (name != null) v1.property(VertexProperty.Cardinality.single, "name", name)
     if (x != null) {
-        if (label.equals("project")) v1.property("lang", x)
-        else v1.property("age", Integer.valueOf(x))
+        if (label.equals("project")) v1.property(VertexProperty.Cardinality.single, "lang", x)
+        else v1.property(VertexProperty.Cardinality.single, "age", Integer.valueOf(x))
     }
     // process out-edges
     if (parts.length >= 2) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopVertex.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopVertex.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopVertex.java
index c380535..bfd4d6a 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopVertex.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopVertex.java
@@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.hadoop.structure;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedVertex;
@@ -55,6 +54,11 @@ public class HadoopVertex extends HadoopElement implements Vertex, WrappedVertex
     }
 
     @Override
+    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+        throw Element.Exceptions.propertyAdditionNotSupported();
+    }
+
+    @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
         throw Element.Exceptions.propertyAdditionNotSupported();
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
index ec97d0b..e35ecc2 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
@@ -83,6 +83,11 @@ public class TinkerVertex extends TinkerElement implements Vertex {
     }
 
     @Override
+    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+        return this.property(VertexProperty.Cardinality.single,key,value,keyValues);
+    }
+
+    @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
         if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id);
         ElementHelper.legalPropertyKeyValueArray(keyValues);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/46683cfc/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphIdManagerTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphIdManagerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphIdManagerTest.java
index 4bd8aad..69fc230 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphIdManagerTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphIdManagerTest.java
@@ -85,7 +85,7 @@ public class TinkerGraphIdManagerTest {
         public void shouldUseLongIdManagerToCoerceTypes() {
             final Graph graph = TinkerGraph.open(longIdManagerConfig);
             final Vertex v = graph.addVertex(T.id, vertexIdValue);
-            final VertexProperty vp = v.property("test", "value", T.id, vertexPropertyIdValue);
+            final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "value", T.id, vertexPropertyIdValue);
             final Edge e = v.addEdge("self", v, T.id, edgeIdValue);
 
             assertEquals(100l, v.id());
@@ -97,7 +97,7 @@ public class TinkerGraphIdManagerTest {
         public void shouldUseIntegerIdManagerToCoerceTypes() {
             final Graph graph = TinkerGraph.open(integerIdManagerConfig);
             final Vertex v = graph.addVertex(T.id, vertexIdValue);
-            final VertexProperty vp = v.property("test", "value", T.id, vertexPropertyIdValue);
+            final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "value", T.id, vertexPropertyIdValue);
             final Edge e = v.addEdge("self", v, T.id, edgeIdValue);
 
             assertEquals(100, v.id());
@@ -147,7 +147,7 @@ public class TinkerGraphIdManagerTest {
         public void shouldUseIdManagerToCoerceTypes() {
             final Graph graph = TinkerGraph.open(idManagerConfig);
             final Vertex v = graph.addVertex(T.id, vertexIdValue);
-            final VertexProperty vp = v.property("test", "value", T.id, vertexPropertyIdValue);
+            final VertexProperty vp = v.property(VertexProperty.Cardinality.single, "test", "value", T.id, vertexPropertyIdValue);
             final Edge e = v.addEdge("self", v, T.id, edgeIdValue);
 
             assertEquals(vertexId, v.id());


[23/50] incubator-tinkerpop git commit: Provide a way to bind TraversalSource objects to Gremlin Server. TINKERPOP3-594

Posted by sp...@apache.org.
Provide a way to bind TraversalSource objects to Gremlin Server. TINKERPOP3-594


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

Branch: refs/heads/variables
Commit: b1a513792089b06a35a0d7da906af5955e583e0e
Parents: fe7c56c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 13:56:54 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 13:56:54 2015 -0400

----------------------------------------------------------------------
 .../gremlin/groovy/engine/GremlinExecutor.java         |  8 +++++---
 gremlin-server/conf/gremlin-server-classic.yaml        |  2 +-
 gremlin-server/conf/gremlin-server-min.yaml            |  2 +-
 gremlin-server/conf/gremlin-server-modern.yaml         |  2 +-
 gremlin-server/conf/gremlin-server-rest-modern.yaml    |  2 +-
 gremlin-server/conf/gremlin-server.yaml                |  5 +++--
 gremlin-server/scripts/empty-sample.groovy             |  4 ++++
 gremlin-server/scripts/generate-classic.groovy         |  6 +++++-
 gremlin-server/scripts/generate-modern.groovy          |  6 +++++-
 gremlin-server/scripts/load-sample.groovy              |  7 ++++++-
 .../org/apache/tinkerpop/gremlin/server/Graphs.java    | 13 ++++++++++---
 .../apache/tinkerpop/gremlin/server/GremlinServer.java |  9 +++++++++
 .../gremlin/server/GremlinDriverIntegrateTest.java     |  8 ++++----
 .../gremlin/server/GremlinServerHttpIntegrateTest.java |  6 +++---
 .../gremlin/server/GremlinServerIntegrateTest.java     |  2 +-
 .../server/GremlinTraversalPerformanceTest.java        | 10 +++++-----
 .../gremlin/server/gremlin-server-integration.yaml     |  2 +-
 .../gremlin/server/gremlin-server-performance.yaml     |  2 +-
 18 files changed, 66 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
index 8fcd776..5d87fc5 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
@@ -21,6 +21,7 @@ package org.apache.tinkerpop.gremlin.groovy.engine;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.commons.lang3.concurrent.BasicThreadFactory;
 import org.javatuples.Pair;
@@ -358,10 +359,11 @@ public class GremlinExecutor implements AutoCloseable {
 
                         se.eval(p.getValue1(), bindings, language);
 
-                        // re-assign graph bindings back to global bindings.  prevent assignment of non-graph
-                        // implementations just in case someone tries to overwrite them in the init
+                        // re-assign graph bindings back to global bindings and grab TraversalSource creations.
+                        // prevent assignment of non-graph implementations just in case someone tries to overwrite
+                        // them in the init
                         bindings.entrySet().stream()
-                                .filter(kv -> kv.getValue() instanceof Graph)
+                                .filter(kv -> kv.getValue() instanceof Graph || kv.getValue() instanceof TraversalSource)
                                 .forEach(kv -> this.globalBindings.put(kv.getKey(), kv.getValue()));
 
                         logger.info("Initialized {} ScriptEngine with {}", language, p.getValue0());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/conf/gremlin-server-classic.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-classic.yaml b/gremlin-server/conf/gremlin-server-classic.yaml
index e216c1b..ea0fd7f 100644
--- a/gremlin-server/conf/gremlin-server-classic.yaml
+++ b/gremlin-server/conf/gremlin-server-classic.yaml
@@ -22,7 +22,7 @@ gremlinPool: 8
 scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/conf/gremlin-server-min.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-min.yaml b/gremlin-server/conf/gremlin-server-min.yaml
index 24bdc95..90b1f19 100644
--- a/gremlin-server/conf/gremlin-server-min.yaml
+++ b/gremlin-server/conf/gremlin-server-min.yaml
@@ -22,7 +22,7 @@ gremlinPool: 8
 scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/conf/gremlin-server-modern.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml
index 940b48d..9909388 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -22,7 +22,7 @@ gremlinPool: 8
 scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/conf/gremlin-server-rest-modern.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-rest-modern.yaml b/gremlin-server/conf/gremlin-server-rest-modern.yaml
index ee1ac1d..4260add 100644
--- a/gremlin-server/conf/gremlin-server-rest-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-rest-modern.yaml
@@ -23,7 +23,7 @@ scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/conf/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml
index 40f2c88..de2effe 100644
--- a/gremlin-server/conf/gremlin-server.yaml
+++ b/gremlin-server/conf/gremlin-server.yaml
@@ -23,13 +23,14 @@ scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {
   gremlin-groovy: {
     imports: [java.lang.Math],
-    staticImports: [java.lang.Math.PI]},
+    staticImports: [java.lang.Math.PI],
+    scripts: [scripts/empty-sample.groovy]},
   nashorn: {
       imports: [java.lang.Math],
       staticImports: [java.lang.Math.PI]}}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/scripts/empty-sample.groovy
----------------------------------------------------------------------
diff --git a/gremlin-server/scripts/empty-sample.groovy b/gremlin-server/scripts/empty-sample.groovy
index f57e758..2be5e55 100644
--- a/gremlin-server/scripts/empty-sample.groovy
+++ b/gremlin-server/scripts/empty-sample.groovy
@@ -16,6 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
+// define the default TraversalSource to bind queries to.
+g = graph.traversal()
+
 // An example of an initialization script that can be configured to run in Gremlin Server.
 // Functions defined here will go into global cache and will not be removed from there
 // unless there is a reset of the ScriptEngine.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/scripts/generate-classic.groovy
----------------------------------------------------------------------
diff --git a/gremlin-server/scripts/generate-classic.groovy b/gremlin-server/scripts/generate-classic.groovy
index 39c45e6..b169fa2 100644
--- a/gremlin-server/scripts/generate-classic.groovy
+++ b/gremlin-server/scripts/generate-classic.groovy
@@ -16,5 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 // Generates the classic graph into an "empty" TinkerGraph
-TinkerFactory.generateClassic(g)
\ No newline at end of file
+TinkerFactory.generateClassic(graph)
+
+// define the default TraversalSource to bind queries to.
+g = graph.traversal()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/scripts/generate-modern.groovy
----------------------------------------------------------------------
diff --git a/gremlin-server/scripts/generate-modern.groovy b/gremlin-server/scripts/generate-modern.groovy
index 730e62a..d23bee6 100644
--- a/gremlin-server/scripts/generate-modern.groovy
+++ b/gremlin-server/scripts/generate-modern.groovy
@@ -16,5 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 // Generates the modern graph into an "empty" TinkerGraph
-TinkerFactory.generateModern(g)
\ No newline at end of file
+TinkerFactory.generateModern(graph)
+
+// define the default TraversalSource to bind queries to.
+g = graph.traversal()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/scripts/load-sample.groovy
----------------------------------------------------------------------
diff --git a/gremlin-server/scripts/load-sample.groovy b/gremlin-server/scripts/load-sample.groovy
index a327f4e..23ed1c4 100644
--- a/gremlin-server/scripts/load-sample.groovy
+++ b/gremlin-server/scripts/load-sample.groovy
@@ -16,8 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 // An example of an initialization script that can be configured to run in Gremlin Server.
 // Functions defined here will go into global cache and will not be removed from there
 // unless there is a reset of the ScriptEngine.
-g.io().readGryo('data/sample.kryo')
+graph.io().readGryo('data/sample.kryo')
+
+// define the default TraversalSource to bind queries to.
+g = graph.traversal()
+
 def addItUp(x, y) { x + y }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Graphs.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Graphs.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Graphs.java
index 971d48e..a19015a 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Graphs.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Graphs.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.server;
 
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
 import org.slf4j.Logger;
@@ -29,14 +30,15 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Traverser of {@link Graph} instances configured for the server to be passed to sessionless bindings. The
+ * {@link Graph} instances configured for the server to be passed to script engine bindings. The
  * {@link Graph} instances are read from the {@link Settings} for Gremlin Server as defined in the configuration
- * file.
+ * file. Also holds any {@link TraversalSource} objects as constructed in the server.
  */
 public class Graphs {
     private static final Logger logger = LoggerFactory.getLogger(GremlinServer.class);
 
     private final Map<String, Graph> graphs = new HashMap<>();
+    private final Map<String, TraversalSource> traversalSources = new HashMap<>();
 
     /**
      * Create a new instance using the {@link Settings} from Gremlin Server.
@@ -65,12 +67,17 @@ public class Graphs {
         return graphs;
     }
 
+    public Map<String, TraversalSource> getTraversalSources() {
+        return traversalSources;
+    }
+
     /**
-     * Get the graphs list as a set of bindings.
+     * Get the {@link Graph} and {@link TraversalSource} list as a set of bindings.
      */
     public Bindings getGraphsAsBindings() {
         final Bindings bindings = new SimpleBindings();
         graphs.forEach(bindings::put);
+        traversalSources.forEach(bindings::put);
         return bindings;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
index b2a4c22..5b75d58 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.server;
 
 import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.server.util.MetricManager;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import io.netty.bootstrap.ServerBootstrap;
@@ -186,6 +187,14 @@ public class GremlinServer {
                 .filter(kv -> kv.getValue() instanceof Graph)
                 .forEach(kv -> graphs.get().getGraphs().put(kv.getKey(), (Graph) kv.getValue()));
 
+        // script engine init may have constructed the TraversalSource bindings - store them in Graphs object
+        gremlinExecutor.getGlobalBindings().entrySet().stream()
+                .filter(kv -> kv.getValue() instanceof TraversalSource)
+                .forEach(kv -> {
+                    logger.info("A {} is now bound to [{}] with {}", kv.getValue().getClass().getSimpleName(), kv.getKey(), kv.getValue());
+                    graphs.get().getTraversalSources().put(kv.getKey(), (TraversalSource) kv.getValue());
+                });
+
         return gremlinExecutor;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 5ab7cc7..967f215 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -177,7 +177,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
         final Cluster cluster = Cluster.open();
         final Client client = cluster.connect();
 
-        final ResultSet results = client.submit("h=g.traversal();h.V().drop().iterate();null");
+        final ResultSet results = client.submit("g.V().drop().iterate();null");
         assertNull(results.all().get().get(0).getObject());
 
         cluster.close();
@@ -342,16 +342,16 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
         final Cluster cluster = Cluster.build().create();
         final Client client = cluster.connect(name.getMethodName());
 
-        final Vertex vertexBeforeTx = client.submit("v=g.addVertex(\"name\",\"stephen\")").all().get().get(0).getVertex();
+        final Vertex vertexBeforeTx = client.submit("v=graph.addVertex(\"name\",\"stephen\")").all().get().get(0).getVertex();
         assertEquals("stephen", vertexBeforeTx.values("name").next());
 
-        final Vertex vertexFromV = client.submit("g.vertices().next()").all().get().get(0).getVertex();
+        final Vertex vertexFromV = client.submit("graph.vertices().next()").all().get().get(0).getVertex();
         assertEquals("stephen", vertexFromV.values("name").next());
 
         final Vertex vertexFromBinding = client.submit("v").all().get().get(0).getVertex();
         assertEquals("stephen", vertexFromBinding.values("name").next());
 
-        final Vertex vertexAfterTx = client.submit("v.property(\"color\",\"blue\"); g.tx().commit(); v").all().get().get(0).getVertex();
+        final Vertex vertexAfterTx = client.submit("v.property(\"color\",\"blue\"); graph.tx().commit(); v").all().get().get(0).getVertex();
         assertEquals("stephen", vertexAfterTx.values("name").next());
         assertEquals("blue", vertexAfterTx.values("color").next());
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index 4062f0d..788974e 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -81,7 +81,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
     @Test
     public void should200OnGETWithGremlinQueryStringArgumentWithIteratorResult() throws Exception {
         final CloseableHttpClient httpclient = HttpClients.createDefault();
-        final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=g.traversal().V()");
+        final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=g.V()");
 
         try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
             assertEquals(200, response.getStatusLine().getStatusCode());
@@ -109,7 +109,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
     @Test
     public void should200OnGETWithGremlinQueryStringArgumentReturningVertex() throws Exception {
         final CloseableHttpClient httpclient = HttpClients.createDefault();
-        final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=g.addVertex('name','stephen')");
+        final HttpGet httpget = new HttpGet("http://localhost:8182?gremlin=graph.addVertex('name','stephen')");
 
         try (final CloseableHttpResponse response = httpclient.execute(httpget)) {
             assertEquals(200, response.getStatusLine().getStatusCode());
@@ -191,7 +191,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
         final CloseableHttpClient httpclient = HttpClients.createDefault();
         final HttpPost httppost = new HttpPost("http://localhost:8182");
         httppost.addHeader("Content-Type", "application/json");
-        httppost.setEntity(new StringEntity("{\"gremlin\":\"h=g.traversal();h.V()\"}", Consts.UTF_8));
+        httppost.setEntity(new StringEntity("{\"gremlin\":\"g.V()\"}", Consts.UTF_8));
 
         try (final CloseableHttpResponse response = httpclient.execute(httppost)) {
             assertEquals(200, response.getStatusLine().getStatusCode());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 277e50e..4db56e2 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -187,7 +187,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
 
         try {
             // this should return "nothing" - there should be no exception
-            assertNull(client.submit("h=g.traversal();h.V().has('name','kadfjaldjfla')").one());
+            assertNull(client.submit("g.V().has('name','kadfjaldjfla')").one());
         } finally {
             cluster.close();
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
index 7b712aa..27e3d39 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinTraversalPerformanceTest.java
@@ -90,11 +90,11 @@ public class GremlinTraversalPerformanceTest extends AbstractGremlinServerPerfor
         final Map<String, Object> params = new HashMap<>();
         params.put("x", 16384l);
 
-        final CompletableFuture<ResultSet> future1 = client.get().submitAsync("h=g.traversal();h.V(x).out().out().next(512)", params);
-        final CompletableFuture<ResultSet> future2 = client.get().submitAsync("h=g.traversal();h.V(x).out().next(7)", params);
-        final CompletableFuture<ResultSet> future3 = client.get().submitAsync("h=g.traversal();h.V(16384l).out().out().next(10)");
-        final CompletableFuture<ResultSet> future4 = client.get().submitAsync("h=g.traversal();h.V(16432l).out().out().next(10)");
-        final CompletableFuture<ResultSet> future5 = client.get().submitAsync("h=g.traversal();h.V(14l).out().next(1)");
+        final CompletableFuture<ResultSet> future1 = client.get().submitAsync("g.V(x).out().out().next(512)", params);
+        final CompletableFuture<ResultSet> future2 = client.get().submitAsync("g.V(x).out().next(7)", params);
+        final CompletableFuture<ResultSet> future3 = client.get().submitAsync("g.V(16384l).out().out().next(10)");
+        final CompletableFuture<ResultSet> future4 = client.get().submitAsync("g.V(16432l).out().out().next(10)");
+        final CompletableFuture<ResultSet> future5 = client.get().submitAsync("g.V(14l).out().next(1)");
 
         assertEquals(512, future1.get().stream().count());
         assertEquals(7, future2.get().stream().count());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
index f513fdd..83bf6df 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
@@ -22,7 +22,7 @@ gremlinPool: 8
 scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1a51379/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
index 0469d36..f11f109 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
@@ -22,7 +22,7 @@ gremlinPool: 8
 scriptEvaluationTimeout: 30000
 serializedResponseTimeout: 30000
 graphs: {
-  g: conf/tinkergraph-empty.properties}
+  graph: conf/tinkergraph-empty.properties}
 plugins:
   - tinkerpop.tinkergraph
 scriptEngines: {


[42/50] incubator-tinkerpop git commit: Refactoring test suites a bit for better clarity.

Posted by sp...@apache.org.
Refactoring test suites a bit for better clarity.

Removed redundant and unclear constructor overloads with default. Using more explicit construction now.  Put test enforcement back in - that was lost at some point.  Changed the nature of the gremlinFlavorSuite flag to print a message to System.err as a warning instead of doing nothing and just letting the test execute.  Rexamined all the settings for that flag in each suite.


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

Branch: refs/heads/variables
Commit: ea4a49deccce04926ba71b672f1f45a834359681
Parents: af20879
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 10:05:56 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 10:05:56 2015 -0400

----------------------------------------------------------------------
 .../groovy/GroovyEnvironmentIntegrateSuite.java |  3 +-
 .../GroovyEnvironmentPerformanceSuite.java      |  3 +-
 .../gremlin/groovy/GroovyEnvironmentSuite.java  |  3 +-
 .../process/GroovyProcessComputerSuite.java     |  2 +-
 .../process/GroovyProcessStandardSuite.java     |  3 +-
 .../tinkerpop/gremlin/AbstractGremlinSuite.java | 52 ++++++-----
 .../gremlin/process/ProcessComputerSuite.java   | 80 +++++++++++++++--
 .../process/ProcessPerformanceSuite.java        |  3 +-
 .../gremlin/process/ProcessStandardSuite.java   | 90 +++++++++++++++++---
 .../structure/StructurePerformanceSuite.java    |  3 +-
 .../structure/StructureStandardSuite.java       |  3 +-
 .../tinkergraph/structure/TinkerGraph.java      |  1 -
 12 files changed, 188 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
index f85f40d..b1c5dd3 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentIntegrateSuite.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.GraphManager;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineIntegrateTest;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
@@ -57,7 +58,7 @@ public class GroovyEnvironmentIntegrateSuite extends AbstractGremlinSuite {
     };
 
     public GroovyEnvironmentIntegrateSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests);
+        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
index d79ebb6..ccff0d1 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentPerformanceSuite.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutorPerformanceTest
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoaderPerformanceTest;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
@@ -60,7 +61,7 @@ public class GroovyEnvironmentPerformanceSuite extends AbstractGremlinSuite {
     };
 
     public GroovyEnvironmentPerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests);
+        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
index 01b5280..a938c7a 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/GroovyEnvironmentSuite.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoaderTest;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoaderTest;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
@@ -61,7 +62,7 @@ public class GroovyEnvironmentSuite extends AbstractGremlinSuite {
     };
 
     public GroovyEnvironmentSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests);
+        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
index 43ceb19..ad93092 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
@@ -152,7 +152,7 @@ public class GroovyProcessComputerSuite extends ProcessComputerSuite {
     };
 
     public GroovyProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests, allTests);
+        super(klass, builder, allTests);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
index a660f7e..5fea4bc 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessStandardSuite.java
@@ -153,9 +153,8 @@ public class GroovyProcessStandardSuite extends ProcessStandardSuite {
             CoreTraversalTest.class,
     };
 
-
     public GroovyProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests, allTests, true);
+        super(klass, builder, allTests);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
index 4d0cfa6..469a10a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinSuite.java
@@ -19,13 +19,7 @@
 package org.apache.tinkerpop.gremlin;
 
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.commons.configuration.Configuration;
 import org.javatuples.Pair;
 import org.junit.runner.Description;
 import org.junit.runner.Runner;
@@ -41,15 +35,11 @@ import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -80,25 +70,28 @@ public abstract class AbstractGremlinSuite extends Suite {
 
     /**
      * Indicates that this suite is for testing a gremlin flavor and is therefore not responsible for validating
-     * the suite against what the Graph implementation opts-in for.
+     * the suite against what the {@link Graph} implementation opts-in for. This setting will let Gremlin flavor
+     * developers run their test cases against a {@link Graph} without the need for the {@link Graph} to supply
+     * an {@link Graph.OptIn} annotation.  Not having that annotation is a likely case for flavors while they are
+     * under development and a {@link Graph.OptIn} is not possible.
      */
     private final boolean gremlinFlavorSuite;
 
-    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute) throws InitializationError {
-        this(klass, builder, testsToExecute, null);
-    }
-
-    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce) throws InitializationError {
-        this(klass, builder, testsToExecute, testsToEnforce, false);
-    }
-
-    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce,
-                                final boolean gremlinFlavorSuite) throws InitializationError {
-        this(klass, builder, testsToExecute, testsToEnforce, gremlinFlavorSuite, TraversalEngine.Type.STANDARD);
-    }
-
-    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, Class<?>[] testsToExecute, final Class<?>[] testsToEnforce,
-                                final boolean gremlinFlavorSuite, TraversalEngine.Type traversalEngineType) throws InitializationError {
+    /**
+     * Constructs a Gremlin Test Suite implementation.
+     *
+     * @param klass Required for JUnit Suite construction
+     * @param builder Required for JUnit Suite construction
+     * @param testsToExecute The list of tests to execute
+     * @param testsToEnforce The list of tests to "enforce" such that a check is made to ensure that in this list,
+     *                       there exists an implementation in the testsToExecute (use {@code null} for no enforcement.
+     * @param gremlinFlavorSuite Ignore validation of {@link Graph.OptIn} annotations which is typically reserved for
+     *                           structure tests
+     * @param traversalEngineType The {@link TraversalEngine.Type} to enforce on this suite
+     */
+    public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute,
+                                final Class<?>[] testsToEnforce, final boolean gremlinFlavorSuite,
+                                final TraversalEngine.Type traversalEngineType) throws InitializationError {
         super(builder, klass, enforce(testsToExecute, testsToEnforce));
 
         this.gremlinFlavorSuite = gremlinFlavorSuite;
@@ -124,8 +117,11 @@ public abstract class AbstractGremlinSuite extends Suite {
 
     private void validateOptInToSuite(final Class<? extends Graph> klass) throws InitializationError {
         final Graph.OptIn[] optIns = klass.getAnnotationsByType(Graph.OptIn.class);
-        if (!gremlinFlavorSuite && !Arrays.stream(optIns).anyMatch(optIn -> optIn.value().equals(this.getClass().getCanonicalName())))
-            throw new InitializationError("The suite will not run for this Graph until it is publicly acknowledged with the @OptIn annotation on the Graph instance itself");
+        if (!Arrays.stream(optIns).anyMatch(optIn -> optIn.value().equals(this.getClass().getCanonicalName())))
+            if (gremlinFlavorSuite)
+                System.err.println(String.format("The %s will run for this Graph as it is testing a Gremlin flavor but the Graph does not publicly acknowledged it yet with the @OptIn annotation.", this.getClass().getSimpleName()));
+            else
+                throw new InitializationError(String.format("The %s will not run for this Graph until it is publicly acknowledged with the @OptIn annotation on the Graph instance itself", this.getClass().getSimpleName()));
     }
 
     private void registerOptOuts(final Class<? extends Graph> klass) throws InitializationError {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 86ab157..285363d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -97,8 +97,7 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
     // todo: all tests are not currently passing. see specific todos in each test
 
     /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
+     * This list of tests in the suite that will be executed as part of this suite.
      */
     private static final Class<?>[] allTests = new Class<?>[]{
 
@@ -175,16 +174,81 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
             SubgraphStrategyProcessTest.class
     };
 
+    /**
+     * A list of the minimum set of base tests that Gremlin flavors should implement to be compliant with Gremlin.
+     */
+    private static final Class<?>[] testsToEnforce = new Class<?>[]{
+            // branch
+            BranchTest.class,
+            ChooseTest.class,
+            LocalTest.class,
+            RepeatTest.class,
+            UnionTest.class,
+
+            // filter
+            AndTest.class,
+            CoinTest.class,
+            CyclicPathTest.class,
+            DedupTest.class,
+            ExceptTest.class,
+            FilterTest.class,
+            HasNotTest.class,
+            HasTest.class,
+            IsTest.class,
+            OrTest.class,
+            RangeTest.class,
+            RetainTest.class,
+            SampleTest.class,
+            SimplePathTest.class,
+            WhereTest.class,
+
+            // map
+            CoalesceTest.class,
+            CountTest.class,
+            FoldTest.class,
+            MapTest.class,
+            MaxTest.class,
+            MeanTest.class,
+            MinTest.class,
+            SumTest.class,
+            // TODO: MatchTest.ComputerTest.class,
+            OrderTest.class,
+            PathTest.class,
+            PropertiesTest.class,
+            SelectTest.class,
+            UnfoldTest.class,
+            ValueMapTest.class,
+            VertexTest.class,
+
+            // sideEffect
+            // TODO: AddEdgeTest.ComputerTest.class,
+            AggregateTest.class,
+            GroupTest.class,
+            GroupCountTest.class,
+            // TODO: InjectTest.ComputerTest.class,
+            ProfileTest.class,
+            SackTest.class,
+            SideEffectCapTest.class,
+            // TODO: REMOVE? SideEffectTest.ComputerTest.class,
+            StoreTest.class,
+            // TODO: REMOVE? SubgraphTest.ComputerTest.class,
+            TreeTest.class
+    };
+
+    /**
+     * This constructor is used by JUnit and will run this suite with its concrete implementations of the
+     * {@code testsToEnforce}.
+     */
     public ProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
         super(klass, builder, allTests, allTests, false, TraversalEngine.Type.COMPUTER);
     }
 
-    public ProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToEnforce, false, TraversalEngine.Type.COMPUTER);
-    }
-
-    public ProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce, final boolean gremlinFlavorSuite) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToEnforce, gremlinFlavorSuite, TraversalEngine.Type.COMPUTER);
+    /**
+     * This constructor is used by Gremlin flavor implementers who supply their own implementations of the
+     * {@code testsToEnforce}.
+     */
+    public ProcessComputerSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute) throws InitializationError {
+        super(klass, builder, testsToExecute, testsToEnforce, true, TraversalEngine.Type.COMPUTER);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
index e0619b1..073dacc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessPerformanceSuite.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.GraphReadPerformanceTest;
 import org.apache.tinkerpop.gremlin.structure.GraphWritePerformanceTest;
@@ -47,7 +48,7 @@ public class ProcessPerformanceSuite extends AbstractGremlinSuite {
     };
 
     public ProcessPerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests);
+        super(klass, builder, allTests, null, true, TraversalEngine.Type.STANDARD);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
index 645e599..eae93f2 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
@@ -84,9 +84,6 @@ import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 /**
@@ -101,8 +98,7 @@ import java.util.stream.Stream;
 public class ProcessStandardSuite extends AbstractGremlinSuite {
 
     /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
+     * This list of tests in the suite that will be executed as part of this suite.
      */
     private static final Class<?>[] allTests = new Class<?>[]{
             // branch
@@ -184,16 +180,86 @@ public class ProcessStandardSuite extends AbstractGremlinSuite {
             SubgraphStrategyProcessTest.class
     };
 
-    public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests, allTests);
-    }
+    /**
+     * A list of the minimum set of base tests that Gremlin flavors should implement to be compliant with Gremlin.
+     */
+    private static final Class<?>[] testsToEnforce = new Class<?>[]{
+            // branch
+            BranchTest.class,
+            ChooseTest.class,
+            LocalTest.class,
+            RepeatTest.class,
+            UnionTest.class,
+
+            // filter
+            AndTest.class,
+            CoinTest.class,
+            CyclicPathTest.class,
+            DedupTest.class,
+            DropTest.class,
+            ExceptTest.class,
+            FilterTest.class,
+            HasNotTest.class,
+            HasTest.class,
+            IsTest.class,
+            OrTest.class,
+            RangeTest.class,
+            RetainTest.class,
+            SampleTest.class,
+            SimplePathTest.class,
+            WhereTest.class,
+
+            // map
+            AddEdgeTest.class,
+            AddVertexTest.class,
+            CoalesceTest.class,
+            CountTest.class,
+            FoldTest.class,
+            MapTest.class,
+            MatchTest.class,
+            MaxTest.class,
+            MeanTest.class,
+            MinTest.class,
+            SumTest.class,
+            OrderTest.class,
+            PathTest.class,
+            PropertiesTest.class,
+            SelectTest.class,
+            VertexTest.class,
+            UnfoldTest.class,
+            ValueMapTest.class,
 
-    public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToEnforce);
+            // sideEffect
+            AggregateTest.class,
+            GroupTest.class,
+            GroupCountTest.class,
+            InjectTest.class,
+            ProfileTest.class,
+            SackTest.class,
+            SideEffectCapTest.class,
+            SideEffectTest.class,
+            StoreTest.class,
+            SubgraphTest.class,
+            TreeTest.class,
+
+            // util
+            TraversalSideEffectsTest.class
+    };
+
+    /**
+     * This constructor is used by JUnit and will run this suite with its concrete implementations of the
+     * {@code testsToEnforce}.
+     */
+    public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
+        super(klass, builder, allTests, testsToEnforce, false, TraversalEngine.Type.STANDARD);
     }
 
-    public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute, final Class<?>[] testsToEnforce, final boolean gremlinFlavorSuite) throws InitializationError {
-        super(klass, builder, testsToExecute, testsToEnforce, gremlinFlavorSuite, TraversalEngine.Type.STANDARD);
+    /**
+     * This constructor is used by Gremlin flavor implementers who supply their own implementations of the
+     * {@code testsToEnforce}.
+     */
+    public ProcessStandardSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute) throws InitializationError {
+        super(klass, builder, testsToExecute, testsToEnforce, true, TraversalEngine.Type.STANDARD);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
index 5ef20cc..e25fac8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructurePerformanceSuite.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.structure;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -44,7 +45,7 @@ public class StructurePerformanceSuite extends AbstractGremlinSuite {
     };
 
     public StructurePerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests);
+        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
index 37cbe29..b5e73bb 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
 import org.apache.tinkerpop.gremlin.GraphProvider;
 import org.apache.tinkerpop.gremlin.algorithm.generator.CommunityGeneratorTest;
 import org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGeneratorTest;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPropertyTest;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexPropertyTest;
@@ -96,6 +97,6 @@ public class StructureStandardSuite extends AbstractGremlinSuite {
     };
 
     public StructureStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests);
+        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ea4a49de/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
index 5eb317d..9a29bae 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
@@ -56,7 +56,6 @@ import java.util.stream.Stream;
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD)
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER)
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_PERFORMANCE)
-@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_STANDARD)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_COMPUTER)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE)


[50/50] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master' into variables

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master' into variables

Conflicts:
	tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java


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

Branch: refs/heads/variables
Commit: c15ab5e749e9776ada8b81cf662f9c698e63193c
Parents: 7783d4f d09ffa8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 13:46:50 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 13:46:50 2015 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   21 +
 README.asciidoc                                 |   15 +-
 docs/preprocessor/preprocess.sh                 |   12 +-
 docs/src/acknowledgements.asciidoc              |    2 +-
 docs/src/gremlin-applications.asciidoc          |   39 +-
 docs/src/implementations.asciidoc               |   24 +-
 docs/src/the-graph.asciidoc                     |   51 +-
 docs/src/the-graphcomputer.asciidoc             |    7 +-
 docs/src/the-traversal.asciidoc                 |   34 +-
 docs/static/images/ketrina-tinkerpop3.png       |  Bin 0 -> 646438 bytes
 gremlin-console/pom.xml                         |    2 +-
 gremlin-console/src/main/LICENSE                |    2 +-
 gremlin-core/pom.xml                            |    2 +-
 .../gremlin/process/computer/GraphComputer.java |    4 +
 .../gremlin/process/computer/Memory.java        |    3 +
 .../gremlin/process/computer/MessageScope.java  |   31 +-
 .../gremlin/process/computer/Messenger.java     |    7 +-
 .../peerpressure/PeerPressureVertexProgram.java |   15 +-
 .../ranking/pagerank/PageRankVertexProgram.java |   11 +-
 .../computer/traversal/SingleMessenger.java     |    2 +-
 .../traversal/TraversalScriptSupplier.java      |    5 +-
 .../traversal/TraversalVertexProgram.java       |    3 +-
 .../computer/traversal/TraverserExecutor.java   |    7 +-
 .../traversal/step/map/ComputerResultStep.java  |    2 +-
 .../process/computer/util/ComputerGraph.java    |    2 +-
 .../process/computer/util/LambdaHolder.java     |    2 +-
 .../process/computer/util/ShellGraph.java       |  283 +++++
 .../process/traversal/TraversalStrategies.java  |   13 +-
 .../gremlin/process/traversal/Traverser.java    |    2 +-
 .../traversal/dsl/graph/GraphTraversal.java     |    9 +-
 .../dsl/graph/GraphTraversalSource.java         |    5 +-
 .../gremlin/process/traversal/dsl/graph/__.java |    8 +-
 .../process/traversal/step/map/BackStep.java    |   64 --
 .../traversal/step/sideEffect/GraphStep.java    |   18 +-
 .../step/sideEffect/SideEffectCapStep.java      |    9 +-
 .../traversal/step/util/HasContainer.java       |    4 +-
 .../strategy/decoration/ElementIdStrategy.java  |    8 +-
 .../traverser/util/AbstractTraverser.java       |   18 +-
 .../traversal/traverser/util/TraverserSet.java  |    8 +-
 .../traversal/util/DefaultTraversal.java        |    2 +-
 .../util/DefaultTraversalSideEffects.java       |    3 +-
 .../tinkerpop/gremlin/structure/Edge.java       |    3 +
 .../tinkerpop/gremlin/structure/Element.java    |    9 +-
 .../tinkerpop/gremlin/structure/Graph.java      |  135 ++-
 .../tinkerpop/gremlin/structure/Property.java   |   11 +-
 .../gremlin/structure/Transaction.java          |    4 +
 .../tinkerpop/gremlin/structure/Vertex.java     |   16 +-
 .../gremlin/structure/VertexProperty.java       |    6 +-
 .../io/graphson/LegacyGraphSONReader.java       |    3 +-
 .../structure/io/gryo/GremlinClassResolver.java |  206 ----
 .../structure/io/gryo/GryoClassResolver.java    |  211 ++++
 .../gremlin/structure/io/gryo/GryoMapper.java   |   19 +-
 .../gremlin/structure/util/Attachable.java      |   76 ++
 .../gremlin/structure/util/ElementHelper.java   |    7 +-
 .../structure/util/batch/BatchGraph.java        |    5 +
 .../structure/util/detached/Attachable.java     |   33 -
 .../structure/util/detached/DetachedEdge.java   |   10 +-
 .../util/detached/DetachedElement.java          |   11 +-
 .../util/detached/DetachedFactory.java          |    4 +
 .../structure/util/detached/DetachedPath.java   |    5 +-
 .../util/detached/DetachedProperty.java         |   14 +-
 .../structure/util/detached/DetachedVertex.java |   36 +-
 .../util/detached/DetachedVertexProperty.java   |    7 +-
 .../structure/util/reference/ReferenceEdge.java |   89 ++
 .../util/reference/ReferenceElement.java        |   74 ++
 .../util/reference/ReferenceFactory.java        |   81 ++
 .../structure/util/reference/ReferencePath.java |   75 ++
 .../util/reference/ReferenceProperty.java       |  111 ++
 .../util/reference/ReferenceVertex.java         |  106 ++
 .../util/reference/ReferenceVertexProperty.java |  106 ++
 .../gremlin/structure/util/star/StarGraph.java  |  673 ++++++++++++
 .../tinkerpop/gremlin/util/StreamFactory.java   |   32 -
 .../gremlin/util/iterator/IteratorUtils.java    |   24 +
 .../util/iterator/IteratorUtilsTest.java        |   24 +
 gremlin-driver/pom.xml                          |    2 +-
 .../ser/GryoMessageSerializerV1D0Test.java      |    9 +-
 .../JsonMessageSerializerGremlinV1d0Test.java   |    5 +-
 .../ser/JsonMessageSerializerV1d0Test.java      |    3 +-
 gremlin-groovy-test/pom.xml                     |    2 +-
 .../GroovyTraversalSideEffectsTest.groovy       |   35 +
 .../traversal/step/filter/GroovyHasTest.groovy  |   10 +
 .../step/filter/GroovyRangeTest.groovy          |   36 -
 .../traversal/step/map/GroovyBackTest.groovy    |  146 ---
 .../step/map/GroovyPropertiesTest.groovy        |   19 +-
 .../traversal/step/map/GroovySelectTest.groovy  |  112 +-
 .../traversal/step/map/GroovyVertexTest.groovy  |   10 +
 .../groovy/GroovyEnvironmentIntegrateSuite.java |   35 +-
 .../GroovyEnvironmentPerformanceSuite.java      |   38 +-
 .../gremlin/groovy/GroovyEnvironmentSuite.java  |   35 +-
 .../engine/GremlinExecutorPerformanceTest.java  |    2 +-
 .../GremlinGroovyScriptEngineOverGraphTest.java |    7 +-
 .../process/GroovyProcessComputerSuite.java     |   17 +-
 .../process/GroovyProcessStandardSuite.java     |   21 +-
 gremlin-groovy/pom.xml                          |    2 +-
 .../gremlin/groovy/engine/GremlinExecutor.java  |    8 +-
 .../jsr223/GremlinGroovyScriptEngine.java       |    4 +-
 gremlin-server/conf/gremlin-server-classic.yaml |    2 +-
 gremlin-server/conf/gremlin-server-min.yaml     |    2 +-
 gremlin-server/conf/gremlin-server-modern.yaml  |    2 +-
 .../conf/gremlin-server-rest-modern.yaml        |    2 +-
 gremlin-server/conf/gremlin-server.yaml         |    5 +-
 gremlin-server/pom.xml                          |    2 +-
 gremlin-server/scripts/empty-sample.groovy      |    4 +
 gremlin-server/scripts/generate-classic.groovy  |    6 +-
 gremlin-server/scripts/generate-modern.groovy   |    6 +-
 gremlin-server/scripts/load-sample.groovy       |    7 +-
 gremlin-server/src/main/LICENSE                 |    2 +-
 .../apache/tinkerpop/gremlin/server/Graphs.java |   13 +-
 .../tinkerpop/gremlin/server/GremlinServer.java |    9 +
 .../server/GremlinDriverIntegrateTest.java      |    8 +-
 .../server/GremlinServerHttpIntegrateTest.java  |    6 +-
 .../server/GremlinServerIntegrateTest.java      |    2 +-
 .../server/GremlinTraversalPerformanceTest.java |   10 +-
 .../server/gremlin-server-integration.yaml      |    2 +-
 .../server/gremlin-server-performance.yaml      |    2 +-
 gremlin-shaded/pom.xml                          |    2 +-
 gremlin-test/pom.xml                            |    2 +-
 .../gremlin/AbstractGraphProvider.java          |   16 +-
 .../tinkerpop/gremlin/AbstractGremlinSuite.java |  144 +--
 .../tinkerpop/gremlin/AbstractGremlinTest.java  |   30 +-
 .../apache/tinkerpop/gremlin/GraphProvider.java |   48 +-
 .../apache/tinkerpop/gremlin/LoadGraphWith.java |    4 +-
 .../generator/CommunityGeneratorTest.java       |    7 +-
 .../generator/DistributionGeneratorTest.java    |    6 +-
 .../gremlin/process/ProcessComputerSuite.java   |  135 ++-
 .../process/ProcessPerformanceSuite.java        |   31 +-
 .../gremlin/process/ProcessStandardSuite.java   |  136 ++-
 .../process/TraversalPerformanceTest.java       |    8 +-
 .../process/computer/GraphComputerTest.java     |   22 +-
 .../process/traversal/CoreTraversalTest.java    |   24 +-
 .../traversal/step/filter/ExceptTest.java       |    2 +-
 .../process/traversal/step/filter/HasTest.java  |   47 +-
 .../traversal/step/filter/RangeTest.java        |   79 +-
 .../process/traversal/step/map/BackTest.java    |  220 ----
 .../traversal/step/map/PropertiesTest.java      |   25 +
 .../process/traversal/step/map/SelectTest.java  |  183 +++-
 .../process/traversal/step/map/VertexTest.java  |   94 +-
 .../traversal/step/sideEffect/SubgraphTest.java |    4 +-
 .../decoration/EventStrategyProcessTest.java    |    8 +-
 .../tinkerpop/gremlin/structure/BatchTest.java  |   22 +-
 .../tinkerpop/gremlin/structure/EdgeTest.java   |   35 +-
 .../gremlin/structure/FeatureSupportTest.java   |  100 +-
 .../structure/GraphConstructionTest.java        |    4 +-
 .../tinkerpop/gremlin/structure/GraphTest.java  | 1029 +++++++++++++++++-
 .../structure/GraphWritePerformanceTest.java    |    6 +-
 .../tinkerpop/gremlin/structure/IoTest.java     |  217 ++--
 .../gremlin/structure/PropertyTest.java         |    4 +-
 .../structure/StructurePerformanceSuite.java    |   29 +-
 .../structure/StructureStandardSuite.java       |   59 +-
 .../gremlin/structure/TransactionTest.java      |   12 +-
 .../gremlin/structure/VertexPropertyTest.java   |   43 +-
 .../tinkerpop/gremlin/structure/VertexTest.java |  170 ++-
 .../util/detached/DetachedEdgeTest.java         |   21 +-
 .../util/detached/DetachedPropertyTest.java     |    2 +-
 .../detached/DetachedVertexPropertyTest.java    |   20 +-
 .../util/detached/DetachedVertexTest.java       |   26 +-
 .../util/reference/ReferenceEdgeTest.java       |  152 +++
 .../reference/ReferenceVertexPropertyTest.java  |  101 ++
 .../util/reference/ReferenceVertexTest.java     |  176 +++
 .../structure/util/star/StarGraphTest.java      |  171 +++
 .../structure/io/script/script-input.groovy     |    8 +-
 hadoop-gremlin/conf/hadoop-gryo.properties      |    6 +-
 hadoop-gremlin/pom.xml                          |    7 +-
 .../hadoop/groovy/plugin/HadoopLoader.groovy    |   40 +-
 .../computer/example/TraversalSupplier1.java    |    3 +-
 .../computer/example/TraversalSupplier2.java    |    3 +-
 .../computer/example/TraversalSupplier3.java    |    3 +-
 .../computer/giraph/GiraphMessenger.java        |    4 +-
 .../process/computer/spark/SparkExecutor.java   |   16 +-
 .../computer/spark/SparkGraphComputer.java      |   19 +-
 .../process/computer/spark/SparkMessenger.java  |    7 +-
 .../gremlin/hadoop/structure/HadoopGraph.java   |   51 +-
 .../gremlin/hadoop/structure/HadoopVertex.java  |    6 +-
 .../gremlin/hadoop/structure/io/IOClasses.java  |   52 +
 .../hadoop/structure/io/VertexWritable.java     |   11 +-
 .../structure/io/VertexWritableIterator.java    |   95 ++
 .../io/graphson/GraphSONRecordReader.java       |    8 +-
 .../structure/io/gryo/GryoRecordReader.java     |    9 +-
 .../structure/io/script/ScriptRecordReader.java |    6 +-
 .../gremlin/hadoop/HadoopGraphProvider.java     |    5 +-
 pom.xml                                         |    2 +-
 tinkergraph-gremlin/pom.xml                     |    2 +-
 .../process/computer/TinkerGraphComputer.java   |    2 +-
 .../process/computer/TinkerMessageBoard.java    |    7 +
 .../process/computer/TinkerMessenger.java       |   48 +-
 .../dsl/graph/VariableGraphTraversal.java       |    9 +-
 .../tinkergraph/structure/TinkerFactory.java    |    9 +-
 .../tinkergraph/structure/TinkerGraph.java      |  232 +++-
 .../tinkergraph/structure/TinkerHelper.java     |    8 +-
 .../tinkergraph/structure/TinkerProperty.java   |    3 +
 .../tinkergraph/structure/TinkerVertex.java     |   16 +-
 .../structure/TinkerVertexProperty.java         |   13 +-
 .../tinkergraph/TinkerGraphProvider.java        |   87 +-
 .../structure/TinkerGraphIdManagerTest.java     |  158 +++
 .../tinkergraph/structure/TinkerGraphTest.java  |   19 +-
 195 files changed, 6256 insertions(+), 2029 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c15ab5e7/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/dsl/graph/VariableGraphTraversal.java
----------------------------------------------------------------------
diff --cc tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/dsl/graph/VariableGraphTraversal.java
index eb7b3eb,0000000..52f0876
mode 100644,000000..100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/dsl/graph/VariableGraphTraversal.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/dsl/graph/VariableGraphTraversal.java
@@@ -1,832 -1,0 +1,827 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + * http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.dsl.graph;
 +
 +import org.apache.tinkerpop.gremlin.process.traversal.Path;
 +import org.apache.tinkerpop.gremlin.process.traversal.Scope;
 +import org.apache.tinkerpop.gremlin.process.traversal.Scopeable;
 +import org.apache.tinkerpop.gremlin.process.traversal.Step;
 +import org.apache.tinkerpop.gremlin.process.traversal.T;
 +import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.ElementValueTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.FilterTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.FilterTraverserTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.IdentityTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.LoopTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.MapTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.MapTraverserTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.TokenTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.lambda.TrueTraversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.ComparatorHolder;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.ExceptStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTraversalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.LambdaFilterStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.RetainStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SampleGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SimplePathStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TimeLimitStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeByPathStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStep;
- import org.apache.tinkerpop.gremlin.process.traversal.step.map.BackStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.CoalesceStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.DedupLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeOtherVertexStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.FoldStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroupCountStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroupStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.IdStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.KeyStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.LabelStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaFlatMapStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaMapStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.MaxGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.MaxLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.MeanGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.MeanLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.MinGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.MinLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertiesStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertyMapStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertyValueStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.RangeLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SackStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SampleLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumLocalStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.TreeStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.UnfoldStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.match.MatchStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountSideEffectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupSideEffectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.LambdaSideEffectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackElementValueStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackObjectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StartStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeSideEffectStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.CollectingBarrierStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementFunctionComparator;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementValueComparator;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.PathIdentityStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.TraversalComparator;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
 +import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 +import org.apache.tinkerpop.gremlin.structure.Compare;
 +import org.apache.tinkerpop.gremlin.structure.Contains;
 +import org.apache.tinkerpop.gremlin.structure.Direction;
 +import org.apache.tinkerpop.gremlin.structure.Edge;
 +import org.apache.tinkerpop.gremlin.structure.Element;
 +import org.apache.tinkerpop.gremlin.structure.Order;
 +import org.apache.tinkerpop.gremlin.structure.Property;
 +import org.apache.tinkerpop.gremlin.structure.PropertyType;
 +import org.apache.tinkerpop.gremlin.structure.Vertex;
 +import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 +import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 +
 +import java.util.Arrays;
 +import java.util.Collection;
 +import java.util.Comparator;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Optional;
 +import java.util.function.BiFunction;
 +import java.util.function.BiPredicate;
 +import java.util.function.BinaryOperator;
 +import java.util.function.Consumer;
 +import java.util.function.Function;
 +import java.util.function.Predicate;
 +import java.util.function.Supplier;
 +import java.util.function.UnaryOperator;
 +
 +/**
 + * @author Stephen Mallette (http://stephen.genoprime.com)
 + */
 +public interface VariableGraphTraversal<S, E> extends Traversal<S, E> {
 +
 +    public interface Admin<S, E> extends Traversal.Admin<S, E>, VariableGraphTraversal<S, E> {
 +
 +        @Override
 +        public default <E2> VariableGraphTraversal.Admin<S, E2> addStep(final Step<?, E2> step) {
 +            return (VariableGraphTraversal.Admin<S, E2>) Traversal.Admin.super.addStep((Step) step);
 +        }
 +
 +        @Override
 +        public default VariableGraphTraversal<S, E> iterate() {
 +            return VariableGraphTraversal.super.iterate();
 +        }
 +
 +        @Override
 +        public VariableGraphTraversal.Admin<S, E> clone();
 +    }
 +
 +    @Override
 +    public default VariableGraphTraversal.Admin<S, E> asAdmin() {
 +        return (VariableGraphTraversal.Admin<S, E>) this;
 +    }
 +
 +    public Map<Step, List<TraversalVariablePosition>> getStepVariables();
 +
 +    ///////////////////// MAP STEPS /////////////////////
 +
 +    public default <E2> VariableGraphTraversal<S, E2> map(final Function<Traverser<E>, E2> function) {
 +        return this.asAdmin().addStep(new LambdaMapStep<>(this.asAdmin(), function));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> flatMap(final Function<Traverser<E>, Iterator<E2>> function) {
 +        return this.asAdmin().addStep(new LambdaFlatMapStep<>(this.asAdmin(), function));
 +    }
 +
 +    public default VariableGraphTraversal<S, Object> id() {
 +        return this.asAdmin().addStep(new IdStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, String> label() {
 +        return this.asAdmin().addStep(new LabelStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> identity() {
 +        return this.asAdmin().addStep(new IdentityStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> to(final Direction direction, final String... edgeLabels) {
 +        return this.asAdmin().addStep(new VertexStep<>(this.asAdmin(), Vertex.class, direction, edgeLabels));
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> out(final String... edgeLabels) {
 +        return this.to(Direction.OUT, edgeLabels);
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> in(final String... edgeLabels) {
 +        return this.to(Direction.IN, edgeLabels);
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> both(final String... edgeLabels) {
 +        return this.to(Direction.BOTH, edgeLabels);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> toE(final Direction direction, final String... edgeLabels) {
 +        return this.asAdmin().addStep(new VertexStep<>(this.asAdmin(), Edge.class, direction, edgeLabels));
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> outE(final String... edgeLabels) {
 +        return this.toE(Direction.OUT, edgeLabels);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> inE(final String... edgeLabels) {
 +        return this.toE(Direction.IN, edgeLabels);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> bothE(final String... edgeLabels) {
 +        return this.toE(Direction.BOTH, edgeLabels);
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> toV(final Direction direction) {
 +        return this.asAdmin().addStep(new EdgeVertexStep(this.asAdmin(), direction));
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> inV() {
 +        return this.toV(Direction.IN);
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> outV() {
 +        return this.toV(Direction.OUT);
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> bothV() {
 +        return this.toV(Direction.BOTH);
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> otherV() {
 +        return this.asAdmin().addStep(new EdgeOtherVertexStep(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> order() {
 +        return this.order(Scope.global);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> order(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new OrderGlobalStep<>(this.asAdmin()) : new OrderLocalStep<>(this.asAdmin()));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, ? extends Property<E2>> properties(final String... propertyKeys) {
 +        return this.asAdmin().addStep(new PropertiesStep<>(this.asAdmin(), PropertyType.PROPERTY, propertyKeys));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> values(final String... propertyKeys) {
 +        return this.asAdmin().addStep(new PropertiesStep<>(this.asAdmin(), PropertyType.VALUE, propertyKeys));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> propertyMap(final String... propertyKeys) {
 +        return this.asAdmin().addStep(new PropertyMapStep<>(this.asAdmin(), false, PropertyType.PROPERTY, propertyKeys));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> valueMap(final String... propertyKeys) {
 +        return this.asAdmin().addStep(new PropertyMapStep<>(this.asAdmin(), false, PropertyType.VALUE, propertyKeys));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> valueMap(final boolean includeTokens, final String... propertyKeys) {
 +        return this.asAdmin().addStep(new PropertyMapStep<>(this.asAdmin(), includeTokens, PropertyType.VALUE, propertyKeys));
 +    }
 +
 +    public default VariableGraphTraversal<S, String> key() {
 +        return this.asAdmin().addStep(new KeyStep(this.asAdmin()));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> value() {
 +        return this.asAdmin().addStep(new PropertyValueStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, Path> path() {
 +        return this.asAdmin().addStep(new PathStep<>(this.asAdmin()));
 +    }
 +
-     public default <E2> VariableGraphTraversal<S, E2> back(final String stepLabel) {
-         return this.asAdmin().addStep(new BackStep<>(this.asAdmin(), stepLabel));
-     }
- 
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> match(final String startLabel, final Traversal... traversals) {
 +        return (VariableGraphTraversal) this.asAdmin().addStep(new MatchStep<E, Map<String, E2>>(this.asAdmin(), startLabel, traversals));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> sack() {
 +        return this.asAdmin().addStep(new SackStep<>(this.asAdmin()));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> select(final String... stepLabels) {
 +        return this.asAdmin().addStep(new SelectStep<>(this.asAdmin(), stepLabels));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> select(final String stepLabel) {
 +        return this.asAdmin().addStep(new SelectOneStep(this.asAdmin(), stepLabel));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> unfold() {
 +        return this.asAdmin().addStep(new UnfoldStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, List<E>> fold() {
 +        return this.asAdmin().addStep(new FoldStep<>(this.asAdmin()));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> fold(final E2 seed, final BiFunction<E2, E, E2> foldFunction) {
 +        return this.asAdmin().addStep(new FoldStep<>(this.asAdmin(), new ConstantSupplier<>(seed), foldFunction)); // TODO: User should provide supplier?
 +    }
 +
 +    public default VariableGraphTraversal<S, Long> count() {
 +        return this.count(Scope.global);
 +    }
 +
 +    public default VariableGraphTraversal<S, Long> count(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new CountGlobalStep<>(this.asAdmin()) : new CountLocalStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, Double> sum() {
 +        return this.sum(Scope.global);
 +    }
 +
 +    public default VariableGraphTraversal<S, Double> sum(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new SumGlobalStep(this.asAdmin()) : new SumLocalStep<>(this.asAdmin()));
 +    }
 +
 +    public default <E2 extends Number> VariableGraphTraversal<S, E2> max() {
 +        return this.max(Scope.global);
 +    }
 +
 +    public default <E2 extends Number> VariableGraphTraversal<S, E2> max(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new MaxGlobalStep<E2>(this.asAdmin()) : new MaxLocalStep(this.asAdmin()));
 +    }
 +
 +    public default <E2 extends Number> VariableGraphTraversal<S, E2> min() {
 +        return this.min(Scope.global);
 +    }
 +
 +    public default <E2 extends Number> VariableGraphTraversal<S, E2> min(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new MinGlobalStep<E2>(this.asAdmin()) : new MinLocalStep(this.asAdmin()));
 +    }
 +
 +
 +    public default VariableGraphTraversal<S, Double> mean() {
 +        return this.mean(Scope.global);
 +    }
 +
 +    public default VariableGraphTraversal<S, Double> mean(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new MeanGlobalStep<>(this.asAdmin()) : new MeanLocalStep<>(this.asAdmin()));
 +    }
 +
 +    public default <K, R> VariableGraphTraversal<S, Map<K, R>> group() {
 +        return this.asAdmin().addStep(new GroupStep<>(this.asAdmin()));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<E2, Long>> groupCount() {
 +        return this.asAdmin().addStep(new GroupCountStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, Tree> tree() {
 +        return this.asAdmin().addStep(new TreeStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, Vertex> addV(final Object... keyValues) {
 +        return this.asAdmin().addStep(new AddVertexStep<>(this.asAdmin(), keyValues));
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addE(final Direction direction, final String edgeLabel, final String stepLabel, final Object... propertyKeyValues) {
 +        return this.asAdmin().addStep(new AddEdgeByPathStep(this.asAdmin(), direction, edgeLabel, stepLabel, propertyKeyValues));
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addE(final Direction direction, final String edgeLabel, final Vertex otherVertex, final Object... propertyKeyValues) {
 +        return this.asAdmin().addStep(new AddEdgeStep(this.asAdmin(), direction, edgeLabel, otherVertex, propertyKeyValues));
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addE(final Direction direction, final String edgeLabel, final Iterator<Vertex> otherVertices, final Object... propertyKeyValues) {
 +        return this.asAdmin().addStep(new AddEdgeStep(this.asAdmin(), direction, edgeLabel, otherVertices, propertyKeyValues));
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addInE(final String edgeLabel, final String stepLabel, final Object... propertyKeyValues) {
 +        return this.addE(Direction.IN, edgeLabel, stepLabel, propertyKeyValues);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addInE(final String edgeLabel, final Vertex otherVertex, final Object... propertyKeyValues) {
 +        return this.addE(Direction.IN, edgeLabel, otherVertex, propertyKeyValues);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addInE(final String edgeLabel, final Iterator<Vertex> otherVertices, final Object... propertyKeyValues) {
 +        return this.addE(Direction.IN, edgeLabel, otherVertices, propertyKeyValues);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addOutE(final String edgeLabel, final String stepLabel, final Object... propertyKeyValues) {
 +        return this.addE(Direction.OUT, edgeLabel, stepLabel, propertyKeyValues);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addOutE(final String edgeLabel, final Vertex otherVertex, final Object... propertyKeyValues) {
 +        return this.addE(Direction.OUT, edgeLabel, otherVertex, propertyKeyValues);
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> addOutE(final String edgeLabel, final Iterator<Vertex> otherVertices, final Object... propertyKeyValues) {
 +        return this.addE(Direction.OUT, edgeLabel, otherVertices, propertyKeyValues);
 +    }
 +
 +    ///////////////////// FILTER STEPS /////////////////////
 +
 +    public default VariableGraphTraversal<S, E> filter(final Predicate<Traverser<E>> predicate) {
 +        return this.asAdmin().addStep(new LambdaFilterStep<>(this.asAdmin(), predicate));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> or(final Traversal<?, ?>... orTraversals) {
 +        return this.asAdmin().addStep(0 == orTraversals.length ?
 +                new OrStep.OrMarker<>(this.asAdmin()) :
 +                new OrStep(this.asAdmin(), Arrays.copyOf(orTraversals, orTraversals.length, Traversal.Admin[].class)));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> and(final Traversal<?, ?>... andTraversals) {
 +        return this.asAdmin().addStep(0 == andTraversals.length ?
 +                new AndStep.AndMarker<>(this.asAdmin()) :
 +                new AndStep(this.asAdmin(), Arrays.copyOf(andTraversals, andTraversals.length, Traversal.Admin[].class)));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> inject(final E... injections) {
 +        return this.asAdmin().addStep(new InjectStep<>(this.asAdmin(), injections));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> dedup() {
 +        return this.dedup(Scope.global);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> dedup(final Scope scope) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global) ? new DedupGlobalStep<>(this.asAdmin()) : new DedupLocalStep(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> except(final String sideEffectKeyOrPathLabel) {
 +        return this.asAdmin().addStep(new ExceptStep<E>(this.asAdmin(), sideEffectKeyOrPathLabel));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> except(final E exceptObject) {
 +        return this.asAdmin().addStep(new ExceptStep<>(this.asAdmin(), exceptObject));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> except(final Collection<E> exceptCollection) {
 +        return this.asAdmin().addStep(new ExceptStep<>(this.asAdmin(), exceptCollection));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> where(final String firstKey, final String secondKey, final BiPredicate predicate) {
 +        return this.asAdmin().addStep(new WhereStep(this.asAdmin(), firstKey, secondKey, predicate));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> where(final String firstKey, final BiPredicate predicate, final String secondKey) {
 +        return this.where(firstKey, secondKey, predicate);
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, Map<String, E2>> where(final Traversal constraint) {
 +        return this.asAdmin().addStep(new WhereStep<>(this.asAdmin(), constraint.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> has(final Traversal<?, ?> hasNextTraversal) {
 +        return this.asAdmin().addStep(new HasTraversalStep<>(this.asAdmin(), (Traversal.Admin<E, ?>) hasNextTraversal, false));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> hasNot(final Traversal<?, ?> hasNotNextTraversal) {
 +        return this.asAdmin().addStep(new HasTraversalStep<>(this.asAdmin(), (Traversal.Admin<E, ?>) hasNotNextTraversal, true));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> has(final String key) {
 +        return this.asAdmin().addStep(new HasStep(this.asAdmin(), new HasContainer(key, Contains.within)));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> has(final String key, final Object value) {
 +        return this.has(key, Compare.eq, value);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> has(final T accessor, final Object value) {
 +        return this.has(accessor.getAccessor(), value);
 +    }
 +
 +    public VariableGraphTraversal<S, E> has(final CharSequence key, final BiPredicate predicate, final Object value);
 +
 +    public default VariableGraphTraversal<S, E> has(final T accessor, final BiPredicate predicate, final Object value) {
 +        return this.has(accessor.getAccessor(), predicate, value);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> has(final String label, final String key, final Object value) {
 +        return this.has(label, key, Compare.eq, value);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> has(final String label, final String key, final BiPredicate predicate, final Object value) {
 +        return this.has(T.label, label).has(key, predicate, value);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> hasNot(final String key) {
 +        return this.asAdmin().addStep(new HasStep(this.asAdmin(), new HasContainer(key, Contains.without)));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> hasLabel(final String... labels) {
 +        return labels.length == 1 ? this.has(T.label, labels[0]) : this.has(T.label, Contains.within, Arrays.asList(labels));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> hasId(final Object... ids) {
 +        return ids.length == 1 ? this.has(T.id, ids[0]) : this.has(T.id, Contains.within, Arrays.asList(ids));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> hasKey(final String... keys) {
 +        return keys.length == 1 ? this.has(T.key, keys[0]) : this.has(T.key, Contains.within, Arrays.asList(keys));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> hasValue(final Object... values) {
 +        return values.length == 1 ? this.has(T.value, values[0]) : this.has(T.value, Contains.within, Arrays.asList(values));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> is(final Object value) {
 +        return this.is(Compare.eq, value);
 +    }
 +
 +    public VariableGraphTraversal<S, E> is(final BiPredicate predicate, final Object value);
 +
 +    public default VariableGraphTraversal<S, E> coin(final double probability) {
 +        return this.asAdmin().addStep(new CoinStep<>(this.asAdmin(), probability));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> range(final Number low, final Number high) {
 +        return this.range(Scope.global, low, high);
 +    }
 +
 +    public VariableGraphTraversal<S, E> range(final Scopeable scope, final Number low, final Number high);
 +
 +    public default VariableGraphTraversal<S, E> limit(final long limit) {
 +        return this.range(Scope.global, 0, limit);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> limit(final Scope scope, final long limit) {
 +        return this.range(scope, 0, limit);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> retain(final String sideEffectKeyOrPathLabel) {
 +        return this.asAdmin().addStep(new RetainStep<>(this.asAdmin(), sideEffectKeyOrPathLabel));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> retain(final E retainObject) {
 +        return this.asAdmin().addStep(new RetainStep<>(this.asAdmin(), retainObject));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> retain(final Collection<E> retainCollection) {
 +        return this.asAdmin().addStep(new RetainStep<>(this.asAdmin(), retainCollection));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> simplePath() {
 +        return this.asAdmin().addStep(new SimplePathStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> cyclicPath() {
 +        return this.asAdmin().addStep(new CyclicPathStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> sample(final int amountToSample) {
 +        return this.sample(Scope.global, amountToSample);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> sample(final Scope scope, final int amountToSample) {
 +        return this.asAdmin().addStep(scope.equals(Scope.global)
 +                ? new SampleGlobalStep<>(this.asAdmin(), amountToSample)
 +                : new SampleLocalStep<>(this.asAdmin(), amountToSample));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> drop() {
 +        return this.asAdmin().addStep(new DropStep<>(this.asAdmin()));
 +    }
 +
 +    ///////////////////// SIDE-EFFECT STEPS /////////////////////
 +
 +    public default VariableGraphTraversal<S, E> sideEffect(final Consumer<Traverser<E>> consumer) {
 +        return this.asAdmin().addStep(new LambdaSideEffectStep<>(this.asAdmin(), consumer));
 +    }
 +
-     public default <E2> VariableGraphTraversal<S, E2> cap(final String... sideEffectKeys) {
-         return this.asAdmin().addStep(new SideEffectCapStep<>(this.asAdmin(), sideEffectKeys));
++    public default <E2> VariableGraphTraversal<S, E2> cap(final String sideEffectKey, final String... sideEffectKeys) {
++        return this.asAdmin().addStep(new SideEffectCapStep<>(this.asAdmin(), sideEffectKey, sideEffectKeys));
 +    }
 +
 +    public default VariableGraphTraversal<S, Edge> subgraph(final String sideEffectKey) {
 +        return this.asAdmin().addStep(new SubgraphStep(this.asAdmin(), sideEffectKey));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> aggregate(final String sideEffectKey) {
 +        return this.asAdmin().addStep(new AggregateStep<>(this.asAdmin(), sideEffectKey));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> group(final String sideEffectKey) {
 +        return this.asAdmin().addStep(new GroupSideEffectStep<>(this.asAdmin(), sideEffectKey));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> groupCount(final String sideEffectKey) {
 +        return this.asAdmin().addStep(new GroupCountSideEffectStep<>(this.asAdmin(), sideEffectKey));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> timeLimit(final long timeLimit) {
 +        return this.asAdmin().addStep(new TimeLimitStep<E>(this.asAdmin(), timeLimit));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> tree(final String sideEffectKey) {
 +        return this.asAdmin().addStep(new TreeSideEffectStep<>(this.asAdmin(), sideEffectKey));
 +    }
 +
 +    public default <V> VariableGraphTraversal<S, E> sack(final BiFunction<V, E, V> sackFunction) {
 +        return this.asAdmin().addStep(new SackObjectStep<>(this.asAdmin(), sackFunction));
 +    }
 +
 +    public default <V> VariableGraphTraversal<S, E> sack(final BinaryOperator<V> sackOperator, final String elementPropertyKey) {
 +        return this.asAdmin().addStep(new SackElementValueStep(this.asAdmin(), sackOperator, elementPropertyKey));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> store(final String sideEffectKey) {
 +        return this.asAdmin().addStep(new StoreStep<>(this.asAdmin(), sideEffectKey));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> profile() {
 +        return this.asAdmin().addStep(new ProfileStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> property(final String key, final Object value, final Object... keyValues) {
 +        return this.asAdmin().addStep(new AddPropertyStep(this.asAdmin(), key, value, keyValues));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> property(final VertexProperty.Cardinality cardinality, final String key, final Object value, final Object... keyValues) {
 +        return this.asAdmin().addStep(new AddPropertyStep(this.asAdmin(), cardinality, key, value, keyValues));
 +    }
 +
 +    ///////////////////// BRANCH STEPS /////////////////////
 +
 +    public default <M, E2> VariableGraphTraversal<S, E2> branch(final Traversal<?, M> branchTraversal) {
 +        final BranchStep<E, E2, M> branchStep = new BranchStep<>(this.asAdmin());
 +        branchStep.setBranchTraversal((Traversal.Admin<E, M>) branchTraversal);
 +        return this.asAdmin().addStep(branchStep);
 +    }
 +
 +    public default <M, E2> VariableGraphTraversal<S, E2> branch(final Function<Traverser<E>, M> function) {
 +        return this.branch(new MapTraverserTraversal<>(function));
 +    }
 +
 +    public default <M, E2> VariableGraphTraversal<S, E2> choose(final Traversal<?, M> choiceTraversal) {
 +        return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), (Traversal.Admin<E, M>) choiceTraversal));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> choose(final Traversal<?, ?> traversalPredicate, final Traversal<?, E2> trueChoice, final Traversal<?, E2> falseChoice) {
 +        return this.asAdmin().addStep(new ChooseStep<E, E2, Boolean>(this.asAdmin(), (Traversal.Admin<E, ?>) traversalPredicate, (Traversal.Admin<E, E2>) trueChoice, (Traversal.Admin<E, E2>) falseChoice));
 +    }
 +
 +    public default <M, E2> VariableGraphTraversal<S, E2> choose(final Function<E, M> choiceFunction) {
 +        return this.choose(new MapTraversal<>(choiceFunction));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> choose(final Predicate<E> choosePredicate, final Traversal<?, E2> trueChoice, final Traversal<?, E2> falseChoice) {
 +        return this.choose(new FilterTraversal<>(choosePredicate), trueChoice, falseChoice);
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> union(final Traversal<?, E2>... unionTraversals) {
 +        return this.asAdmin().addStep(new UnionStep(this.asAdmin(), Arrays.copyOf(unionTraversals, unionTraversals.length, Traversal.Admin[].class)));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> coalesce(final Traversal<?, E2>... coalesceTraversals) {
 +        return this.asAdmin().addStep(new CoalesceStep(this.asAdmin(), Arrays.copyOf(coalesceTraversals, coalesceTraversals.length, Traversal.Admin[].class)));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> repeat(final Traversal<?, E> repeatTraversal) {
 +        return RepeatStep.addRepeatToTraversal(this, (Traversal.Admin<E, E>) repeatTraversal);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> emit(final Traversal<?, ?> emitTraversal) {
 +        return RepeatStep.addEmitToTraversal(this, (Traversal.Admin<E, ?>) emitTraversal);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> emit(final Predicate<Traverser<E>> emitPredicate) {
 +        return this.emit(new FilterTraverserTraversal<>(emitPredicate));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> emit() {
 +        return this.emit(TrueTraversal.instance());
 +    }
 +
 +    public default VariableGraphTraversal<S, E> until(final Traversal<?, ?> untilTraversal) {
 +        return RepeatStep.addUntilToTraversal(this, (Traversal.Admin<E, ?>) untilTraversal);
 +    }
 +
 +    public default VariableGraphTraversal<S, E> until(final Predicate<Traverser<E>> untilPredicate) {
 +        return this.until(new FilterTraverserTraversal<>(untilPredicate));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> times(final int maxLoops) {
 +        return this.until(new LoopTraversal(maxLoops));
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E2> local(final Traversal<?, E2> localTraversal) {
 +        return this.asAdmin().addStep(new LocalStep<>(this.asAdmin(), localTraversal.asAdmin()));
 +    }
 +
 +    ///////////////////// UTILITY STEPS /////////////////////
 +
 +    public default VariableGraphTraversal<S, E> withSideEffect(final String key, final Supplier supplier) {
 +        this.asAdmin().getSideEffects().registerSupplier(key, supplier);
 +        return this;
 +    }
 +
 +    public default <A> VariableGraphTraversal<S, E> withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
 +        this.asAdmin().getSideEffects().setSack(initialValue, Optional.of(splitOperator));
 +        return this;
 +    }
 +
 +    public default <A> VariableGraphTraversal<S, E> withSack(final Supplier<A> initialValue) {
 +        this.asAdmin().getSideEffects().setSack(initialValue, Optional.empty());
 +        return this;
 +    }
 +
 +    public default <A> VariableGraphTraversal<S, E> withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
 +        this.asAdmin().getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.of(splitOperator));
 +        return this;
 +    }
 +
 +    public default <A> VariableGraphTraversal<S, E> withSack(A initialValue) {
 +        this.asAdmin().getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.empty());
 +        return this;
 +    }
 +
 +    public default VariableGraphTraversal<S, E> withPath() {
 +        return this.asAdmin().addStep(new PathIdentityStep<>(this.asAdmin()));
 +    }
 +
 +    public default VariableGraphTraversal<S, E> as(final String stepLabel) {
 +        if (this.asAdmin().getSteps().size() == 0) this.asAdmin().addStep(new StartStep<>(this.asAdmin()));
 +        this.asAdmin().getEndStep().setLabel(stepLabel);
 +        return this;
 +    }
 +
 +    public default VariableGraphTraversal<S, E> barrier() {
 +        return this.asAdmin().addStep(new CollectingBarrierStep(asAdmin()) {
 +            @Override
 +            public void barrierConsumer(TraverserSet traverserSet) {
 +
 +            }
 +        }); // TODO: THIS IS NOT SERIALIZABLE
 +    }
 +
 +    ////
 +
 +    public default VariableGraphTraversal<S, E> by() {
 +        ((TraversalParent) this.asAdmin().getEndStep()).addLocalChild(new IdentityTraversal<>());
 +        return this;
 +    }
 +
 +    public default <V> VariableGraphTraversal<S, E> by(final Function<V, Object> functionProjection) {
 +        ((TraversalParent) this.asAdmin().getEndStep()).addLocalChild(new MapTraversal<>(functionProjection));
 +        return this;
 +    }
 +
 +    public default VariableGraphTraversal<S, E> by(final T tokenProjection) {
 +        ((TraversalParent) this.asAdmin().getEndStep()).addLocalChild(new TokenTraversal<>(tokenProjection));
 +        return this;
 +    }
 +
 +    public default VariableGraphTraversal<S, E> by(final String elementPropertyKey) {
 +        ((TraversalParent) this.asAdmin().getEndStep()).addLocalChild(new ElementValueTraversal<>(elementPropertyKey));
 +        return this;
 +    }
 +
 +    public default VariableGraphTraversal<S, E> by(final Traversal<?, ?> byTraversal) {
 +        ((TraversalParent) this.asAdmin().getEndStep()).addLocalChild(byTraversal.asAdmin());
 +        return this;
 +    }
 +
 +    ////
 +
 +    public default VariableGraphTraversal<S, E> by(final Order order) {
 +        ((ComparatorHolder) this.asAdmin().getEndStep()).addComparator(order);
 +        return this;
 +    }
 +
 +    public default VariableGraphTraversal<S, E> by(final Comparator<E> comparator) {
 +        ((ComparatorHolder<E>) this.asAdmin().getEndStep()).addComparator(comparator);
 +        return this;
 +    }
 +
 +    public default <V> VariableGraphTraversal<S, E> by(final Function<Element, V> elementFunctionProjection, final Comparator<V> elementFunctionValueComparator) {
 +        ((ComparatorHolder<Element>) this.asAdmin().getEndStep()).addComparator(new ElementFunctionComparator<>(elementFunctionProjection, elementFunctionValueComparator));
 +        return this;
 +    }
 +
 +    public default <V> VariableGraphTraversal<S, E> by(final String elementPropertyProjection, final Comparator<V> propertyValueComparator) {
 +        ((ComparatorHolder<Element>) this.asAdmin().getEndStep()).addComparator(new ElementValueComparator<>(elementPropertyProjection, propertyValueComparator));
 +        return this;
 +    }
 +
 +    public default <V> VariableGraphTraversal<S, E> by(final Traversal<?, ?> traversal, final Comparator<V> endComparator) {
 +        ((ComparatorHolder<E>) this.asAdmin().getEndStep()).addComparator(new TraversalComparator(traversal.asAdmin(), endComparator));
 +        return this;
 +    }
 +
 +    ////
 +
 +    public default <M, E2> VariableGraphTraversal<S, E> option(final M pickToken, final Traversal<E, E2> traversalOption) {
 +        ((TraversalOptionParent<M, E, E2>) this.asAdmin().getEndStep()).addGlobalChildOption(pickToken, traversalOption.asAdmin());
 +        return this;
 +    }
 +
 +    public default <E2> VariableGraphTraversal<S, E> option(final Traversal<E, E2> traversalOption) {
 +        ((TraversalOptionParent<TraversalOptionParent.Pick, E, E2>) this.asAdmin().getEndStep()).addGlobalChildOption(TraversalOptionParent.Pick.any, traversalOption.asAdmin());
 +        return this;
 +    }
 +
 +    ////
 +
 +    @Override
 +    public default VariableGraphTraversal<S, E> iterate() {
 +        Traversal.super.iterate();
 +        return this;
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c15ab5e7/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --cc tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index 4d75cbb,291dddd..d75d183
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@@ -20,19 -20,11 +20,20 @@@ package org.apache.tinkerpop.gremlin.ti
  
  import org.apache.commons.io.FileUtils;
  import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 +import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 +import org.apache.tinkerpop.gremlin.process.traversal.Step;
  import org.apache.tinkerpop.gremlin.TestHelper;
+ import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
  import org.apache.tinkerpop.gremlin.process.traversal.T;
  import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 +import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
  import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 +import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertiesStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
 +import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
  import org.apache.tinkerpop.gremlin.structure.Direction;
  import org.apache.tinkerpop.gremlin.structure.Edge;
  import org.apache.tinkerpop.gremlin.structure.Graph;
@@@ -45,12 -36,7 +45,13 @@@ import org.apache.tinkerpop.gremlin.str
  import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
  import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader;
  import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
+ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
 +import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.dsl.graph.DefaultVariableGraphTraversal;
 +import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.dsl.graph.TraversalVariable;
 +import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.dsl.graph.TraversalVariablePosition;
 +import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.dsl.graph.VariableGraphTraversal;
 +import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.dsl.graph.VariableGraphTraversalSource;
 +import org.apache.tinkerpop.gremlin.util.StreamFactory;
  import org.junit.BeforeClass;
  import org.junit.Ignore;
  import org.junit.Test;


[45/50] incubator-tinkerpop git commit: Cleaned up discrepancy with PathTest for enforcement purposes.

Posted by sp...@apache.org.
Cleaned up discrepancy with PathTest for enforcement purposes.

There were two tests named PathTest and one was enforceable and the other not.


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

Branch: refs/heads/variables
Commit: 0f4fb31d6c9ec43db0b8cbb61df3a7df606e0c39
Parents: 05616f2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 10:25:21 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 10:25:21 2015 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/process/ProcessStandardSuite.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0f4fb31d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
index 3124588..f056d2e 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
@@ -161,6 +161,7 @@ public class ProcessStandardSuite extends AbstractGremlinSuite {
 
             // util
             TraversalSideEffectsTest.Traversals.class,
+            org.apache.tinkerpop.gremlin.process.traversal.step.util.PathTest.class,
 
             // compliance
             CoreTraversalTest.class,
@@ -222,7 +223,7 @@ public class ProcessStandardSuite extends AbstractGremlinSuite {
             MinTest.class,
             SumTest.class,
             OrderTest.class,
-            PathTest.class,
+            org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest.class,   // note that there are two PathTest in this suite - only one is enforce
             PropertiesTest.class,
             SelectTest.class,
             VertexTest.class,


[25/50] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master'

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/variables
Commit: 60c2e70c4a0687585b34cdce2599d9bc8ccc8f8d
Parents: b1a5137 e0574a3
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 13:57:56 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 13:57:56 2015 -0400

----------------------------------------------------------------------
 hadoop-gremlin/conf/hadoop-gryo.properties | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[29/50] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master'

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/variables
Commit: c30e100a19484b1d9199d8aa6bcd6b01302b72d1
Parents: 6194545 8c131e1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 14:35:00 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 14:35:00 2015 -0400

----------------------------------------------------------------------
 docs/src/acknowledgements.asciidoc        |   2 +-
 docs/static/images/ketrina-tinkerpop3.png | Bin 0 -> 646438 bytes
 2 files changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[13/50] incubator-tinkerpop git commit: Fixed groupCount performance.

Posted by sp...@apache.org.
Fixed groupCount performance.

groupCount step is no longer a sideEffect step, hence .cap() has to be removed.


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

Branch: refs/heads/variables
Commit: 0eddf8eccf80673473533c186a7aef2c0d00edc1
Parents: 54d909f
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Apr 14 00:58:28 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Apr 14 00:58:28 2015 +0200

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/TraversalPerformanceTest.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0eddf8ec/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/TraversalPerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/TraversalPerformanceTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/TraversalPerformanceTest.java
index aed4b23..773b819 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/TraversalPerformanceTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/TraversalPerformanceTest.java
@@ -107,8 +107,8 @@ public class TraversalPerformanceTest extends AbstractGremlinTest {
     @BenchmarkOptions(benchmarkRounds = DEFAULT_BENCHMARK_ROUNDS, warmupRounds = DEFAULT_WARMUP_ROUNDS, concurrency = BenchmarkOptions.CONCURRENCY_SEQUENTIAL)
     @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
     @Test
-    public void g_V_label_groupCount_cap() throws Exception {
-        g.V().label().groupCount("x").cap("x").iterate();
+    public void g_V_label_groupCount() throws Exception {
+        g.V().label().groupCount().iterate();
     }
 
     @BenchmarkOptions(benchmarkRounds = DEFAULT_BENCHMARK_ROUNDS, warmupRounds = DEFAULT_WARMUP_ROUNDS, concurrency = BenchmarkOptions.CONCURRENCY_SEQUENTIAL)


[28/50] incubator-tinkerpop git commit: Update the docs around TraversalSource configuration in Gremlin Server.

Posted by sp...@apache.org.
Update the docs around TraversalSource configuration in Gremlin Server.


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

Branch: refs/heads/variables
Commit: 61945458838042b6b7013d68892fdc57f3e45263
Parents: f86aaaa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 14 14:34:03 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 14 14:34:03 2015 -0400

----------------------------------------------------------------------
 docs/src/gremlin-applications.asciidoc | 39 +++++++++++++++--------------
 1 file changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/61945458/docs/src/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/gremlin-applications.asciidoc b/docs/src/gremlin-applications.asciidoc
index a83c629..7a60307 100644
--- a/docs/src/gremlin-applications.asciidoc
+++ b/docs/src/gremlin-applications.asciidoc
@@ -210,7 +210,7 @@ image:gremlin-server.png[width=400,float=right] Gremlin Server provides a way to
 
 NOTE: Gremlin Server is the replacement for link:http://rexster.tinkerpop.com[Rexster].
 
-By default, communication with Gremlin Server occurs over link:http://en.wikipedia.org/wiki/WebSocket[WebSockets] and exposes a custom subprotocol for interacting with the server.
+By default, communication with Gremlin Server occurs over link:http://en.wikipedia.org/wiki/WebSocket[WebSockets] and exposes a custom sub-protocol for interacting with the server.
 
 [[connecting-via-console]]
 Connecting via Console
@@ -228,15 +228,16 @@ $ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
 
 [INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
 [INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
-[INFO] GremlinServer$WebSocketServerInitializer - Configured application/vnd.gremlin-v1.0+kryo with org.apache.tinkerpop.gremlin.driver.ser.KryoMessageSerializerV1d0
-[INFO] GremlinServer$WebSocketServerInitializer - Configured application/vnd.gremlin-v1.0+kryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.KryoMessageSerializerV1d0
-[INFO] Graphs - Graph [g] was successfully configured via [config/tinkergraph-empty.properties].
-[INFO] GremlinExecutor - Getting dependencies for [[org.apache.commons, commons-math3, 3.2]]
+[INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
+[INFO] GremlinServer - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
+[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
 [INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy
-[INFO] GremlinServer$WebSocketServerInitializer - Initialized GremlinExecutor and configured ScriptEngines.
-[INFO] GremlinServer$WebSocketServerInitializer - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
-[INFO] GremlinServer - Gremlin Server configured with worker thread pool of 1 and boss thread pool of 1
-[INFO] GremlinServer - Channel started at port 8182.
+[INFO] GremlinServer - Initialized GremlinExecutor and configured ScriptEngines.
+[INFO] GremlinServer - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
+[INFO] GremlinServer$1 - Channel started at port 8182.
 ----
 
 Gremlin Server is configured by the provided link:http://www.yaml.org/[YAML] file `conf/gremlin-server-modern.yaml`.  That file tells Gremlin Server many things such as:
@@ -248,14 +249,14 @@ Gremlin Server is configured by the provided link:http://www.yaml.org/[YAML] fil
 * The Gremlin `ScriptEngine` instances to expose and external dependencies to inject into them
 * `Graph` instances to expose
 
-The log messages that printed above show a number of things, but most importantly, there is a `Graph` instance named `g` that is exposed in Gremlin Server.  This graph is an in-memory TinkerGraph and was empty at the start of the server.  An initialization script at `scripts/generate-modern.groovy` was executed during startup.  It's contents are as follows:
+The log messages that printed above show a number of things, but most importantly, there is a `Graph` instance named `graph` that is exposed in Gremlin Server.  This graph is an in-memory TinkerGraph and was empty at the start of the server.  An initialization script at `scripts/generate-modern.groovy` was executed during startup.  It's contents are as follows:
 
 [source,groovy]
 ----
 include::{basedir}/gremlin-server/scripts/generate-modern.groovy[]
 ----
 
-This script loads the "modern" graph into the empty TinkerGraph instance, preparing it for use.  With Gremlin Server running it is now possible to issue some scripts to it for processing.  Start Gremlin Console as follows:
+This script loads the "modern" graph into the empty TinkerGraph instance, preparing it for use and then creates a `TraversalSource` variable `g` from `graph`. This variable `g` will be made available on future remote script executions. Note that `Graph` and `TraversalSource` objects that are created or modified in the initialization script will become globally bound to the server. It is not possible to bind variables of other types. With Gremlin Server running it is now possible to issue some scripts to it for processing.  Start Gremlin Console as follows:
 
 [source,text]
 ----
@@ -279,16 +280,16 @@ The `:remote` command shown above displays the current status of the remote conn
 
 [source,groovy]
 ----
-gremlin> :> g.traversal().V().values('name')
+gremlin> :> g.V().values('name')
 ==>marko
 ==>vadas
 ==>lop
 ==>josh
 ==>ripple
 ==>peter
-gremlin> :> g.traversal().V().has('name','marko').out('created').values('name')
+gremlin> :> g.V().has('name','marko').out('created').values('name')
 ==>lop
-gremlin> :> g.traversal().E().label().groupCount()
+gremlin> :> g.E().label().groupCount()
 ==>{created=4, knows=2}
 gremlin> result
 ==>result{object={created=4, knows=2} class=java.lang.String}
@@ -305,7 +306,7 @@ gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml <1>
 gremlin> :remote list <2>
 ==>0 - Gremlin Server - [localhost/127.0.0.1:8182]
 ==>*1 - Gremlin Server - [localhost/127.0.0.1:8182]
-gremlin> :> g.traversal().E().label().groupCount() <3>
+gremlin> :> g.E().label().groupCount() <3>
 ==>[created:4, knows:2]
 gremlin> m = result[0].object <4>
 ==>created=4
@@ -314,18 +315,18 @@ gremlin> m.sort{it.value}
 ==>knows=2
 ==>created=4
 gremlin> script = """
-                  matthias = g.addVertex('name','matthias')
+                  matthias = graph.addVertex('name','matthias')
                   matthias.addEdge('co-creator',g.V().has('name','marko').next())
                   """
 gremlin> :> @script   <5>
 ==>e[14][12-co-creator->1]
-gremlin> :> g.traversal().V().has('name','matthias').out('co-creator').values('name')
+gremlin> :> g.V().has('name','matthias').out('co-creator').values('name')
 ==>marko
 gremlin> :remote close
 ==>Removed - gremlin server - [localhost/127.0.0.1:8182]
 ----
 
-<1> This configuration file specifies that results should be deserialized back into an `Object` in the Console with the caveat being that the server and console both know how to serialize and deserialize the result to be returned.
+<1> This configuration file specifies that results should be deserialized back into an `Object` in the console with the caveat being that the server and console both know how to serialize and deserialize the result to be returned.
 <2> There are now two configured remote connections.  The one marked by an asterisk is the one that was just created and denotes the current one that `:sumbit` will react to.
 <3> When the script is executed again, the `class` is no longer shown to be a `java.lang.String`.  It is instead a `java.util.HashMap`.
 <4> The last result of a remote script is always stored in the reserved variable `result`, which allows access to the `Result` and by virtue of that, the `Map` itself.
@@ -499,7 +500,7 @@ The following table describes the various configuration options that Gremlin Ser
 |scriptEngines |A `Map` of `ScriptEngine` implementations to expose through Gremlin Server, where the key is the name given by the `ScriptEngine` implementation.  The key must match the name exactly for the `ScriptEngine` to be constructed.  The value paired with this key is itself a `Map` of configuration for that `ScriptEngine`.  |_none_
 |scriptEngines.<name>.imports |A comma separated list of classes/packages to make available to the `ScriptEngine`. |_none_
 |scriptEngines.<name>.staticImports |A comma separated list of "static" imports to make available to the `ScriptEngine`. |_none_
-|scriptEngines.<name>.scripts |A comma separated list of script files to execute on `ScriptEngine` initialization. Modifications to `Graph` instance references will be stored globally in Gremlin Server, therefore it is possible to use initialization scripts to add Graph Strategies or create entirely new `Graph` instances all together. |_none_
+|scriptEngines.<name>.scripts |A comma separated list of script files to execute on `ScriptEngine` initialization. `Graph` and `TraversalSource` instance references produced from scripts will be stored globally in Gremlin Server, therefore it is possible to use initialization scripts to add Traversal Strategies or create entirely new `Graph` instances all together. |_none_
 |scriptEngines.<name>.config |A `Map` of configuration settings for the `ScriptEngine`.  These settings are dependent on the `ScriptEngine` implementation being used. |_none_
 |scriptEvaluationTimeout |The amount of time in milliseconds before a script evaluation times out. The notion of "script evaluation" refers to the time it takes for the `ScriptEngine` to do its work and *not* any additional time it takes for the result of the evaluation to be iterated and serialized. |30000
 |serializers |A `List` of `Map` settings, where each `Map` represents a `MessageSerializer` implementation to use along with its configuration. |_none_