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 2017/07/18 21:03:34 UTC

[01/50] [abbrv] tinkerpop git commit: added a tree() example to the docs to clear up any confusion about what happens when duplicate nodes are realized in a tree projection. [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1489 baeabd7c8 -> b6f2cddaf (forced update)


added a tree() example to the docs to clear up any confusion about what happens when duplicate nodes are realized in a tree projection.


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

Branch: refs/heads/TINKERPOP-1489
Commit: e962f5964f59f116f58c3294f38ac5c4904732e9
Parents: c8cc0e5
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Jun 30 12:48:35 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Jun 30 12:48:35 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e962f596/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index f39fe11..4c95f72 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2283,6 +2283,20 @@ tree['marko']['josh']
 tree.getObjectsAtDepth(3)
 ----
 
+Note that when using `by()`-modulation, tree nodes are combined based on projection uniqueness, not on the
+uniqueness of the original objects being projected. For instance:
+
+[gremlin-groovy,modern]
+----
+g.V().has('name','josh').out('created').values('name').tree() <1>
+g.V().has('name','josh').out('created').values('name').
+  tree().by('name').by(label).by() <2>
+----
+
+<1> When the `tree()` is created, vertex 3 and 5 are unique and thus, form unique branches in the tree structure.
+<2> When the `tree()` is `by()`-modulated by `label`, then vertex 3 and 5 are both "software" and thus are merged to a single node in the tree.
+
+
 [[unfold-step]]
 Unfold Step
 ~~~~~~~~~~~


[06/50] [abbrv] tinkerpop git commit: Updated old, dead codehaus link CTR

Posted by sp...@apache.org.
Updated old, dead codehaus link CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: faa7611197fcc412008c81977d0b268156e3a3af
Parents: beb9a84
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:49:26 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:49:26 2017 -0400

----------------------------------------------------------------------
 .../gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/faa76111/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
index 5f5e3c6..bfa6690 100644
--- a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
+++ b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
@@ -34,7 +34,7 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
     def testsOptedOut = optOuts != null && optOuts.size() > 0 ? optOuts.collect { "> " + it.test() + "#" + it.method() + "${lf}\t\"" + it.reason() + "\"" }.join(lf) : "> none";
 
     // not the use of {lf} here rather than triple quoted string is that groovy 2.4.0 seems to have trouble
-    // parsing that into groovysh - note the bug report here: https://jira.codehaus.org/browse/GROOVY-7290
+    // parsing that into groovysh - note the bug report here: https://issues.apache.org/jira/browse/GROOVY-7290
     return "${lf}" +
 "IMPLEMENTATION - ${c.getCanonicalName()} ${lf}" +
 "TINKERPOP TEST SUITE ${lf}" +
@@ -49,4 +49,4 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
 "the implementation itself.  Compliant implementations will faithfully and ${lf}" +
 "honestly supply these Annotations to provide the most accurate depiction of ${lf}" +
 "their support."
-}
\ No newline at end of file
+}


[38/50] [abbrv] tinkerpop git commit: TINKERPOP-1489 Cleaned up pom

Posted by sp...@apache.org.
TINKERPOP-1489 Cleaned up pom

Removed some weird characters in license and bumped version to 3.2.5-SNAPSHOT


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

Branch: refs/heads/TINKERPOP-1489
Commit: 5f1089123221a9ce9804a59a83d7965917d8f6b2
Parents: 58bd9b5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 18 12:47:48 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 gremlin-javascript/pom.xml | 35 ++++++++++++++++-------------------
 1 file changed, 16 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5f108912/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index 387e628..b9b78cc 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -1,22 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~  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.
-  -->
+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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -24,7 +21,7 @@
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.3-SNAPSHOT</version>
+        <version>3.2.5-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-javascript</artifactId>
     <name>Apache TinkerPop :: Gremlin Javascript</name>


[21/50] [abbrv] tinkerpop git commit: Merge branch 'pr-618' into tp32

Posted by sp...@apache.org.
Merge branch 'pr-618' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: c30b378b3a61f62fb936a11740d6f981d8473f87
Parents: bd4b989 c264390
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 12 13:04:16 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 12 13:04:16 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../src/reference/gremlin-applications.asciidoc |   7 +-
 .../upgrade/release-3.2.x-incubating.asciidoc   |   9 +
 .../gremlin/server/AbstractChannelizer.java     |  11 +-
 .../server/channel/WebSocketChannelizer.java    |   7 +-
 .../server/channel/WsAndHttpChannelizer.java    |  61 ++++
 .../SaslAndHttpBasicAuthenticationHandler.java  |  57 +++
 .../server/handler/WebSocketHandlerUtil.java    |  38 ++
 .../handler/WsAndHttpChannelizerHandler.java    |  87 +++++
 .../AbstractGremlinServerIntegrationTest.java   |  23 +-
 .../server/GremlinServerHttpIntegrateTest.java  |   6 -
 .../server/GremlinServerIntegrateTest.java      |  37 --
 ...tGremlminServerChannelizerIntegrateTest.java | 346 +++++++++++++++++++
 .../channel/HttpChannelizerIntegrateTest.java   |  56 +++
 .../channel/NioChannelizerIntegrateTest.java    |  56 +++
 .../WebSocketChannelizerIntegrateTest.java      |  56 +++
 .../WsAndHttpChannelizerIntegrateTest.java      |  58 ++++
 17 files changed, 864 insertions(+), 52 deletions(-)
----------------------------------------------------------------------



[09/50] [abbrv] tinkerpop git commit: updated the docs with @dkuppitz recommended tweaks.

Posted by sp...@apache.org.
updated the docs with @dkuppitz recommended tweaks.


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

Branch: refs/heads/TINKERPOP-1489
Commit: f6290331b9a393b9ddf1828c5850092806c86168
Parents: 41c16fa
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 07:31:08 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 07:31:08 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6290331/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 738255e..e7d9d25 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2592,7 +2592,7 @@ g.V().has('name','marko').out('knows').fold().count(global) <4>
 
 <1> Marko knows 2 people.
 <2> A list of Marko's friends is created and thus, one object is counted (the single list).
-<3> A list of Marko's fiends is created and a `local`-count yields the number of objects in that list.
+<3> A list of Marko's friends is created and a `local`-count yields the number of objects in that list.
 <4> `count(global)` is the same as `count()` as the default behavior for most scoped steps is `global`.
 
 The steps that support scoping are:
@@ -2604,6 +2604,7 @@ The steps that support scoping are:
 * <<min-step, `min()`>>: get the min value in the local collection or global stream.
 * <<order-step,`order()`>>: order the objects in the local collection or global stream.
 * <<range-step, `range()`>>: clip the local collection or global stream.
+* <<limit-step, `limit()`>>: clip the local collection or global stream.
 * <<sample-step, `sample()`>>: sample objects from the local collection or global stream.
 * <<tail-step, `tail()`>>: get the tail of the objects in the local collection or global stream.
 


[13/50] [abbrv] tinkerpop git commit: TINKERPOP-1552 Put enums on separate lines for Gremlin.Net

Posted by sp...@apache.org.
TINKERPOP-1552 Put enums on separate lines for Gremlin.Net


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

Branch: refs/heads/TINKERPOP-1489
Commit: 426d141fda6f70f11e806b857111bb6d8c8e41a0
Parents: cc522be
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 12:09:52 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 12:09:52 2017 -0400

----------------------------------------------------------------------
 gremlin-dotnet/pom.xml                                  |  2 +-
 .../src/Gremlin.Net/Process/Traversal/Cardinality.cs    |  4 +++-
 .../src/Gremlin.Net/Process/Traversal/Column.cs         |  3 ++-
 .../src/Gremlin.Net/Process/Traversal/Direction.cs      |  4 +++-
 .../Gremlin.Net/Process/Traversal/GraphSONVersion.cs    |  3 ++-
 .../src/Gremlin.Net/Process/Traversal/Operator.cs       | 12 +++++++++++-
 .../src/Gremlin.Net/Process/Traversal/Order.cs          |  8 +++++++-
 .../src/Gremlin.Net/Process/Traversal/Pick.cs           |  3 ++-
 gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs |  4 +++-
 .../src/Gremlin.Net/Process/Traversal/Scope.cs          |  3 ++-
 gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs   |  5 ++++-
 11 files changed, 40 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index 20db3d8..aba4315 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -237,7 +237,7 @@ def createEnum = { enumClass, csharpToJava ->
                                         def csharpName = toCSharpName(enumClass, value.name())
                                         csharpToJava.put(enumClass.simpleName + "." + csharpName, value.name())
                                         return csharpName
-                                    }.join(",")]
+                                    }.join(",\n\t\t")]
 
     def enumTemplate = engine.createTemplate(new File('${project.basedir}/glv/Enum.template')).make(b)
     def enumFile = new File('${project.basedir}/src/Gremlin.Net/Process/Traversal/' + enumClass.getSimpleName() + '.cs')

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
index c31a142..5a07258 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
@@ -28,7 +28,9 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Cardinality
     {
-        List,Set,Single
+        List,
+		Set,
+		Single
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
index adcf738..432323f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
@@ -28,7 +28,8 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Column
     {
-        Keys,Values
+        Keys,
+		Values
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
index d379263..6f19748 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
@@ -28,7 +28,9 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Direction
     {
-        Both,In,Out
+        Both,
+		In,
+		Out
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
index 6869ba5..e978bc6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
@@ -28,7 +28,8 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum GraphSONVersion
     {
-        V1_0,V2_0
+        V1_0,
+		V2_0
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
index 1ebc581..72b0048 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
@@ -28,7 +28,17 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Operator
     {
-        AddAll,And,Assign,Div,Max,Min,Minus,Mult,Or,Sum,SumLong
+        AddAll,
+		And,
+		Assign,
+		Div,
+		Max,
+		Min,
+		Minus,
+		Mult,
+		Or,
+		Sum,
+		SumLong
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
index 0fdbbf9..1f12710 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
@@ -28,7 +28,13 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Order
     {
-        Decr,Incr,KeyDecr,KeyIncr,Shuffle,ValueDecr,ValueIncr
+        Decr,
+		Incr,
+		KeyDecr,
+		KeyIncr,
+		Shuffle,
+		ValueDecr,
+		ValueIncr
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
index 1f8c2d9..e6394ae 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
@@ -28,7 +28,8 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Pick
     {
-        Any,None
+        Any,
+		None
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
index f0975d2..a7a8403 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
@@ -28,7 +28,9 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Pop
     {
-        All,First,Last
+        All,
+		First,
+		Last
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
index 67fa970..d5af93a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
@@ -28,7 +28,8 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum Scope
     {
-        Global,Local
+        Global,
+		Local
     }
     
 #pragma warning restore 1591

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/426d141f/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
index b580aab..c21b50a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
@@ -28,7 +28,10 @@ namespace Gremlin.Net.Process.Traversal
 
     public enum T
     {
-        Id,Key,Label,Value
+        Id,
+		Key,
+		Label,
+		Value
     }
     
 #pragma warning restore 1591


[25/50] [abbrv] tinkerpop git commit: removed reference of MapReduceGraphComputer as we are currently not going to provide that in TinkerPop. Ref TINKERPOP-841

Posted by sp...@apache.org.
removed reference of MapReduceGraphComputer as we are currently not going to provide that in TinkerPop. Ref TINKERPOP-841


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

Branch: refs/heads/TINKERPOP-1489
Commit: 672c8aa393242a74cc2b0860f7a70e3512d6ff17
Parents: 937981a
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jul 13 09:21:24 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jul 13 09:21:24 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/implementations-hadoop-start.asciidoc | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/672c8aa3/docs/src/reference/implementations-hadoop-start.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/implementations-hadoop-start.asciidoc b/docs/src/reference/implementations-hadoop-start.asciidoc
index 1798749..028b1c1 100644
--- a/docs/src/reference/implementations-hadoop-start.asciidoc
+++ b/docs/src/reference/implementations-hadoop-start.asciidoc
@@ -183,12 +183,8 @@ image:hadoop-furnace.png[width=180,float=left] Hadoop-Gremlin was designed to ex
 for the execution of the Gremlin traversal.
 
 A `Graph` in TinkerPop3 can support any number of `GraphComputer` implementations. Out of the box, Hadoop-Gremlin
-supports the following three implementations.
+supports the following two implementations.
 
-* <<mapreducegraphcomputer,`MapReduceGraphComputer`>>: Leverages Hadoop's MapReduce engine to execute TinkerPop3 OLAP
-computations. (*coming soon*)
-** The graph must fit within the total disk space of the Hadoop cluster (supports massive graphs). Message passing is
-coordinated via MapReduce jobs over the on-disk graph (slow traversals).
 * <<sparkgraphcomputer,`SparkGraphComputer`>>: Leverages Apache Spark to execute TinkerPop3 OLAP computations.
 ** The graph may fit within the total RAM of the cluster (supports larger graphs). Message passing is coordinated via
 Spark map/reduce/join operations on in-memory and disk-cached data (average speed traversals).


[28/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1718' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1718' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: 42c3f4077a15d8fe981c84b37f7e99f9241e0c02
Parents: 04d4e90 f97a21c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 14 12:05:57 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 14 12:05:57 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                              | 1 +
 docs/src/reference/gremlin-applications.asciidoc                | 1 -
 docs/src/reference/gremlin-variants.asciidoc                    | 1 -
 .../gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java       | 3 +++
 .../tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java | 2 --
 .../gremlin/python/driver/gremlin-server-modern-secure-py.yaml  | 1 -
 gremlin-server/conf/gremlin-server-classic.yaml                 | 1 -
 gremlin-server/conf/gremlin-server-modern-py.yaml               | 1 -
 gremlin-server/conf/gremlin-server-modern-readonly.yaml         | 1 -
 gremlin-server/conf/gremlin-server-modern.yaml                  | 1 -
 gremlin-server/conf/gremlin-server-neo4j.yaml                   | 1 -
 gremlin-server/conf/gremlin-server-secure.yaml                  | 1 -
 gremlin-server/conf/gremlin-server-spark.yaml                   | 1 -
 gremlin-server/conf/gremlin-server.yaml                         | 1 -
 .../apache/tinkerpop/gremlin/server/AbstractChannelizer.java    | 5 +++--
 15 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/42c3f407/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index f36fe33,582af8f..1d57828
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -28,9 -28,8 +28,10 @@@ TinkerPop 3.2.6 (Release Date: NOT OFFI
  
  This release also includes changes from <<release-3-1-8, 3.1.8>>.
  
 +* `ProfileTest` is now less stringent about assertions which will reduce burdens on providers.
 +* `GremlinExecutor` begins timeout of script evaluation at the time the script was submitted and not from the time it began evaluation.
  * `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.
+ * Deprecated `GryoLiteMessageSerializerV1d0` in favor of `HaltedTraverserStrategy`.
  * Deprecated the `useMapperFromGraph` configuration option for Gremlin Server serializers.
  * `JavaTranslator` is now smart about handling `BulkSet` and `Tree`.
  * Added annotations to the traversal metrics pretty print.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/42c3f407/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/42c3f407/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------


[45/50] [abbrv] tinkerpop git commit: Javascript GLV

Posted by sp...@apache.org.
Javascript GLV


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

Branch: refs/heads/TINKERPOP-1489
Commit: 66bd5fa408746d3ccc3cc0b74598836bb0019b70
Parents: 2704245
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Wed Oct 5 16:14:46 2016 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 gremlin-javascript/pom.xml                      |  132 ++
 .../GraphTraversalSourceGenerator.groovy        |  247 +++
 .../javascript/TraversalSourceGenerator.groovy  |  398 ++++
 .../javascript/GenerateGremlinJavascript.java   |   32 +
 .../gremlin/javascript/jsr223/SymbolHelper.java |   59 +
 .../driver/remote-connection.js                 |  107 +
 .../main/javascript/gremlin-javascript/index.js |   85 +
 .../process/graph-traversal.js                  | 2025 ++++++++++++++++++
 .../gremlin-javascript/process/traversal.js     |  395 ++++
 .../gremlin-javascript/structure/graph.js       |  146 ++
 .../structure/io/graph-serializer.js            |  406 ++++
 .../javascript/gremlin-javascript/helper.js     |   84 +
 .../gremlin-javascript/test-exports.js          |   78 +
 .../gremlin-javascript/test-graphson.js         |  108 +
 .../gremlin-javascript/test-traversal.js        |   54 +
 pom.xml                                         |    1 +
 16 files changed, 4357 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
new file mode 100644
index 0000000..387e628
--- /dev/null
+++ b/gremlin-javascript/pom.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tinkerpop</groupId>
+        <artifactId>tinkerpop</artifactId>
+        <version>3.2.3-SNAPSHOT</version>
+    </parent>
+    <artifactId>gremlin-javascript</artifactId>
+    <name>Apache TinkerPop :: Gremlin Javascript</name>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>gremlin-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.groovy</groupId>
+            <artifactId>groovy</artifactId>
+            <version>${groovy.version}</version>
+            <classifier>indy</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>tinkergraph-gremlin</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>gremlin-test</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>gremlin-server</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <properties>
+        <!-- provides a way to convert maven.test.skip value to skipTests for use in skipping python tests -->
+        <maven.test.skip>false</maven.test.skip>
+        <skipTests>${maven.test.skip}</skipTests>
+        <gremlin.server.dir>${project.parent.basedir}/gremlin-server</gremlin.server.dir>
+    </properties>
+    <build>
+        <directory>${basedir}/target</directory>
+        <finalName>${project.artifactId}-${project.version}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.2.1</version>
+                <executions>
+                    <execution>
+                        <id>generate-javascript</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>java</goal>
+                        </goals>
+                        <configuration>
+                            <mainClass>org.apache.tinkerpop.gremlin.javascript.GenerateGremlinJavascript</mainClass>
+                            <arguments>
+                                <argument>${basedir}/src/main/javascript/gremlin-javascript/process/traversal.js</argument>
+                                <argument>${basedir}/src/main/javascript/gremlin-javascript/process/graph-traversal.js</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>js-tests</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                            <executable>jjs</executable>
+                            <arguments>
+                                <argument>${basedir}/src/test/javascript/gremlin-javascript/test-exports.js</argument>
+                                <argument>${basedir}/src/test/javascript/gremlin-javascript/test-graphson.js</argument>
+                                <argument>${basedir}/src/test/javascript/gremlin-javascript/test-traversal.js</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.gmavenplus</groupId>
+                <artifactId>gmavenplus-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
new file mode 100644
index 0000000..81c38dc
--- /dev/null
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
@@ -0,0 +1,247 @@
+/*
+ *  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.javascript
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource
+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.process.traversal.dsl.graph.__
+import org.apache.tinkerpop.gremlin.javascript.jsr223.SymbolHelper
+
+import java.lang.reflect.Modifier
+
+/**
+ * @author Jorge Bay Gondra
+ */
+class GraphTraversalSourceGenerator {
+
+    public static void create(final String graphTraversalSourceFile) {
+
+        final StringBuilder moduleOutput = new StringBuilder()
+
+        moduleOutput.append("""/*
+ *  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.
+ */
+ """)
+
+//////////////////////////
+// GraphTraversalSource //
+//////////////////////////
+        moduleOutput.append("""
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineGraphTraversalModule() {
+  "use strict";
+
+  var t = loadModule.call(this, './traversal.js');
+  var remote = loadModule.call(this, '../driver/remote-connection.js');
+  var Bytecode = t.Bytecode;
+  var inherits = t.inherits;
+  var parseArgs = t.parseArgs;
+
+  /**
+   *
+   * @param {Graph} graph
+   * @param {TraversalStrategies} traversalStrategies
+   * @param {Bytecode} [bytecode]
+   * @constructor
+   */
+  function GraphTraversalSource(graph, traversalStrategies, bytecode) {
+    this._graph = graph;
+    this._traversalStrategies = traversalStrategies;
+    this._bytecode = bytecode || new Bytecode();
+  }
+
+  /**
+   * @param remoteConnection
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
+    var traversalStrategy = new t.TraversalStrategies(this._traversalStrategies);
+    traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
+    return new GraphTraversal(this._graph, traversalStrategy, new Bytecode(this._bytecode));
+  };
+
+  /**
+   * Returns the string representation of the GraphTraversalSource.
+   * @returns {string}
+   */
+  GraphTraversalSource.prototype.toString = function () {
+    return 'graphtraversalsource[' + this._graph.toString() + ']';
+  };
+""")
+        GraphTraversalSource.getMethods(). // SOURCE STEPS
+                findAll { GraphTraversalSource.class.equals(it.returnType) }.
+                findAll {
+                    !it.name.equals("clone") &&
+                            !it.name.equals(TraversalSource.Symbols.withBindings) &&
+                            !it.name.equals(TraversalSource.Symbols.withRemote)
+                }.
+                collect { SymbolHelper.toJs(it.name) }.
+                unique().
+                sort { a, b -> a <=> b }.
+                forEach { method ->
+                    moduleOutput.append(
+                            """
+  /**
+   * ${method} GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.${method} = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+""")
+                }
+        GraphTraversalSource.getMethods(). // SPAWN STEPS
+                findAll { GraphTraversal.class.equals(it.returnType) }.
+                collect { SymbolHelper.toJs(it.name) }.
+                unique().
+                sort { a, b -> a <=> b }.
+                forEach { method ->
+                    moduleOutput.append(
+                            """
+  /**
+   * ${method} GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.${method} = function (args) {
+    var b = new Bytecode(this._bytecode).addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+""")
+                }
+////////////////////
+// GraphTraversal //
+////////////////////
+        moduleOutput.append(
+                """
+  /**
+   * Represents a graph traversal.
+   * @constructor
+   */
+  function GraphTraversal(graph, traversalStrategies, bytecode) {
+    t.Traversal.call(this, graph, traversalStrategies, bytecode);
+  }
+
+  inherits(GraphTraversal, t.Traversal);
+""")
+        GraphTraversal.getMethods().
+                findAll { GraphTraversal.class.equals(it.returnType) }.
+                findAll { !it.name.equals("clone") && !it.name.equals("iterate") }.
+                collect { SymbolHelper.toJs(it.name) }.
+                unique().
+                sort { a, b -> a <=> b }.
+                forEach { method ->
+                    moduleOutput.append(
+                            """
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.${method} = function (args) {
+    this._bytecode.addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+    return this;
+  };
+""")
+                };
+
+////////////////////////
+// AnonymousTraversal //
+////////////////////////
+        moduleOutput.append("""
+  /**
+   * Contains the static method definitions
+   * @type {Object}
+   */
+  var statics = {};
+""");
+        __.class.getMethods().
+                findAll { GraphTraversal.class.equals(it.returnType) }.
+                findAll { Modifier.isStatic(it.getModifiers()) }.
+                collect { SymbolHelper.toJs(it.name) }.
+                unique().
+                sort { a, b -> a <=> b }.
+                forEach { method ->
+                    moduleOutput.append(
+                            """
+  /**
+   * ${method}() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.${method} = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.${method}.apply(g, arguments);
+  };
+""")
+                };
+
+        moduleOutput.append("""
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  var toExport = {
+    GraphTraversal: GraphTraversal,
+    GraphTraversalSource: GraphTraversalSource,
+    statics: statics
+  };
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);""")
+
+        // save to file
+        final File file = new File(graphTraversalSourceFile);
+        file.delete()
+        moduleOutput.eachLine { file.append(it + "\n") }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
new file mode 100644
index 0000000..efcb826
--- /dev/null
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
@@ -0,0 +1,398 @@
+/*
+ *  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.javascript
+
+import org.apache.tinkerpop.gremlin.process.traversal.P
+import org.apache.tinkerpop.gremlin.util.CoreImports
+import org.apache.tinkerpop.gremlin.javascript.jsr223.SymbolHelper
+
+import java.lang.reflect.Modifier
+
+/**
+ * @author Jorge Bay Gondra
+ */
+class TraversalSourceGenerator {
+
+    public static void create(final String traversalSourceFile) {
+
+        final StringBuilder moduleOutput = new StringBuilder()
+
+        moduleOutput.append("""/*
+ *  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.
+ */
+""")
+        moduleOutput.append("""
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineTraversalModule() {
+  "use strict";
+
+  function Traversal(graph, traversalStrategies, bytecode) {
+    this._graph = graph;
+    this._traversalStrategies = traversalStrategies;
+    this._bytecode = bytecode;
+    this.traversers = null;
+    this.sideEffects = null;
+  }
+
+  /** @returns {Bytecode} */
+  Traversal.prototype.getBytecode = function () {
+    return this._bytecode;
+  };
+
+  /** @param {Function} callback */
+  Traversal.prototype.list = function (callback) {
+    var self = this;
+    this._traversalStrategies.applyStrategies(this, function (err) {
+      if (err) {
+        return callback(err);
+      }
+      callback(err, self.traversers);
+    });
+  };
+
+  /** @param {Function} callback */
+  Traversal.prototype.one = function (callback) {
+    this.list(function (err, result) {
+      callback(err, result ? result[0] : null);
+    });
+  };
+
+  /**
+   * Returns the Bytecode JSON representation of the traversal
+   * @returns {String}
+   */
+  Traversal.prototype.toString = function () {
+    return this._bytecode.toString();
+  };
+  """);
+
+        moduleOutput.append("""
+  /**
+   * Represents an operation.
+   * @constructor
+   */
+  function P(operator, value, other) {
+    this.operator = operator;
+    this.value = value;
+    this.other = other;
+  }
+
+  /**
+   * Returns the string representation of the instance.
+   * @returns {string}
+   */
+  P.prototype.toString = function () {
+    if (this.other === undefined) {
+      return this.operator + '(' + this.value + ')';
+    }
+    return this.operator + '(' + this.value + ', ' + this.other + ')';
+  };
+
+  function createP(operator, args) {
+    args.unshift(null, operator);
+    return new (Function.prototype.bind.apply(P, args));
+  }
+""")
+        P.class.getMethods().
+                findAll { Modifier.isStatic(it.getModifiers()) }.
+                findAll { P.class.isAssignableFrom(it.returnType) }.
+                collect { SymbolHelper.toJs(it.name) }.
+                unique().
+                sort { a, b -> a <=> b }.
+                each { method ->
+                    moduleOutput.append(
+                            """
+  /** @param {...Object} args */
+  P.${method} = function (args) {
+    return createP('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+  };
+""")
+                };
+        moduleOutput.append("""
+  P.prototype.and = function (arg) {
+    return new P('and', this, arg);
+  };
+
+  P.prototype.or = function (arg) {
+    return new P('or', this, arg);
+  };
+""")
+
+        moduleOutput.append("""
+  function Traverser(object, bulk) {
+    this.object = object;
+    this.bulk = bulk == undefined ? 1 : bulk;
+  }
+
+  function TraversalSideEffects() {
+
+  }
+
+  /**
+   * Creates a new instance of TraversalStrategies.
+   * @param {TraversalStrategies} [traversalStrategies]
+   * @constructor
+   */
+  function TraversalStrategies(traversalStrategies) {
+    /** @type {Array<TraversalStrategy>} */
+    this.strategies = traversalStrategies ? traversalStrategies.strategies : [];
+  }
+
+  /** @param {TraversalStrategy} strategy */
+  TraversalStrategies.prototype.addStrategy = function (strategy) {
+    this.strategies.push(strategy);
+  };
+
+  /** @param {Traversal} traversal */
+  TraversalStrategies.prototype.applyStrategies = function (traversal) {
+    this.strategies.forEach(function eachStrategy(s) {
+      s.apply(traversal);
+    });
+  };
+
+  /**
+   * @abstract
+   * @constructor
+   */
+  function TraversalStrategy() {
+
+  }
+
+  /**
+   * @abstract
+   * @param {Traversal} traversal
+   */
+  TraversalStrategy.prototype.apply = function (traversal) {
+
+  };
+
+  /**
+   * Creates a new instance of Bytecode
+   * @param {Bytecode} [toClone]
+   * @constructor
+   */
+  function Bytecode(toClone) {
+    this._bindings = {};
+    if (!toClone) {
+      this.sourceInstructions = [];
+      this.stepInstructions = [];
+    }
+    else {
+      this.sourceInstructions = toClone.sourceInstructions.slice(0);
+      this.stepInstructions = toClone.sourceInstructions.slice(0);
+    }
+  }
+
+  /**
+   * Adds a new source instructions
+   * @param {String} name
+   * @param {Array} values
+   * @returns {Bytecode}
+   */
+  Bytecode.prototype.addSource = function (name, values) {
+    if (name === undefined) {
+      throw new Error('Name is not defined');
+    }
+    var instruction = new Array(values.length + 1);
+    instruction[0] = name;
+    for (var i = 0; i < values.length; ++i) {
+      instruction[i + 1] = this._convertToArgument(values[i]);
+    }
+    this.sourceInstructions.push(this._generateInstruction(name, values));
+    return this;
+  };
+
+  /**
+   * Adds a new step instructions
+   * @param {String} name
+   * @param {Array} values
+   * @returns {Bytecode}
+   */
+  Bytecode.prototype.addStep = function (name, values) {
+    if (name === undefined) {
+      throw new Error('Name is not defined');
+    }
+    this.stepInstructions.push(this._generateInstruction(name, values));
+    return this;
+  };
+
+  Bytecode.prototype._generateInstruction = function (name, values) {
+    var instruction = new Array(values.length + 1);
+    instruction[0] = name;
+    for (var i = 0; i < values.length; ++i) {
+      instruction[i + 1] = this._convertToArgument(values[i]);
+    }
+    return instruction;
+  };
+
+  /**
+   * Returns the JSON representation of the source and step instructions
+   * @returns {String}
+   */
+  Bytecode.prototype.toString = function () {
+    return (
+      (this.sourceInstructions.length > 0 ? JSON.stringify(this.sourceInstructions) : '') +
+      (this.stepInstructions.length   > 0 ? JSON.stringify(this.stepInstructions) : '')
+    );
+  };
+
+  Bytecode.prototype._convertToArgument = function (value) {
+    return value;
+  };
+
+  function toEnum(typeName, keys) {
+    var result = {};
+    keys.split(' ').forEach(function (k) {
+      if (k === k.toUpperCase()) {
+        k = k.toLowerCase();
+      }
+      result[k] = new EnumValue(typeName, k);
+    });
+    return result;
+  }
+
+  function EnumValue(typeName, elementName) {
+    this.typeName = typeName;
+    this.elementName = elementName;
+  }
+
+  /**
+   * @type {{barrier, cardinality, column, direction, operator, order, pop, scope, t}}
+   */
+  var enums = {};\n""")
+
+        for (final Class<? extends Enum> enumClass : CoreImports.getClassImports()
+                .findAll { Enum.class.isAssignableFrom(it) }
+                .sort { a, b -> a.getSimpleName() <=> b.getSimpleName() }
+                .collect()) {
+            moduleOutput.append("  enums.${SymbolHelper.decapitalize(enumClass.getSimpleName())} = " +
+                    "toEnum('${SymbolHelper.toJs(enumClass.getSimpleName())}', '");
+            enumClass.getEnumConstants()
+                    .sort { a, b -> a.name() <=> b.name() }
+                    .each { value -> moduleOutput.append("${SymbolHelper.toJs(value.name())} "); }
+            moduleOutput.deleteCharAt(moduleOutput.length() - 1).append("');\n")
+        }
+
+        moduleOutput.append("""
+  // Utility functions
+  /** @returns {Array} */
+  function parseArgs() {
+    return (arguments.length === 1 ? [ arguments[0] ] : Array.apply(null, arguments));
+  }
+
+  /**
+   * @param {Array} arr
+   * @param {Function} fn
+   * @param {Function} [callback]
+   */
+  function eachSeries(arr, fn, callback) {
+    if (!Array.isArray(arr)) {
+      throw new TypeError('First parameter is not an Array');
+    }
+    callback = callback || noop;
+    var length = arr.length;
+    if (length === 0) {
+      return callback();
+    }
+    var sync;
+    var index = 1;
+    fn(arr[0], next);
+    if (sync === undefined) {
+      sync = false;
+    }
+
+    function next(err) {
+      if (err) {
+        return callback(err);
+      }
+      if (index >= length) {
+        return callback();
+      }
+      if (sync === undefined) {
+        sync = true;
+      }
+      if (sync) {
+        return process.nextTick(function () {
+          fn(arr[index++], next);
+        });
+      }
+      fn(arr[index++], next);
+    }
+  }
+
+  function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor;
+    ctor.prototype = Object.create(superCtor.prototype, {
+      constructor: {
+        value: ctor,
+        enumerable: false,
+        writable: true,
+        configurable: true
+      }
+    });
+  }
+
+  var toExport = {
+    Bytecode: Bytecode,
+    EnumValue: EnumValue,
+    inherits: inherits,
+    P: P,
+    parseArgs: parseArgs,
+    Traversal: Traversal,
+    TraversalSideEffects: TraversalSideEffects,
+    TraversalStrategies: TraversalStrategies,
+    TraversalStrategy: TraversalStrategy,
+    Traverser: Traverser
+  };
+  Object.keys(enums).forEach(function (k) {
+    toExport[k] = enums[k];
+  });
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);""")
+
+        // save to a file
+        final File file = new File(traversalSourceFile);
+        file.delete()
+        moduleOutput.eachLine { file.append(it + "\n") }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java b/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java
new file mode 100644
index 0000000..1656db4
--- /dev/null
+++ b/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java
@@ -0,0 +1,32 @@
+/*
+ *  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.javascript;
+
+public class GenerateGremlinJavascript {
+
+    private GenerateGremlinJavascript() {
+        // just need the main method
+    }
+
+    public static void main(String[] args) {
+        TraversalSourceGenerator.create(args[0]);
+        GraphTraversalSourceGenerator.create(args[1]);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java b/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java
new file mode 100644
index 0000000..535de44
--- /dev/null
+++ b/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java
@@ -0,0 +1,59 @@
+/*
+ *  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.javascript.jsr223;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Jorge Bay Gondra
+ */
+public final class SymbolHelper {
+
+    private final static Map<String, String> TO_JS_MAP = new HashMap<>();
+    private final static Map<String, String> FROM_JS_MAP = new HashMap<>();
+
+    static {
+        TO_JS_MAP.put("in", "in_");
+        TO_JS_MAP.put("from", "from_");
+        TO_JS_MAP.forEach((k, v) -> FROM_JS_MAP.put(v, k));
+    }
+
+    private SymbolHelper() {
+        // static methods only, do not instantiate
+    }
+
+    public static String toJs(final String symbol) {
+        return TO_JS_MAP.getOrDefault(symbol, symbol);
+    }
+
+    public static String toJava(final String symbol) {
+        return FROM_JS_MAP.getOrDefault(symbol, symbol);
+    }
+
+    public static String decapitalize(String string) {
+        if (string == null || string.length() == 0) {
+            return string;
+        }
+        char c[] = string.toCharArray();
+        c[0] = Character.toLowerCase(c[0]);
+        return new String(c);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
new file mode 100644
index 0000000..99b177f
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
@@ -0,0 +1,107 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineRemoteConnectionModule() {
+  "use strict";
+
+  var t = loadModule.call(this, '../process/traversal.js');
+  var inherits = t.inherits;
+
+  function RemoteConnection(url, traversalSource) {
+    this.url = url;
+    this.traversalSource = traversalSource;
+  }
+
+  /**
+   * @abstract
+   * @param {Bytecode} bytecode
+   * @param {Function} callback
+   */
+  RemoteConnection.prototype.submit = function (bytecode, callback) {
+    throw new Error('submit() needs to be implemented');
+  };
+
+  /**
+   * @extends {Traversal}
+   * @constructor
+   */
+  function RemoteTraversal(traversers, sideEffects) {
+    t.Traversal.call(this, null, null, null);
+    this.traversers = traversers;
+    this.sideEffects = sideEffects;
+  }
+
+  inherits(RemoteTraversal, t.Traversal);
+
+  /**
+   *
+   * @param {RemoteConnection} connection
+   * @extends {TraversalStrategy}
+   * @constructor
+   */
+  function RemoteStrategy(connection) {
+    t.TraversalStrategy.call(this);
+    this.connection = connection;
+  }
+
+  inherits(RemoteStrategy, t.TraversalStrategy);
+
+  /** @override */
+  RemoteStrategy.prototype.apply = function (traversal, callback) {
+    if (traversal.traversers) {
+      return;
+    }
+    this.connection.submit(traversal.getBytecode(), function (err, remoteTraversal) {
+      if (err) {
+        return callback(err);
+      }
+      traversal.sideEffects = remoteTraversal.sideEffects;
+      traversal.traversers = remoteTraversal.traversers;
+      callback();
+    });
+  };
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  var toExport = {
+    RemoteConnection: RemoteConnection,
+    RemoteStrategy: RemoteStrategy,
+    RemoteTraversal: RemoteTraversal
+  };
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
new file mode 100644
index 0000000..cda8200
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
@@ -0,0 +1,85 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function exportModule() {
+  "use strict";
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  var t = loadModule.call(this, './process/traversal.js');
+  var gt = loadModule.call(this, './process/graph-traversal.js');
+  var graph = loadModule.call(this, './structure/graph.js');
+  var gs = loadModule.call(this, './structure/io/graph-serializer.js');
+  var rc = loadModule.call(this, './driver/remote-connection.js');
+  var toExport = {
+    driver: {
+      RemoteConnection: rc.RemoteConnection,
+      RemoteStrategy: rc.RemoteStrategy,
+      RemoteTraversal: rc.RemoteTraversal
+    },
+    process: {
+      Bytecode: t.Bytecode,
+      EnumValue: t.EnumValue,
+      inherits: t.inherits,
+      P: t.P,
+      parseArgs: t.parseArgs,
+      Traversal: t.Traversal,
+      TraversalSideEffects: t.TraversalSideEffects,
+      TraversalStrategies: t.TraversalStrategies,
+      TraversalStrategy: t.TraversalStrategy,
+      Traverser: t.Traverser,
+      GraphTraversal: gt.GraphTraversal,
+      GraphTraversalSource: gt.GraphTraversalSource,
+      statics: gt.statics
+    },
+    structure: {
+      io: {
+        GraphSONReader: gs.GraphSONReader,
+        GraphSONWriter: gs.GraphSONWriter
+      },
+      Edge: graph.Edge,
+      Graph: graph.Graph,
+      Path: graph.Path,
+      Property: graph.Property,
+      Vertex: graph.Vertex,
+      VertexProperty: graph.VertexProperty
+    }
+  };
+
+
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  return toExport;
+}).call(this);
\ No newline at end of file


[26/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1709' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1709' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: f161f7bf09dd1f58afd6b15c2a297c7a2a69e316
Parents: 672c8aa 94f9305
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jul 13 13:15:45 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jul 13 13:15:45 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[32/50] [abbrv] tinkerpop git commit: Increased timeout a bit for test.

Posted by sp...@apache.org.
Increased timeout a bit for test.

Wasn't giving enough time (suddenly) to handle the follow-on request that ensures calls work after a timeout has triggered. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: a5d60c6b844aee5169238f000b5fd0b66d850e61
Parents: 2ba4104
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 17 11:36:14 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 17 12:24:44 2017 -0400

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5d60c6b/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 aad8131..8b0c280 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
@@ -157,7 +157,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
                 settings.writeBufferLowWaterMark = 32;
                 break;
             case "shouldReceiveFailureTimeOutOnScriptEval":
-                settings.scriptEvaluationTimeout = 200;
+                settings.scriptEvaluationTimeout = 1000;
                 break;
             case "shouldReceiveFailureTimeOutOnTotalSerialization":
                 settings.serializedResponseTimeout = 1;
@@ -699,7 +699,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     public void shouldReceiveFailureTimeOutOnScriptEval() throws Exception {
         try (SimpleClient client = TestClientFactory.createWebSocketClient()){
             final List<ResponseMessage> responses = client.submit("Thread.sleep(3000);'some-stuff-that-should not return'");
-            assertThat(responses.get(0).getStatus().getMessage(), startsWith("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of 200 ms"));
+            assertThat(responses.get(0).getStatus().getMessage(), startsWith("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of 1000 ms"));
 
             // validate that we can still send messages to the server
             assertEquals(2, ((List<Integer>) client.submit("1+1").get(0).getResult().getData()).get(0).intValue());


[37/50] [abbrv] tinkerpop git commit: Graph, traversalStrategies and graph as Traversal properties

Posted by sp...@apache.org.
Graph, traversalStrategies and graph as Traversal properties

Expose those properties as in the Python GLV and the Java implementation. Previously, those properties where exposed using the private notation (ie: _graph).


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

Branch: refs/heads/TINKERPOP-1489
Commit: d9ea1cf6c861725ec0fcf58478076f5bbfe166d9
Parents: 38c2409
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Tue Oct 18 16:22:23 2016 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 .../GraphTraversalSourceGenerator.groovy        |  23 +-
 .../javascript/TraversalSourceGenerator.groovy  |  12 +-
 .../process/graph-traversal.js                  | 253 ++++++++++---------
 .../gremlin-javascript/process/traversal.js     |  12 +-
 4 files changed, 151 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9ea1cf6/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
index b569292..a8217e2 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
@@ -80,9 +80,9 @@ class GraphTraversalSourceGenerator {
    * @constructor
    */
   function GraphTraversalSource(graph, traversalStrategies, bytecode) {
-    this._graph = graph;
-    this._traversalStrategies = traversalStrategies;
-    this._bytecode = bytecode || new Bytecode();
+    this.graph = graph;
+    this.traversalStrategies = traversalStrategies;
+    this.bytecode = bytecode || new Bytecode();
   }
 
   /**
@@ -90,9 +90,9 @@ class GraphTraversalSourceGenerator {
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
-    var traversalStrategy = new t.TraversalStrategies(this._traversalStrategies);
+    var traversalStrategy = new t.TraversalStrategies(this.traversalStrategies);
     traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-    return new GraphTraversalSource(this._graph, traversalStrategy, new Bytecode(this._bytecode));
+    return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
   };
 
   /**
@@ -100,7 +100,7 @@ class GraphTraversalSourceGenerator {
    * @returns {string}
    */
   GraphTraversalSource.prototype.toString = function () {
-    return 'graphtraversalsource[' + this._graph.toString() + ']';
+    return 'graphtraversalsource[' + this.graph.toString() + ']';
   };
 """)
         GraphTraversalSource.getMethods(). // SOURCE STEPS
@@ -122,8 +122,8 @@ class GraphTraversalSourceGenerator {
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.${method} = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 """)
                 }
@@ -141,8 +141,8 @@ class GraphTraversalSourceGenerator {
    * @returns {GraphTraversal}
    */
   GraphTraversalSource.prototype.${method} = function (args) {
-    var b = new Bytecode(this._bytecode).addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 """)
                 }
@@ -153,6 +153,7 @@ class GraphTraversalSourceGenerator {
                 """
   /**
    * Represents a graph traversal.
+   * @extends Traversal
    * @constructor
    */
   function GraphTraversal(graph, traversalStrategies, bytecode) {
@@ -175,7 +176,7 @@ class GraphTraversalSourceGenerator {
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.${method} = function (args) {
-    this._bytecode.addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
     return this;
   };
 """)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9ea1cf6/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
index 5b07a32..46f65a4 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
@@ -61,22 +61,22 @@ class TraversalSourceGenerator {
   "use strict";
 
   function Traversal(graph, traversalStrategies, bytecode) {
-    this._graph = graph;
-    this._traversalStrategies = traversalStrategies;
-    this._bytecode = bytecode;
+    this.graph = graph;
+    this.traversalStrategies = traversalStrategies;
+    this.bytecode = bytecode;
     this.traversers = null;
     this.sideEffects = null;
   }
 
   /** @returns {Bytecode} */
   Traversal.prototype.getBytecode = function () {
-    return this._bytecode;
+    return this.bytecode;
   };
 
   /** @param {Function} callback */
   Traversal.prototype.list = function (callback) {
     var self = this;
-    this._traversalStrategies.applyStrategies(this, function (err) {
+    this.traversalStrategies.applyStrategies(this, function (err) {
       if (err) {
         return callback(err);
       }
@@ -96,7 +96,7 @@ class TraversalSourceGenerator {
    * @returns {String}
    */
   Traversal.prototype.toString = function () {
-    return this._bytecode.toString();
+    return this.bytecode.toString();
   };
   """);
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9ea1cf6/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
index 1a6356b..663a24d 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
@@ -37,9 +37,9 @@
    * @constructor
    */
   function GraphTraversalSource(graph, traversalStrategies, bytecode) {
-    this._graph = graph;
-    this._traversalStrategies = traversalStrategies;
-    this._bytecode = bytecode || new Bytecode();
+    this.graph = graph;
+    this.traversalStrategies = traversalStrategies;
+    this.bytecode = bytecode || new Bytecode();
   }
 
   /**
@@ -47,9 +47,9 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
-    var traversalStrategy = new t.TraversalStrategies(this._traversalStrategies);
+    var traversalStrategy = new t.TraversalStrategies(this.traversalStrategies);
     traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-    return new GraphTraversalSource(this._graph, traversalStrategy, new Bytecode(this._bytecode));
+    return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
   };
 
   /**
@@ -57,7 +57,7 @@
    * @returns {string}
    */
   GraphTraversalSource.prototype.toString = function () {
-    return 'graphtraversalsource[' + this._graph.toString() + ']';
+    return 'graphtraversalsource[' + this.graph.toString() + ']';
   };
 
   /**
@@ -66,8 +66,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withBulk = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -76,8 +76,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withComputer = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withComputer', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withComputer', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -86,8 +86,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withPath = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withPath', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withPath', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -96,8 +96,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withSack = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withSack', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withSack', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -106,8 +106,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withSideEffect = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -116,8 +116,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withStrategies = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -126,8 +126,8 @@
    * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withoutStrategies = function (args) {
-    var b = new Bytecode(this._bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -136,8 +136,8 @@
    * @returns {GraphTraversal}
    */
   GraphTraversalSource.prototype.E = function (args) {
-    var b = new Bytecode(this._bytecode).addStep('E', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addStep('E', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -146,8 +146,8 @@
    * @returns {GraphTraversal}
    */
   GraphTraversalSource.prototype.V = function (args) {
-    var b = new Bytecode(this._bytecode).addStep('V', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addStep('V', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -156,8 +156,8 @@
    * @returns {GraphTraversal}
    */
   GraphTraversalSource.prototype.addV = function (args) {
-    var b = new Bytecode(this._bytecode).addStep('addV', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addStep('addV', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
@@ -166,12 +166,13 @@
    * @returns {GraphTraversal}
    */
   GraphTraversalSource.prototype.inject = function (args) {
-    var b = new Bytecode(this._bytecode).addStep('inject', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+    var b = new Bytecode(this.bytecode).addStep('inject', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
   };
 
   /**
    * Represents a graph traversal.
+   * @extends Traversal
    * @constructor
    */
   function GraphTraversal(graph, traversalStrategies, bytecode) {
@@ -185,7 +186,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.V = function (args) {
-    this._bytecode.addStep('V', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('V', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -194,7 +195,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.addE = function (args) {
-    this._bytecode.addStep('addE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('addE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -203,7 +204,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.addInE = function (args) {
-    this._bytecode.addStep('addInE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('addInE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -212,7 +213,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.addOutE = function (args) {
-    this._bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -221,7 +222,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.addV = function (args) {
-    this._bytecode.addStep('addV', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('addV', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -230,7 +231,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.aggregate = function (args) {
-    this._bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -239,7 +240,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.and = function (args) {
-    this._bytecode.addStep('and', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('and', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -248,7 +249,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.as = function (args) {
-    this._bytecode.addStep('as', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('as', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -257,7 +258,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.barrier = function (args) {
-    this._bytecode.addStep('barrier', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('barrier', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -266,7 +267,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.both = function (args) {
-    this._bytecode.addStep('both', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('both', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -275,7 +276,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.bothE = function (args) {
-    this._bytecode.addStep('bothE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('bothE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -284,7 +285,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.bothV = function (args) {
-    this._bytecode.addStep('bothV', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('bothV', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -293,7 +294,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.branch = function (args) {
-    this._bytecode.addStep('branch', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('branch', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -302,7 +303,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.by = function (args) {
-    this._bytecode.addStep('by', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('by', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -311,7 +312,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.cap = function (args) {
-    this._bytecode.addStep('cap', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('cap', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -320,7 +321,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.choose = function (args) {
-    this._bytecode.addStep('choose', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('choose', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -329,7 +330,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.coalesce = function (args) {
-    this._bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -338,7 +339,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.coin = function (args) {
-    this._bytecode.addStep('coin', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('coin', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -347,7 +348,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.constant = function (args) {
-    this._bytecode.addStep('constant', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('constant', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -356,7 +357,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.count = function (args) {
-    this._bytecode.addStep('count', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('count', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -365,7 +366,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.cyclicPath = function (args) {
-    this._bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -374,7 +375,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.dedup = function (args) {
-    this._bytecode.addStep('dedup', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('dedup', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -383,7 +384,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.drop = function (args) {
-    this._bytecode.addStep('drop', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('drop', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -392,7 +393,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.emit = function (args) {
-    this._bytecode.addStep('emit', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('emit', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -401,7 +402,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.filter = function (args) {
-    this._bytecode.addStep('filter', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('filter', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -410,7 +411,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.flatMap = function (args) {
-    this._bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -419,7 +420,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.fold = function (args) {
-    this._bytecode.addStep('fold', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('fold', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -428,7 +429,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.from_ = function (args) {
-    this._bytecode.addStep('from', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('from', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -437,7 +438,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.group = function (args) {
-    this._bytecode.addStep('group', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('group', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -446,7 +447,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.groupCount = function (args) {
-    this._bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -455,7 +456,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.groupV3d0 = function (args) {
-    this._bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -464,7 +465,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.has = function (args) {
-    this._bytecode.addStep('has', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('has', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -473,7 +474,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.hasId = function (args) {
-    this._bytecode.addStep('hasId', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('hasId', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -482,7 +483,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.hasKey = function (args) {
-    this._bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -491,7 +492,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.hasLabel = function (args) {
-    this._bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -500,7 +501,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.hasNot = function (args) {
-    this._bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -509,7 +510,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.hasValue = function (args) {
-    this._bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -518,7 +519,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.id = function (args) {
-    this._bytecode.addStep('id', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('id', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -527,7 +528,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.identity = function (args) {
-    this._bytecode.addStep('identity', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('identity', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -536,7 +537,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.inE = function (args) {
-    this._bytecode.addStep('inE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('inE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -545,7 +546,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.inV = function (args) {
-    this._bytecode.addStep('inV', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('inV', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -554,7 +555,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.in_ = function (args) {
-    this._bytecode.addStep('in', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('in', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -563,7 +564,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.inject = function (args) {
-    this._bytecode.addStep('inject', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('inject', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -572,7 +573,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.is = function (args) {
-    this._bytecode.addStep('is', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('is', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -581,7 +582,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.key = function (args) {
-    this._bytecode.addStep('key', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('key', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -590,7 +591,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.label = function (args) {
-    this._bytecode.addStep('label', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('label', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -599,7 +600,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.limit = function (args) {
-    this._bytecode.addStep('limit', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('limit', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -608,7 +609,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.local = function (args) {
-    this._bytecode.addStep('local', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('local', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -617,7 +618,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.loops = function (args) {
-    this._bytecode.addStep('loops', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('loops', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -626,7 +627,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.map = function (args) {
-    this._bytecode.addStep('map', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('map', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -635,7 +636,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.mapKeys = function (args) {
-    this._bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -644,7 +645,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.mapValues = function (args) {
-    this._bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -653,7 +654,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.match = function (args) {
-    this._bytecode.addStep('match', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('match', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -662,7 +663,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.max = function (args) {
-    this._bytecode.addStep('max', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('max', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -671,7 +672,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.mean = function (args) {
-    this._bytecode.addStep('mean', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('mean', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -680,7 +681,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.min = function (args) {
-    this._bytecode.addStep('min', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('min', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -689,7 +690,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.not = function (args) {
-    this._bytecode.addStep('not', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('not', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -698,7 +699,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.option = function (args) {
-    this._bytecode.addStep('option', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('option', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -707,7 +708,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.optional = function (args) {
-    this._bytecode.addStep('optional', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('optional', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -716,7 +717,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.or = function (args) {
-    this._bytecode.addStep('or', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('or', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -725,7 +726,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.order = function (args) {
-    this._bytecode.addStep('order', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('order', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -734,7 +735,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.otherV = function (args) {
-    this._bytecode.addStep('otherV', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('otherV', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -743,7 +744,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.out = function (args) {
-    this._bytecode.addStep('out', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('out', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -752,7 +753,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.outE = function (args) {
-    this._bytecode.addStep('outE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('outE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -761,7 +762,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.outV = function (args) {
-    this._bytecode.addStep('outV', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('outV', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -770,7 +771,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.pageRank = function (args) {
-    this._bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -779,7 +780,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.path = function (args) {
-    this._bytecode.addStep('path', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('path', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -788,7 +789,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.peerPressure = function (args) {
-    this._bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -797,7 +798,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.profile = function (args) {
-    this._bytecode.addStep('profile', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('profile', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -806,7 +807,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.program = function (args) {
-    this._bytecode.addStep('program', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('program', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -815,7 +816,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.project = function (args) {
-    this._bytecode.addStep('project', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('project', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -824,7 +825,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.properties = function (args) {
-    this._bytecode.addStep('properties', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('properties', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -833,7 +834,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.property = function (args) {
-    this._bytecode.addStep('property', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('property', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -842,7 +843,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.propertyMap = function (args) {
-    this._bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -851,7 +852,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.range = function (args) {
-    this._bytecode.addStep('range', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('range', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -860,7 +861,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.repeat = function (args) {
-    this._bytecode.addStep('repeat', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('repeat', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -869,7 +870,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.sack = function (args) {
-    this._bytecode.addStep('sack', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('sack', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -878,7 +879,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.sample = function (args) {
-    this._bytecode.addStep('sample', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('sample', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -887,7 +888,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.select = function (args) {
-    this._bytecode.addStep('select', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('select', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -896,7 +897,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.sideEffect = function (args) {
-    this._bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -905,7 +906,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.simplePath = function (args) {
-    this._bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -914,7 +915,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.store = function (args) {
-    this._bytecode.addStep('store', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('store', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -923,7 +924,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.subgraph = function (args) {
-    this._bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -932,7 +933,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.sum = function (args) {
-    this._bytecode.addStep('sum', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('sum', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -941,7 +942,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.tail = function (args) {
-    this._bytecode.addStep('tail', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('tail', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -950,7 +951,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.timeLimit = function (args) {
-    this._bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -959,7 +960,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.times = function (args) {
-    this._bytecode.addStep('times', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('times', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -968,7 +969,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.to = function (args) {
-    this._bytecode.addStep('to', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('to', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -977,7 +978,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.toE = function (args) {
-    this._bytecode.addStep('toE', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('toE', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -986,7 +987,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.toV = function (args) {
-    this._bytecode.addStep('toV', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('toV', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -995,7 +996,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.tree = function (args) {
-    this._bytecode.addStep('tree', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('tree', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1004,7 +1005,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.unfold = function (args) {
-    this._bytecode.addStep('unfold', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('unfold', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1013,7 +1014,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.union = function (args) {
-    this._bytecode.addStep('union', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('union', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1022,7 +1023,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.until = function (args) {
-    this._bytecode.addStep('until', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('until', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1031,7 +1032,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.value = function (args) {
-    this._bytecode.addStep('value', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('value', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1040,7 +1041,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.valueMap = function (args) {
-    this._bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1049,7 +1050,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.values = function (args) {
-    this._bytecode.addStep('values', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('values', parseArgs.apply(null, arguments));
     return this;
   };
 
@@ -1058,7 +1059,7 @@
    * @returns {GraphTraversal}
    */
   GraphTraversal.prototype.where = function (args) {
-    this._bytecode.addStep('where', parseArgs.apply(null, arguments));
+    this.bytecode.addStep('where', parseArgs.apply(null, arguments));
     return this;
   };
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9ea1cf6/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
index ff2927e..a7a9bb7 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
@@ -24,22 +24,22 @@
   "use strict";
 
   function Traversal(graph, traversalStrategies, bytecode) {
-    this._graph = graph;
-    this._traversalStrategies = traversalStrategies;
-    this._bytecode = bytecode;
+    this.graph = graph;
+    this.traversalStrategies = traversalStrategies;
+    this.bytecode = bytecode;
     this.traversers = null;
     this.sideEffects = null;
   }
 
   /** @returns {Bytecode} */
   Traversal.prototype.getBytecode = function () {
-    return this._bytecode;
+    return this.bytecode;
   };
 
   /** @param {Function} callback */
   Traversal.prototype.list = function (callback) {
     var self = this;
-    this._traversalStrategies.applyStrategies(this, function (err) {
+    this.traversalStrategies.applyStrategies(this, function (err) {
       if (err) {
         return callback(err);
       }
@@ -59,7 +59,7 @@
    * @returns {String}
    */
   Traversal.prototype.toString = function () {
-    return this._bytecode.toString();
+    return this.bytecode.toString();
   };
   
   /**


[42/50] [abbrv] tinkerpop git commit: Parse Edge and VertexProperty properties

Posted by sp...@apache.org.
Parse Edge and VertexProperty properties

To follow the decision around TINKERPOP-1474 for the GLV to parse properties.


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

Branch: refs/heads/TINKERPOP-1489
Commit: 58bd9b548a2bc418c8e34e3637bf2005c385d15f
Parents: 256ccc3
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Wed Nov 16 13:41:46 2016 +0100
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 .../javascript/gremlin-javascript/structure/graph.js | 15 +++++++++++++--
 .../structure/io/graph-serializer.js                 | 13 +++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58bd9b54/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
index 7c48819..cd408ae 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
@@ -68,10 +68,20 @@
 
   inherits(Vertex, Element);
 
-  function Edge(id, outV, label, inV) {
+  function Edge(id, outV, label, inV, properties) {
     Element.call(this, id, label);
     this.outV = outV;
     this.inV = inV;
+    this.properties = {};
+    (function adaptProperties(self) {
+      if (properties) {
+        var keys = Object.keys(properties);
+        for (var i = 0; i < keys.length; i++) {
+          var k = keys[i];
+          self.properties[k] = properties[k].value;
+        }
+      }
+    })(this);
   }
 
   inherits(Edge, Element);
@@ -80,10 +90,11 @@
     return 'e[' + this.id + '][' + this.outV.id + '-' + this.label + '->' + this.inV.id + ']';
   };
 
-  function VertexProperty(id, label, value) {
+  function VertexProperty(id, label, value, properties) {
     Element.call(this, id, label);
     this.value = value;
     this.key = this.label;
+    this.properties = properties;
   }
 
   inherits(VertexProperty, Element);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/58bd9b54/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
index 2dde340..31652da 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
@@ -155,6 +155,9 @@
   }
 
   GraphSONReader.prototype.read = function (obj) {
+    if (obj === undefined) {
+      return undefined;
+    }
     if (Array.isArray(obj)) {
       return obj.map(function mapEach(item) {
         return this.read(item);
@@ -340,7 +343,12 @@
 
   VertexPropertySerializer.prototype.deserialize = function (obj) {
     var value = obj[valueKey];
-    return new g.VertexProperty(this.reader.read(value['id']), value['label'], this.reader.read(value['value']));
+    return new g.VertexProperty(
+      this.reader.read(value['id']),
+      value['label'],
+      this.reader.read(value['value']),
+      this.reader.read(value['properties'])
+    );
   };
 
   function PropertySerializer() {
@@ -364,7 +372,8 @@
       this.reader.read(value['id']),
       this.reader.read(value['outV']),
       value['label'],
-      this.reader.read(value['inV'])
+      this.reader.read(value['inV']),
+      this.reader.read(value['properties'])
     );
   };
 


[18/50] [abbrv] tinkerpop git commit: added a new test case to test_driver_remote_connection.py that is related to TINKERPOP-1716. CTR.

Posted by sp...@apache.org.
added a new test case to test_driver_remote_connection.py that is related to TINKERPOP-1716. CTR.


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

Branch: refs/heads/TINKERPOP-1489
Commit: 31daf3261de14712163cd5ffcfc8cb0104e4e05e
Parents: 402678b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jul 10 07:24:12 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jul 10 07:24:12 2017 -0600

----------------------------------------------------------------------
 .../main/jython/tests/driver/test_driver_remote_connection.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/31daf326/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index cd64e2b..71cebf0 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -85,6 +85,13 @@ class TestDriverRemoteConnection(object):
         assert 1 == g.V().label().dedup().count().next()
         assert "person" == g.V().label().dedup().next()
         #
+        g = Graph().traversal().withRemote(remote_connection). \
+            withStrategies(SubgraphStrategy(edges=__.hasLabel("created")))
+        assert 6 == g.V().count().next()
+        assert 4 == g.E().count().next()
+        assert 1 == g.E().label().dedup().count().next()
+        assert "created" == g.E().label().dedup().next()
+        #
         g = g.withoutStrategies(SubgraphStrategy). \
             withComputer(vertices=__.has("name", "marko"), edges=__.limit(0))
         assert 1 == g.V().count().next()


[31/50] [abbrv] tinkerpop git commit: Wrapped future in WeakReference

Posted by sp...@apache.org.
Wrapped future in WeakReference

This is an add-on change that should have been in place on TINKERPOP-1714. This should allow the result to be garbage collected without waiting for the timeout. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 2ba4104aaa3e93b0155331b6f5e410a0bd59b0d3
Parents: 5335f4a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 17 10:39:07 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 17 10:39:07 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/groovy/engine/GremlinExecutor.java       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2ba4104a/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 d646a8c..d02d773 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
@@ -38,6 +38,7 @@ import javax.script.SimpleBindings;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.lang.ref.WeakReference;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -324,11 +325,12 @@ public class GremlinExecutor implements AutoCloseable {
             return null;
         });
 
-        final Future<?> executionFuture = executorService.submit(evalFuture);
+        final WeakReference<Future<?>> executionFuture = new WeakReference<>(executorService.submit(evalFuture));
         if (scriptEvalTimeOut > 0) {
             // Schedule a timeout in the thread pool for future execution
             scheduledExecutorService.schedule(() -> {
-                if (executionFuture.cancel(true)) {
+                final Future<?> f = executionFuture.get();
+                if (f != null && f.cancel(true)) {
                     lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
                     evaluationFuture.completeExceptionally(new TimeoutException(
                             String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]", scriptEvalTimeOut, script)));


[08/50] [abbrv] tinkerpop git commit: Merge branch 'tp31' into tp32

Posted by sp...@apache.org.
Merge branch 'tp31' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: e12cc7c80a2f816ab49f966e4895a79c0f27e59f
Parents: faa7611 28ab372
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 08:10:41 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 08:10:41 2017 -0400

----------------------------------------------------------------------
 docs/src/tutorials/getting-started/index.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e12cc7c8/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------


[44/50] [abbrv] tinkerpop git commit: Javascript GLV

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
new file mode 100644
index 0000000..d9803ba
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
@@ -0,0 +1,2025 @@
+/*
+ *  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.
+ */
+ 
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineGraphTraversalModule() {
+  "use strict";
+
+  var t = loadModule.call(this, './traversal.js');
+  var remote = loadModule.call(this, '../driver/remote-connection.js');
+  var Bytecode = t.Bytecode;
+  var inherits = t.inherits;
+  var parseArgs = t.parseArgs;
+
+  /**
+   *
+   * @param {Graph} graph
+   * @param {TraversalStrategies} traversalStrategies
+   * @param {Bytecode} [bytecode]
+   * @constructor
+   */
+  function GraphTraversalSource(graph, traversalStrategies, bytecode) {
+    this._graph = graph;
+    this._traversalStrategies = traversalStrategies;
+    this._bytecode = bytecode || new Bytecode();
+  }
+
+  /**
+   * @param remoteConnection
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
+    var traversalStrategy = new t.TraversalStrategies(this._traversalStrategies);
+    traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
+    return new GraphTraversal(this._graph, traversalStrategy, new Bytecode(this._bytecode));
+  };
+
+  /**
+   * Returns the string representation of the GraphTraversalSource.
+   * @returns {string}
+   */
+  GraphTraversalSource.prototype.toString = function () {
+    return 'graphtraversalsource[' + this._graph.toString() + ']';
+  };
+
+  /**
+   * withBulk GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withBulk = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * withComputer GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withComputer = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withComputer', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * withPath GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withPath = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withPath', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * withSack GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withSack = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withSack', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * withSideEffect GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withSideEffect = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * withStrategies GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withStrategies = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * withoutStrategies GraphTraversalSource method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  GraphTraversalSource.prototype.withoutStrategies = function (args) {
+    var b = new Bytecode(this._bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * E GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.E = function (args) {
+    var b = new Bytecode(this._bytecode).addStep('E', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * V GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.V = function (args) {
+    var b = new Bytecode(this._bytecode).addStep('V', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * addV GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.addV = function (args) {
+    var b = new Bytecode(this._bytecode).addStep('addV', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * inject GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversalSource.prototype.inject = function (args) {
+    var b = new Bytecode(this._bytecode).addStep('inject', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this._graph, new t.TraversalStrategies(this._traversalStrategies), b);
+  };
+
+  /**
+   * Represents a graph traversal.
+   * @constructor
+   */
+  function GraphTraversal(graph, traversalStrategies, bytecode) {
+    t.Traversal.call(this, graph, traversalStrategies, bytecode);
+  }
+
+  inherits(GraphTraversal, t.Traversal);
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.V = function (args) {
+    this._bytecode.addStep('V', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.addE = function (args) {
+    this._bytecode.addStep('addE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.addInE = function (args) {
+    this._bytecode.addStep('addInE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.addOutE = function (args) {
+    this._bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.addV = function (args) {
+    this._bytecode.addStep('addV', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.aggregate = function (args) {
+    this._bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.and = function (args) {
+    this._bytecode.addStep('and', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.as = function (args) {
+    this._bytecode.addStep('as', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.barrier = function (args) {
+    this._bytecode.addStep('barrier', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.both = function (args) {
+    this._bytecode.addStep('both', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.bothE = function (args) {
+    this._bytecode.addStep('bothE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.bothV = function (args) {
+    this._bytecode.addStep('bothV', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.branch = function (args) {
+    this._bytecode.addStep('branch', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.by = function (args) {
+    this._bytecode.addStep('by', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.cap = function (args) {
+    this._bytecode.addStep('cap', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.choose = function (args) {
+    this._bytecode.addStep('choose', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.coalesce = function (args) {
+    this._bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.coin = function (args) {
+    this._bytecode.addStep('coin', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.constant = function (args) {
+    this._bytecode.addStep('constant', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.count = function (args) {
+    this._bytecode.addStep('count', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.cyclicPath = function (args) {
+    this._bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.dedup = function (args) {
+    this._bytecode.addStep('dedup', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.drop = function (args) {
+    this._bytecode.addStep('drop', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.emit = function (args) {
+    this._bytecode.addStep('emit', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.filter = function (args) {
+    this._bytecode.addStep('filter', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.flatMap = function (args) {
+    this._bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.fold = function (args) {
+    this._bytecode.addStep('fold', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.from_ = function (args) {
+    this._bytecode.addStep('from', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.group = function (args) {
+    this._bytecode.addStep('group', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.groupCount = function (args) {
+    this._bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.groupV3d0 = function (args) {
+    this._bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.has = function (args) {
+    this._bytecode.addStep('has', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.hasId = function (args) {
+    this._bytecode.addStep('hasId', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.hasKey = function (args) {
+    this._bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.hasLabel = function (args) {
+    this._bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.hasNot = function (args) {
+    this._bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.hasValue = function (args) {
+    this._bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.id = function (args) {
+    this._bytecode.addStep('id', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.identity = function (args) {
+    this._bytecode.addStep('identity', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.inE = function (args) {
+    this._bytecode.addStep('inE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.inV = function (args) {
+    this._bytecode.addStep('inV', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.in_ = function (args) {
+    this._bytecode.addStep('in', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.inject = function (args) {
+    this._bytecode.addStep('inject', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.is = function (args) {
+    this._bytecode.addStep('is', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.key = function (args) {
+    this._bytecode.addStep('key', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.label = function (args) {
+    this._bytecode.addStep('label', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.limit = function (args) {
+    this._bytecode.addStep('limit', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.local = function (args) {
+    this._bytecode.addStep('local', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.loops = function (args) {
+    this._bytecode.addStep('loops', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.map = function (args) {
+    this._bytecode.addStep('map', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.mapKeys = function (args) {
+    this._bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.mapValues = function (args) {
+    this._bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.match = function (args) {
+    this._bytecode.addStep('match', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.max = function (args) {
+    this._bytecode.addStep('max', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.mean = function (args) {
+    this._bytecode.addStep('mean', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.min = function (args) {
+    this._bytecode.addStep('min', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.not = function (args) {
+    this._bytecode.addStep('not', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.option = function (args) {
+    this._bytecode.addStep('option', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.optional = function (args) {
+    this._bytecode.addStep('optional', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.or = function (args) {
+    this._bytecode.addStep('or', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.order = function (args) {
+    this._bytecode.addStep('order', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.otherV = function (args) {
+    this._bytecode.addStep('otherV', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.out = function (args) {
+    this._bytecode.addStep('out', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.outE = function (args) {
+    this._bytecode.addStep('outE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.outV = function (args) {
+    this._bytecode.addStep('outV', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.pageRank = function (args) {
+    this._bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.path = function (args) {
+    this._bytecode.addStep('path', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.peerPressure = function (args) {
+    this._bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.profile = function (args) {
+    this._bytecode.addStep('profile', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.program = function (args) {
+    this._bytecode.addStep('program', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.project = function (args) {
+    this._bytecode.addStep('project', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.properties = function (args) {
+    this._bytecode.addStep('properties', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.property = function (args) {
+    this._bytecode.addStep('property', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.propertyMap = function (args) {
+    this._bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.range = function (args) {
+    this._bytecode.addStep('range', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.repeat = function (args) {
+    this._bytecode.addStep('repeat', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.sack = function (args) {
+    this._bytecode.addStep('sack', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.sample = function (args) {
+    this._bytecode.addStep('sample', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.select = function (args) {
+    this._bytecode.addStep('select', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.sideEffect = function (args) {
+    this._bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.simplePath = function (args) {
+    this._bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.store = function (args) {
+    this._bytecode.addStep('store', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.subgraph = function (args) {
+    this._bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.sum = function (args) {
+    this._bytecode.addStep('sum', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.tail = function (args) {
+    this._bytecode.addStep('tail', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.timeLimit = function (args) {
+    this._bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.times = function (args) {
+    this._bytecode.addStep('times', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.to = function (args) {
+    this._bytecode.addStep('to', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.toE = function (args) {
+    this._bytecode.addStep('toE', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.toV = function (args) {
+    this._bytecode.addStep('toV', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.tree = function (args) {
+    this._bytecode.addStep('tree', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.unfold = function (args) {
+    this._bytecode.addStep('unfold', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.union = function (args) {
+    this._bytecode.addStep('union', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.until = function (args) {
+    this._bytecode.addStep('until', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.value = function (args) {
+    this._bytecode.addStep('value', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.valueMap = function (args) {
+    this._bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.values = function (args) {
+    this._bytecode.addStep('values', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  GraphTraversal.prototype.where = function (args) {
+    this._bytecode.addStep('where', parseArgs.apply(null, arguments));
+    return this;
+  };
+
+  /**
+   * Contains the static method definitions
+   * @type {Object}
+   */
+  var statics = {};
+
+  /**
+   * V() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.V = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.V.apply(g, arguments);
+  };
+
+  /**
+   * __() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.__ = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.__.apply(g, arguments);
+  };
+
+  /**
+   * addE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.addE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.addE.apply(g, arguments);
+  };
+
+  /**
+   * addInE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.addInE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.addInE.apply(g, arguments);
+  };
+
+  /**
+   * addOutE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.addOutE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.addOutE.apply(g, arguments);
+  };
+
+  /**
+   * addV() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.addV = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.addV.apply(g, arguments);
+  };
+
+  /**
+   * aggregate() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.aggregate = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.aggregate.apply(g, arguments);
+  };
+
+  /**
+   * and() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.and = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.and.apply(g, arguments);
+  };
+
+  /**
+   * as() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.as = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.as.apply(g, arguments);
+  };
+
+  /**
+   * barrier() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.barrier = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.barrier.apply(g, arguments);
+  };
+
+  /**
+   * both() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.both = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.both.apply(g, arguments);
+  };
+
+  /**
+   * bothE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.bothE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.bothE.apply(g, arguments);
+  };
+
+  /**
+   * bothV() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.bothV = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.bothV.apply(g, arguments);
+  };
+
+  /**
+   * branch() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.branch = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.branch.apply(g, arguments);
+  };
+
+  /**
+   * cap() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.cap = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.cap.apply(g, arguments);
+  };
+
+  /**
+   * choose() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.choose = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.choose.apply(g, arguments);
+  };
+
+  /**
+   * coalesce() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.coalesce = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.coalesce.apply(g, arguments);
+  };
+
+  /**
+   * coin() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.coin = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.coin.apply(g, arguments);
+  };
+
+  /**
+   * constant() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.constant = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.constant.apply(g, arguments);
+  };
+
+  /**
+   * count() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.count = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.count.apply(g, arguments);
+  };
+
+  /**
+   * cyclicPath() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.cyclicPath = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.cyclicPath.apply(g, arguments);
+  };
+
+  /**
+   * dedup() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.dedup = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.dedup.apply(g, arguments);
+  };
+
+  /**
+   * drop() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.drop = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.drop.apply(g, arguments);
+  };
+
+  /**
+   * emit() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.emit = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.emit.apply(g, arguments);
+  };
+
+  /**
+   * filter() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.filter = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.filter.apply(g, arguments);
+  };
+
+  /**
+   * flatMap() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.flatMap = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.flatMap.apply(g, arguments);
+  };
+
+  /**
+   * fold() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.fold = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.fold.apply(g, arguments);
+  };
+
+  /**
+   * group() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.group = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.group.apply(g, arguments);
+  };
+
+  /**
+   * groupCount() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.groupCount = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.groupCount.apply(g, arguments);
+  };
+
+  /**
+   * groupV3d0() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.groupV3d0 = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.groupV3d0.apply(g, arguments);
+  };
+
+  /**
+   * has() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.has = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.has.apply(g, arguments);
+  };
+
+  /**
+   * hasId() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.hasId = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.hasId.apply(g, arguments);
+  };
+
+  /**
+   * hasKey() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.hasKey = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.hasKey.apply(g, arguments);
+  };
+
+  /**
+   * hasLabel() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.hasLabel = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.hasLabel.apply(g, arguments);
+  };
+
+  /**
+   * hasNot() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.hasNot = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.hasNot.apply(g, arguments);
+  };
+
+  /**
+   * hasValue() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.hasValue = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.hasValue.apply(g, arguments);
+  };
+
+  /**
+   * id() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.id = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.id.apply(g, arguments);
+  };
+
+  /**
+   * identity() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.identity = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.identity.apply(g, arguments);
+  };
+
+  /**
+   * inE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.inE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.inE.apply(g, arguments);
+  };
+
+  /**
+   * inV() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.inV = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.inV.apply(g, arguments);
+  };
+
+  /**
+   * in_() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.in_ = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.in_.apply(g, arguments);
+  };
+
+  /**
+   * inject() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.inject = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.inject.apply(g, arguments);
+  };
+
+  /**
+   * is() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.is = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.is.apply(g, arguments);
+  };
+
+  /**
+   * key() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.key = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.key.apply(g, arguments);
+  };
+
+  /**
+   * label() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.label = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.label.apply(g, arguments);
+  };
+
+  /**
+   * limit() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.limit = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.limit.apply(g, arguments);
+  };
+
+  /**
+   * local() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.local = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.local.apply(g, arguments);
+  };
+
+  /**
+   * loops() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.loops = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.loops.apply(g, arguments);
+  };
+
+  /**
+   * map() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.map = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.map.apply(g, arguments);
+  };
+
+  /**
+   * mapKeys() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.mapKeys = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.mapKeys.apply(g, arguments);
+  };
+
+  /**
+   * mapValues() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.mapValues = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.mapValues.apply(g, arguments);
+  };
+
+  /**
+   * match() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.match = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.match.apply(g, arguments);
+  };
+
+  /**
+   * max() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.max = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.max.apply(g, arguments);
+  };
+
+  /**
+   * mean() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.mean = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.mean.apply(g, arguments);
+  };
+
+  /**
+   * min() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.min = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.min.apply(g, arguments);
+  };
+
+  /**
+   * not() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.not = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.not.apply(g, arguments);
+  };
+
+  /**
+   * optional() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.optional = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.optional.apply(g, arguments);
+  };
+
+  /**
+   * or() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.or = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.or.apply(g, arguments);
+  };
+
+  /**
+   * order() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.order = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.order.apply(g, arguments);
+  };
+
+  /**
+   * otherV() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.otherV = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.otherV.apply(g, arguments);
+  };
+
+  /**
+   * out() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.out = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.out.apply(g, arguments);
+  };
+
+  /**
+   * outE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.outE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.outE.apply(g, arguments);
+  };
+
+  /**
+   * outV() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.outV = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.outV.apply(g, arguments);
+  };
+
+  /**
+   * path() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.path = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.path.apply(g, arguments);
+  };
+
+  /**
+   * project() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.project = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.project.apply(g, arguments);
+  };
+
+  /**
+   * properties() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.properties = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.properties.apply(g, arguments);
+  };
+
+  /**
+   * property() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.property = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.property.apply(g, arguments);
+  };
+
+  /**
+   * propertyMap() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.propertyMap = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.propertyMap.apply(g, arguments);
+  };
+
+  /**
+   * range() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.range = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.range.apply(g, arguments);
+  };
+
+  /**
+   * repeat() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.repeat = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.repeat.apply(g, arguments);
+  };
+
+  /**
+   * sack() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.sack = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.sack.apply(g, arguments);
+  };
+
+  /**
+   * sample() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.sample = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.sample.apply(g, arguments);
+  };
+
+  /**
+   * select() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.select = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.select.apply(g, arguments);
+  };
+
+  /**
+   * sideEffect() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.sideEffect = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.sideEffect.apply(g, arguments);
+  };
+
+  /**
+   * simplePath() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.simplePath = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.simplePath.apply(g, arguments);
+  };
+
+  /**
+   * start() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.start = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.start.apply(g, arguments);
+  };
+
+  /**
+   * store() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.store = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.store.apply(g, arguments);
+  };
+
+  /**
+   * subgraph() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.subgraph = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.subgraph.apply(g, arguments);
+  };
+
+  /**
+   * sum() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.sum = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.sum.apply(g, arguments);
+  };
+
+  /**
+   * tail() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.tail = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.tail.apply(g, arguments);
+  };
+
+  /**
+   * timeLimit() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.timeLimit = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.timeLimit.apply(g, arguments);
+  };
+
+  /**
+   * times() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.times = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.times.apply(g, arguments);
+  };
+
+  /**
+   * to() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.to = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.to.apply(g, arguments);
+  };
+
+  /**
+   * toE() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.toE = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.toE.apply(g, arguments);
+  };
+
+  /**
+   * toV() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.toV = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.toV.apply(g, arguments);
+  };
+
+  /**
+   * tree() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.tree = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.tree.apply(g, arguments);
+  };
+
+  /**
+   * unfold() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.unfold = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.unfold.apply(g, arguments);
+  };
+
+  /**
+   * union() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.union = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.union.apply(g, arguments);
+  };
+
+  /**
+   * until() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.until = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.until.apply(g, arguments);
+  };
+
+  /**
+   * value() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.value = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.value.apply(g, arguments);
+  };
+
+  /**
+   * valueMap() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.valueMap = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.valueMap.apply(g, arguments);
+  };
+
+  /**
+   * values() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.values = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.values.apply(g, arguments);
+  };
+
+  /**
+   * where() static method
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  statics.where = function (args) {
+    var g = new GraphTraversal(null, null, new Bytecode());
+    return g.where.apply(g, arguments);
+  };
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  var toExport = {
+    GraphTraversal: GraphTraversal,
+    GraphTraversalSource: GraphTraversalSource,
+    statics: statics
+  };
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
new file mode 100644
index 0000000..5c9bf6c
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
@@ -0,0 +1,395 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineTraversalModule() {
+  "use strict";
+
+  function Traversal(graph, traversalStrategies, bytecode) {
+    this._graph = graph;
+    this._traversalStrategies = traversalStrategies;
+    this._bytecode = bytecode;
+    this.traversers = null;
+    this.sideEffects = null;
+  }
+
+  /** @returns {Bytecode} */
+  Traversal.prototype.getBytecode = function () {
+    return this._bytecode;
+  };
+
+  /** @param {Function} callback */
+  Traversal.prototype.list = function (callback) {
+    var self = this;
+    this._traversalStrategies.applyStrategies(this, function (err) {
+      if (err) {
+        return callback(err);
+      }
+      callback(err, self.traversers);
+    });
+  };
+
+  /** @param {Function} callback */
+  Traversal.prototype.one = function (callback) {
+    this.list(function (err, result) {
+      callback(err, result ? result[0] : null);
+    });
+  };
+
+  /**
+   * Returns the Bytecode JSON representation of the traversal
+   * @returns {String}
+   */
+  Traversal.prototype.toString = function () {
+    return this._bytecode.toString();
+  };
+  
+  /**
+   * Represents an operation.
+   * @constructor
+   */
+  function P(operator, value, other) {
+    this.operator = operator;
+    this.value = value;
+    this.other = other;
+  }
+
+  /**
+   * Returns the string representation of the instance.
+   * @returns {string}
+   */
+  P.prototype.toString = function () {
+    if (this.other === undefined) {
+      return this.operator + '(' + this.value + ')';
+    }
+    return this.operator + '(' + this.value + ', ' + this.other + ')';
+  };
+
+  function createP(operator, args) {
+    args.unshift(null, operator);
+    return new (Function.prototype.bind.apply(P, args));
+  }
+
+  /** @param {...Object} args */
+  P.between = function (args) {
+    return createP('between', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.eq = function (args) {
+    return createP('eq', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.gt = function (args) {
+    return createP('gt', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.gte = function (args) {
+    return createP('gte', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.inside = function (args) {
+    return createP('inside', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.lt = function (args) {
+    return createP('lt', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.lte = function (args) {
+    return createP('lte', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.neq = function (args) {
+    return createP('neq', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.not = function (args) {
+    return createP('not', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.outside = function (args) {
+    return createP('outside', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.test = function (args) {
+    return createP('test', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.within = function (args) {
+    return createP('within', parseArgs.apply(null, arguments));
+  };
+
+  /** @param {...Object} args */
+  P.without = function (args) {
+    return createP('without', parseArgs.apply(null, arguments));
+  };
+
+  P.prototype.and = function (arg) {
+    return new P('and', this, arg);
+  };
+
+  P.prototype.or = function (arg) {
+    return new P('or', this, arg);
+  };
+
+  function Traverser(object, bulk) {
+    this.object = object;
+    this.bulk = bulk == undefined ? 1 : bulk;
+  }
+
+  function TraversalSideEffects() {
+
+  }
+
+  /**
+   * Creates a new instance of TraversalStrategies.
+   * @param {TraversalStrategies} [traversalStrategies]
+   * @constructor
+   */
+  function TraversalStrategies(traversalStrategies) {
+    /** @type {Array<TraversalStrategy>} */
+    this.strategies = traversalStrategies ? traversalStrategies.strategies : [];
+  }
+
+  /** @param {TraversalStrategy} strategy */
+  TraversalStrategies.prototype.addStrategy = function (strategy) {
+    this.strategies.push(strategy);
+  };
+
+  /** @param {Traversal} traversal */
+  TraversalStrategies.prototype.applyStrategies = function (traversal) {
+    this.strategies.forEach(function eachStrategy(s) {
+      s.apply(traversal);
+    });
+  };
+
+  /**
+   * @abstract
+   * @constructor
+   */
+  function TraversalStrategy() {
+
+  }
+
+  /**
+   * @abstract
+   * @param {Traversal} traversal
+   */
+  TraversalStrategy.prototype.apply = function (traversal) {
+
+  };
+
+  /**
+   * Creates a new instance of Bytecode
+   * @param {Bytecode} [toClone]
+   * @constructor
+   */
+  function Bytecode(toClone) {
+    this._bindings = {};
+    if (!toClone) {
+      this.sourceInstructions = [];
+      this.stepInstructions = [];
+    }
+    else {
+      this.sourceInstructions = toClone.sourceInstructions.slice(0);
+      this.stepInstructions = toClone.sourceInstructions.slice(0);
+    }
+  }
+
+  /**
+   * Adds a new source instructions
+   * @param {String} name
+   * @param {Array} values
+   * @returns {Bytecode}
+   */
+  Bytecode.prototype.addSource = function (name, values) {
+    if (name === undefined) {
+      throw new Error('Name is not defined');
+    }
+    var instruction = new Array(values.length + 1);
+    instruction[0] = name;
+    for (var i = 0; i < values.length; ++i) {
+      instruction[i + 1] = this._convertToArgument(values[i]);
+    }
+    this.sourceInstructions.push(this._generateInstruction(name, values));
+    return this;
+  };
+
+  /**
+   * Adds a new step instructions
+   * @param {String} name
+   * @param {Array} values
+   * @returns {Bytecode}
+   */
+  Bytecode.prototype.addStep = function (name, values) {
+    if (name === undefined) {
+      throw new Error('Name is not defined');
+    }
+    this.stepInstructions.push(this._generateInstruction(name, values));
+    return this;
+  };
+
+  Bytecode.prototype._generateInstruction = function (name, values) {
+    var instruction = new Array(values.length + 1);
+    instruction[0] = name;
+    for (var i = 0; i < values.length; ++i) {
+      instruction[i + 1] = this._convertToArgument(values[i]);
+    }
+    return instruction;
+  };
+
+  /**
+   * Returns the JSON representation of the source and step instructions
+   * @returns {String}
+   */
+  Bytecode.prototype.toString = function () {
+    return (
+      (this.sourceInstructions.length > 0 ? JSON.stringify(this.sourceInstructions) : '') +
+      (this.stepInstructions.length   > 0 ? JSON.stringify(this.stepInstructions) : '')
+    );
+  };
+
+  Bytecode.prototype._convertToArgument = function (value) {
+    return value;
+  };
+
+  function toEnum(typeName, keys) {
+    var result = {};
+    keys.split(' ').forEach(function (k) {
+      if (k === k.toUpperCase()) {
+        k = k.toLowerCase();
+      }
+      result[k] = new EnumValue(typeName, k);
+    });
+    return result;
+  }
+
+  function EnumValue(typeName, elementName) {
+    this.typeName = typeName;
+    this.elementName = elementName;
+  }
+
+  /**
+   * @type {{barrier, cardinality, column, direction, operator, order, pop, scope, t}}
+   */
+  var enums = {};
+  enums.barrier = toEnum('Barrier', 'normSack');
+  enums.cardinality = toEnum('Cardinality', 'list set single');
+  enums.column = toEnum('Column', 'keys values');
+  enums.direction = toEnum('Direction', 'BOTH IN OUT');
+  enums.operator = toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong');
+  enums.order = toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr');
+  enums.pop = toEnum('Pop', 'all first last');
+  enums.scope = toEnum('Scope', 'global local');
+  enums.t = toEnum('T', 'id key label value');
+
+  // Utility functions
+  /** @returns {Array} */
+  function parseArgs() {
+    return (arguments.length === 1 ? [ arguments[0] ] : Array.apply(null, arguments));
+  }
+
+  /**
+   * @param {Array} arr
+   * @param {Function} fn
+   * @param {Function} [callback]
+   */
+  function eachSeries(arr, fn, callback) {
+    if (!Array.isArray(arr)) {
+      throw new TypeError('First parameter is not an Array');
+    }
+    callback = callback || noop;
+    var length = arr.length;
+    if (length === 0) {
+      return callback();
+    }
+    var sync;
+    var index = 1;
+    fn(arr[0], next);
+    if (sync === undefined) {
+      sync = false;
+    }
+
+    function next(err) {
+      if (err) {
+        return callback(err);
+      }
+      if (index >= length) {
+        return callback();
+      }
+      if (sync === undefined) {
+        sync = true;
+      }
+      if (sync) {
+        return process.nextTick(function () {
+          fn(arr[index++], next);
+        });
+      }
+      fn(arr[index++], next);
+    }
+  }
+
+  function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor;
+    ctor.prototype = Object.create(superCtor.prototype, {
+      constructor: {
+        value: ctor,
+        enumerable: false,
+        writable: true,
+        configurable: true
+      }
+    });
+  }
+
+  var toExport = {
+    Bytecode: Bytecode,
+    EnumValue: EnumValue,
+    inherits: inherits,
+    P: P,
+    parseArgs: parseArgs,
+    Traversal: Traversal,
+    TraversalSideEffects: TraversalSideEffects,
+    TraversalStrategies: TraversalStrategies,
+    TraversalStrategy: TraversalStrategy,
+    Traverser: Traverser
+  };
+  Object.keys(enums).forEach(function (k) {
+    toExport[k] = enums[k];
+  });
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
new file mode 100644
index 0000000..7c48819
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
@@ -0,0 +1,146 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineGraphModule() {
+  "use strict";
+
+  var gt = loadModule.call(this, '../process/graph-traversal.js');
+  var t = loadModule.call(this, '../process/traversal.js');
+  var inherits = t.inherits;
+
+  function Graph() {
+
+  }
+
+  /**
+   * Returns the graph traversal source.
+   * @returns {GraphTraversalSource}
+   */
+  Graph.prototype.traversal = function () {
+    return new gt.GraphTraversalSource(this, new t.TraversalStrategies());
+  };
+
+  Graph.prototype.toString = function () {
+    return 'graph[empty]';
+  };
+
+  function Element(id, label) {
+    this.id = id;
+    this.label = label;
+  }
+
+  /**
+   * Compares this instance to another and determines if they can be considered as equal.
+   * @param {Element} other
+   * @returns {boolean}
+   */
+  Element.prototype.equals = function (other) {
+    return (other instanceof Element) && this.id === other.id;
+  };
+
+  function Vertex(id, label, properties) {
+    Element.call(this, id, label);
+    this.properties = properties;
+  }
+
+  Vertex.prototype.toString = function () {
+    return 'v[' + this.id + ']';
+  };
+
+  inherits(Vertex, Element);
+
+  function Edge(id, outV, label, inV) {
+    Element.call(this, id, label);
+    this.outV = outV;
+    this.inV = inV;
+  }
+
+  inherits(Edge, Element);
+
+  Edge.prototype.toString = function () {
+    return 'e[' + this.id + '][' + this.outV.id + '-' + this.label + '->' + this.inV.id + ']';
+  };
+
+  function VertexProperty(id, label, value) {
+    Element.call(this, id, label);
+    this.value = value;
+    this.key = this.label;
+  }
+
+  inherits(VertexProperty, Element);
+
+  VertexProperty.prototype.toString = function () {
+    return 'vp[' + this.label + '->' + this.value.substr(0, 20) + ']';
+  };
+
+  function Property(key, value) {
+    this.key = key;
+    this.value = value;
+  }
+
+  Property.prototype.toString = function () {
+    return 'p[' + this.key + '->' + this.value.substr(0, 20) + ']';
+  };
+
+  Property.prototype.equals = function (other) {
+    return (other instanceof Property) && this.key === other.key && this.value === other.value;
+  };
+
+  /**
+   * Represents a walk through a graph as defined by a traversal.
+   * @param {Array} labels
+   * @param {Array} objects
+   * @constructor
+   */
+  function Path(labels, objects) {
+    this.labels = labels;
+    this.objects = objects;
+  }
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  var toExport = {
+    Edge: Edge,
+    Graph: Graph,
+    Path: Path,
+    Property: Property,
+    Vertex: Vertex,
+    VertexProperty: VertexProperty
+  };
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
new file mode 100644
index 0000000..2dde340
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
@@ -0,0 +1,406 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function graphSerializerModule() {
+  "use strict";
+
+  var t = loadModule.call(this, '../../process/traversal.js');
+  var g = loadModule.call(this, '../graph.js');
+
+  /**
+   * A type serializer
+   * @typedef {Object} Serializer
+   * @property {Function} serialize
+   * @property {Function} deserialize
+   * @property {Function} [canBeUsedFor]
+   */
+
+  /**
+   * @const
+   * @private
+   */
+  var valueKey = '@value';
+
+  /**
+   * @const
+   * @private
+   */
+  var typeKey = '@type';
+
+  var deserializers = {
+    'g:Traverser': TraverserSerializer,
+    'g:Int32':  NumberSerializer,
+    'g:Int64':  NumberSerializer,
+    'g:Float':  NumberSerializer,
+    'g:Double': NumberSerializer,
+    'g:Vertex': VertexSerializer,
+    'g:Edge': EdgeSerializer,
+    'g:VertexProperty': VertexPropertySerializer,
+    'g:Property': PropertySerializer,
+    'g:Path': PathSerializer
+  };
+
+  var serializers = [
+    NumberSerializer,
+    BytecodeSerializer,
+    TraverserSerializer,
+    PSerializer,
+    LambdaSerializer,
+    EnumSerializer
+  ];
+
+  /**
+   * GraphSON Writer
+   * @param {Object} [options]
+   * @param {Object} options.serializers An object used as an associative array with GraphSON 2 type name as keys and
+   * serializer instances as values, ie: { 'g:Int64': longSerializer }.
+   * @constructor
+   */
+  function GraphSONWriter(options) {
+    this._options = options || {};
+    // Create instance of the default serializers
+    this._serializers = serializers.map(function (serializerConstructor) {
+      var s = new serializerConstructor();
+      s.writer = this;
+      return s;
+    }, this);
+    var customSerializers = this._options.serializers || {};
+    Object.keys(customSerializers).forEach(function (key) {
+      var s = customSerializers[key];
+      if (!s.serialize) {
+        return;
+      }
+      s.writer = this;
+      // Insert custom serializers first
+      this._serializers.unshift(s);
+    }, this);
+  }
+
+  GraphSONWriter.prototype.adaptObject = function (value) {
+    var s;
+    if (Array.isArray(value)) {
+      return value.map(function (item) {
+        return this.adaptObject(item);
+      }, this);
+    }
+    for (var i = 0; i < this._serializers.length; i++) {
+      var currentSerializer = this._serializers[i];
+      if (currentSerializer.canBeUsedFor && currentSerializer.canBeUsedFor(value)) {
+        s = currentSerializer;
+        break;
+      }
+    }
+    if (s) {
+      return s.serialize(value);
+    }
+    // Default (strings / objects / ...)
+    return value;
+  };
+
+  /**
+   * Returns the GraphSON representation of the provided object instance.
+   * @param {Object} obj
+   * @returns {String}
+   */
+  GraphSONWriter.prototype.write = function (obj) {
+    return JSON.stringify(this.adaptObject(obj));
+  };
+
+  /**
+   * GraphSON Reader
+   * @param {Object} [options]
+   * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
+   * deserializer instances as values, ie: { 'g:Int64': longSerializer }.
+   * @constructor
+   */
+  function GraphSONReader(options) {
+    this._options = options || {};
+    this._deserializers = {};
+    Object.keys(deserializers).forEach(function (typeName) {
+      var serializerConstructor = deserializers[typeName];
+      var s = new serializerConstructor();
+      s.reader = this;
+      this._deserializers[typeName] = s;
+    }, this);
+    if (this._options.serializers) {
+      var customSerializers = this._options.serializers || {};
+      Object.keys(customSerializers).forEach(function (key) {
+        var s = customSerializers[key];
+        if (!s.deserialize) {
+          return;
+        }
+        s.reader = this;
+        this._deserializers[key] = s;
+      }, this);
+    }
+  }
+
+  GraphSONReader.prototype.read = function (obj) {
+    if (Array.isArray(obj)) {
+      return obj.map(function mapEach(item) {
+        return this.read(item);
+      }, this);
+    }
+    var type = obj[typeKey];
+    if (type) {
+      var d = this._deserializers[type];
+      if (d) {
+        // Use type serializer
+        return d.deserialize(obj);
+      }
+      return obj[valueKey];
+    }
+    if (obj && typeof obj === 'object' && obj.constructor === Object) {
+      return this._deserializeObject(obj);
+    }
+    // Default (for boolean, number and other scalars)
+    return obj;
+  };
+
+  GraphSONReader.prototype._deserializeObject = function (obj) {
+    var keys = Object.keys(obj);
+    var result = {};
+    for (var i = 0; i < keys.length; i++) {
+      result[keys[i]] = this.read(obj[keys[i]]);
+    }
+    return result;
+  };
+
+  function NumberSerializer() {
+
+  }
+
+  NumberSerializer.prototype.serialize = function (item) {
+    return item;
+  };
+
+  NumberSerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    return parseFloat(value);
+  };
+
+  NumberSerializer.prototype.canBeUsedFor = function (value) {
+    return (typeof value === 'number');
+  };
+
+  function BytecodeSerializer() {
+
+  }
+
+  BytecodeSerializer.prototype.serialize = function (item) {
+    var bytecode = item;
+    if (item instanceof t.Traversal) {
+      bytecode = item.getBytecode();
+    }
+    var result = {};
+    result[typeKey] = 'g:Bytecode';
+    var resultValue = result[valueKey] = {};
+    var sources = this._serializeInstructions(bytecode.sourceInstructions);
+    if (sources) {
+      resultValue['source'] = sources;
+    }
+    var steps = this._serializeInstructions(bytecode.stepInstructions);
+    if (steps) {
+      resultValue['step'] = steps;
+    }
+    return result;
+  };
+
+  BytecodeSerializer.prototype._serializeInstructions = function (instructions) {
+    if (instructions.length === 0) {
+      return null;
+    }
+    var result = new Array(instructions.length);
+    result[0] = instructions[0];
+    for (var i = 1; i < instructions.length; i++) {
+      result[i] = this.writer.adaptObject(instructions[i]);
+    }
+    return result;
+  };
+
+  BytecodeSerializer.prototype.canBeUsedFor = function (value) {
+    return (value instanceof t.Bytecode) || (value instanceof t.Traversal);
+  };
+
+  function PSerializer() {
+
+  }
+
+  /** @param {P} item */
+  PSerializer.prototype.serialize = function (item) {
+    var result = {};
+    result[typeKey] = 'g:P';
+    var resultValue = result[valueKey] = {
+      'predicate': item.operator
+    };
+    if (item.other == undefined) {
+      resultValue['value'] = this.writer.adaptObject(item.value);
+    }
+    else {
+      resultValue['value'] = [ this.writer.adaptObject(item.value), this.writer.adaptObject(item.other) ];
+    }
+    return result;
+  };
+
+  PSerializer.prototype.canBeUsedFor = function (value) {
+    return (value instanceof t.P);
+  };
+
+  function LambdaSerializer() {
+
+  }
+
+  /** @param {Function} item */
+  LambdaSerializer.prototype.serialize = function (item) {
+    var result = {};
+    result[typeKey] = 'g:Lambda';
+    result[valueKey] = {
+      'arguments': item.length,
+      'language': 'gremlin-javascript',
+      'script': item.toString()
+    };
+    return result;
+  };
+
+  LambdaSerializer.prototype.canBeUsedFor = function (value) {
+    return (typeof value === 'function');
+  };
+
+  function EnumSerializer() {
+
+  }
+
+  /** @param {EnumValue} item */
+  EnumSerializer.prototype.serialize = function (item) {
+    var result = {};
+    result[typeKey] = 'g:' + item.typeName;
+    result[valueKey] = item.elementName;
+    return result;
+  };
+
+  EnumSerializer.prototype.canBeUsedFor = function (value) {
+    return value && value.typeName && value instanceof t.EnumValue;
+  };
+
+  function TraverserSerializer() {
+
+  }
+
+  /** @param {Traverser} item */
+  TraverserSerializer.prototype.serialize = function (item) {
+    var result = {};
+    result[typeKey] = 'g:Traverser';
+    result[valueKey] = {
+      'value': this.writer.adaptObject(item.object),
+      'bulk': this.writer.adaptObject(item.bulk)
+    };
+    return result;
+  };
+
+  TraverserSerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    return new t.Traverser(this.reader.read(value['value']), this.reader.read(value['bulk']));
+  };
+
+  TraverserSerializer.prototype.canBeUsedFor = function (value) {
+    return (value instanceof t.Traverser);
+  };
+
+  function VertexSerializer() {
+
+  }
+
+  VertexSerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    return new g.Vertex(this.reader.read(value['id']), value['label'], this.reader.read(value['properties']));
+  };
+
+  function VertexPropertySerializer() {
+
+  }
+
+  VertexPropertySerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    return new g.VertexProperty(this.reader.read(value['id']), value['label'], this.reader.read(value['value']));
+  };
+
+  function PropertySerializer() {
+
+  }
+
+  PropertySerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    return new g.Property(
+      value['key'],
+      this.reader.read(value['value']));
+  };
+
+  function EdgeSerializer() {
+
+  }
+
+  EdgeSerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    return new g.Edge(
+      this.reader.read(value['id']),
+      this.reader.read(value['outV']),
+      value['label'],
+      this.reader.read(value['inV'])
+    );
+  };
+
+  function PathSerializer() {
+
+  }
+
+  PathSerializer.prototype.deserialize = function (obj) {
+    var value = obj[valueKey];
+    var objects = value['objects'].map(function objectMapItem(o) {
+      return this.reader.read(o);
+    }, this);
+    return new g.Path(this.reader.read(value['labels']), objects);
+  };
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  var toExport = {
+    GraphSONWriter: GraphSONWriter,
+    GraphSONReader: GraphSONReader
+  };
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  // Nashorn and rest
+  return toExport;
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js
new file mode 100644
index 0000000..858ed06
--- /dev/null
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js
@@ -0,0 +1,84 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineHelperModule() {
+  "use strict";
+
+  var assert = {
+    ok: function (condition, message) {
+      if (!condition) {
+        throw new AssertError(message || (condition + ' == true'));
+      }
+    },
+    strictEqual: function (val1, val2, message) {
+      if (val1 !== val2) {
+        throw new AssertError(message || (val1 + ' === ' + val2));
+      }
+    }
+  };
+
+  function loadLibModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      moduleName = '../lib/' + moduleName;
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined' && typeof java !== 'undefined') {
+      moduleName = __DIR__ + '../../../main/javascript/gremlin-javascript/' + moduleName;
+      var path = new java.io.File(moduleName).getCanonicalPath();
+      this.__dependencies = this.__dependencies || {};
+      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
+    }
+    throw new Error('No module loader was found');
+  }
+
+  function AssertError(message) {
+    Error.call(this, message);
+    this.stack = (new Error(message)).stack;
+    if (typeof print !== 'undefined') {
+      print(this.stack);
+    }
+  }
+
+  inherits(AssertError, Error);
+
+  function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor;
+    ctor.prototype = Object.create(superCtor.prototype, {
+      constructor: {
+        value: ctor,
+        enumerable: false,
+        writable: true,
+        configurable: true
+      }
+    });
+  }
+  var toExport = {
+    assert: assert,
+    loadLibModule: loadLibModule
+  };
+  if (typeof module !== 'undefined') {
+    // CommonJS
+    module.exports = toExport;
+    return;
+  }
+  return toExport;
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
new file mode 100644
index 0000000..6edb323
--- /dev/null
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
@@ -0,0 +1,78 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineTestCases() {
+  "use strict";
+
+  var helper = loadModule.call(this, './helper.js');
+  var assert = helper.assert;
+  var glvModule = helper.loadLibModule.call(this, './index.js');
+
+  [
+    function testExports() {
+      assert.ok(glvModule);
+
+      assert.ok(glvModule.process);
+      assert.strictEqual(typeof glvModule.process.Bytecode, 'function');
+      assert.strictEqual(typeof glvModule.process.EnumValue, 'function');
+      assert.strictEqual(typeof glvModule.process.inherits, 'function');
+      assert.strictEqual(typeof glvModule.process.P, 'function');
+      assert.strictEqual(typeof glvModule.process.parseArgs, 'function');
+      assert.strictEqual(typeof glvModule.process.Traversal, 'function');
+      assert.strictEqual(typeof glvModule.process.TraversalSideEffects, 'function');
+      assert.strictEqual(typeof glvModule.process.TraversalStrategies, 'function');
+      assert.strictEqual(typeof glvModule.process.TraversalStrategy, 'function');
+      assert.strictEqual(typeof glvModule.process.Traverser, 'function');
+      assert.strictEqual(typeof glvModule.process.GraphTraversal, 'function');
+      assert.strictEqual(typeof glvModule.process.GraphTraversalSource, 'function');
+      assert.ok(glvModule.process.statics);
+
+      assert.ok(glvModule.structure);
+      assert.ok(glvModule.structure.io);
+      assert.strictEqual(typeof glvModule.structure.io.GraphSONReader, 'function');
+      assert.strictEqual(typeof glvModule.structure.io.GraphSONWriter, 'function');
+      assert.strictEqual(typeof glvModule.structure.Edge, 'function');
+      assert.strictEqual(typeof glvModule.structure.Graph, 'function');
+      assert.strictEqual(typeof glvModule.structure.Path, 'function');
+      assert.strictEqual(typeof glvModule.structure.Property, 'function');
+      assert.strictEqual(typeof glvModule.structure.Vertex, 'function');
+      assert.strictEqual(typeof glvModule.structure.VertexProperty, 'function');
+
+      assert.ok(glvModule.driver);
+      assert.strictEqual(typeof glvModule.driver.RemoteConnection, 'function');
+      assert.strictEqual(typeof glvModule.driver.RemoteStrategy, 'function');
+      assert.strictEqual(typeof glvModule.driver.RemoteTraversal, 'function');
+    }
+  ].forEach(function (testCase) {
+    testCase.call(null);
+  });
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      return load(__DIR__ + moduleName);
+    }
+    throw new Error('No module loader was found');
+  }
+}).call(this)
\ No newline at end of file


[36/50] [abbrv] tinkerpop git commit: Removed server test that has been ignored for a while

Posted by sp...@apache.org.
Removed server test that has been ignored for a while

The shouldHandleRequestSentThatNeverReturns has never behaved consistently in test environment even when the feature works fine under manual test. No point letting it hang around any longer. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 2704245c2c64f0e1514aa4d6d2cd4c71f81c2511
Parents: 7c72e51
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 18 16:56:51 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 16:56:51 2017 -0400

----------------------------------------------------------------------
 .../server/GremlinDriverIntegrateTest.java      | 26 --------------------
 1 file changed, 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2704245c/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 70ed643..6d4f236 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
@@ -764,32 +764,6 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    @org.junit.Ignore("Can't seem to make this test pass consistently")
-    public void shouldHandleRequestSentThatNeverReturns() throws Exception {
-        final Cluster cluster = TestClientFactory.open();
-        final Client client = cluster.connect();
-
-        final ResultSet results = client.submit("Thread.sleep(10000); 'should-not-ever-get-back-coz-we-killed-the-server'");
-
-        stopServer();
-
-        // give the server a chance to kill everything
-        Thread.sleep(1000);
-
-        try {
-            results.all().get(10000, TimeUnit.MILLISECONDS);
-            fail("Server was stopped before the request could execute");
-        } catch (TimeoutException toe) {
-            fail("Should not have tossed a TimeOutException getting the result");
-        } catch (Exception ex) {
-            final Throwable cause = ExceptionUtils.getCause(ex);
-            assertThat(cause.getMessage(), containsString("rejected from java.util.concurrent.ThreadPoolExecutor"));
-        }
-
-        cluster.close();
-    }
-
-    @Test
     public void shouldFailClientSideWithTooLargeAResponse() {
         final Cluster cluster = TestClientFactory.build().maxContentLength(1).create();
         final Client client = cluster.connect();


[24/50] [abbrv] tinkerpop git commit: added references to thosee steps that support by(), to(), from(), and option(). as() was excluded as everything supports as.

Posted by sp...@apache.org.
added references to thosee steps that support by(), to(), from(), and option(). as() was excluded as everything supports as.


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

Branch: refs/heads/TINKERPOP-1489
Commit: 94f93055f5321a36f96b83fab1f380b6ae932e2c
Parents: bd4b989
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 12 14:42:11 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 12 14:42:11 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/94f93055/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index c54a9db..c7fbcde 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -425,6 +425,24 @@ g.V().group().by(bothE().count()).by(count())  <3>
 <2> `by('name')` will process the grouped elements by their name (*element property projection*).
 <3> `by(count())` will count the number of elements in each group (*traversal*).
 
+The following steps all support `by()`-modulation. Note that the semantics of such modulation should be understood
+on a step-by-step level and thus, as discussed in their respective section of the documentation.
+
+* <<dedup-step, `dedup()`>>: dedup on the results of a `by()`-modulation.
+* <<cyclicpath-step, `cyclicPath()`>>: filter if the traverser's path is cyclic given `by()`-modulation.
+* <<simplepath-step, `simplePath()`>>: filter if the traverser's path is simple given `by()`-modulation.
+* <<sample-step, `sample()`>>: sample using the value returned by `by()`-modulation.
+* <<where-step, `where()`>>: determine the predicate given the testing of the results of `by()`-modulation.
+* <<groupCount-step,`groupCount()`>>: count those groups where the group keys are the result of `by()`-modulation.
+* <<group-step, `group()`>>: create group keys and values according to `by()`-modulation.
+* <<order-step, `order()`>>: order the objects by the results of a `by()`-modulation.
+* <<path-step, `path()`>>: get the path of the traverser where each path element is `by()`-modulated.
+* <<project-step, `project()`>>: project a map of results given various `by()`-modulations off the current object.
+* <<select-step, `select()`>>: select path elements and transform them via `by()`-modulation.
+* <<tree-step, `tree()`>>: get a tree of traversers objects where the objects have been `by()`-modulated.
+* <<aggregate-step, `aggregate()`>>: aggregate all objects into a set but only store their `by()`-modulated values.
+* <<store-step, `store()`>>: store all objects into a set but only store their `by()`-modulated values.
+
 [[cap-step]]
 Cap Step
 ~~~~~~~~
@@ -724,6 +742,9 @@ The `from()`-step is not an actual step, but instead is a "step-modulator" simil
 <<by-step,`by()`>>. If a step is able to accept traversals or strings then `from()` is the
 means by which they are added. The general pattern is `step().from()`. See <<to-step,`to()`>>-step.
 
+The list of steps that support `from()`-modulation are: <<simplepath-step,`simplePath()`>>, <<cyclicpath-step,`cyclicPath()`>>,
+ <<path-step,`path()`>>, and <<addedge-step,`addE()`>>.
+
 [[group-step]]
 Group Step
 ~~~~~~~~~~
@@ -1288,8 +1309,7 @@ g.V().hasLabel('person').
 Option Step
 ~~~~~~~~~~~
 
-An option to a <<branch-step,`branch()`>> or <<choose-step,`choose()`>>
-
+An option to a <<branch-step,`branch()`>> or <<choose-step,`choose()`>>.
 
 [[optional-step]]
 Optional Step
@@ -2253,6 +2273,8 @@ The `to()`-step is not an actual step, but instead is a "step-modulator" similar
 <<by-step,`by()`>>. If a step is able to accept traversals or strings then `to()` is the
 means by which they are added. The general pattern is `step().to()`. See <<from-step,`from()`>>-step.
 
+The list of steps that support `to()`-modulation are: <<simplepath-step,`simplePath()`>>, <<cyclicpath-step,`cyclicPath()`>>,
+ <<path-step,`path()`>>, and <<addedge-step,`addE()`>>.
 
 [[tree-step]]
 Tree Step


[23/50] [abbrv] tinkerpop git commit: Added gremlin+beer image CTR

Posted by sp...@apache.org.
Added gremlin+beer image CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 937981a168ee46241f588d979aed476ab97cac26
Parents: fbed57b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 12 13:50:11 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 12 13:50:11 2017 -0400

----------------------------------------------------------------------
 docs/static/images/gremlin-beer.png | Bin 0 -> 208206 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/937981a1/docs/static/images/gremlin-beer.png
----------------------------------------------------------------------
diff --git a/docs/static/images/gremlin-beer.png b/docs/static/images/gremlin-beer.png
new file mode 100755
index 0000000..f9448e9
Binary files /dev/null and b/docs/static/images/gremlin-beer.png differ


[19/50] [abbrv] tinkerpop git commit: TINKERPOP-1718 Deprecated GryoLiteMessageSerializerV1d0

Posted by sp...@apache.org.
TINKERPOP-1718 Deprecated GryoLiteMessageSerializerV1d0

This is the "old" way of specifying detachment. Detachment is now best specified by `HaltedTraverserStrategy`.


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

Branch: refs/heads/TINKERPOP-1489
Commit: f97a21c8fee278e379ecbe6b4f2be40b37652469
Parents: 402678b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 10 10:20:54 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 10:20:54 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                              | 1 +
 docs/src/reference/gremlin-applications.asciidoc                | 1 -
 docs/src/reference/gremlin-variants.asciidoc                    | 1 -
 .../gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java       | 3 +++
 .../tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java | 2 --
 .../gremlin/python/driver/gremlin-server-modern-secure-py.yaml  | 1 -
 gremlin-server/conf/gremlin-server-classic.yaml                 | 1 -
 gremlin-server/conf/gremlin-server-modern-py.yaml               | 1 -
 gremlin-server/conf/gremlin-server-modern-readonly.yaml         | 1 -
 gremlin-server/conf/gremlin-server-modern.yaml                  | 1 -
 gremlin-server/conf/gremlin-server-neo4j.yaml                   | 1 -
 gremlin-server/conf/gremlin-server-secure.yaml                  | 1 -
 gremlin-server/conf/gremlin-server-spark.yaml                   | 1 -
 gremlin-server/conf/gremlin-server.yaml                         | 1 -
 .../apache/tinkerpop/gremlin/server/AbstractChannelizer.java    | 5 +++--
 15 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 96e79ab..582af8f 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ TinkerPop 3.2.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 This release also includes changes from <<release-3-1-8, 3.1.8>>.
 
 * `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.
+* Deprecated `GryoLiteMessageSerializerV1d0` in favor of `HaltedTraverserStrategy`.
 * Deprecated the `useMapperFromGraph` configuration option for Gremlin Server serializers.
 * `JavaTranslator` is now smart about handling `BulkSet` and `Tree`.
 * Added annotations to the traversal metrics pretty print.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index a936d3a..c212af8 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -415,7 +415,6 @@ $ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
 [INFO] GremlinServer - Executing start up LifeCycleHook
 [INFO] Logger$info - Loading 'modern' graph data.
 [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-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0
 [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.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index 39b5558..013e7be 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -151,7 +151,6 @@ $ bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml
 [INFO] GremlinServer - Executing start up LifeCycleHook
 [INFO] Logger$info - Loading 'modern' graph data.
 [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-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java
index 53825be..a9b1ac6 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.driver.ser;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
@@ -43,7 +44,9 @@ import java.util.Map;
  * as {@link ReferenceVertex} exclude the label and the properties associated with it and only return the identifier.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
+ * @deprecated As of release 3.2.6, not directly replaced - supported through {@link HaltedTraverserStrategy}.
  */
+@Deprecated
 public class GryoLiteMessageSerializerV1d0 extends AbstractGryoMessageSerializerV1d0 {
 
     private static final String MIME_TYPE = SerTokens.MIME_GRYO_LITE_V1D0;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
index 445b6cc..a80e0dd 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
@@ -26,8 +26,6 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
  * {@link DetachedVertex} include the label and the properties associated with it which could be more costly for
  * network serialization purposes.
  *
- * @see GryoLiteMessageSerializerV1d0
- *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class GryoMessageSerializerV1d0 extends AbstractGryoMessageSerializerV1d0 {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
index c87f4de..a1b595f 100644
--- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
+++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
@@ -42,7 +42,6 @@ scriptEngines: {
 }
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/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 9315ac8..b56960d 100644
--- a/gremlin-server/conf/gremlin-server-classic.yaml
+++ b/gremlin-server/conf/gremlin-server-classic.yaml
@@ -29,7 +29,6 @@ scriptEngines: {
     scripts: [scripts/generate-classic.groovy]}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/conf/gremlin-server-modern-py.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-py.yaml b/gremlin-server/conf/gremlin-server-modern-py.yaml
index 89b204f..a04681f 100644
--- a/gremlin-server/conf/gremlin-server-modern-py.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-py.yaml
@@ -44,7 +44,6 @@ scriptEngines: {
 }
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/conf/gremlin-server-modern-readonly.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
index 8c32f1f..c2073ea 100644
--- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -29,7 +29,6 @@ scriptEngines: {
     scripts: [scripts/generate-modern-readonly.groovy]}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/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 d8c6a45..16eba68 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -29,7 +29,6 @@ scriptEngines: {
     scripts: [scripts/generate-modern.groovy]}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/conf/gremlin-server-neo4j.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml
index da53572..8d91374 100644
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ b/gremlin-server/conf/gremlin-server-neo4j.yaml
@@ -40,7 +40,6 @@ scriptEngines: {
     scripts: [scripts/empty-sample.groovy]}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/conf/gremlin-server-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-secure.yaml b/gremlin-server/conf/gremlin-server-secure.yaml
index 6ea21d0..197e3a7 100644
--- a/gremlin-server/conf/gremlin-server-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-secure.yaml
@@ -43,7 +43,6 @@ scriptEngines: {
               "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider":["org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension"]}}}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/conf/gremlin-server-spark.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-spark.yaml b/gremlin-server/conf/gremlin-server-spark.yaml
index f096d41..5ff7cc8 100644
--- a/gremlin-server/conf/gremlin-server-spark.yaml
+++ b/gremlin-server/conf/gremlin-server-spark.yaml
@@ -53,7 +53,6 @@ scriptEngines: {
     scripts: [scripts/spark.groovy]}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/conf/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml
index 6ffc7b5..71d1d91 100644
--- a/gremlin-server/conf/gremlin-server.yaml
+++ b/gremlin-server/conf/gremlin-server.yaml
@@ -30,7 +30,6 @@ scriptEngines: {
     scripts: [scripts/empty-sample.groovy]}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f97a21c8/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index 476cdd5..45718e9 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -24,7 +24,6 @@ import io.netty.handler.ssl.SslContextBuilder;
 import io.netty.handler.ssl.SslProvider;
 import io.netty.handler.ssl.util.SelfSignedCertificate;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
-import org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
@@ -55,7 +54,6 @@ import java.util.Optional;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.stream.Stream;
-import java.util.Iterator;
 
 /**
  * A base implementation for the {@code Channelizer} which does a basic configuration of the pipeline, one that
@@ -199,6 +197,9 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
                     return Optional.<MessageSerializer>empty();
                 }
 
+                if (clazz.getAnnotation(Deprecated.class) != null)
+                    logger.warn("The {} serialization class is deprecated.", config.className);
+
                 final MessageSerializer serializer = (MessageSerializer) clazz.newInstance();
                 final Map<String, Graph> graphsDefinedAtStartup = new HashMap<>();
                 for (String graphName : settings.graphs.keySet()) {


[40/50] [abbrv] tinkerpop git commit: Filter out __() static method

Posted by sp...@apache.org.
Filter out __() static method


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

Branch: refs/heads/TINKERPOP-1489
Commit: a50baf0103f7defc1e913c94ce62024d82c30b73
Parents: d9ea1cf
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Wed Oct 19 16:03:45 2016 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 .../javascript/GraphTraversalSourceGenerator.groovy       |  1 +
 .../gremlin-javascript/process/graph-traversal.js         | 10 ----------
 2 files changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a50baf01/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
index a8217e2..0ae6079 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
@@ -195,6 +195,7 @@ class GraphTraversalSourceGenerator {
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { Modifier.isStatic(it.getModifiers()) }.
+                findAll { !it.name.equals("__") }.
                 collect { SymbolHelper.toJs(it.name) }.
                 unique().
                 sort { a, b -> a <=> b }.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a50baf01/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
index 663a24d..7f36e59 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
@@ -1080,16 +1080,6 @@
   };
 
   /**
-   * __() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.__ = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.__.apply(g, arguments);
-  };
-
-  /**
    * addE() static method
    * @param {...Object} args
    * @returns {GraphTraversal}


[03/50] [abbrv] tinkerpop git commit: fixed an apostrophe error noticed by @twilmes.

Posted by sp...@apache.org.
fixed an apostrophe error noticed by @twilmes.


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

Branch: refs/heads/TINKERPOP-1489
Commit: 41c16fa72d372ac0b3f8b42375cab0f6a81ca5e5
Parents: fb90f88
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Jun 30 14:33:02 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Jun 30 14:33:02 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/41c16fa7/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 3c52d5c..738255e 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2580,7 +2580,7 @@ A Note on Scopes
 
 The `Scope` enum has two constants: `Scope.local` and `Scope.global`. Scope determines whether the particular step
 being scoped is with respects to the current object (`local`) at that step or to the entire stream of objects up to that
-step ('global').
+step (`global`).
 
 [gremlin-groovy,modern]
 ----


[05/50] [abbrv] tinkerpop git commit: Merge branch 'tp31' into tp32

Posted by sp...@apache.org.
Merge branch 'tp31' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: beb9a84c58ce1d07dd95cfd57fe27f8b95b80cc4
Parents: c8cc0e5 8460854
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:45:35 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:45:35 2017 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc             | 8 ++++----
 docs/src/reference/intro.asciidoc                            | 2 +-
 .../groovy/plugin/UtilitiesGremlinPluginScript.groovy        | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/beb9a84c/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/gremlin-applications.asciidoc
index 0d93194,af9ae48..a936d3a
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@@ -102,9 -102,9 +102,9 @@@ more information on the `:plugin use` c
  These plugins can only be deactivated.
  
  The Gremlin Console is loaded and ready for commands. Recall that the console hosts the Gremlin-Groovy language.
- Please review link:http://groovy.codehaus.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
+ Please review link:http://www.groovy-lang.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
  superset of Java. What works in Java, works in Groovy. However, Groovy provides many shorthands to make it easier
 -to interact with the Java API.  Moreoever, Gremlin provides many neat shorthands to make it easier to express paths
 +to interact with the Java API.  Moreover, Gremlin provides many neat shorthands to make it easier to express paths
  through a property graph.
  
  [gremlin-groovy]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/beb9a84c/docs/src/reference/intro.asciidoc
----------------------------------------------------------------------


[34/50] [abbrv] tinkerpop git commit: Used WeakReference for evaluationFuture

Posted by sp...@apache.org.
Used WeakReference for evaluationFuture

Adjusted a previous commit - didn't get the last one right for some reason. The evaluationFuture holds on to the result and thus needs the WeakReference. In this way the result can be garbage collected once it goes out of scope and doesn't need to wait for the timeout to expire. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 362e77240925426574e925d665cd937507e9b698
Parents: 779399a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 18 09:30:52 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 09:30:52 2017 -0400

----------------------------------------------------------------------
 .../gremlin/groovy/engine/GremlinExecutor.java  | 36 ++++++++++++--------
 1 file changed, 21 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/362e7724/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 d02d773..da495e6 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
@@ -278,7 +278,7 @@ public class GremlinExecutor implements AutoCloseable {
         // override the timeout if the lifecycle has a value assigned
         final long scriptEvalTimeOut = lifeCycle.getScriptEvaluationTimeoutOverride().orElse(scriptEvaluationTimeout);
 
-        final CompletableFuture<Object> evaluationFuture = new CompletableFuture<>();
+        final WeakReference<CompletableFuture<Object>> evaluationFuture = new WeakReference<>(new CompletableFuture<>());
         final FutureTask<Void> evalFuture = new FutureTask<>(() -> {
             try {
                 lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings);
@@ -306,39 +306,45 @@ public class GremlinExecutor implements AutoCloseable {
                 // that must raise as an exception to the caller who has the returned evaluationFuture. in other words,
                 // if it occurs before this point, then the handle() method won't be called again if there is an
                 // exception that ends up below trying to completeExceptionally()
-                evaluationFuture.complete(result);
+                final CompletableFuture<Object> ef = evaluationFuture.get();
+                if (ef != null) ef.complete(result);
             } catch (Throwable ex) {
                 final Throwable root = null == ex.getCause() ? ex : ExceptionUtils.getRootCause(ex);
 
                 // thread interruptions will typically come as the result of a timeout, so in those cases,
                 // check for that situation and convert to TimeoutException
-                if (root instanceof InterruptedException) {
-                    lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
-                    evaluationFuture.completeExceptionally(new TimeoutException(
-                            String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]: %s", scriptEvalTimeOut, script, root.getMessage())));
-                } else {
-                    lifeCycle.getAfterFailure().orElse(afterFailure).accept(bindings, root);
-                    evaluationFuture.completeExceptionally(root);
+                final CompletableFuture<Object> ef = evaluationFuture.get();
+                if (ef != null) {
+                    if (root instanceof InterruptedException) {
+                        lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
+                        ef.completeExceptionally(new TimeoutException(
+                                String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]: %s", scriptEvalTimeOut, script, root.getMessage())));
+                    } else {
+                        lifeCycle.getAfterFailure().orElse(afterFailure).accept(bindings, root);
+                        ef.completeExceptionally(root);
+                    }
                 }
             }
 
             return null;
         });
 
-        final WeakReference<Future<?>> executionFuture = new WeakReference<>(executorService.submit(evalFuture));
+        final Future<?> executionFuture = executorService.submit(evalFuture);
         if (scriptEvalTimeOut > 0) {
             // Schedule a timeout in the thread pool for future execution
             scheduledExecutorService.schedule(() -> {
-                final Future<?> f = executionFuture.get();
-                if (f != null && f.cancel(true)) {
+                if (executionFuture.cancel(true)) {
                     lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
-                    evaluationFuture.completeExceptionally(new TimeoutException(
-                            String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]", scriptEvalTimeOut, script)));
+                    final CompletableFuture<Object> ef = evaluationFuture.get();
+                    if (ef != null) {
+                        ef.completeExceptionally(new TimeoutException(
+                                String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]", scriptEvalTimeOut, script)));
+                    }
                 }
             }, scriptEvalTimeOut, TimeUnit.MILLISECONDS);
         }
 
-        return evaluationFuture;
+        return evaluationFuture.get();
     }
 
     /**


[39/50] [abbrv] tinkerpop git commit: TINKERPOP-1489 Regenerated traversal.js

Posted by sp...@apache.org.
TINKERPOP-1489 Regenerated traversal.js

which added Pick.


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

Branch: refs/heads/TINKERPOP-1489
Commit: b8441c58294567da9be0ab7d0d8249d0c949aad0
Parents: 5f10891
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 18 12:48:27 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 .../src/main/javascript/gremlin-javascript/process/traversal.js     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8441c58/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
index f585161..9709a4f 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
@@ -377,6 +377,7 @@
     direction: toEnum('Direction', 'BOTH IN OUT'),
     operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
     order: toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr'),
+    pick: toEnum('Pick', 'any none'),
     pop: toEnum('Pop', 'all first last'),
     scope: toEnum('Scope', 'global local'),
     t: toEnum('T', 'id key label value')


[47/50] [abbrv] tinkerpop git commit: Update Javascript GLV

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/exports-test.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/exports-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/exports-test.js
new file mode 100644
index 0000000..3864a4a
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/exports-test.js
@@ -0,0 +1,73 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var assert = require('assert');
+var glvModule = require('../../');
+
+describe('API', function () {
+  it('should export fields under process', function () {
+    assert.ok(glvModule);
+    assert.ok(glvModule.process);
+    assert.strictEqual(typeof glvModule.process.Bytecode, 'function');
+    assert.strictEqual(typeof glvModule.process.EnumValue, 'function');
+    assert.strictEqual(typeof glvModule.process.P, 'function');
+    assert.strictEqual(typeof glvModule.process.Traversal, 'function');
+    assert.strictEqual(typeof glvModule.process.TraversalSideEffects, 'function');
+    assert.strictEqual(typeof glvModule.process.TraversalStrategies, 'function');
+    assert.strictEqual(typeof glvModule.process.TraversalStrategy, 'function');
+    assert.strictEqual(typeof glvModule.process.Traverser, 'function');
+    assert.strictEqual(typeof glvModule.process.GraphTraversal, 'function');
+    assert.strictEqual(typeof glvModule.process.GraphTraversalSource, 'function');
+    assert.strictEqual(typeof glvModule.process.barrier, 'object');
+    assert.strictEqual(typeof glvModule.process.cardinality, 'object');
+    assert.strictEqual(typeof glvModule.process.column, 'object');
+    assert.strictEqual(typeof glvModule.process.direction, 'object');
+    assert.strictEqual(typeof glvModule.process.direction.both, 'object');
+    assert.strictEqual(glvModule.process.direction.both.elementName, 'BOTH');
+    assert.strictEqual(typeof glvModule.process.operator, 'object');
+    assert.strictEqual(typeof glvModule.process.order, 'object');
+    assert.strictEqual(typeof glvModule.process.pop, 'object');
+    assert.strictEqual(typeof glvModule.process.scope, 'object');
+    assert.strictEqual(typeof glvModule.process.t, 'object');
+    assert.ok(glvModule.process.statics);
+  });
+  it('should expose fields under structure', function () {
+    assert.ok(glvModule.structure);
+    assert.ok(glvModule.structure.io);
+    assert.strictEqual(typeof glvModule.structure.io.GraphSONReader, 'function');
+    assert.strictEqual(typeof glvModule.structure.io.GraphSONWriter, 'function');
+    assert.strictEqual(typeof glvModule.structure.Edge, 'function');
+    assert.strictEqual(typeof glvModule.structure.Graph, 'function');
+    assert.strictEqual(typeof glvModule.structure.Path, 'function');
+    assert.strictEqual(typeof glvModule.structure.Property, 'function');
+    assert.strictEqual(typeof glvModule.structure.Vertex, 'function');
+    assert.strictEqual(typeof glvModule.structure.VertexProperty, 'function');
+  });
+  it('should expose fields under driver', function () {
+    assert.ok(glvModule.driver);
+    assert.strictEqual(typeof glvModule.driver.RemoteConnection, 'function');
+    assert.strictEqual(typeof glvModule.driver.RemoteStrategy, 'function');
+    assert.strictEqual(typeof glvModule.driver.RemoteTraversal, 'function');
+  });
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js
new file mode 100644
index 0000000..ed5beb3
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js
@@ -0,0 +1,112 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var assert = require('assert');
+var graph = require('../../lib/structure/graph');
+var t = require('../../lib/process/traversal.js');
+var gs = require('../../lib/structure/io/graph-serializer.js');
+var GraphSONReader = gs.GraphSONReader;
+var GraphSONWriter = gs.GraphSONWriter;
+var P = t.P;
+
+describe('GraphSONReader', function () {
+  it('should parse GraphSON int32, float and double to Number from GraphSON', function () {
+    var reader = new GraphSONReader();
+    [
+      [ 'g:Int32', 31 ],
+      [ 'g:Float', 31.3],
+      [ 'g:Double', 31.2]
+    ].forEach(function (item) {
+      var result = reader.read({
+        "@type": item[0],
+        "@value": item[1]
+      });
+      assert.strictEqual(typeof result, 'number');
+      assert.strictEqual(result, item[1]);
+    });
+  });
+  it('should parse vertices from GraphSON', function () {
+    var obj = {
+      "@type":"g:Vertex", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"person",
+        "properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],
+          "age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}};
+    var reader = new GraphSONReader(obj);
+    var result = reader.read(obj);
+    assert.ok(result instanceof graph.Vertex);
+    assert.strictEqual(result.label, 'person');
+    assert.strictEqual(typeof result.id, 'number');
+    assert.ok(result.properties);
+    assert.ok(result.properties['name']);
+    assert.strictEqual(result.properties['name'].length, 1);
+    assert.strictEqual(result.properties['name'][0].value, 'marko');
+    assert.ok(result.properties['age']);
+    assert.strictEqual(result.properties['age'].length, 1);
+    assert.strictEqual(result.properties['age'][0].value, 29);
+  });
+  it('should parse paths from GraphSON', function () {
+    var obj = {"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[
+      {
+        "@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person",
+        "properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},
+          "value":"marko","label":"name"}}],"age":[{
+              "@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},
+              "value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},
+      {
+        "@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software",
+        "properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},
+          "value":"lop","label":"name"}}],
+          "lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},
+            "value":"java","label":"lang"}}]}}},
+      "lop"]}};
+    var reader = new GraphSONReader(obj);
+    var result = reader.read(obj);
+    assert.ok(result);
+    assert.ok(result.objects);
+    assert.ok(result.labels);
+    assert.strictEqual(result.objects[2], 'lop');
+    assert.ok(result.objects[0] instanceof graph.Vertex);
+    assert.ok(result.objects[1] instanceof graph.Vertex);
+    assert.strictEqual(result.objects[0].label, 'person');
+    assert.strictEqual(result.objects[1].label, 'software');
+  });
+});
+describe('GraphSONWriter', function () {
+  it('should write numbers', function () {
+    var writer = new GraphSONWriter();
+    assert.strictEqual(writer.write(2), '2');
+  });
+  it('should write boolean values', function () {
+    var writer = new GraphSONWriter();
+    assert.strictEqual(writer.write(true), 'true');
+    assert.strictEqual(writer.write(false), 'false');
+  });
+  it('should write P', function () {
+    var writer = new GraphSONWriter();
+    var expected = JSON.stringify({"@type":"g:P","@value":{"predicate":"and","value":[
+      {"@type":"g:P","@value":{"predicate":"or","value":[{"@type":"g:P","@value":{"predicate":"lt","value":"b"}},
+        {"@type":"g:P","@value":{"predicate":"gt","value":"c"}}]}},
+      {"@type":"g:P","@value":{"predicate":"neq","value":"d"}}]}});
+    assert.strictEqual(writer.write(P.lt("b").or(P.gt("c")).and(P.neq("d"))), expected);
+  });
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js
new file mode 100644
index 0000000..c5271c9
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js
@@ -0,0 +1,119 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var assert = require('assert');
+var graph = require('../../lib/structure/graph');
+var utils = require('../../lib/utils');
+var t = require('../../lib/process/traversal');
+var TraversalStrategies = require('../../lib/process/traversal-strategy').TraversalStrategies;
+
+describe('Traversal', function () {
+  describe('#getByteCode()', function () {
+    it('should add steps for with a string parameter', function () {
+      var g = new graph.Graph().traversal();
+      var bytecode = g.V().out('created').getBytecode();
+      assert.ok(bytecode);
+      assert.strictEqual(bytecode.sourceInstructions.length, 0);
+      assert.strictEqual(bytecode.stepInstructions.length, 2);
+      assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
+      assert.strictEqual(bytecode.stepInstructions[1][0], 'out');
+      assert.strictEqual(bytecode.stepInstructions[1][1], 'created');
+    });
+    it('should add steps with an enum value', function () {
+      var g = new graph.Graph().traversal();
+      var bytecode = g.V().order().by('age', t.order.decr).getBytecode();
+      assert.ok(bytecode);
+      assert.strictEqual(bytecode.sourceInstructions.length, 0);
+      assert.strictEqual(bytecode.stepInstructions.length, 3);
+      assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
+      assert.strictEqual(bytecode.stepInstructions[1][0], 'order');
+      assert.strictEqual(bytecode.stepInstructions[2][0], 'by');
+      assert.strictEqual(bytecode.stepInstructions[2][1], 'age');
+      assert.strictEqual(typeof bytecode.stepInstructions[2][2], 'object');
+      assert.strictEqual(bytecode.stepInstructions[2][2].typeName, 'Order');
+      assert.strictEqual(bytecode.stepInstructions[2][2].elementName, 'decr');
+    });
+  });
+  describe('#next()', function () {
+    it('should apply the strategies and return a Promise with the iterator item', function () {
+      var strategyMock = {
+        apply: function (traversal) {
+          traversal.traversers = [ new t.Traverser(1, 1), new t.Traverser(2, 1) ];
+          return utils.resolvedPromise();
+        }
+      };
+      var strategies = new TraversalStrategies();
+      strategies.addStrategy(strategyMock);
+      var traversal = new t.Traversal(null, strategies, null);
+      return traversal.next()
+        .then(function (item) {
+          assert.strictEqual(item.value, 1);
+          assert.strictEqual(item.done, false);
+          return traversal.next();
+        })
+        .then(function (item) {
+          assert.strictEqual(item.value, 2);
+          assert.strictEqual(item.done, false);
+          return traversal.next();
+        })
+        .then(function (item) {
+          assert.strictEqual(item.value, null);
+          assert.strictEqual(item.done, true);
+          return traversal.next();
+        });
+    });
+  });
+  describe('#toList()', function () {
+    it('should apply the strategies and return a Promise with an array', function () {
+      var strategyMock = {
+        apply: function (traversal) {
+          traversal.traversers = [ new t.Traverser('a', 1), new t.Traverser('b', 1) ];
+          return utils.resolvedPromise();
+        }
+      };
+      var strategies = new TraversalStrategies();
+      strategies.addStrategy(strategyMock);
+      var traversal = new t.Traversal(null, strategies, null);
+      return traversal.toList().then(function (list) {
+        assert.ok(list);
+        assert.deepEqual(list, [ 'a', 'b' ]);
+      });
+    });
+    it('should return an empty array when traversers is empty', function () {
+      var strategyMock = {
+        apply: function (traversal) {
+          traversal.traversers = [];
+          return utils.resolvedPromise();
+        }
+      };
+      var strategies = new TraversalStrategies();
+      strategies.addStrategy(strategyMock);
+      var traversal = new t.Traversal(null, strategies, null);
+      return traversal.toList().then(function (list) {
+        assert.ok(Array.isArray(list));
+        assert.strictEqual(list.length, 0);
+      });
+    })
+  });
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js
deleted file mode 100644
index 858ed06..0000000
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/helper.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineHelperModule() {
-  "use strict";
-
-  var assert = {
-    ok: function (condition, message) {
-      if (!condition) {
-        throw new AssertError(message || (condition + ' == true'));
-      }
-    },
-    strictEqual: function (val1, val2, message) {
-      if (val1 !== val2) {
-        throw new AssertError(message || (val1 + ' === ' + val2));
-      }
-    }
-  };
-
-  function loadLibModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      moduleName = '../lib/' + moduleName;
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined' && typeof java !== 'undefined') {
-      moduleName = __DIR__ + '../../../main/javascript/gremlin-javascript/' + moduleName;
-      var path = new java.io.File(moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
-
-  function AssertError(message) {
-    Error.call(this, message);
-    this.stack = (new Error(message)).stack;
-    if (typeof print !== 'undefined') {
-      print(this.stack);
-    }
-  }
-
-  inherits(AssertError, Error);
-
-  function inherits(ctor, superCtor) {
-    ctor.super_ = superCtor;
-    ctor.prototype = Object.create(superCtor.prototype, {
-      constructor: {
-        value: ctor,
-        enumerable: false,
-        writable: true,
-        configurable: true
-      }
-    });
-  }
-  var toExport = {
-    assert: assert,
-    loadLibModule: loadLibModule
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  return toExport;
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
deleted file mode 100644
index b9265c7..0000000
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineTestCases() {
-  "use strict";
-
-  var helper = loadModule.call(this, './helper.js');
-  var assert = helper.assert;
-  var glvModule = helper.loadLibModule.call(this, './index.js');
-
-  [
-    function testExports() {
-      assert.ok(glvModule);
-
-      assert.ok(glvModule.process);
-      assert.strictEqual(typeof glvModule.process.Bytecode, 'function');
-      assert.strictEqual(typeof glvModule.process.EnumValue, 'function');
-      assert.strictEqual(typeof glvModule.process.P, 'function');
-      assert.strictEqual(typeof glvModule.process.Traversal, 'function');
-      assert.strictEqual(typeof glvModule.process.TraversalSideEffects, 'function');
-      assert.strictEqual(typeof glvModule.process.TraversalStrategies, 'function');
-      assert.strictEqual(typeof glvModule.process.TraversalStrategy, 'function');
-      assert.strictEqual(typeof glvModule.process.Traverser, 'function');
-      assert.strictEqual(typeof glvModule.process.GraphTraversal, 'function');
-      assert.strictEqual(typeof glvModule.process.GraphTraversalSource, 'function');
-      assert.strictEqual(typeof glvModule.process.barrier, 'object');
-      assert.strictEqual(typeof glvModule.process.cardinality, 'object');
-      assert.strictEqual(typeof glvModule.process.column, 'object');
-      assert.strictEqual(typeof glvModule.process.direction, 'object');
-      assert.strictEqual(typeof glvModule.process.operator, 'object');
-      assert.strictEqual(typeof glvModule.process.order, 'object');
-      assert.strictEqual(typeof glvModule.process.pop, 'object');
-      assert.strictEqual(typeof glvModule.process.scope, 'object');
-      assert.strictEqual(typeof glvModule.process.t, 'object');
-
-
-      assert.ok(glvModule.process.statics);
-
-      assert.ok(glvModule.structure);
-      assert.ok(glvModule.structure.io);
-      assert.strictEqual(typeof glvModule.structure.io.GraphSONReader, 'function');
-      assert.strictEqual(typeof glvModule.structure.io.GraphSONWriter, 'function');
-      assert.strictEqual(typeof glvModule.structure.Edge, 'function');
-      assert.strictEqual(typeof glvModule.structure.Graph, 'function');
-      assert.strictEqual(typeof glvModule.structure.Path, 'function');
-      assert.strictEqual(typeof glvModule.structure.Property, 'function');
-      assert.strictEqual(typeof glvModule.structure.Vertex, 'function');
-      assert.strictEqual(typeof glvModule.structure.VertexProperty, 'function');
-
-      assert.ok(glvModule.driver);
-      assert.strictEqual(typeof glvModule.driver.RemoteConnection, 'function');
-      assert.strictEqual(typeof glvModule.driver.RemoteStrategy, 'function');
-      assert.strictEqual(typeof glvModule.driver.RemoteTraversal, 'function');
-    }
-  ].forEach(function (testCase) {
-    testCase.call(null);
-  });
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      return load(__DIR__ + moduleName);
-    }
-    throw new Error('No module loader was found');
-  }
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
deleted file mode 100644
index 418a9dd..0000000
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineTestCases() {
-  "use strict";
-
-  var helper = loadModule.call(this, './helper.js');
-  var assert = helper.assert;
-  var graph = helper.loadLibModule.call(this, 'structure/graph.js');
-  var t = helper.loadLibModule.call(this, 'process/traversal.js');
-  var gs = helper.loadLibModule.call(this, 'structure/io/graph-serializer.js');
-  var GraphSONReader = gs.GraphSONReader;
-  var GraphSONWriter = gs.GraphSONWriter;
-  var P = t.P;
-
-  [
-    function testReadNumbers() {
-      var reader = new GraphSONReader();
-      [
-        [{
-          "@type": "g:Int32",
-          "@value": 31
-        }, 31],
-        [{
-          "@type": "g:Float",
-          "@value": 31.3
-        }, 31.3],
-        [{
-          "@type": "g:Double",
-          "@value": 31.2
-        }, 31.2]
-      ].forEach(function (item) {
-        var result = reader.read(item[0]);
-        assert.strictEqual(result, item[1]);
-        assert.strictEqual(typeof result, 'number');
-      });
-    },
-    function testReadGraph() {
-      var obj = {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9}, "inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}};
-      var reader = new GraphSONReader(obj);
-      var result = reader.read(obj);
-      assert.ok(result instanceof graph.Vertex);
-      assert.strictEqual(result.label, 'person');
-      assert.strictEqual(typeof result.id, 'number');
-    },
-    function testReadPath() {
-      var obj = {"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[
-        {"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},
-        {"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},
-        "lop"]}};
-      var reader = new GraphSONReader(obj);
-      var result = reader.read(obj);
-      assert.ok(result);
-      assert.ok(result.objects);
-      assert.ok(result.labels);
-      assert.strictEqual(result.objects[2], 'lop');
-      assert.ok(result.objects[0] instanceof graph.Vertex);
-      assert.ok(result.objects[1] instanceof graph.Vertex);
-      assert.strictEqual(result.objects[0].label, 'person');
-      assert.strictEqual(result.objects[1].label, 'software');
-    },
-    function testWriteNumber() {
-      var writer = new GraphSONWriter();
-      assert.strictEqual(writer.write(2), '2');
-    },
-    function testWriteBoolean() {
-      var writer = new GraphSONWriter();
-      assert.strictEqual(writer.write(true), 'true');
-      assert.strictEqual(writer.write(false), 'false');
-    },
-    function testWriteP() {
-      var writer = new GraphSONWriter();
-      var expected = JSON.stringify({"@type":"g:P","@value":{"predicate":"and","value":[{"@type":"g:P","@value":{"predicate":"or","value":[{"@type":"g:P","@value":{"predicate":"lt","value":"b"}},{"@type":"g:P","@value":{"predicate":"gt","value":"c"}}]}},{"@type":"g:P","@value":{"predicate":"neq","value":"d"}}]}});
-      assert.strictEqual(writer.write(P.lt("b").or(P.gt("c")).and(P.neq("d"))), expected);
-    }
-  ].forEach(function (testCase) {
-    testCase.call(null);
-  });
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      return load(__DIR__ + moduleName);
-    }
-    throw new Error('No module loader was found');
-  }
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
deleted file mode 100644
index 1ec4253..0000000
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineTestCases() {
-  "use strict";
-
-  var helper = loadModule.call(this, './helper.js');
-  var assert = helper.assert;
-  var graph = helper.loadLibModule.call(this, 'structure/graph.js');
-  var t = helper.loadLibModule.call(this, 'process/traversal.js');
-
-  [
-    function testBytecode1() {
-      var g = new graph.Graph().traversal();
-      var bytecode = g.V().out('created').getBytecode();
-      assert.ok(bytecode);
-      assert.strictEqual(bytecode.sourceInstructions.length, 0);
-      assert.strictEqual(bytecode.stepInstructions.length, 2);
-      assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
-      assert.strictEqual(bytecode.stepInstructions[1][0], 'out');
-      assert.strictEqual(bytecode.stepInstructions[1][1], 'created');
-    },
-    function testBytecode2() {
-      var g = new graph.Graph().traversal();
-      var bytecode = g.V().order().by('age', t.order.decr).getBytecode();
-      assert.ok(bytecode);
-      assert.strictEqual(bytecode.sourceInstructions.length, 0);
-      assert.strictEqual(bytecode.stepInstructions.length, 3);
-      assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
-      assert.strictEqual(bytecode.stepInstructions[1][0], 'order');
-      assert.strictEqual(bytecode.stepInstructions[2][0], 'by');
-      assert.strictEqual(bytecode.stepInstructions[2][1], 'age');
-      assert.strictEqual(typeof bytecode.stepInstructions[2][2], 'object');
-      assert.strictEqual(bytecode.stepInstructions[2][2].typeName, 'Order');
-      assert.strictEqual(bytecode.stepInstructions[2][2].elementName, 'decr');
-    }
-  ].forEach(function (testCase) {
-    testCase.call(null);
-  });
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      return load(__DIR__ + moduleName);
-    }
-    throw new Error('No module loader was found');
-  }
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8cd2aa4..b4f2e12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -321,6 +321,10 @@ limitations under the License.
                         <exclude>**/*.csproj</exclude>
                         <exclude>**/.vs/**</exclude>
                         <exclude>**/NuGet.Config</exclude>
+                        <exclude>**/gremlin-javascript/node_modules/**</exclude>
+                        <exclude>**/node/node_modules/**</exclude>
+                        <exclude>**/node/node</exclude>
+                        <exclude>**/npm-debug.log</exclude>
                     </excludes>
                     <licenses>
                         <license implementation="org.apache.rat.analysis.license.ApacheSoftwareLicense20"/>


[07/50] [abbrv] tinkerpop git commit: Minor tutorial fix

Posted by sp...@apache.org.
Minor tutorial fix


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

Branch: refs/heads/TINKERPOP-1489
Commit: 28ab372bc49194866d6899a92744159d10843400
Parents: 8460854
Author: Mihails Volkovs <mi...@gmail.com>
Authored: Tue Jul 4 17:37:09 2017 +0300
Committer: Mihails Volkovs <mi...@gmail.com>
Committed: Wed Jul 5 14:28:06 2017 +0300

----------------------------------------------------------------------
 docs/src/tutorials/getting-started/index.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28ab372b/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/tutorials/getting-started/index.asciidoc b/docs/src/tutorials/getting-started/index.asciidoc
index 7af5364..f5d9f86 100644
--- a/docs/src/tutorials/getting-started/index.asciidoc
+++ b/docs/src/tutorials/getting-started/index.asciidoc
@@ -535,7 +535,7 @@ containing a Gremlin script to be processed with results returned.
 $ curl -L -O https://www.apache.org/dist/tinkerpop/x.y.z/apache-tinkerpop-gremlin-server-x.y.z-bin.zip
 $ unzip apache-tinkerpop-gremlin-server-x.y.z-bin.zip
 $ cd apache-tinkerpop-gremlin-server-x.y.z
-$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
+$ bin/gremlin-server.sh conf/gremlin-server-rest-modern.yaml
 [INFO] GremlinServer -
          \,,,/
          (o o)


[10/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1710' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1710' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: 5f56495ef999800e67e68fcdbf359ba4cb3e363b
Parents: e12cc7c e962f59
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 08:53:30 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 08:53:30 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------



[12/50] [abbrv] tinkerpop git commit: TINKERPOP-1552 Bumped to dotnet-dev-1.0.4

Posted by sp...@apache.org.
TINKERPOP-1552 Bumped to dotnet-dev-1.0.4


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

Branch: refs/heads/TINKERPOP-1489
Commit: cc522be287fc70eecc5dbcfadefaf30d98d1c659
Parents: 79e37fb
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 11:51:01 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 11:51:01 2017 -0400

----------------------------------------------------------------------
 .travis.yml       | 2 +-
 docker/Dockerfile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc522be2/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 31a98a5..f0c88db 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,7 @@ before_install:
   - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
   - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
   - sudo apt-get update
-  - sudo apt-get install dotnet-dev-1.0.1
+  - sudo apt-get install dotnet-dev-1.0.4
 script: 
   - "mvn clean install -Dci"
 #notifications:

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc522be2/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 932536c..3e7ca42 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -26,7 +26,7 @@ RUN apt-get update \
     && sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' \
     && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 \
     && apt-get update \
-    && apt-get install -y oracle-java8-installer curl gawk git maven openssh-server dotnet-dev-1.0.1 \
+    && apt-get install -y oracle-java8-installer curl gawk git maven openssh-server dotnet-dev-1.0.4 \
     && rm -rf /var/lib/apt/lists/* /var/cache/oracle-jdk8-installer
 
 RUN sed -i 's@PermitRootLogin without-password@PermitRootLogin yes@' /etc/ssh/sshd_config


[11/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1708' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1708' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: 77d6dfdc34c296f7c337c583088a7c1fdc934280
Parents: 5f56495 f629033
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 08:54:39 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 08:54:39 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 53 ++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/77d6dfdc/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------


[15/50] [abbrv] tinkerpop git commit: [TINKERPOP-915]Add combined handler for Http and Websockets

Posted by sp...@apache.org.
[TINKERPOP-915]Add combined handler for Http and Websockets

[TINKERPOP-915](https://issues.apache.org/jira/browse/TINKERPOP-915)

Most of this is tests. I added an integration test that goes over the
functionality of both the http and websocket channelizers using the new
`WsAndHttpChannelizer`. I added an additional test on top of that to
switch between using WebSockets and http.

The change itself leverages the existing `WebSocketChannelizer` to
provide the base pipeline setup. It has everything needed handler-wise
to service both http and ws connections. The
`WsAndHttpChannelizerHandler` then detects whether the incoming request
is a plain http connection or a WebSockets connection. If it's an http
connection, the channelizer handler swaps out the request handler
appropriately for whether or not authentication has been enabled.


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

Branch: refs/heads/TINKERPOP-1489
Commit: c2643905ede89c2cb8580280dcf42ecfb4cdfe01
Parents: 402678b
Author: Keith Lohnes <kr...@us.ibm.com>
Authored: Tue May 30 10:02:54 2017 -0400
Committer: Keith Lohnes <kr...@us.ibm.com>
Committed: Thu Jul 6 11:07:22 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../src/reference/gremlin-applications.asciidoc |   7 +-
 .../upgrade/release-3.2.x-incubating.asciidoc   |   9 +
 .../gremlin/server/AbstractChannelizer.java     |  11 +-
 .../server/channel/WebSocketChannelizer.java    |   7 +-
 .../server/channel/WsAndHttpChannelizer.java    |  61 ++++
 .../SaslAndHttpBasicAuthenticationHandler.java  |  57 +++
 .../server/handler/WebSocketHandlerUtil.java    |  38 ++
 .../handler/WsAndHttpChannelizerHandler.java    |  87 +++++
 .../AbstractGremlinServerIntegrationTest.java   |  23 +-
 .../server/GremlinServerHttpIntegrateTest.java  |   6 -
 .../server/GremlinServerIntegrateTest.java      |  37 --
 ...tGremlminServerChannelizerIntegrateTest.java | 346 +++++++++++++++++++
 .../channel/HttpChannelizerIntegrateTest.java   |  56 +++
 .../channel/NioChannelizerIntegrateTest.java    |  56 +++
 .../WebSocketChannelizerIntegrateTest.java      |  56 +++
 .../WsAndHttpChannelizerIntegrateTest.java      |  58 ++++
 17 files changed, 864 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 96e79ab..b19b67e 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -38,6 +38,7 @@ This release also includes changes from <<release-3-1-8, 3.1.8>>.
 * Fixed `HADOOP_GREMLIN_LIBS` parsing for Windows.
 * Improved GraphSON serialization performance around `VertexProperty`.
 * Changed some tests in `EventStrategyProcessTest` which were enforcing some unintended semantics around transaction state.
+* Added WsAndHttpChannelizer and SaslAndHttpBasicAuthenticationHandler to be allow for servicing Http and Websocket requests to the same server
 
 [[release-3-2-5]]
 TinkerPop 3.2.5 (Release Date: June 12, 2017)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index a936d3a..4e367e9 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -861,13 +861,16 @@ as the API for the endpoint is very similar to Rexster's link:https://github.com
 
 Gremlin Server provides for a single REST endpoint - a Gremlin evaluator - which allows the submission of a Gremlin
 script as a request.  For each request, it returns a response containing the serialized results of that script.
-To enable this endpoint, Gremlin Server needs to be configured with the `HttpChannelizer`, which replaces the default
+To enable this endpoint, Gremlin Server needs to be configured with the `HttpChannelizer`, which replaces the default. The `WsAndHttpChannelizer` may also be configured to enable both WebSockets and the REST endpoint.
 `WebSocketChannelizer`, in the configuration file:
 
 [source,yaml]
 channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
 
-This setting is already configured in the `gremlin-server-rest-modern.yaml` file that is packaged with the Gremlin
+[source,yaml]
+channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
+
+The `HttpChannelizer` is already configured in the `gremlin-server-rest-modern.yaml` file that is packaged with the Gremlin
 Server distribution.  To utilize it, start Gremlin Server as follows:
 
 [source,text]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index aa98de4..b8348d3 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -39,6 +39,15 @@ it has not been promoted as the primary way to add `IoRegistry` instances to ser
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1694[TINKERPOP-1694]
 
+WsAndHttpChannelizer
+^^^^^^^^^^^^^^^^^^^^
+
+The `WsAndHttpChannelizer` has been added to allow for processing both WebSocket and Http requests on the same
+port and gremlin server. The `SaslAndHttpBasicAuthenticationHandler` has also been added to service
+authentication for both protocols in conjunction with the `SimpleAuthenticator`.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-915[TINKERPOP-915]
+
 Upgrading for Providers
 ~~~~~~~~~~~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index 476cdd5..22bb1eb 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -85,11 +85,18 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
     protected ExecutorService gremlinExecutorService;
     protected ScheduledExecutorService scheduledExecutorService;
 
+
+    public static final String PIPELINE_AUTHENTICATOR = "authenticator";
+    public static final String PIPELINE_REQUEST_HANDLER = "request-handler";
+    public static final String PIPELINE_HTTP_RESPONSE_ENCODER = "http-response-encoder";
+
     protected static final String PIPELINE_SSL = "ssl";
     protected static final String PIPELINE_OP_SELECTOR = "op-selector";
     protected static final String PIPELINE_RESULT_ITERATOR_HANDLER = "result-iterator-handler";
     protected static final String PIPELINE_OP_EXECUTOR = "op-executor";
-    protected static final String PIPELINE_AUTHENTICATOR = "authenticator";
+    protected static final String PIPELINE_HTTP_REQUEST_DECODER = "http-request-decoder";
+
+    protected static final String GREMLIN_ENDPOINT = "/gremlin";
 
     protected final Map<String, MessageSerializer> serializers = new HashMap<>();
 
@@ -272,8 +279,6 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
             builder = SslContextBuilder.forServer(keyCertChainFile, keyFile, sslSettings.keyPassword)
                     .trustManager(trustCertChainFile);
         }
-        
-        
 
         builder.clientAuth(sslSettings.needClientAuth).sslProvider(provider);
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
index 1b613a1..af41cc6 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
@@ -79,7 +79,7 @@ public class WebSocketChannelizer extends AbstractChannelizer {
 
         logger.debug("HttpRequestDecoder settings - maxInitialLineLength={}, maxHeaderSize={}, maxChunkSize={}",
                 settings.maxInitialLineLength, settings.maxHeaderSize, settings.maxChunkSize);
-        pipeline.addLast("http-request-decoder", new HttpRequestDecoder(settings.maxInitialLineLength, settings.maxHeaderSize, settings.maxChunkSize));
+        pipeline.addLast(PIPELINE_HTTP_REQUEST_DECODER, new HttpRequestDecoder(settings.maxInitialLineLength, settings.maxHeaderSize, settings.maxChunkSize));
 
         if (logger.isDebugEnabled())
             pipeline.addLast(new LoggingHandler("log-decoder-aggregator", LogLevel.DEBUG));
@@ -93,8 +93,9 @@ public class WebSocketChannelizer extends AbstractChannelizer {
         if (logger.isDebugEnabled())
             pipeline.addLast(new LoggingHandler("log-aggregator-encoder", LogLevel.DEBUG));
 
-        pipeline.addLast("http-response-encoder", new HttpResponseEncoder());
-        pipeline.addLast("request-handler", new WebSocketServerProtocolHandler("/gremlin", null, false, settings.maxContentLength));
+        pipeline.addLast(PIPELINE_HTTP_RESPONSE_ENCODER, new HttpResponseEncoder());
+
+        pipeline.addLast(PIPELINE_REQUEST_HANDLER, new WebSocketServerProtocolHandler(GREMLIN_ENDPOINT, null, false, settings.maxContentLength));
 
         if (logger.isDebugEnabled())
             pipeline.addLast(new LoggingHandler("log-aggregator-encoder", LogLevel.DEBUG));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
new file mode 100644
index 0000000..58885fb
--- /dev/null
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
@@ -0,0 +1,61 @@
+/*
+ * 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.server.channel;
+
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.ChannelPipeline;
+import io.netty.channel.EventLoopGroup;
+import io.netty.handler.codec.http.HttpObjectAggregator;
+import io.netty.handler.codec.http.HttpRequestDecoder;
+import io.netty.handler.codec.http.HttpResponseEncoder;
+import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
+import io.netty.handler.logging.LogLevel;
+import io.netty.handler.logging.LoggingHandler;
+import org.apache.tinkerpop.gremlin.server.AbstractChannelizer;
+import org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler;
+import org.apache.tinkerpop.gremlin.server.handler.WsAndHttpChannelizerHandler;
+import org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor;
+import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *A channelizer for port unification with websockets and http
+ *@author Keith Lohnes lohnesk@gmail.com
+ */
+
+public class WsAndHttpChannelizer extends AbstractChannelizer {
+
+    private static final Logger logger = LoggerFactory.getLogger(WsAndHttpChannelizer.class);
+
+    private WsAndHttpChannelizerHandler handler;
+
+    @Override
+    public void init(final ServerGremlinExecutor<EventLoopGroup> serverGremlinExecutor) {
+        super.init(serverGremlinExecutor);
+        handler = new WsAndHttpChannelizerHandler();
+        handler.init(serverGremlinExecutor, new HttpGremlinEndpointHandler(serializers, gremlinExecutor, graphManager, settings));
+    }
+
+    @Override
+    public void configure(final ChannelPipeline pipeline) {
+        handler.configure(pipeline);
+        pipeline.addAfter(PIPELINE_HTTP_REQUEST_DECODER, "WsAndHttpChannelizerHandler", handler);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAndHttpBasicAuthenticationHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAndHttpBasicAuthenticationHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAndHttpBasicAuthenticationHandler.java
new file mode 100644
index 0000000..d3e4cfe
--- /dev/null
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAndHttpBasicAuthenticationHandler.java
@@ -0,0 +1,57 @@
+/*
+ * 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.server.handler;
+
+import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelPipeline;
+import io.netty.handler.codec.http.HttpMessage;
+import org.apache.tinkerpop.gremlin.server.auth.Authenticator;
+import org.apache.tinkerpop.gremlin.server.handler.HttpBasicAuthenticationHandler;
+import org.apache.tinkerpop.gremlin.server.handler.SaslAuthenticationHandler;
+import org.apache.tinkerpop.gremlin.server.handler.WebSocketHandlerUtil;
+
+import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.PIPELINE_AUTHENTICATOR;
+
+/**
+ *An Authentication Handler for doing WebSocket Sasl and Http Basic auth
+ */
+@ChannelHandler.Sharable
+public class SaslAndHttpBasicAuthenticationHandler extends SaslAuthenticationHandler {
+
+    private final String HTTP_AUTH = "http-authentication";
+
+    public SaslAndHttpBasicAuthenticationHandler(final Authenticator authenticator) {
+        super(authenticator);
+    }
+
+    @Override
+    public void channelRead(final ChannelHandlerContext ctx, final Object obj) throws Exception {
+        if (obj instanceof HttpMessage && !WebSocketHandlerUtil.isWebSocket((HttpMessage)obj)) {
+            if (null == ctx.pipeline().get(HTTP_AUTH)) {
+                ctx.pipeline().addAfter(PIPELINE_AUTHENTICATOR, HTTP_AUTH, new HttpBasicAuthenticationHandler(authenticator));
+            }
+            ctx.fireChannelRead(obj);
+        } else {
+            super.channelRead(ctx, obj);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketHandlerUtil.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketHandlerUtil.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketHandlerUtil.java
new file mode 100644
index 0000000..2d571c0
--- /dev/null
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketHandlerUtil.java
@@ -0,0 +1,38 @@
+/*
+ * 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.server.handler;
+
+import io.netty.handler.codec.http.HttpMessage;
+
+import static io.netty.handler.codec.http.HttpHeaders.Names.UPGRADE;
+import static io.netty.handler.codec.http.HttpHeaders.Names.CONNECTION;
+
+/**
+ * A class to handle common WebSocket operations
+ * @author Keith Lohnes lohnesk@gmail.com
+ */
+final class WebSocketHandlerUtil {
+
+    static boolean isWebSocket(final HttpMessage msg) {
+        final String connectionHeader = msg.headers().get(CONNECTION);
+        final String upgradeHeader = msg.headers().get(UPGRADE);
+        return (null != connectionHeader && connectionHeader.equalsIgnoreCase("Upgrade")) ||
+               (null != upgradeHeader && upgradeHeader.equalsIgnoreCase("WebSocket"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
new file mode 100644
index 0000000..328a34b
--- /dev/null
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
@@ -0,0 +1,87 @@
+/*
+ * 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.server.handler;
+
+import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.ChannelPipeline;
+import io.netty.channel.EventLoopGroup;
+import io.netty.handler.codec.http.HttpMessage;
+import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
+import io.netty.handler.codec.http.HttpServerCodec;
+import org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer;
+import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
+import org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler;
+import org.apache.tinkerpop.gremlin.server.handler.WsAndHttpChannelizerHandler;
+import org.apache.tinkerpop.gremlin.server.handler.WebSocketHandlerUtil;
+import org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor;
+
+import static io.netty.handler.codec.http.HttpHeaders.Names.UPGRADE;
+import static io.netty.handler.codec.http.HttpHeaders.Names.CONNECTION;
+import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.PIPELINE_AUTHENTICATOR;
+import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.PIPELINE_REQUEST_HANDLER;
+import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.PIPELINE_HTTP_RESPONSE_ENCODER;
+
+/*
+ * A ChannelInboundHandlerAdapter for use with {@link WsAndHttpChannelizer} that toggles between WebSockets
+ * and http
+ * @author Keith Lohnes lohnesk@gmail.com
+ */
+@ChannelHandler.Sharable
+public class WsAndHttpChannelizerHandler extends ChannelInboundHandlerAdapter {
+
+    private final WebSocketChannelizer wsChannelizer = new WebSocketChannelizer();
+    private HttpGremlinEndpointHandler httpGremlinEndpointHandler;
+
+    public void init(final ServerGremlinExecutor<EventLoopGroup> serverGremlinExecutor, final HttpGremlinEndpointHandler httpGremlinEndpointHandler) {
+        //WebSocketChannelizer has everything needed for the http endpoint to work
+        wsChannelizer.init(serverGremlinExecutor);
+        this.httpGremlinEndpointHandler = httpGremlinEndpointHandler;
+    }
+
+    public void configure(final ChannelPipeline pipeline) {
+        wsChannelizer.configure(pipeline);
+    }
+
+    @Override
+    public void channelRead(final ChannelHandlerContext ctx, final Object obj) {
+        final ChannelPipeline pipeline = ctx.pipeline();
+        if (obj instanceof HttpMessage && !WebSocketHandlerUtil.isWebSocket((HttpMessage)obj)) {
+            if (null != pipeline.get(PIPELINE_AUTHENTICATOR)) {
+                pipeline.remove(PIPELINE_REQUEST_HANDLER);
+                final ChannelHandler authenticator = pipeline.get(PIPELINE_AUTHENTICATOR);
+                pipeline.remove(PIPELINE_AUTHENTICATOR);
+                pipeline.addAfter(PIPELINE_HTTP_RESPONSE_ENCODER, PIPELINE_AUTHENTICATOR, authenticator);
+                pipeline.addAfter(PIPELINE_AUTHENTICATOR, PIPELINE_REQUEST_HANDLER, this.httpGremlinEndpointHandler);
+            } else {
+                pipeline.remove(PIPELINE_REQUEST_HANDLER);
+                pipeline.addAfter(PIPELINE_HTTP_RESPONSE_ENCODER, PIPELINE_REQUEST_HANDLER, this.httpGremlinEndpointHandler);
+            }
+        }
+        ctx.fireChannelRead(obj);
+    }
+
+    @Override
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
+        ctx.close();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
index b8bf51f..7c124f0 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
@@ -62,6 +62,28 @@ public abstract class AbstractGremlinServerIntegrationTest {
         startServer();
     }
 
+    public void setUp(final Settings settings) throws Exception {
+        logger.info("* Testing: " + name.getMethodName());
+        logger.info("* Epoll option enabled:" + GREMLIN_SERVER_EPOLL);
+
+        startServer(settings);
+    }
+
+    public void startServer(final Settings settings) throws Exception {
+        if (null == settings) {
+            startServer();
+        } else {
+            final Settings overridenSettings = overrideSettings(settings);
+            ServerTestHelper.rewritePathsInGremlinServerSettings(overridenSettings);
+            if (GREMLIN_SERVER_EPOLL) {
+                overridenSettings.useEpollEventLoop = true;
+            }
+            this.server = new GremlinServer(overridenSettings);
+            server.start().join();
+
+        }
+    }
+
     public void startServer() throws Exception {
         final InputStream stream = getSettingsInputStream();
         final Settings settings = Settings.read(stream);
@@ -83,7 +105,6 @@ public abstract class AbstractGremlinServerIntegrationTest {
 
     public void stopServer() throws Exception {
         server.stop().join();
-
         // reset the OpLoader processors so that they can get reconfigured on startup - Settings may have changed
         // between tests
         OpLoader.reset();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/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 769ee88..90017a9 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
@@ -96,12 +96,6 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             case "should401OnGETWithInvalidPasswordAuthorizationHeader":
             case "should401OnPOSTWithInvalidPasswordAuthorizationHeader":
             case "should200OnGETWithAuthorizationHeader":
-            case "should200OnPOSTWithAuthorizationHeaderExplicitHandlerSetting":
-                configureForAuthenticationWithHandlerClass(settings);
-                break;
-            case "should200OnPOSTWithAuthorizationHeader":
-                configureForAuthentication(settings);
-                break;
             case "should401OnPOSTWithInvalidPasswordAuthorizationHeaderOld":
             case "should200OnPOSTWithAuthorizationHeaderOld":
                 configureForAuthenticationOld(settings);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/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 96ec17c..aad8131 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
@@ -56,7 +56,6 @@ import org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor;
 import org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
@@ -169,9 +168,6 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
             case "shouldBatchResultsByTwos":
                 settings.resultIterationBatchSize = 2;
                 break;
-            case "shouldWorkOverNioTransport":
-                settings.channelizer = NioChannelizer.class.getName();
-                break;
             case "shouldEnableSsl":
             case "shouldEnableSslButFailIfClientConnectsWithoutIt":
                 settings.ssl = new Settings.SslSettings();
@@ -212,11 +208,6 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
                 // Trust ONLY the server cert
                 settings.ssl.trustCertChainFile = SERVER_CRT;
             	break;
-            case "shouldStartWithDefaultSettings":
-                // test with defaults exception for port because we want to keep testing off of 8182
-                final Settings defaultSettings = new Settings();
-                defaultSettings.port = TestClientFactory.PORT;
-                return settings;
             case "shouldUseSimpleSandbox":
                 settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForSimpleSandbox();
                 break;
@@ -370,20 +361,6 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    public void shouldStartWithDefaultSettings() {
-        // just quickly validate that results are returning given defaults. no graphs are config'd with defaults
-        // so just eval a groovy script.
-        final Cluster cluster = TestClientFactory.open();
-        final Client client = cluster.connect();
-
-        final ResultSet results = client.submit("[1,2,3,4,5,6,7,8,9]");
-        final AtomicInteger counter = new AtomicInteger(0);
-        results.stream().map(i -> i.get(Integer.class) * 2).forEach(i -> assertEquals(counter.incrementAndGet() * 2, Integer.parseInt(i.toString())));
-
-        cluster.close();
-    }
-
-    @Test
     public void shouldEnableSsl() {
         final Cluster cluster = TestClientFactory.build().enableSsl(true).create();
         final Client client = cluster.connect();
@@ -709,20 +686,6 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    @SuppressWarnings("unchecked")
-    public void shouldWorkOverNioTransport() throws Exception {
-        try (SimpleClient client = TestClientFactory.createNioClient()) {
-            final RequestMessage request = RequestMessage.build(Tokens.OPS_EVAL)
-                    .addArg(Tokens.ARGS_GREMLIN, "[0,1,2,3,4,5,6,7,8,9,]").create();
-
-            final List<ResponseMessage> msg = client.submit(request);
-            assertEquals(1, msg.size());
-            final List<Integer> integers = (List<Integer>) msg.get(0).getResult().getData();
-            IntStream.rangeClosed(0, 9).forEach(i -> assertEquals(i, integers.get(i).intValue()));
-        }
-    }
-
-    @Test
     public void shouldNotThrowNoSuchElementException() throws Exception {
         try (SimpleClient client = TestClientFactory.createWebSocketClient()){
             // this should return "nothing" - there should be no exception

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java
new file mode 100644
index 0000000..738ca89
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java
@@ -0,0 +1,346 @@
+/*
+ * 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.server.channel;
+
+import org.apache.tinkerpop.gremlin.driver.AuthProperties;
+import org.apache.tinkerpop.gremlin.driver.Client;
+import org.apache.tinkerpop.gremlin.driver.Cluster;
+import org.apache.tinkerpop.gremlin.driver.Client;
+import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
+import org.apache.tinkerpop.gremlin.driver.Channelizer;
+import org.apache.tinkerpop.gremlin.server.AbstractGremlinServerIntegrationTest;
+import org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.server.TestClientFactory;
+
+
+import org.apache.http.Consts;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
+import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.rules.ExternalResource;
+
+import java.io.File;
+import java.io.InputStream;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Base64;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.apache.tinkerpop.gremlin.driver.AuthProperties.Property;
+
+abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGremlinServerIntegrationTest {
+
+    private final ObjectMapper mapper = new ObjectMapper();
+    private final Base64.Encoder encoder = Base64.getUrlEncoder();
+
+    protected static final String HTTP = "http";
+    protected static final String WS = "ws";
+    protected static final String HTTPS = "https";
+    protected static final String WSS = "wss";
+    protected static final String WS_AND_HTTP = "wsAndHttp";
+    protected static final String WSS_AND_HTTPS = "wssAndHttps";
+    protected static final String NIO = "nio";
+    protected static final String NIO_SECURE = "nioSecure";
+
+    public abstract String getProtocol();
+    public abstract String getSecureProtocol();
+    public abstract String getChannelizer();
+    public abstract Settings.AuthenticationSettings getAuthSettings();
+
+    /**
+     * Configure specific Gremlin Server settings for specific tests.
+     */
+    @Override
+    public Settings overrideSettings(final Settings settings) {
+        settings.channelizer = getChannelizer();
+        final String nameOfTest = name.getMethodName();
+        Settings.AuthenticationSettings authSettings = getAuthSettings();
+        switch (nameOfTest) {
+            case "shouldReturnResult":
+                break;
+            case "shouldWorkWithSSL":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                break;
+            case "shouldWorkWithAuth":
+                if (authSettings != null) {
+                    settings.authentication = getAuthSettings();
+                }
+                break;
+            case "shouldWorkWithSSLAndAuth":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                if (authSettings != null) {
+                    settings.authentication = getAuthSettings();
+                }
+                break;
+        }
+        return settings;
+    }
+
+    @Test
+    public void shouldReturnResult() throws Exception {
+        final CombinedTestClient client =  new CombinedTestClient(getProtocol());
+        try {
+            client.sendAndAssert("2+2", 4);
+        } finally {
+            client.close();
+        }
+    }
+
+    @Test
+    public void shouldWorkWithSSL() throws Exception {
+        final CombinedTestClient client =  new CombinedTestClient(getSecureProtocol());
+        try {
+            client.sendAndAssert("2+2", 4);
+        } finally {
+            client.close();
+        }
+    }
+
+    @Test
+    public void shouldWorkWithAuth() throws Exception {
+        CombinedTestClient client =  new CombinedTestClient(getProtocol());
+        try {
+            client.sendAndAssertUnauthorized("2+2", "stephen", "notpassword");
+            client.close();
+            client = new CombinedTestClient(getProtocol());
+            client.sendAndAssert("2+2", 4, "stephen", "password");
+            client.close();
+        } catch (Exception e) {
+            client.close();
+            throw e;
+        }
+    }
+
+    @Test
+    public void shouldWorkWithSSLAndAuth() throws Exception {
+        CombinedTestClient client =  new CombinedTestClient(getSecureProtocol());
+        try {
+            client.sendAndAssertUnauthorized("2+2", "stephen", "incorrect-password");
+            client.close();
+            client = new CombinedTestClient(getSecureProtocol());
+            client.sendAndAssert("2+2", 4, "stephen", "password");
+            client.close();
+        } catch (Exception e) {
+            client.close();
+            throw e;
+        }
+    }
+
+    public class CombinedTestClient {
+        private CloseableHttpClient httpClient = null;
+        private Cluster wsCluster = null;
+        private Cluster.Builder wsBuilder = null;
+        private Cluster nioCluster = null;
+        private Cluster.Builder nioBuilder = null;
+        private Client wsClient = null;
+        private Client.ClusteredClient nioClient = null;
+        private boolean secure = false;
+
+
+        public CombinedTestClient(final String protocol) throws Exception {
+            switch (protocol) {
+                case HTTP:
+                    httpClient = HttpClients.createDefault();
+                    break;
+                case HTTPS:
+                    httpClient = createSslHttpClient();
+                    secure = true;
+                    break;
+                case WS:
+                    this.wsBuilder = TestClientFactory.build();
+                    break;
+                case WSS:
+                    this.wsBuilder = TestClientFactory.build();
+                    secure = true;
+                    break;
+                case WS_AND_HTTP:
+                    httpClient = HttpClients.createDefault();
+                    this.wsBuilder = TestClientFactory.build();
+                    break;
+                case WSS_AND_HTTPS:
+                    httpClient = createSslHttpClient();
+                    secure = true;
+                    this.wsBuilder = TestClientFactory.build();
+                    break;
+                case NIO:
+                    this.nioBuilder = TestClientFactory.build();
+                    break;
+                case NIO_SECURE:
+                    this.nioBuilder = TestClientFactory.build();
+                    secure = true;
+                    break;
+            }
+        }
+
+        private CloseableHttpClient createSslHttpClient() throws Exception {
+            final SSLContextBuilder wsBuilder = new SSLContextBuilder();
+            wsBuilder.loadTrustMaterial(null, new TrustStrategy() {
+                @Override
+                public boolean isTrusted(X509Certificate[] chain,
+                    String authType) throws CertificateException {
+                    return true;
+                }
+            });
+            final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(wsBuilder.build(),
+                new AllowAllHostnameVerifier());
+            //This winds up using a PoolingHttpClientConnectionManager so need to pass the
+            //RegistryBuilder
+            final Registry<ConnectionSocketFactory> registry = RegistryBuilder
+                .<ConnectionSocketFactory> create().register("https", sslsf)
+                .build();
+            final PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(registry);
+            return HttpClients
+                .custom()
+                .setConnectionManager(cm)
+                .build();
+
+        }
+
+        public void sendAndAssert(final String gremlin, Object result) throws Exception {
+            sendAndAssert(gremlin, result, null, null);
+        }
+
+        public void close() {
+            if (wsCluster != null) {
+                wsCluster.close();
+            }
+            if (nioCluster != null) {
+                nioCluster.close();
+            }
+        }
+
+        public void sendAndAssertUnauthorized(final String gremlin, final String username, final String password) throws Exception {
+            if (httpClient != null) {
+                final HttpPost httpPost = createPost(gremlin, username, password);
+                try (final CloseableHttpResponse response = httpClient.execute(httpPost)) {
+                    assertEquals(401, response.getStatusLine().getStatusCode());
+                }
+            }
+            if (wsBuilder != null) {
+                setWsClient(username, password);
+                try {
+                    wsClient.submit(gremlin).all().get();
+                    fail("Should not authorize on incorrect auth creds");
+                } catch(Exception e) {
+                    assertEquals("Username and/or password are incorrect", e.getCause().getMessage());
+                }
+            }
+            if (nioBuilder != null) {
+                setNioClient(username, password);
+                try {
+                    nioClient.submit(gremlin);
+                } catch(Exception e) {
+                    assertEquals("Username and/or password are incorrect", e.getCause().getMessage());
+                }
+            }
+
+        }
+
+        public void sendAndAssert(final String gremlin, final Object result, final String username, final String password) throws Exception {
+            if (httpClient != null) {
+                final HttpPost httpPost = createPost(gremlin, username, password);
+                try (final CloseableHttpResponse response = httpClient.execute(httpPost)) {
+                    assertEquals(200, response.getStatusLine().getStatusCode());
+                    assertEquals("application/json", response.getEntity().getContentType().getValue());
+                    final String json = EntityUtils.toString(response.getEntity());
+                    final JsonNode node = mapper.readTree(json);
+                    assertEquals(result, node.get("result").get("data").get(0).intValue());
+                }
+            }
+            if (wsBuilder != null) {
+                setWsClient(username, password);
+                assertEquals(result, wsClient.submit(gremlin).all().get().get(0).getInt());
+            }
+            if (nioClient != null) {
+                assertEquals(result, nioClient.submit(gremlin).all().get().get(0).getInt());
+            }
+        }
+
+        private void setNioClient(final String username, final String password) {
+            nioBuilder.channelizer(Channelizer.NioChannelizer.class.getName());
+            if (username != null && password != null) {
+                final AuthProperties authProps = new AuthProperties()
+                                                .with(Property.USERNAME, username)
+                                                .with(Property.PASSWORD, password);
+
+                nioCluster = nioBuilder.enableSsl(secure).authProperties(authProps).create();
+                nioClient = nioCluster.connect();
+            } else {
+                nioCluster = nioBuilder.enableSsl(secure).create();
+                nioClient = nioCluster.connect();
+            }
+        }
+
+        private void setWsClient(final String username, final String password) {
+            if (username != null && password != null) {
+                final AuthProperties authProps = new AuthProperties()
+                                                .with(Property.USERNAME, username)
+                                                .with(Property.PASSWORD, password);
+
+                wsCluster = wsBuilder.enableSsl(secure).authProperties(authProps).create();
+                wsClient = wsCluster.connect();
+            } else {
+                wsCluster = wsBuilder.enableSsl(secure).create();
+                wsClient = wsCluster.connect();
+            }
+        }
+
+        private HttpPost createPost(final String gremlin, final String username, final String password) {
+            String urlString = TestClientFactory.createURLString();
+            if (secure) {
+                urlString = urlString.replace("http", "https");
+            }
+            final HttpPost httpPost = new HttpPost(urlString);
+            httpPost.addHeader("Content-Type", "application/json");
+            if (username != null && password != null) {
+                final String auth = encoder.encodeToString((username + ":" + password).getBytes());
+                httpPost.addHeader("Authorization", "Basic " + auth);
+            }
+            final String jsonBody = String.format("{\"gremlin\": \"%s\"}", gremlin);
+            httpPost.setEntity(new StringEntity(jsonBody, Consts.UTF_8));
+            return httpPost;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/HttpChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/HttpChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/HttpChannelizerIntegrateTest.java
new file mode 100644
index 0000000..22cb2da
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/HttpChannelizerIntegrateTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.server.channel;
+
+
+import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
+import org.apache.tinkerpop.gremlin.server.Settings;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class HttpChannelizerIntegrateTest extends AbstractGremlinServerChannelizerIntegrateTest {
+
+    @Override
+    public String getProtocol() {
+        return HTTP;
+    }
+
+    @Override
+    public String getSecureProtocol() {
+        return HTTPS;
+    }
+
+    @Override
+    public String getChannelizer() {
+        return HttpChannelizer.class.getName();
+    }
+
+    @Override
+    public Settings.AuthenticationSettings getAuthSettings() {
+        final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
+        final Map<String,Object> authConfig = new HashMap<>();
+        authSettings.authenticator = SimpleAuthenticator.class.getName();
+        authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-credentials.properties");
+        authSettings.config = authConfig;
+
+        return authSettings;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/NioChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/NioChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/NioChannelizerIntegrateTest.java
new file mode 100644
index 0000000..8388b40
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/NioChannelizerIntegrateTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.server.channel;
+
+
+import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
+import org.apache.tinkerpop.gremlin.server.Settings;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class NioChannelizerIntegrateTest extends AbstractGremlinServerChannelizerIntegrateTest {
+
+    @Override
+    public String getProtocol() {
+        return NIO;
+    }
+
+    @Override
+    public String getSecureProtocol() {
+        return NIO_SECURE;
+    }
+
+    @Override
+    public String getChannelizer() {
+        return NioChannelizer.class.getName();
+    }
+
+    @Override
+    public Settings.AuthenticationSettings getAuthSettings() {
+        final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
+        final Map<String,Object> authConfig = new HashMap<>();
+        authSettings.authenticator = SimpleAuthenticator.class.getName();
+        authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-credentials.properties");
+        authSettings.config = authConfig;
+
+        return authSettings;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizerIntegrateTest.java
new file mode 100644
index 0000000..9ae600e
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizerIntegrateTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.server.channel;
+
+
+import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
+import org.apache.tinkerpop.gremlin.server.Settings;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class WebSocketChannelizerIntegrateTest extends AbstractGremlinServerChannelizerIntegrateTest {
+
+    @Override
+    public String getProtocol() {
+        return WS;
+    }
+
+    @Override
+    public String getSecureProtocol() {
+        return WSS;
+    }
+
+    @Override
+    public String getChannelizer() {
+        return WebSocketChannelizer.class.getName();
+    }
+
+    @Override
+    public Settings.AuthenticationSettings getAuthSettings() {
+        final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
+        final Map<String,Object> authConfig = new HashMap<>();
+        authSettings.authenticator = SimpleAuthenticator.class.getName();
+        authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-credentials.properties");
+        authSettings.config = authConfig;
+
+        return authSettings;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2643905/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizerIntegrateTest.java
new file mode 100644
index 0000000..0bda809
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizerIntegrateTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.server.channel;
+
+
+import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
+import org.apache.tinkerpop.gremlin.server.handler.SaslAndHttpBasicAuthenticationHandler;
+import org.apache.tinkerpop.gremlin.server.Settings;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class WsAndHttpChannelizerIntegrateTest extends AbstractGremlinServerChannelizerIntegrateTest {
+
+    @Override
+    public String getProtocol() {
+        return WS_AND_HTTP;
+    }
+
+    @Override
+    public String getSecureProtocol() {
+        return WSS_AND_HTTPS;
+    }
+
+    @Override
+    public String getChannelizer() {
+        return WsAndHttpChannelizer.class.getName();
+    }
+
+    @Override
+    public Settings.AuthenticationSettings getAuthSettings() {
+        final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
+        final Map<String,Object> authConfig = new HashMap<>();
+        authSettings.authenticator = SimpleAuthenticator.class.getName();
+        authSettings.authenticationHandler = SaslAndHttpBasicAuthenticationHandler.class.getName();
+        authConfig.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-credentials.properties");
+        authSettings.config = authConfig;
+
+        return authSettings;
+    }
+
+}


[14/50] [abbrv] tinkerpop git commit: Didn't account for a null value in the config

Posted by sp...@apache.org.
Didn't account for a null value in the config

When the warn message got added it didn't account for null configs. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 402678b1bb6bfb9f6c94dd1281969018d1b2637a
Parents: 77d6dfd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 10:13:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 10:17:49 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/AbstractChannelizer.java       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/402678b1/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index 0a784d9..476cdd5 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -200,16 +200,17 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
                 }
 
                 final MessageSerializer serializer = (MessageSerializer) clazz.newInstance();
-                final Map<String, Graph> graphsDefinedAtStartup = new HashMap<String, Graph>();
+                final Map<String, Graph> graphsDefinedAtStartup = new HashMap<>();
                 for (String graphName : settings.graphs.keySet()) {
                     graphsDefinedAtStartup.put(graphName, graphManager.getGraph(graphName));
                 }
 
-                if (config.config.containsKey(AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH))
-                    logger.warn("{} utilizes the {} configuration setting which is deprecated - prefer use of {}", config.className, AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH, AbstractGryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES);
+                if (config.config != null) {
+                    if (config.config.containsKey(AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH))
+                        logger.warn("{} utilizes the {} configuration setting which is deprecated - prefer use of {}", config.className, AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH, AbstractGryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES);
 
-                if (config.config != null)
                     serializer.configure(config.config, graphsDefinedAtStartup);
+                }
 
                 return Optional.ofNullable(serializer);
             } catch (ClassNotFoundException cnfe) {


[20/50] [abbrv] tinkerpop git commit: Fixed bad link CTR

Posted by sp...@apache.org.
Fixed bad link CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: bd4b98957818650e3daeed7fd37dd124a0b9b31d
Parents: 31daf32
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 11 07:45:23 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 07:45:23 2017 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/administration.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bd4b9895/docs/src/dev/developer/administration.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/administration.asciidoc b/docs/src/dev/developer/administration.asciidoc
index ddf6719..eef199b 100644
--- a/docs/src/dev/developer/administration.asciidoc
+++ b/docs/src/dev/developer/administration.asciidoc
@@ -101,7 +101,7 @@ productivity.
 
 Finally, new committers should be sent an email that covers some of the administrative elements of their new role:
 
-* link:http://www.apache.org/dev/committers.html[Apache Committer Guide]
+* link:https://www.apache.org/dev/new-committers-guide.html[Apache Committer Guide]
 * link:http://www.apache.org/dev/committers.html[Apache Committer FAQ]
 * link:http://tinkerpop.apache.org/docs/current/dev/developer/[TinkerPop Developer Documentation]
 ** Bring specific attention to the "committer" section which describes our general policies.


[49/50] [abbrv] tinkerpop git commit: Update Javascript GLV

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
new file mode 100644
index 0000000..5ee734a1
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
@@ -0,0 +1,2095 @@
+/*
+ *  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.
+ */
+ 
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var t = require('./traversal.js');
+var remote = require('../driver/remote-connection');
+var utils = require('../utils');
+var Bytecode = require('./bytecode');
+var TraversalStrategies = require('./traversal-strategy').TraversalStrategies;
+var inherits = utils.inherits;
+var parseArgs = utils.parseArgs;
+
+/**
+ *
+ * @param {Graph} graph
+ * @param {TraversalStrategies} traversalStrategies
+ * @param {Bytecode} [bytecode]
+ * @constructor
+ */
+function GraphTraversalSource(graph, traversalStrategies, bytecode) {
+  this.graph = graph;
+  this.traversalStrategies = traversalStrategies;
+  this.bytecode = bytecode || new Bytecode();
+}
+
+/**
+ * @param remoteConnection
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
+  var traversalStrategy = new TraversalStrategies(this.traversalStrategies);
+  traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
+  return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
+};
+
+/**
+ * Returns the string representation of the GraphTraversalSource.
+ * @returns {string}
+ */
+GraphTraversalSource.prototype.toString = function () {
+  return 'graphtraversalsource[' + this.graph.toString() + ']';
+};
+
+/**
+ * Graph Traversal Source withBulk method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withBulk = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Graph Traversal Source withComputer method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withComputer = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withComputer', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Graph Traversal Source withPath method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withPath = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withPath', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Graph Traversal Source withSack method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withSack = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withSack', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Graph Traversal Source withSideEffect method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withSideEffect = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Graph Traversal Source withStrategies method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withStrategies = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Graph Traversal Source withoutStrategies method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withoutStrategies = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * E GraphTraversalSource step method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversalSource.prototype.E = function (args) {
+  var b = new Bytecode(this.bytecode).addStep('E', parseArgs.apply(null, arguments));
+  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * V GraphTraversalSource step method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversalSource.prototype.V = function (args) {
+  var b = new Bytecode(this.bytecode).addStep('V', parseArgs.apply(null, arguments));
+  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * addV GraphTraversalSource step method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversalSource.prototype.addV = function (args) {
+  var b = new Bytecode(this.bytecode).addStep('addV', parseArgs.apply(null, arguments));
+  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * inject GraphTraversalSource step method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversalSource.prototype.inject = function (args) {
+  var b = new Bytecode(this.bytecode).addStep('inject', parseArgs.apply(null, arguments));
+  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
+
+/**
+ * Represents a graph traversal.
+ * @extends Traversal
+ * @constructor
+ */
+function GraphTraversal(graph, traversalStrategies, bytecode) {
+  t.Traversal.call(this, graph, traversalStrategies, bytecode);
+}
+
+inherits(GraphTraversal, t.Traversal);
+
+/**
+ * Graph traversal V method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.V = function (args) {
+  this.bytecode.addStep('V', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal addE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.addE = function (args) {
+  this.bytecode.addStep('addE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal addInE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.addInE = function (args) {
+  this.bytecode.addStep('addInE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal addOutE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.addOutE = function (args) {
+  this.bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal addV method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.addV = function (args) {
+  this.bytecode.addStep('addV', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal aggregate method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.aggregate = function (args) {
+  this.bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal and method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.and = function (args) {
+  this.bytecode.addStep('and', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal as method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.as = function (args) {
+  this.bytecode.addStep('as', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal barrier method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.barrier = function (args) {
+  this.bytecode.addStep('barrier', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal both method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.both = function (args) {
+  this.bytecode.addStep('both', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal bothE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.bothE = function (args) {
+  this.bytecode.addStep('bothE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal bothV method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.bothV = function (args) {
+  this.bytecode.addStep('bothV', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal branch method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.branch = function (args) {
+  this.bytecode.addStep('branch', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal by method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.by = function (args) {
+  this.bytecode.addStep('by', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal cap method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.cap = function (args) {
+  this.bytecode.addStep('cap', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal choose method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.choose = function (args) {
+  this.bytecode.addStep('choose', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal coalesce method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.coalesce = function (args) {
+  this.bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal coin method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.coin = function (args) {
+  this.bytecode.addStep('coin', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal constant method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.constant = function (args) {
+  this.bytecode.addStep('constant', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal count method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.count = function (args) {
+  this.bytecode.addStep('count', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal cyclicPath method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.cyclicPath = function (args) {
+  this.bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal dedup method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.dedup = function (args) {
+  this.bytecode.addStep('dedup', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal drop method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.drop = function (args) {
+  this.bytecode.addStep('drop', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal emit method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.emit = function (args) {
+  this.bytecode.addStep('emit', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal filter method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.filter = function (args) {
+  this.bytecode.addStep('filter', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal flatMap method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.flatMap = function (args) {
+  this.bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal fold method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.fold = function (args) {
+  this.bytecode.addStep('fold', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal from method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.from_ = function (args) {
+  this.bytecode.addStep('from', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal group method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.group = function (args) {
+  this.bytecode.addStep('group', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal groupCount method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.groupCount = function (args) {
+  this.bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal groupV3d0 method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.groupV3d0 = function (args) {
+  this.bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal has method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.has = function (args) {
+  this.bytecode.addStep('has', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal hasId method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.hasId = function (args) {
+  this.bytecode.addStep('hasId', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal hasKey method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.hasKey = function (args) {
+  this.bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal hasLabel method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.hasLabel = function (args) {
+  this.bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal hasNot method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.hasNot = function (args) {
+  this.bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal hasValue method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.hasValue = function (args) {
+  this.bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal id method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.id = function (args) {
+  this.bytecode.addStep('id', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal identity method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.identity = function (args) {
+  this.bytecode.addStep('identity', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal in method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.in_ = function (args) {
+  this.bytecode.addStep('in', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal inE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.inE = function (args) {
+  this.bytecode.addStep('inE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal inV method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.inV = function (args) {
+  this.bytecode.addStep('inV', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal inject method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.inject = function (args) {
+  this.bytecode.addStep('inject', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal is method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.is = function (args) {
+  this.bytecode.addStep('is', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal key method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.key = function (args) {
+  this.bytecode.addStep('key', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal label method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.label = function (args) {
+  this.bytecode.addStep('label', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal limit method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.limit = function (args) {
+  this.bytecode.addStep('limit', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal local method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.local = function (args) {
+  this.bytecode.addStep('local', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal loops method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.loops = function (args) {
+  this.bytecode.addStep('loops', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal map method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.map = function (args) {
+  this.bytecode.addStep('map', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal mapKeys method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.mapKeys = function (args) {
+  this.bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal mapValues method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.mapValues = function (args) {
+  this.bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal match method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.match = function (args) {
+  this.bytecode.addStep('match', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal max method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.max = function (args) {
+  this.bytecode.addStep('max', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal mean method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.mean = function (args) {
+  this.bytecode.addStep('mean', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal min method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.min = function (args) {
+  this.bytecode.addStep('min', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal not method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.not = function (args) {
+  this.bytecode.addStep('not', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal option method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.option = function (args) {
+  this.bytecode.addStep('option', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal optional method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.optional = function (args) {
+  this.bytecode.addStep('optional', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal or method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.or = function (args) {
+  this.bytecode.addStep('or', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal order method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.order = function (args) {
+  this.bytecode.addStep('order', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal otherV method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.otherV = function (args) {
+  this.bytecode.addStep('otherV', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal out method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.out = function (args) {
+  this.bytecode.addStep('out', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal outE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.outE = function (args) {
+  this.bytecode.addStep('outE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal outV method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.outV = function (args) {
+  this.bytecode.addStep('outV', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal pageRank method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.pageRank = function (args) {
+  this.bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal path method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.path = function (args) {
+  this.bytecode.addStep('path', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal peerPressure method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.peerPressure = function (args) {
+  this.bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal profile method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.profile = function (args) {
+  this.bytecode.addStep('profile', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal program method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.program = function (args) {
+  this.bytecode.addStep('program', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal project method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.project = function (args) {
+  this.bytecode.addStep('project', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal properties method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.properties = function (args) {
+  this.bytecode.addStep('properties', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal property method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.property = function (args) {
+  this.bytecode.addStep('property', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal propertyMap method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.propertyMap = function (args) {
+  this.bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal range method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.range = function (args) {
+  this.bytecode.addStep('range', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal repeat method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.repeat = function (args) {
+  this.bytecode.addStep('repeat', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal sack method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.sack = function (args) {
+  this.bytecode.addStep('sack', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal sample method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.sample = function (args) {
+  this.bytecode.addStep('sample', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal select method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.select = function (args) {
+  this.bytecode.addStep('select', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal sideEffect method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.sideEffect = function (args) {
+  this.bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal simplePath method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.simplePath = function (args) {
+  this.bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal store method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.store = function (args) {
+  this.bytecode.addStep('store', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal subgraph method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.subgraph = function (args) {
+  this.bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal sum method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.sum = function (args) {
+  this.bytecode.addStep('sum', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal tail method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.tail = function (args) {
+  this.bytecode.addStep('tail', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal timeLimit method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.timeLimit = function (args) {
+  this.bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal times method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.times = function (args) {
+  this.bytecode.addStep('times', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal to method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.to = function (args) {
+  this.bytecode.addStep('to', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal toE method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.toE = function (args) {
+  this.bytecode.addStep('toE', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal toV method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.toV = function (args) {
+  this.bytecode.addStep('toV', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal tree method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.tree = function (args) {
+  this.bytecode.addStep('tree', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal unfold method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.unfold = function (args) {
+  this.bytecode.addStep('unfold', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal union method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.union = function (args) {
+  this.bytecode.addStep('union', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal until method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.until = function (args) {
+  this.bytecode.addStep('until', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal value method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.value = function (args) {
+  this.bytecode.addStep('value', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal valueMap method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.valueMap = function (args) {
+  this.bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal values method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.values = function (args) {
+  this.bytecode.addStep('values', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Graph traversal where method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.where = function (args) {
+  this.bytecode.addStep('where', parseArgs.apply(null, arguments));
+  return this;
+};
+
+/**
+ * Contains the static method definitions
+ * @type {Object}
+ */
+var statics = {};
+
+/**
+ * V() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.V = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.V.apply(g, arguments);
+};
+
+/**
+ * addE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.addE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.addE.apply(g, arguments);
+};
+
+/**
+ * addInE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.addInE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.addInE.apply(g, arguments);
+};
+
+/**
+ * addOutE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.addOutE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.addOutE.apply(g, arguments);
+};
+
+/**
+ * addV() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.addV = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.addV.apply(g, arguments);
+};
+
+/**
+ * aggregate() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.aggregate = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.aggregate.apply(g, arguments);
+};
+
+/**
+ * and() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.and = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.and.apply(g, arguments);
+};
+
+/**
+ * as() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.as = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.as.apply(g, arguments);
+};
+
+/**
+ * barrier() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.barrier = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.barrier.apply(g, arguments);
+};
+
+/**
+ * both() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.both = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.both.apply(g, arguments);
+};
+
+/**
+ * bothE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.bothE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.bothE.apply(g, arguments);
+};
+
+/**
+ * bothV() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.bothV = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.bothV.apply(g, arguments);
+};
+
+/**
+ * branch() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.branch = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.branch.apply(g, arguments);
+};
+
+/**
+ * cap() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.cap = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.cap.apply(g, arguments);
+};
+
+/**
+ * choose() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.choose = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.choose.apply(g, arguments);
+};
+
+/**
+ * coalesce() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.coalesce = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.coalesce.apply(g, arguments);
+};
+
+/**
+ * coin() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.coin = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.coin.apply(g, arguments);
+};
+
+/**
+ * constant() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.constant = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.constant.apply(g, arguments);
+};
+
+/**
+ * count() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.count = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.count.apply(g, arguments);
+};
+
+/**
+ * cyclicPath() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.cyclicPath = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.cyclicPath.apply(g, arguments);
+};
+
+/**
+ * dedup() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.dedup = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.dedup.apply(g, arguments);
+};
+
+/**
+ * drop() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.drop = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.drop.apply(g, arguments);
+};
+
+/**
+ * emit() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.emit = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.emit.apply(g, arguments);
+};
+
+/**
+ * filter() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.filter = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.filter.apply(g, arguments);
+};
+
+/**
+ * flatMap() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.flatMap = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.flatMap.apply(g, arguments);
+};
+
+/**
+ * fold() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.fold = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.fold.apply(g, arguments);
+};
+
+/**
+ * group() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.group = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.group.apply(g, arguments);
+};
+
+/**
+ * groupCount() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.groupCount = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.groupCount.apply(g, arguments);
+};
+
+/**
+ * groupV3d0() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.groupV3d0 = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.groupV3d0.apply(g, arguments);
+};
+
+/**
+ * has() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.has = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.has.apply(g, arguments);
+};
+
+/**
+ * hasId() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.hasId = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.hasId.apply(g, arguments);
+};
+
+/**
+ * hasKey() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.hasKey = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.hasKey.apply(g, arguments);
+};
+
+/**
+ * hasLabel() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.hasLabel = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.hasLabel.apply(g, arguments);
+};
+
+/**
+ * hasNot() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.hasNot = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.hasNot.apply(g, arguments);
+};
+
+/**
+ * hasValue() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.hasValue = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.hasValue.apply(g, arguments);
+};
+
+/**
+ * id() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.id = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.id.apply(g, arguments);
+};
+
+/**
+ * identity() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.identity = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.identity.apply(g, arguments);
+};
+
+/**
+ * inE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.inE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.inE.apply(g, arguments);
+};
+
+/**
+ * inV() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.inV = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.inV.apply(g, arguments);
+};
+
+/**
+ * in_() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.in_ = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.in_.apply(g, arguments);
+};
+
+/**
+ * inject() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.inject = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.inject.apply(g, arguments);
+};
+
+/**
+ * is() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.is = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.is.apply(g, arguments);
+};
+
+/**
+ * key() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.key = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.key.apply(g, arguments);
+};
+
+/**
+ * label() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.label = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.label.apply(g, arguments);
+};
+
+/**
+ * limit() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.limit = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.limit.apply(g, arguments);
+};
+
+/**
+ * local() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.local = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.local.apply(g, arguments);
+};
+
+/**
+ * loops() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.loops = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.loops.apply(g, arguments);
+};
+
+/**
+ * map() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.map = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.map.apply(g, arguments);
+};
+
+/**
+ * mapKeys() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.mapKeys = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.mapKeys.apply(g, arguments);
+};
+
+/**
+ * mapValues() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.mapValues = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.mapValues.apply(g, arguments);
+};
+
+/**
+ * match() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.match = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.match.apply(g, arguments);
+};
+
+/**
+ * max() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.max = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.max.apply(g, arguments);
+};
+
+/**
+ * mean() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.mean = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.mean.apply(g, arguments);
+};
+
+/**
+ * min() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.min = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.min.apply(g, arguments);
+};
+
+/**
+ * not() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.not = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.not.apply(g, arguments);
+};
+
+/**
+ * optional() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.optional = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.optional.apply(g, arguments);
+};
+
+/**
+ * or() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.or = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.or.apply(g, arguments);
+};
+
+/**
+ * order() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.order = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.order.apply(g, arguments);
+};
+
+/**
+ * otherV() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.otherV = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.otherV.apply(g, arguments);
+};
+
+/**
+ * out() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.out = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.out.apply(g, arguments);
+};
+
+/**
+ * outE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.outE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.outE.apply(g, arguments);
+};
+
+/**
+ * outV() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.outV = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.outV.apply(g, arguments);
+};
+
+/**
+ * path() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.path = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.path.apply(g, arguments);
+};
+
+/**
+ * project() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.project = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.project.apply(g, arguments);
+};
+
+/**
+ * properties() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.properties = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.properties.apply(g, arguments);
+};
+
+/**
+ * property() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.property = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.property.apply(g, arguments);
+};
+
+/**
+ * propertyMap() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.propertyMap = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.propertyMap.apply(g, arguments);
+};
+
+/**
+ * range() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.range = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.range.apply(g, arguments);
+};
+
+/**
+ * repeat() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.repeat = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.repeat.apply(g, arguments);
+};
+
+/**
+ * sack() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.sack = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.sack.apply(g, arguments);
+};
+
+/**
+ * sample() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.sample = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.sample.apply(g, arguments);
+};
+
+/**
+ * select() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.select = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.select.apply(g, arguments);
+};
+
+/**
+ * sideEffect() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.sideEffect = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.sideEffect.apply(g, arguments);
+};
+
+/**
+ * simplePath() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.simplePath = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.simplePath.apply(g, arguments);
+};
+
+/**
+ * start() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.start = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.start.apply(g, arguments);
+};
+
+/**
+ * store() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.store = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.store.apply(g, arguments);
+};
+
+/**
+ * subgraph() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.subgraph = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.subgraph.apply(g, arguments);
+};
+
+/**
+ * sum() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.sum = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.sum.apply(g, arguments);
+};
+
+/**
+ * tail() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.tail = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.tail.apply(g, arguments);
+};
+
+/**
+ * timeLimit() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.timeLimit = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.timeLimit.apply(g, arguments);
+};
+
+/**
+ * times() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.times = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.times.apply(g, arguments);
+};
+
+/**
+ * to() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.to = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.to.apply(g, arguments);
+};
+
+/**
+ * toE() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.toE = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.toE.apply(g, arguments);
+};
+
+/**
+ * toV() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.toV = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.toV.apply(g, arguments);
+};
+
+/**
+ * tree() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.tree = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.tree.apply(g, arguments);
+};
+
+/**
+ * unfold() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.unfold = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.unfold.apply(g, arguments);
+};
+
+/**
+ * union() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.union = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.union.apply(g, arguments);
+};
+
+/**
+ * until() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.until = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.until.apply(g, arguments);
+};
+
+/**
+ * value() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.value = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.value.apply(g, arguments);
+};
+
+/**
+ * valueMap() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.valueMap = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.valueMap.apply(g, arguments);
+};
+
+/**
+ * values() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.values = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.values.apply(g, arguments);
+};
+
+/**
+ * where() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.where = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.where.apply(g, arguments);
+};
+
+module.exports = {
+  GraphTraversal: GraphTraversal,
+  GraphTraversalSource: GraphTraversalSource,
+  statics: statics
+};

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
new file mode 100644
index 0000000..22d6498
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
@@ -0,0 +1,88 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var utils = require('../utils');
+
+/**
+ * Creates a new instance of TraversalStrategies.
+ * @param {TraversalStrategies} [parent] The parent strategies from where to clone the values from.
+ * @param {Function} [promiseFactory] The factory used to create the A+ Promise instances. Use it when you want to
+ * create Promise instances without using ECMAScript Promise constructor, ie: bluebird or Q promises.
+ * @constructor
+ */
+function TraversalStrategies(parent, promiseFactory) {
+  if (parent) {
+    // Clone the strategies
+    this.strategies = parent.strategies.slice(0);
+    this.promiseFactory = parent.promiseFactory;
+  }
+  else {
+    this.strategies = [];
+  }
+  if (promiseFactory) {
+    this.promiseFactory = promiseFactory;
+  }
+}
+
+/** @param {TraversalStrategy} strategy */
+TraversalStrategies.prototype.addStrategy = function (strategy) {
+  this.strategies.push(strategy);
+};
+
+/**
+ * @param {Traversal} traversal
+ * @returns {Promise}
+ */
+TraversalStrategies.prototype.applyStrategies = function (traversal) {
+  // Apply all strategies serially
+  var self = this;
+  return this.strategies.reduce(function reduceItem(promise, strategy) {
+    return promise.then(function () {
+      return strategy.apply(traversal, self.promiseFactory);
+    });
+  }, utils.resolvedPromise(this.promiseFactory));
+};
+
+/**
+ * @abstract
+ * @constructor
+ */
+function TraversalStrategy() {
+
+}
+
+/**
+ * @abstract
+ * @param {Traversal} traversal
+ * @param {Function|undefined} promiseFactory
+ * @returns {Promise}
+ */
+TraversalStrategy.prototype.apply = function (traversal, promiseFactory) {
+
+};
+
+module.exports = {
+  TraversalStrategies: TraversalStrategies,
+  TraversalStrategy: TraversalStrategy
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
new file mode 100644
index 0000000..1cd6b53
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
@@ -0,0 +1,236 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var utils = require('../utils');
+var parseArgs = utils.parseArgs;
+var itemDone = Object.freeze({ value: null, done: true });
+var emptyArray = Object.freeze([]);
+
+function Traversal(graph, traversalStrategies, bytecode) {
+  this.graph = graph;
+  this.traversalStrategies = traversalStrategies;
+  this.bytecode = bytecode;
+  this.traversers = null;
+  this.sideEffects = null;
+  this._traversalStrategiesPromise = null;
+  this._traversersIteratorIndex = 0;
+}
+
+/** @returns {Bytecode} */
+Traversal.prototype.getBytecode = function () {
+  return this.bytecode;
+};
+
+/**
+ * Returns an Array containing the traverser objects.
+ * @returns {Promise.<Array>}
+ */
+Traversal.prototype.toList = function () {
+  var self = this;
+  return this._applyStrategies().then(function () {
+    if (!self.traversers || self._traversersIteratorIndex === self.traversers.length) {
+      return emptyArray;
+    }
+    var arr = new Array(self.traversers.length - self._traversersIteratorIndex);
+    for (var i = self._traversersIteratorIndex; i < self.traversers.length; i++) {
+      arr[i] = self.traversers[i].object;
+    }
+    self._traversersIteratorIndex = self.traversers.length;
+    return arr;
+  });
+};
+
+/**
+ * Async iterator method implementation.
+ * Returns a promise containing an iterator item.
+ * @returns {Promise.<{value, done}>}
+ */
+Traversal.prototype.next = function () {
+  var self = this;
+  return this._applyStrategies().then(function () {
+    if (!self.traversers || self._traversersIteratorIndex === self.traversers.length) {
+      return itemDone;
+    }
+    return { value: self.traversers[self._traversersIteratorIndex++].object, done: false };
+  });
+};
+
+Traversal.prototype._applyStrategies = function () {
+  if (this._traversalStrategiesPromise) {
+    // Apply strategies only once
+    return this._traversalStrategiesPromise;
+  }
+  return this._traversalStrategiesPromise = this.traversalStrategies.applyStrategies(this);
+};
+
+/**
+ * Returns the Bytecode JSON representation of the traversal
+ * @returns {String}
+ */
+Traversal.prototype.toString = function () {
+  return this.bytecode.toString();
+};
+  
+/**
+ * Represents an operation.
+ * @constructor
+ */
+function P(operator, value, other) {
+  this.operator = operator;
+  this.value = value;
+  this.other = other;
+}
+
+/**
+ * Returns the string representation of the instance.
+ * @returns {string}
+ */
+P.prototype.toString = function () {
+  if (this.other === undefined) {
+    return this.operator + '(' + this.value + ')';
+  }
+  return this.operator + '(' + this.value + ', ' + this.other + ')';
+};
+
+function createP(operator, args) {
+  args.unshift(null, operator);
+  return new (Function.prototype.bind.apply(P, args));
+}
+
+/** @param {...Object} args */
+P.between = function (args) {
+  return createP('between', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.eq = function (args) {
+  return createP('eq', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.gt = function (args) {
+  return createP('gt', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.gte = function (args) {
+  return createP('gte', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.inside = function (args) {
+  return createP('inside', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.lt = function (args) {
+  return createP('lt', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.lte = function (args) {
+  return createP('lte', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.neq = function (args) {
+  return createP('neq', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.not = function (args) {
+  return createP('not', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.outside = function (args) {
+  return createP('outside', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.test = function (args) {
+  return createP('test', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.within = function (args) {
+  return createP('within', parseArgs.apply(null, arguments));
+};
+
+/** @param {...Object} args */
+P.without = function (args) {
+  return createP('without', parseArgs.apply(null, arguments));
+};
+
+P.prototype.and = function (arg) {
+  return new P('and', this, arg);
+};
+
+P.prototype.or = function (arg) {
+  return new P('or', this, arg);
+};
+
+function Traverser(object, bulk) {
+  this.object = object;
+  this.bulk = bulk == undefined ? 1 : bulk;
+}
+
+function TraversalSideEffects() {
+
+}
+
+function toEnum(typeName, keys) {
+  var result = {};
+  keys.split(' ').forEach(function (k) {
+    var jsKey = k;
+    if (jsKey === jsKey.toUpperCase()) {
+      jsKey = jsKey.toLowerCase();
+    }
+    result[jsKey] = new EnumValue(typeName, k);
+  });
+  return result;
+}
+
+function EnumValue(typeName, elementName) {
+  this.typeName = typeName;
+  this.elementName = elementName;
+}
+
+module.exports = {
+  EnumValue: EnumValue,
+  P: P,
+  Traversal: Traversal,
+  TraversalSideEffects: TraversalSideEffects,
+  Traverser: Traverser,
+  barrier: toEnum('Barrier', 'normSack'),
+  cardinality: toEnum('Cardinality', 'list set single'),
+  column: toEnum('Column', 'keys values'),
+  direction: toEnum('Direction', 'BOTH IN OUT'),
+  operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
+  order: toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr'),
+  pick: toEnum('Pick', 'any none'),
+  pop: toEnum('Pop', 'all first last'),
+  scope: toEnum('Scope', 'global local'),
+  t: toEnum('T', 'id key label value')
+};

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
new file mode 100644
index 0000000..4ef3fd5
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
@@ -0,0 +1,138 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var gt = require('../process/graph-traversal');
+var t = require('../process/traversal');
+var TraversalStrategies = require('../process/traversal-strategy').TraversalStrategies;
+var utils = require('../utils');
+var inherits = utils.inherits;
+
+function Graph() {
+
+}
+
+/**
+ * Returns the graph traversal source.
+ * @returns {GraphTraversalSource}
+ */
+Graph.prototype.traversal = function () {
+  return new gt.GraphTraversalSource(this, new TraversalStrategies());
+};
+
+Graph.prototype.toString = function () {
+  return 'graph[empty]';
+};
+
+function Element(id, label) {
+  this.id = id;
+  this.label = label;
+}
+
+/**
+ * Compares this instance to another and determines if they can be considered as equal.
+ * @param {Element} other
+ * @returns {boolean}
+ */
+Element.prototype.equals = function (other) {
+  return (other instanceof Element) && this.id === other.id;
+};
+
+function Vertex(id, label, properties) {
+  Element.call(this, id, label);
+  this.properties = properties;
+}
+
+Vertex.prototype.toString = function () {
+  return 'v[' + this.id + ']';
+};
+
+inherits(Vertex, Element);
+
+function Edge(id, outV, label, inV, properties) {
+  Element.call(this, id, label);
+  this.outV = outV;
+  this.inV = inV;
+  this.properties = {};
+  (function adaptProperties(self) {
+    if (properties) {
+      var keys = Object.keys(properties);
+      for (var i = 0; i < keys.length; i++) {
+        var k = keys[i];
+        self.properties[k] = properties[k].value;
+      }
+    }
+  })(this);
+}
+
+inherits(Edge, Element);
+
+Edge.prototype.toString = function () {
+  return 'e[' + this.id + '][' + this.outV.id + '-' + this.label + '->' + this.inV.id + ']';
+};
+
+function VertexProperty(id, label, value, properties) {
+  Element.call(this, id, label);
+  this.value = value;
+  this.key = this.label;
+  this.properties = properties;
+}
+
+inherits(VertexProperty, Element);
+
+VertexProperty.prototype.toString = function () {
+  return 'vp[' + this.label + '->' + this.value.substr(0, 20) + ']';
+};
+
+function Property(key, value) {
+  this.key = key;
+  this.value = value;
+}
+
+Property.prototype.toString = function () {
+  return 'p[' + this.key + '->' + this.value.substr(0, 20) + ']';
+};
+
+Property.prototype.equals = function (other) {
+  return (other instanceof Property) && this.key === other.key && this.value === other.value;
+};
+
+/**
+ * Represents a walk through a graph as defined by a traversal.
+ * @param {Array} labels
+ * @param {Array} objects
+ * @constructor
+ */
+function Path(labels, objects) {
+  this.labels = labels;
+  this.objects = objects;
+}
+
+module.exports = {
+  Edge: Edge,
+  Graph: Graph,
+  Path: Path,
+  Property: Property,
+  Vertex: Vertex,
+  VertexProperty: VertexProperty
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
new file mode 100644
index 0000000..46d251e
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
@@ -0,0 +1,398 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var t = require('../../process/traversal');
+var Bytecode = require('../../process/bytecode');
+var g = require('../graph.js');
+
+/**
+ * A type serializer
+ * @typedef {Object} Serializer
+ * @property {Function} serialize
+ * @property {Function} deserialize
+ * @property {Function} [canBeUsedFor]
+ */
+
+/**
+ * @const
+ * @private
+ */
+var valueKey = '@value';
+
+/**
+ * @const
+ * @private
+ */
+var typeKey = '@type';
+
+var deserializers = {
+  'g:Traverser': TraverserSerializer,
+  'g:Int32':  NumberSerializer,
+  'g:Int64':  NumberSerializer,
+  'g:Float':  NumberSerializer,
+  'g:Double': NumberSerializer,
+  'g:Vertex': VertexSerializer,
+  'g:Edge': EdgeSerializer,
+  'g:VertexProperty': VertexPropertySerializer,
+  'g:Property': PropertySerializer,
+  'g:Path': PathSerializer
+};
+
+var serializers = [
+  NumberSerializer,
+  BytecodeSerializer,
+  TraverserSerializer,
+  PSerializer,
+  LambdaSerializer,
+  EnumSerializer
+];
+
+/**
+ * GraphSON Writer
+ * @param {Object} [options]
+ * @param {Object} options.serializers An object used as an associative array with GraphSON 2 type name as keys and
+ * serializer instances as values, ie: { 'g:Int64': longSerializer }.
+ * @constructor
+ */
+function GraphSONWriter(options) {
+  this._options = options || {};
+  // Create instance of the default serializers
+  this._serializers = serializers.map(function (serializerConstructor) {
+    var s = new serializerConstructor();
+    s.writer = this;
+    return s;
+  }, this);
+  var customSerializers = this._options.serializers || {};
+  Object.keys(customSerializers).forEach(function (key) {
+    var s = customSerializers[key];
+    if (!s.serialize) {
+      return;
+    }
+    s.writer = this;
+    // Insert custom serializers first
+    this._serializers.unshift(s);
+  }, this);
+}
+
+GraphSONWriter.prototype.adaptObject = function (value) {
+  var s;
+  if (Array.isArray(value)) {
+    return value.map(function (item) {
+      return this.adaptObject(item);
+    }, this);
+  }
+  for (var i = 0; i < this._serializers.length; i++) {
+    var currentSerializer = this._serializers[i];
+    if (currentSerializer.canBeUsedFor && currentSerializer.canBeUsedFor(value)) {
+      s = currentSerializer;
+      break;
+    }
+  }
+  if (s) {
+    return s.serialize(value);
+  }
+  // Default (strings / objects / ...)
+  return value;
+};
+
+/**
+ * Returns the GraphSON representation of the provided object instance.
+ * @param {Object} obj
+ * @returns {String}
+ */
+GraphSONWriter.prototype.write = function (obj) {
+  return JSON.stringify(this.adaptObject(obj));
+};
+
+/**
+ * GraphSON Reader
+ * @param {Object} [options]
+ * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
+ * deserializer instances as values, ie: { 'g:Int64': longSerializer }.
+ * @constructor
+ */
+function GraphSONReader(options) {
+  this._options = options || {};
+  this._deserializers = {};
+  Object.keys(deserializers).forEach(function (typeName) {
+    var serializerConstructor = deserializers[typeName];
+    var s = new serializerConstructor();
+    s.reader = this;
+    this._deserializers[typeName] = s;
+  }, this);
+  if (this._options.serializers) {
+    var customSerializers = this._options.serializers || {};
+    Object.keys(customSerializers).forEach(function (key) {
+      var s = customSerializers[key];
+      if (!s.deserialize) {
+        return;
+      }
+      s.reader = this;
+      this._deserializers[key] = s;
+    }, this);
+  }
+}
+
+GraphSONReader.prototype.read = function (obj) {
+  if (obj === undefined) {
+    return undefined;
+  }
+  if (obj === null) {
+    return null;
+  }
+  if (Array.isArray(obj)) {
+    return obj.map(function mapEach(item) {
+      return this.read(item);
+    }, this);
+  }
+  var type = obj[typeKey];
+  if (type) {
+    var d = this._deserializers[type];
+    if (d) {
+      // Use type serializer
+      return d.deserialize(obj);
+    }
+    return obj[valueKey];
+  }
+  if (obj && typeof obj === 'object' && obj.constructor === Object) {
+    return this._deserializeObject(obj);
+  }
+  // Default (for boolean, number and other scalars)
+  return obj;
+};
+
+GraphSONReader.prototype._deserializeObject = function (obj) {
+  var keys = Object.keys(obj);
+  var result = {};
+  for (var i = 0; i < keys.length; i++) {
+    result[keys[i]] = this.read(obj[keys[i]]);
+  }
+  return result;
+};
+
+function NumberSerializer() {
+
+}
+
+NumberSerializer.prototype.serialize = function (item) {
+  return item;
+};
+
+NumberSerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  return parseFloat(value);
+};
+
+NumberSerializer.prototype.canBeUsedFor = function (value) {
+  return (typeof value === 'number');
+};
+
+function BytecodeSerializer() {
+
+}
+
+BytecodeSerializer.prototype.serialize = function (item) {
+  var bytecode = item;
+  if (item instanceof t.Traversal) {
+    bytecode = item.getBytecode();
+  }
+  var result = {};
+  result[typeKey] = 'g:Bytecode';
+  var resultValue = result[valueKey] = {};
+  var sources = this._serializeInstructions(bytecode.sourceInstructions);
+  if (sources) {
+    resultValue['source'] = sources;
+  }
+  var steps = this._serializeInstructions(bytecode.stepInstructions);
+  if (steps) {
+    resultValue['step'] = steps;
+  }
+  return result;
+};
+
+BytecodeSerializer.prototype._serializeInstructions = function (instructions) {
+  if (instructions.length === 0) {
+    return null;
+  }
+  var result = new Array(instructions.length);
+  result[0] = instructions[0];
+  for (var i = 1; i < instructions.length; i++) {
+    result[i] = this.writer.adaptObject(instructions[i]);
+  }
+  return result;
+};
+
+BytecodeSerializer.prototype.canBeUsedFor = function (value) {
+  return (value instanceof Bytecode) || (value instanceof t.Traversal);
+};
+
+function PSerializer() {
+
+}
+
+/** @param {P} item */
+PSerializer.prototype.serialize = function (item) {
+  var result = {};
+  result[typeKey] = 'g:P';
+  var resultValue = result[valueKey] = {
+    'predicate': item.operator
+  };
+  if (item.other == undefined) {
+    resultValue['value'] = this.writer.adaptObject(item.value);
+  }
+  else {
+    resultValue['value'] = [ this.writer.adaptObject(item.value), this.writer.adaptObject(item.other) ];
+  }
+  return result;
+};
+
+PSerializer.prototype.canBeUsedFor = function (value) {
+  return (value instanceof t.P);
+};
+
+function LambdaSerializer() {
+
+}
+
+/** @param {Function} item */
+LambdaSerializer.prototype.serialize = function (item) {
+  var result = {};
+  result[typeKey] = 'g:Lambda';
+  result[valueKey] = {
+    'arguments': item.length,
+    'language': 'gremlin-javascript',
+    'script': item.toString()
+  };
+  return result;
+};
+
+LambdaSerializer.prototype.canBeUsedFor = function (value) {
+  return (typeof value === 'function');
+};
+
+function EnumSerializer() {
+
+}
+
+/** @param {EnumValue} item */
+EnumSerializer.prototype.serialize = function (item) {
+  var result = {};
+  result[typeKey] = 'g:' + item.typeName;
+  result[valueKey] = item.elementName;
+  return result;
+};
+
+EnumSerializer.prototype.canBeUsedFor = function (value) {
+  return value && value.typeName && value instanceof t.EnumValue;
+};
+
+function TraverserSerializer() {
+
+}
+
+/** @param {Traverser} item */
+TraverserSerializer.prototype.serialize = function (item) {
+  var result = {};
+  result[typeKey] = 'g:Traverser';
+  result[valueKey] = {
+    'value': this.writer.adaptObject(item.object),
+    'bulk': this.writer.adaptObject(item.bulk)
+  };
+  return result;
+};
+
+TraverserSerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  return new t.Traverser(this.reader.read(value['value']), this.reader.read(value['bulk']));
+};
+
+TraverserSerializer.prototype.canBeUsedFor = function (value) {
+  return (value instanceof t.Traverser);
+};
+
+function VertexSerializer() {
+
+}
+
+VertexSerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  return new g.Vertex(this.reader.read(value['id']), value['label'], this.reader.read(value['properties']));
+};
+
+function VertexPropertySerializer() {
+
+}
+
+VertexPropertySerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  return new g.VertexProperty(
+    this.reader.read(value['id']),
+    value['label'],
+    this.reader.read(value['value']),
+    this.reader.read(value['properties'])
+  );
+};
+
+function PropertySerializer() {
+
+}
+
+PropertySerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  return new g.Property(
+    value['key'],
+    this.reader.read(value['value']));
+};
+
+function EdgeSerializer() {
+
+}
+
+EdgeSerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  return new g.Edge(
+    this.reader.read(value['id']),
+    this.reader.read(value['outV']),
+    value['label'],
+    this.reader.read(value['inV']),
+    this.reader.read(value['properties'])
+  );
+};
+
+function PathSerializer() {
+
+}
+
+PathSerializer.prototype.deserialize = function (obj) {
+  var value = obj[valueKey];
+  var objects = value['objects'].map(function objectMapItem(o) {
+    return this.reader.read(o);
+  }, this);
+  return new g.Path(this.reader.read(value['labels']), objects);
+};
+
+module.exports = {
+  GraphSONWriter: GraphSONWriter,
+  GraphSONReader: GraphSONReader
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
new file mode 100644
index 0000000..7691dda
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
@@ -0,0 +1,62 @@
+/*
+ *  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.
+ */
+
+/**
+ * A module containing any utility functions.
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+var util = require('util');
+
+exports.inherits = util.inherits;
+
+exports.parseArgs = function parseArgs() {
+  return (arguments.length === 1 ? [ arguments[0] ] : Array.apply(null, arguments));
+};
+
+/**
+ * @param {Function} handler
+ * @returns {Promise}
+ */
+function defaultPromiseFactory(handler) {
+  return new Promise(function executor(resolve, reject) {
+    handler(function handlerCallback(err, result) {
+      if (err) {
+        return reject(err);
+      }
+      resolve(result);
+    });
+  });
+}
+
+/**
+ * Gets a resolved Promise instance.
+ * @param {Function} promiseFactory
+ * @returns {Promise}
+ */
+exports.resolvedPromise = function (promiseFactory) {
+  return toPromise(promiseFactory, function handler(cb) {
+    cb();
+  });
+};
+
+var toPromise = exports.toPromise = function toPromise(promiseFactory, handler) {
+  promiseFactory = promiseFactory || defaultPromiseFactory;
+  return promiseFactory(handler);
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
new file mode 100644
index 0000000..0976f31
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
@@ -0,0 +1,36 @@
+{
+  "name": "gremlin-javascript",
+  "version": "3.2.5-alpha1",
+  "description": "JavaScript Gremlin Language Variant",
+  "author": "Apache TinkerPop team",
+  "keywords": [
+    "graph",
+    "gremlin",
+    "tinkerpop",
+    "connection",
+    "glv",
+    "driver",
+    "graphdb"
+  ],
+  "license": "Apache-2.0",
+  "dependencies": {
+    "ws": "^3.0.0"
+  },
+  "devDependencies": {
+    "mocha": ">= 1.14.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/tinkerpop.git"
+  },
+  "bugs": {
+    "url": "https://issues.apache.org/jira/browse/TINKERPOP"
+  },
+  "scripts": {
+    "test": "./node_modules/.bin/mocha test --recursive -t 5000",
+    "unit-test": "./node_modules/.bin/mocha test/unit"
+  },
+  "engines": {
+    "node": ">=4"
+  }
+}


[43/50] [abbrv] tinkerpop git commit: Javascript GLV

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
new file mode 100644
index 0000000..e44ef90
--- /dev/null
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
@@ -0,0 +1,108 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineTestCases() {
+  "use strict";
+
+  var helper = loadModule.call(this, './helper.js');
+  var assert = helper.assert;
+  var graph = helper.loadLibModule.call(this, 'structure/graph.js');
+  var t = helper.loadLibModule.call(this, 'process/traversal.js');
+  var gs = helper.loadLibModule.call(this, 'structure/io/graph-serializer.js');
+  var GraphSONReader = gs.GraphSONReader;
+  var GraphSONWriter = gs.GraphSONWriter;
+  var P = t.P;
+
+  [
+    function testReadNumbers() {
+      var reader = new GraphSONReader();
+      [
+        [{
+          "@type": "g:Int32",
+          "@value": 31
+        }, 31],
+        [{
+          "@type": "g:Float",
+          "@value": 31.3
+        }, 31.3],
+        [{
+          "@type": "g:Double",
+          "@value": 31.2
+        }, 31.2]
+      ].forEach(function (item) {
+        var result = reader.read(item[0]);
+        assert.strictEqual(result, item[1]);
+        assert.strictEqual(typeof result, 'number');
+      });
+    },
+    function testReadGraph() {
+      var obj = {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9}, "inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}};
+      var reader = new GraphSONReader(obj);
+      var result = reader.read(obj);
+      assert.ok(result instanceof graph.Vertex);
+      assert.strictEqual(result.label, 'person');
+      assert.strictEqual(typeof result.id, 'number');
+    },
+    function testReadPath() {
+      var obj = {"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[
+        {"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},
+        {"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},
+        "lop"]}};
+      var reader = new GraphSONReader(obj);
+      var result = reader.read(obj);
+      assert.ok(result);
+      assert.ok(result.objects);
+      assert.ok(result.labels);
+      assert.strictEqual(result.objects[2], 'lop');
+      assert.ok(result.objects[0] instanceof graph.Vertex);
+      assert.ok(result.objects[1] instanceof graph.Vertex);
+      assert.strictEqual(result.objects[0].label, 'person');
+      assert.strictEqual(result.objects[1].label, 'software');
+    },
+    function testWriteNumber() {
+      var writer = new GraphSONWriter();
+      assert.strictEqual(writer.write(2), '2');
+    },
+    function testWriteBoolean() {
+      var writer = new GraphSONWriter();
+      assert.strictEqual(writer.write(true), 'true');
+      assert.strictEqual(writer.write(false), 'false');
+    },
+    function testWriteNumber() {
+      var writer = new GraphSONWriter();
+      var expected = JSON.stringify({"@type":"g:P","@value":{"predicate":"and","value":[{"@type":"g:P","@value":{"predicate":"or","value":[{"@type":"g:P","@value":{"predicate":"lt","value":"b"}},{"@type":"g:P","@value":{"predicate":"gt","value":"c"}}]}},{"@type":"g:P","@value":{"predicate":"neq","value":"d"}}]}});
+      assert.strictEqual(writer.write(P.lt("b").or(P.gt("c")).and(P.neq("d"))), expected);
+    }
+  ].forEach(function (testCase) {
+    testCase.call(null);
+  });
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      return load(__DIR__ + moduleName);
+    }
+    throw new Error('No module loader was found');
+  }
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
new file mode 100644
index 0000000..477df91
--- /dev/null
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
@@ -0,0 +1,54 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+(function defineTestCases() {
+  "use strict";
+
+  var helper = loadModule.call(this, './helper.js');
+  var assert = helper.assert;
+  var graph = helper.loadLibModule.call(this, 'structure/graph.js');
+
+  [
+    function testBytecode() {
+      var g = new graph.Graph().traversal();
+      var bytecode = g.V().out('created').getBytecode();
+      assert.ok(bytecode);
+      assert.strictEqual(bytecode.sourceInstructions.length, 0);
+      assert.strictEqual(bytecode.stepInstructions.length, 2);
+      assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
+      assert.strictEqual(bytecode.stepInstructions[1][0], 'out');
+      assert.strictEqual(bytecode.stepInstructions[1][1], 'created');
+    }
+  ].forEach(function (testCase) {
+    testCase.call(null);
+  });
+
+  function loadModule(moduleName) {
+    if (typeof require !== 'undefined') {
+      return require(moduleName);
+    }
+    if (typeof load !== 'undefined') {
+      return load(__DIR__ + moduleName);
+    }
+    throw new Error('No module loader was found');
+  }
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66bd5fa4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 327a0db..8cd2aa4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -120,6 +120,7 @@ limitations under the License.
         <module>gremlin-groovy</module>
         <module>gremlin-groovy-test</module>
         <module>tinkergraph-gremlin</module>
+        <module>gremlin-javascript</module>
         <module>gremlin-python</module>
         <module>gremlin-dotnet</module>
         <module>hadoop-gremlin</module>


[46/50] [abbrv] tinkerpop git commit: Use null as empty result

Posted by sp...@apache.org.
Use null as empty result


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

Branch: refs/heads/TINKERPOP-1489
Commit: 256ccc388cc99f2f4627cb257b09d56b8d24b2d8
Parents: a50baf0
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Thu Nov 3 14:34:28 2016 +0100
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy   | 2 +-
 .../src/main/javascript/gremlin-javascript/process/traversal.js    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/256ccc38/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
index 46f65a4..d5899f0 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
@@ -87,7 +87,7 @@ class TraversalSourceGenerator {
   /** @param {Function} callback */
   Traversal.prototype.one = function (callback) {
     this.list(function (err, result) {
-      callback(err, result ? result[0] : null);
+      callback(err, result && result.length > 0 ? result[0] : null);
     });
   };
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/256ccc38/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
index a7a9bb7..f585161 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
@@ -50,7 +50,7 @@
   /** @param {Function} callback */
   Traversal.prototype.one = function (callback) {
     this.list(function (err, result) {
-      callback(err, result ? result[0] : null);
+      callback(err, result && result.length > 0 ? result[0] : null);
     });
   };
 


[04/50] [abbrv] tinkerpop git commit: fixed old, dead codehaus links. removed dead repo. CTR

Posted by sp...@apache.org.
fixed old, dead codehaus links. removed dead repo. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 84608546582f8bd09468959f3e5dc44134b4ad6d
Parents: e7f5ef7
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:45:19 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:45:19 2017 -0400

----------------------------------------------------------------------
 docker/resources/groovy/grapeConfig.xml                      | 1 -
 docs/src/reference/gremlin-applications.asciidoc             | 8 ++++----
 docs/src/reference/intro.asciidoc                            | 2 +-
 .../groovy/plugin/UtilitiesGremlinPluginScript.groovy        | 4 ++--
 4 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/docker/resources/groovy/grapeConfig.xml
----------------------------------------------------------------------
diff --git a/docker/resources/groovy/grapeConfig.xml b/docker/resources/groovy/grapeConfig.xml
index 1cdfeb4..ba20af8 100644
--- a/docker/resources/groovy/grapeConfig.xml
+++ b/docker/resources/groovy/grapeConfig.xml
@@ -6,7 +6,6 @@
         <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
         <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
       </filesystem>
-      <ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
       <ibiblio name="central" root="http://central.maven.org/maven2/" m2compatible="true"/>
       <ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
       <ibiblio name="hyracs-releases" root="http://obelix.ics.uci.edu/nexus/content/groups/hyracks-public-releases/" m2compatible="true"/>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index a5c162e..af9ae48 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -31,12 +31,12 @@ Console and Server, where a universal plugin system makes it possible to extend
 important aspects of the plugin system is the ability to help the user install the plugins through the command line
 thus automating the process of gathering dependencies and other error prone activities.
 
-The process of plugin installation is handled by link:http://groovy.codehaus.org/Grape[Grape], which helps resolve
+The process of plugin installation is handled by link:http://www.groovy-lang.org/Grape[Grape], which helps resolve
 dependencies into the classpath.  It is therefore important to ensure that Grape is properly configured in order to
 use the automated capabilities of plugin installation.  Grape is configured by `~/.groovy/grapeConfig.xml` and
 generally speaking, if that file is not present, the default settings will suffice.  However, they will not suffice
 if a required dependency is not in one of the default configured repositories. Please see the
-link:http://groovy.codehaus.org/Grape[Custom Ivy Settings] section of the Grape documentation for more details on
+link:http://www.groovy-lang.org/Grape[Custom Ivy Settings] section of the Grape documentation for more details on
 the defaults.  TinkerPop recommends the following configuration in that file:
 
 [source,xml]
@@ -102,7 +102,7 @@ more information on the `:plugin use` command to manually enable plugins. These
 These plugins can only be deactivated.
 
 The Gremlin Console is loaded and ready for commands. Recall that the console hosts the Gremlin-Groovy language.
-Please review link:http://groovy.codehaus.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
+Please review link:http://www.groovy-lang.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
 superset of Java. What works in Java, works in Groovy. However, Groovy provides many shorthands to make it easier
 to interact with the Java API.  Moreoever, Gremlin provides many neat shorthands to make it easier to express paths
 through a property graph.
@@ -130,7 +130,7 @@ TIP: When using Gremlin-Groovy in a Groovy class file, add `static { GremlinLoad
 Console Commands
 ~~~~~~~~~~~~~~~~
 
-In addition to the standard commands of the link:http://groovy.codehaus.org/Groovy+Shell[Groovy Shell], Gremlin adds
+In addition to the standard commands of the link:http://www.groovy-lang.org/Groovy+Shell[Groovy Shell], Gremlin adds
 some other useful operations.  The following table outlines the most commonly used commands:
 
 [width="100%",cols="3,^2,10",options="header"]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/docs/src/reference/intro.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/intro.asciidoc b/docs/src/reference/intro.asciidoc
index e19742f..7daffc8 100644
--- a/docs/src/reference/intro.asciidoc
+++ b/docs/src/reference/intro.asciidoc
@@ -175,7 +175,7 @@ assert(IteratorUtils.count(graph.edges()) == 0)
 // tada!
 
 IMPORTANT: image:groovy-logo.png[width=175,float=left] Gremlin-Groovy leverages the
-link:http://groovy.codehaus.org/[Groovy 2.x language] to express Gremlin traversals. One of the major benefits of
+link:http://www.groovy-lang.org/[Groovy 2.x language] to express Gremlin traversals. One of the major benefits of
 Groovy is the inclusion of a runtime console that makes it easy for developers to practice with the Gremlin language
 and for production users to connect to their graph and execute traversals in an interactive manner. Moreover,
 Gremlin-Groovy provides various syntax simplifications.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
index 5f5e3c6..bfa6690 100644
--- a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
+++ b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
@@ -34,7 +34,7 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
     def testsOptedOut = optOuts != null && optOuts.size() > 0 ? optOuts.collect { "> " + it.test() + "#" + it.method() + "${lf}\t\"" + it.reason() + "\"" }.join(lf) : "> none";
 
     // not the use of {lf} here rather than triple quoted string is that groovy 2.4.0 seems to have trouble
-    // parsing that into groovysh - note the bug report here: https://jira.codehaus.org/browse/GROOVY-7290
+    // parsing that into groovysh - note the bug report here: https://issues.apache.org/jira/browse/GROOVY-7290
     return "${lf}" +
 "IMPLEMENTATION - ${c.getCanonicalName()} ${lf}" +
 "TINKERPOP TEST SUITE ${lf}" +
@@ -49,4 +49,4 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
 "the implementation itself.  Compliant implementations will faithfully and ${lf}" +
 "honestly supply these Annotations to provide the most accurate depiction of ${lf}" +
 "their support."
-}
\ No newline at end of file
+}


[22/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1714' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1714' into tp32


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

Branch: refs/heads/TINKERPOP-1489
Commit: fbed57b6216ef847aea08065f0d28506b68088cb
Parents: c30b378 ac19d5d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 12 13:29:27 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 12 13:29:27 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../gremlin/groovy/engine/GremlinExecutor.java  | 39 ++++++--------------
 2 files changed, 13 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fbed57b6/CHANGELOG.asciidoc
----------------------------------------------------------------------


[30/50] [abbrv] tinkerpop git commit: Minor improvement to http requests that were too large

Posted by sp...@apache.org.
Minor improvement to http requests that were too large

Added a test to validate a 413 is returned if the request payload exceeds the maxContentLength CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 5335f4af975ecabe9f5138f9bc5d292966b34feb
Parents: 6e86bf5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 17 06:53:03 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 17 06:53:03 2017 -0400

----------------------------------------------------------------------
 .../server/handler/HttpGremlinEndpointHandler.java |  9 ++++++++-
 .../server/GremlinServerHttpIntegrateTest.java     | 17 +++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5335f4af/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
index 2bbb9f7..75c97a0 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.server.handler;
 
 import com.codahale.metrics.Meter;
 import com.codahale.metrics.Timer;
+import io.netty.handler.codec.TooLongFrameException;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.Tokens;
@@ -34,6 +35,7 @@ import org.apache.tinkerpop.gremlin.server.Settings;
 import org.apache.tinkerpop.gremlin.server.util.MetricManager;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
+import org.apache.tinkerpop.gremlin.util.function.ThrowingBiConsumer;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -279,7 +281,12 @@ public class HttpGremlinEndpointHandler extends ChannelInboundHandlerAdapter {
     @Override
     public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         logger.error("Error processing HTTP Request", cause);
-        sendError(ctx, INTERNAL_SERVER_ERROR, cause.getCause().getMessage());
+        final Throwable t = null == cause.getCause() ? cause : cause.getCause();
+        if (t instanceof TooLongFrameException) {
+            sendError(ctx, HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE, t.getMessage() + " - increase the maxContentLength");
+        } else {
+            sendError(ctx, INTERNAL_SERVER_ERROR, t.getMessage());
+        }
         ctx.close();
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5335f4af/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 90017a9..baf4c02 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
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.server;
 
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.tinkerpop.gremlin.driver.Tokens;
 import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0;
 import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
@@ -66,6 +67,9 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
         settings.channelizer = HttpChannelizer.class.getName();
         final String nameOfTest = name.getMethodName();
         switch (nameOfTest) {
+            case "should413OnPostWithResultTooLarge":
+                settings.maxContentLength = 31;
+                break;
             case "should200OnGETWithGremlinQueryStringArgumentWithIteratorResult":
             case "should200OnPOSTWithGremlinJsonEndcodedBodyWithIteratorResult":
             case "should200OnPOSTWithGremlinJsonEndcodedBodyWithIteratorResultAndAliases":
@@ -146,6 +150,19 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
     }
 
     @Test
+    public void should413OnPostWithResultTooLarge() throws Exception {
+        final CloseableHttpClient httpclient = HttpClients.createDefault();
+        final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
+        httppost.addHeader("Content-Type", "application/json");
+        final String bigPost = RandomStringUtils.random(32);
+        httppost.setEntity(new StringEntity("{\"gremlin\":\""+ bigPost + "\", \"bindings\":{\"x\":\"10\"}}", Consts.UTF_8));
+
+        try (final CloseableHttpResponse response = httpclient.execute(httppost)) {
+            assertEquals(413, response.getStatusLine().getStatusCode());
+        }
+    }
+
+    @Test
     public void should401OnGETWithNoAuthorizationHeader() throws Exception {
         final CloseableHttpClient httpclient = HttpClients.createDefault();
         final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=1-1"));


[17/50] [abbrv] tinkerpop git commit: TINKERPOP-1385 Bound profile test assertions to TinkerGraph

Posted by sp...@apache.org.
TINKERPOP-1385 Bound profile test assertions to TinkerGraph

Assertions were too stringent for graph providers who had complex strategies.


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

Branch: refs/heads/TINKERPOP-1489
Commit: d27fc7d2465af97aa583cb6c072391273286d322
Parents: 402678b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sun Jul 9 09:54:21 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun Jul 9 09:54:21 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/step/map/ProfileTest.java | 38 ++++++++++++++------
 2 files changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d27fc7d2/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 96e79ab..05e20bb 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ TinkerPop 3.2.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 
 This release also includes changes from <<release-3-1-8, 3.1.8>>.
 
+* `ProfileTest` is now less stringent about assertions which will reduce burdens on providers.
 * `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.
 * Deprecated the `useMapperFromGraph` configuration option for Gremlin Server serializers.
 * `JavaTranslator` is now smart about handling `BulkSet` and `Tree`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d27fc7d2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
index 1af6ba3..7ac3059 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
@@ -53,11 +53,14 @@ import java.util.concurrent.TimeUnit;
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.GRATEFUL;
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.both;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeThat;
 
 /**
  * @author Bob Briody (http://bobbriody.com)
@@ -105,12 +108,15 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_V_out_out_profileXmetricsX();
         printTraversalForm(traversal);
         traversal.iterate();
-        validate_g_V_out_out_profile_modern(traversal, traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY));
+        validate_g_V_out_out_profile_modern(traversal, traversal.asAdmin().getSideEffects().get(METRICS_KEY));
     }
 
     private void validate_g_V_out_out_profile_modern(final Traversal traversal, final TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
+        assumeThat("The following assertions apply to TinkerGraph only as provider strategies can alter the steps to not comply with expectations",
+                graph.getClass().getSimpleName(), equalTo("TinkerGraph"));
+
         Metrics metrics = traversalMetrics.getMetrics(0);
         assertEquals(6, metrics.getCount(TraversalMetrics.TRAVERSER_COUNT_ID).longValue());
         assertEquals(6, metrics.getCount(TraversalMetrics.ELEMENT_COUNT_ID).longValue());
@@ -149,13 +155,16 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_V_out_out_profileXmetricsX();
         printTraversalForm(traversal);
         traversal.iterate();
-        final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
+        final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().get(METRICS_KEY);
         validate_g_V_out_out_profile_grateful(traversalMetrics);
     }
 
-    private void validate_g_V_out_out_profile_grateful(TraversalMetrics traversalMetrics) {
+    private void validate_g_V_out_out_profile_grateful(final TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
+        assumeThat("The following assertions apply to TinkerGraph only as provider strategies can alter the steps to not comply with expectations",
+                graph.getClass().getSimpleName(), equalTo("TinkerGraph"));
+
         Metrics metrics = traversalMetrics.getMetrics(0);
         assertEquals(808, metrics.getCount(TraversalMetrics.TRAVERSER_COUNT_ID).longValue());
         assertEquals(808, metrics.getCount(TraversalMetrics.ELEMENT_COUNT_ID).longValue());
@@ -202,13 +211,16 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         printTraversalForm(traversal);
         traversal.iterate();
         assertEquals("There should be 7 steps in this traversal (counting injected profile steps).", 7, traversal.asAdmin().getSteps().size());
-        TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
+        TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().get(METRICS_KEY);
         validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(traversalMetrics);
     }
 
-    private void validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(TraversalMetrics traversalMetrics) {
+    private void validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(final TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
+        assumeThat("The following assertions apply to TinkerGraph only as provider strategies can alter the steps to not comply with expectations",
+                graph.getClass().getSimpleName(), equalTo("TinkerGraph"));
+
         // Grab the second (sideEffect{sleep}) step and check the times.
         Metrics metrics = traversalMetrics.getMetrics(1);
         // 6 elements w/ a 10ms sleep each = 60ms with 10ms for other computation.
@@ -247,15 +259,18 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, Vertex> traversal = get_g_V_repeatXbothX_timesX3X_profileXmetricsX();
         printTraversalForm(traversal);
         traversal.iterate();
-        final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
+        final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().get(METRICS_KEY);
         validate_g_V_repeat_both_modern_profile(traversalMetrics,
                 traversal.asAdmin().getStrategies().toList().contains(RepeatUnrollStrategy.instance()) &&
                         !traversal.asAdmin().getStrategies().toList().contains(ComputerVerificationStrategy.instance()));
     }
 
-    private void validate_g_V_repeat_both_modern_profile(TraversalMetrics traversalMetrics, boolean withRepeatUnrollStrategy) {
+    private void validate_g_V_repeat_both_modern_profile(final TraversalMetrics traversalMetrics, final boolean withRepeatUnrollStrategy) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
+        assumeThat("The following assertions apply to TinkerGraph only as provider strategies can alter the steps to not comply with expectations",
+                graph.getClass().getSimpleName(), equalTo("TinkerGraph"));
+
         Metrics metrics = traversalMetrics.getMetrics(0);
         assertEquals(6, metrics.getCount(TraversalMetrics.TRAVERSER_COUNT_ID).longValue());
         assertEquals(6, metrics.getCount(TraversalMetrics.ELEMENT_COUNT_ID).longValue());
@@ -286,9 +301,12 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
 
     /////////////
 
-    private void validate_g_V_whereXinXcreatedX_count_isX1XX_name_profile(Traversal traversal, TraversalMetrics traversalMetrics) {
+    private void validate_g_V_whereXinXcreatedX_count_isX1XX_name_profile(final Traversal traversal, final TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
+        assumeThat("The following assertions apply to TinkerGraph only as provider strategies can alter the steps to not comply with expectations",
+                graph.getClass().getSimpleName(), equalTo("TinkerGraph"));
+
         assertEquals("There should be 3 top-level metrics.", 3, traversalMetrics.getMetrics().size());
 
         Metrics metrics = traversalMetrics.getMetrics(0);
@@ -321,7 +339,7 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         final Traversal<Vertex, String> traversal = get_g_V_whereXinXcreatedX_count_isX1XX_name_profileXmetricsX();
         printTraversalForm(traversal);
         traversal.iterate();
-        final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
+        final TraversalMetrics traversalMetrics = traversal.asAdmin().getSideEffects().get(METRICS_KEY);
         validate_g_V_whereXinXcreatedX_count_isX1XX_name_profile(traversal, traversalMetrics);
     }
 
@@ -377,7 +395,7 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         assertTrue(mockStep.callbackCalled);
 
         if (!onGraphComputer(t.asAdmin())) {
-            final TraversalMetrics traversalMetrics = t.asAdmin().getSideEffects().<TraversalMetrics>get(METRICS_KEY);
+            final TraversalMetrics traversalMetrics = t.asAdmin().getSideEffects().get(METRICS_KEY);
             assertEquals(100, traversalMetrics.getMetrics(3).getCount("bogusCount").longValue());
         }
     }


[35/50] [abbrv] tinkerpop git commit: Initialization scripts to gremlin server won't timeout

Posted by sp...@apache.org.
Initialization scripts to gremlin server won't timeout

Prior to this change the timeout for init scripts was the same as the the timeout configured for the server. Since init scripts might need to be long run (e.g. a long load script to init a graph into memory) it would force the user to make their timeout setting really high. A really high setting might be really bad though for basic request/response. Perhaps in the future it would be better to make this a configuration but for now this change should suffice. CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 7c72e51dc7a27204e150232e8bba3eaa4cd91d9e
Parents: 362e772
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 18 12:12:54 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 12:12:54 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  3 ++-
 .../gremlin/groovy/engine/GremlinExecutor.java  | 27 +++++++++-----------
 .../server/util/ServerGremlinExecutor.java      |  8 +++---
 3 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7c72e51d/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 52d289b..573f681 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,7 +28,8 @@ TinkerPop 3.2.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 
 This release also includes changes from <<release-3-1-8, 3.1.8>>.
 
-* Added Gremlin.Net as an early preview.
+* Initialization scripts for Gremlin Server will not timeout.
+* Added Gremlin.Net.
 * `ProfileTest` is now less stringent about assertions which will reduce burdens on providers.
 * `GremlinExecutor` begins timeout of script evaluation at the time the script was submitted and not from the time it began evaluation.
 * `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7c72e51d/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 da495e6..962f798 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
@@ -278,7 +278,7 @@ public class GremlinExecutor implements AutoCloseable {
         // override the timeout if the lifecycle has a value assigned
         final long scriptEvalTimeOut = lifeCycle.getScriptEvaluationTimeoutOverride().orElse(scriptEvaluationTimeout);
 
-        final WeakReference<CompletableFuture<Object>> evaluationFuture = new WeakReference<>(new CompletableFuture<>());
+        final CompletableFuture<Object> evaluationFuture = new CompletableFuture<>();
         final FutureTask<Void> evalFuture = new FutureTask<>(() -> {
             try {
                 lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings);
@@ -306,36 +306,33 @@ public class GremlinExecutor implements AutoCloseable {
                 // that must raise as an exception to the caller who has the returned evaluationFuture. in other words,
                 // if it occurs before this point, then the handle() method won't be called again if there is an
                 // exception that ends up below trying to completeExceptionally()
-                final CompletableFuture<Object> ef = evaluationFuture.get();
-                if (ef != null) ef.complete(result);
+                evaluationFuture.complete(result);
             } catch (Throwable ex) {
                 final Throwable root = null == ex.getCause() ? ex : ExceptionUtils.getRootCause(ex);
 
                 // thread interruptions will typically come as the result of a timeout, so in those cases,
                 // check for that situation and convert to TimeoutException
-                final CompletableFuture<Object> ef = evaluationFuture.get();
-                if (ef != null) {
-                    if (root instanceof InterruptedException) {
-                        lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
-                        ef.completeExceptionally(new TimeoutException(
-                                String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]: %s", scriptEvalTimeOut, script, root.getMessage())));
-                    } else {
-                        lifeCycle.getAfterFailure().orElse(afterFailure).accept(bindings, root);
-                        ef.completeExceptionally(root);
-                    }
+                if (root instanceof InterruptedException) {
+                    lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
+                    evaluationFuture.completeExceptionally(new TimeoutException(
+                            String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]: %s", scriptEvalTimeOut, script, root.getMessage())));
+                } else {
+                    lifeCycle.getAfterFailure().orElse(afterFailure).accept(bindings, root);
+                    evaluationFuture.completeExceptionally(root);
                 }
             }
 
             return null;
         });
 
+        final WeakReference<CompletableFuture<Object>> evaluationFutureRef = new WeakReference<>(evaluationFuture);
         final Future<?> executionFuture = executorService.submit(evalFuture);
         if (scriptEvalTimeOut > 0) {
             // Schedule a timeout in the thread pool for future execution
             scheduledExecutorService.schedule(() -> {
                 if (executionFuture.cancel(true)) {
                     lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
-                    final CompletableFuture<Object> ef = evaluationFuture.get();
+                    final CompletableFuture<Object> ef = evaluationFutureRef.get();
                     if (ef != null) {
                         ef.completeExceptionally(new TimeoutException(
                                 String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]", scriptEvalTimeOut, script)));
@@ -344,7 +341,7 @@ public class GremlinExecutor implements AutoCloseable {
             }, scriptEvalTimeOut, TimeUnit.MILLISECONDS);
         }
 
-        return evaluationFuture.get();
+        return evaluationFuture;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7c72e51d/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
index 8398dbb..b878549 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
@@ -18,10 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.server.util;
 
-import com.codahale.metrics.Gauge;
 import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor;
 import org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines;
-import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.server.Channelizer;
@@ -32,6 +30,7 @@ import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.script.SimpleBindings;
 import java.lang.reflect.Constructor;
 import java.util.Collections;
 import java.util.HashSet;
@@ -177,7 +176,10 @@ public class ServerGremlinExecutor<T extends ScheduledExecutorService> {
         // runs the init scripts when the GremlinScriptEngine is created.
         settings.scriptEngines.keySet().forEach(engineName -> {
             try {
-                gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join();
+                // use no timeout on the engine initialization - perhaps this can be a configuration later
+                final GremlinExecutor.LifeCycle lifeCycle = GremlinExecutor.LifeCycle.build().
+                        scriptEvaluationTimeoutOverride(0L).create();
+                gremlinExecutor.eval("1+1", engineName, new SimpleBindings(Collections.emptyMap()), lifeCycle).join();
                 registerMetrics(engineName);
                 logger.info("Initialized {} GremlinScriptEngine and registered metrics", engineName);
             } catch (Exception ex) {


[41/50] [abbrv] tinkerpop git commit: Export enums and fix TraversalStrategies#applyStrategies()

Posted by sp...@apache.org.
Export enums and fix TraversalStrategies#applyStrategies()


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

Branch: refs/heads/TINKERPOP-1489
Commit: 38c2409418e481c084dc8858c854acd7fdc6ae12
Parents: 66bd5fa
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Fri Oct 7 12:01:30 2016 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:01:43 2017 -0400

----------------------------------------------------------------------
 .../GraphTraversalSourceGenerator.groovy        |  4 +-
 .../javascript/TraversalSourceGenerator.groovy  | 52 +++++++++-----------
 .../driver/remote-connection.js                 |  2 +-
 .../main/javascript/gremlin-javascript/index.js | 11 ++++-
 .../process/graph-traversal.js                  |  4 +-
 .../gremlin-javascript/process/traversal.js     | 44 ++++++++---------
 .../gremlin-javascript/test-exports.js          | 15 ++++--
 .../gremlin-javascript/test-graphson.js         |  2 +-
 .../gremlin-javascript/test-traversal.js        | 17 ++++++-
 9 files changed, 87 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
index 81c38dc..b569292 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
@@ -87,12 +87,12 @@ class GraphTraversalSourceGenerator {
 
   /**
    * @param remoteConnection
-   * @returns {GraphTraversal}
+   * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
     var traversalStrategy = new t.TraversalStrategies(this._traversalStrategies);
     traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-    return new GraphTraversal(this._graph, traversalStrategy, new Bytecode(this._bytecode));
+    return new GraphTraversalSource(this._graph, traversalStrategy, new Bytecode(this._bytecode));
   };
 
   /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
index efcb826..5b07a32 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
@@ -177,11 +177,14 @@ class TraversalSourceGenerator {
     this.strategies.push(strategy);
   };
 
-  /** @param {Traversal} traversal */
-  TraversalStrategies.prototype.applyStrategies = function (traversal) {
-    this.strategies.forEach(function eachStrategy(s) {
-      s.apply(traversal);
-    });
+  /**
+   * @param {Traversal} traversal
+   * @param {Function} callback
+   */
+  TraversalStrategies.prototype.applyStrategies = function (traversal, callback) {
+    eachSeries(this.strategies, function eachStrategy(s, next) {
+      s.apply(traversal, next);
+    }, callback);
   };
 
   /**
@@ -195,8 +198,9 @@ class TraversalSourceGenerator {
   /**
    * @abstract
    * @param {Traversal} traversal
+   * @param {Function} callback
    */
-  TraversalStrategy.prototype.apply = function (traversal) {
+  TraversalStrategy.prototype.apply = function (traversal, callback) {
 
   };
 
@@ -290,24 +294,6 @@ class TraversalSourceGenerator {
     this.elementName = elementName;
   }
 
-  /**
-   * @type {{barrier, cardinality, column, direction, operator, order, pop, scope, t}}
-   */
-  var enums = {};\n""")
-
-        for (final Class<? extends Enum> enumClass : CoreImports.getClassImports()
-                .findAll { Enum.class.isAssignableFrom(it) }
-                .sort { a, b -> a.getSimpleName() <=> b.getSimpleName() }
-                .collect()) {
-            moduleOutput.append("  enums.${SymbolHelper.decapitalize(enumClass.getSimpleName())} = " +
-                    "toEnum('${SymbolHelper.toJs(enumClass.getSimpleName())}', '");
-            enumClass.getEnumConstants()
-                    .sort { a, b -> a.name() <=> b.name() }
-                    .each { value -> moduleOutput.append("${SymbolHelper.toJs(value.name())} "); }
-            moduleOutput.deleteCharAt(moduleOutput.length() - 1).append("');\n")
-        }
-
-        moduleOutput.append("""
   // Utility functions
   /** @returns {Array} */
   function parseArgs() {
@@ -376,11 +362,21 @@ class TraversalSourceGenerator {
     TraversalSideEffects: TraversalSideEffects,
     TraversalStrategies: TraversalStrategies,
     TraversalStrategy: TraversalStrategy,
-    Traverser: Traverser
+    Traverser: Traverser""")
+        for (final Class<? extends Enum> enumClass : CoreImports.getClassImports()
+                .findAll { Enum.class.isAssignableFrom(it) }
+                .sort { a, b -> a.getSimpleName() <=> b.getSimpleName() }
+                .collect()) {
+            moduleOutput.append(",\n    ${SymbolHelper.decapitalize(enumClass.getSimpleName())}: " +
+                    "toEnum('${SymbolHelper.toJs(enumClass.getSimpleName())}', '");
+            enumClass.getEnumConstants()
+                    .sort { a, b -> a.name() <=> b.name() }
+                    .each { value -> moduleOutput.append("${SymbolHelper.toJs(value.name())} "); }
+            moduleOutput.deleteCharAt(moduleOutput.length() - 1).append("')")
+        }
+
+        moduleOutput.append("""
   };
-  Object.keys(enums).forEach(function (k) {
-    toExport[k] = enums[k];
-  });
   if (typeof module !== 'undefined') {
     // CommonJS
     module.exports = toExport;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
index 99b177f..e19b537 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
@@ -68,7 +68,7 @@
   /** @override */
   RemoteStrategy.prototype.apply = function (traversal, callback) {
     if (traversal.traversers) {
-      return;
+      return callback();
     }
     this.connection.submit(traversal.getBytecode(), function (err, remoteTraversal) {
       if (err) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
index cda8200..ddcdac2 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
@@ -49,14 +49,21 @@
     process: {
       Bytecode: t.Bytecode,
       EnumValue: t.EnumValue,
-      inherits: t.inherits,
       P: t.P,
-      parseArgs: t.parseArgs,
       Traversal: t.Traversal,
       TraversalSideEffects: t.TraversalSideEffects,
       TraversalStrategies: t.TraversalStrategies,
       TraversalStrategy: t.TraversalStrategy,
       Traverser: t.Traverser,
+      barrier: t.barrier,
+      cardinality: t.cardinality,
+      column: t.column,
+      direction: t.direction,
+      operator: t.operator,
+      order: t.order,
+      pop: t.pop,
+      scope: t.scope,
+      t: t.t,
       GraphTraversal: gt.GraphTraversal,
       GraphTraversalSource: gt.GraphTraversalSource,
       statics: gt.statics

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
index d9803ba..1a6356b 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
@@ -44,12 +44,12 @@
 
   /**
    * @param remoteConnection
-   * @returns {GraphTraversal}
+   * @returns {GraphTraversalSource}
    */
   GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
     var traversalStrategy = new t.TraversalStrategies(this._traversalStrategies);
     traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-    return new GraphTraversal(this._graph, traversalStrategy, new Bytecode(this._bytecode));
+    return new GraphTraversalSource(this._graph, traversalStrategy, new Bytecode(this._bytecode));
   };
 
   /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
index 5c9bf6c..ff2927e 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
@@ -185,11 +185,14 @@
     this.strategies.push(strategy);
   };
 
-  /** @param {Traversal} traversal */
-  TraversalStrategies.prototype.applyStrategies = function (traversal) {
-    this.strategies.forEach(function eachStrategy(s) {
-      s.apply(traversal);
-    });
+  /**
+   * @param {Traversal} traversal
+   * @param {Function} callback
+   */
+  TraversalStrategies.prototype.applyStrategies = function (traversal, callback) {
+    eachSeries(this.strategies, function eachStrategy(s, next) {
+      s.apply(traversal, next);
+    }, callback);
   };
 
   /**
@@ -203,8 +206,9 @@
   /**
    * @abstract
    * @param {Traversal} traversal
+   * @param {Function} callback
    */
-  TraversalStrategy.prototype.apply = function (traversal) {
+  TraversalStrategy.prototype.apply = function (traversal, callback) {
 
   };
 
@@ -298,20 +302,6 @@
     this.elementName = elementName;
   }
 
-  /**
-   * @type {{barrier, cardinality, column, direction, operator, order, pop, scope, t}}
-   */
-  var enums = {};
-  enums.barrier = toEnum('Barrier', 'normSack');
-  enums.cardinality = toEnum('Cardinality', 'list set single');
-  enums.column = toEnum('Column', 'keys values');
-  enums.direction = toEnum('Direction', 'BOTH IN OUT');
-  enums.operator = toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong');
-  enums.order = toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr');
-  enums.pop = toEnum('Pop', 'all first last');
-  enums.scope = toEnum('Scope', 'global local');
-  enums.t = toEnum('T', 'id key label value');
-
   // Utility functions
   /** @returns {Array} */
   function parseArgs() {
@@ -380,11 +370,17 @@
     TraversalSideEffects: TraversalSideEffects,
     TraversalStrategies: TraversalStrategies,
     TraversalStrategy: TraversalStrategy,
-    Traverser: Traverser
+    Traverser: Traverser,
+    barrier: toEnum('Barrier', 'normSack'),
+    cardinality: toEnum('Cardinality', 'list set single'),
+    column: toEnum('Column', 'keys values'),
+    direction: toEnum('Direction', 'BOTH IN OUT'),
+    operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
+    order: toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr'),
+    pop: toEnum('Pop', 'all first last'),
+    scope: toEnum('Scope', 'global local'),
+    t: toEnum('T', 'id key label value')
   };
-  Object.keys(enums).forEach(function (k) {
-    toExport[k] = enums[k];
-  });
   if (typeof module !== 'undefined') {
     // CommonJS
     module.exports = toExport;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
index 6edb323..b9265c7 100644
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-exports.js
@@ -34,9 +34,7 @@
       assert.ok(glvModule.process);
       assert.strictEqual(typeof glvModule.process.Bytecode, 'function');
       assert.strictEqual(typeof glvModule.process.EnumValue, 'function');
-      assert.strictEqual(typeof glvModule.process.inherits, 'function');
       assert.strictEqual(typeof glvModule.process.P, 'function');
-      assert.strictEqual(typeof glvModule.process.parseArgs, 'function');
       assert.strictEqual(typeof glvModule.process.Traversal, 'function');
       assert.strictEqual(typeof glvModule.process.TraversalSideEffects, 'function');
       assert.strictEqual(typeof glvModule.process.TraversalStrategies, 'function');
@@ -44,6 +42,17 @@
       assert.strictEqual(typeof glvModule.process.Traverser, 'function');
       assert.strictEqual(typeof glvModule.process.GraphTraversal, 'function');
       assert.strictEqual(typeof glvModule.process.GraphTraversalSource, 'function');
+      assert.strictEqual(typeof glvModule.process.barrier, 'object');
+      assert.strictEqual(typeof glvModule.process.cardinality, 'object');
+      assert.strictEqual(typeof glvModule.process.column, 'object');
+      assert.strictEqual(typeof glvModule.process.direction, 'object');
+      assert.strictEqual(typeof glvModule.process.operator, 'object');
+      assert.strictEqual(typeof glvModule.process.order, 'object');
+      assert.strictEqual(typeof glvModule.process.pop, 'object');
+      assert.strictEqual(typeof glvModule.process.scope, 'object');
+      assert.strictEqual(typeof glvModule.process.t, 'object');
+
+
       assert.ok(glvModule.process.statics);
 
       assert.ok(glvModule.structure);
@@ -75,4 +84,4 @@
     }
     throw new Error('No module loader was found');
   }
-}).call(this)
\ No newline at end of file
+}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
index e44ef90..418a9dd 100644
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-graphson.js
@@ -87,7 +87,7 @@
       assert.strictEqual(writer.write(true), 'true');
       assert.strictEqual(writer.write(false), 'false');
     },
-    function testWriteNumber() {
+    function testWriteP() {
       var writer = new GraphSONWriter();
       var expected = JSON.stringify({"@type":"g:P","@value":{"predicate":"and","value":[{"@type":"g:P","@value":{"predicate":"or","value":[{"@type":"g:P","@value":{"predicate":"lt","value":"b"}},{"@type":"g:P","@value":{"predicate":"gt","value":"c"}}]}},{"@type":"g:P","@value":{"predicate":"neq","value":"d"}}]}});
       assert.strictEqual(writer.write(P.lt("b").or(P.gt("c")).and(P.neq("d"))), expected);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38c24094/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
index 477df91..1ec4253 100644
--- a/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
+++ b/gremlin-javascript/src/test/javascript/gremlin-javascript/test-traversal.js
@@ -26,9 +26,10 @@
   var helper = loadModule.call(this, './helper.js');
   var assert = helper.assert;
   var graph = helper.loadLibModule.call(this, 'structure/graph.js');
+  var t = helper.loadLibModule.call(this, 'process/traversal.js');
 
   [
-    function testBytecode() {
+    function testBytecode1() {
       var g = new graph.Graph().traversal();
       var bytecode = g.V().out('created').getBytecode();
       assert.ok(bytecode);
@@ -37,6 +38,20 @@
       assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
       assert.strictEqual(bytecode.stepInstructions[1][0], 'out');
       assert.strictEqual(bytecode.stepInstructions[1][1], 'created');
+    },
+    function testBytecode2() {
+      var g = new graph.Graph().traversal();
+      var bytecode = g.V().order().by('age', t.order.decr).getBytecode();
+      assert.ok(bytecode);
+      assert.strictEqual(bytecode.sourceInstructions.length, 0);
+      assert.strictEqual(bytecode.stepInstructions.length, 3);
+      assert.strictEqual(bytecode.stepInstructions[0][0], 'V');
+      assert.strictEqual(bytecode.stepInstructions[1][0], 'order');
+      assert.strictEqual(bytecode.stepInstructions[2][0], 'by');
+      assert.strictEqual(bytecode.stepInstructions[2][1], 'age');
+      assert.strictEqual(typeof bytecode.stepInstructions[2][2], 'object');
+      assert.strictEqual(bytecode.stepInstructions[2][2].typeName, 'Order');
+      assert.strictEqual(bytecode.stepInstructions[2][2].elementName, 'decr');
     }
   ].forEach(function (testCase) {
     testCase.call(null);


[16/50] [abbrv] tinkerpop git commit: TINKERPOP-1714 GremlinExecutor checks for timeout from time script submitted

Posted by sp...@apache.org.
TINKERPOP-1714 GremlinExecutor checks for timeout from time script submitted

Prior to this change timeouts were considered from the time the script started evaluation which probably isn't in line with user expectations but also made it hard to clear the job queue on an overloaded server.


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

Branch: refs/heads/TINKERPOP-1489
Commit: ac19d5dec659a1a8f399d5a11a4812774eebeca7
Parents: 402678b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 11:49:21 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 11:49:21 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../gremlin/groovy/engine/GremlinExecutor.java  | 39 ++++++--------------
 2 files changed, 13 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ac19d5de/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 96e79ab..da85ebb 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ TinkerPop 3.2.6 (Release Date: NOT OFFICIALLY RELEASED YET)
 
 This release also includes changes from <<release-3-1-8, 3.1.8>>.
 
+* `GremlinExecutor` begins timeout of script evaluation at the time the script was submitted and not from the time it began evaluation.
 * `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.
 * Deprecated the `useMapperFromGraph` configuration option for Gremlin Server serializers.
 * `JavaTranslator` is now smart about handling `BulkSet` and `Tree`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ac19d5de/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 8802793..d646a8c 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
@@ -52,9 +52,9 @@ import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 import java.util.concurrent.FutureTask;
 import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -279,31 +279,6 @@ public class GremlinExecutor implements AutoCloseable {
 
         final CompletableFuture<Object> evaluationFuture = new CompletableFuture<>();
         final FutureTask<Void> evalFuture = new FutureTask<>(() -> {
-
-            if (scriptEvalTimeOut > 0) {
-                final Thread scriptEvalThread = Thread.currentThread();
-
-                logger.debug("Schedule timeout for script - {} - in thread [{}]", script, scriptEvalThread.getName());
-
-                // Schedule a timeout in the thread pool for future execution
-                final ScheduledFuture<?> sf = scheduledExecutorService.schedule(() -> {
-                    logger.warn("Timing out script - {} - in thread [{}]", script, Thread.currentThread().getName());
-                    if (!evaluationFuture.isDone()) scriptEvalThread.interrupt();
-                }, scriptEvalTimeOut, TimeUnit.MILLISECONDS);
-
-                // Cancel the scheduled timeout if the eval future is complete or the script evaluation failed
-                // with exception
-                evaluationFuture.handleAsync((v, t) -> {
-                    if (!sf.isDone()) {
-                        logger.debug("Killing scheduled timeout on script evaluation - {} - as the eval completed (possibly with exception).", script);
-                        sf.cancel(true);
-                    }
-
-                    // no return is necessary - nothing downstream is concerned with what happens in here
-                    return null;
-                }, scheduledExecutorService);
-            }
-
             try {
                 lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings);
 
@@ -349,7 +324,17 @@ public class GremlinExecutor implements AutoCloseable {
             return null;
         });
 
-        executorService.execute(evalFuture);
+        final Future<?> executionFuture = executorService.submit(evalFuture);
+        if (scriptEvalTimeOut > 0) {
+            // Schedule a timeout in the thread pool for future execution
+            scheduledExecutorService.schedule(() -> {
+                if (executionFuture.cancel(true)) {
+                    lifeCycle.getAfterTimeout().orElse(afterTimeout).accept(bindings);
+                    evaluationFuture.completeExceptionally(new TimeoutException(
+                            String.format("Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold of %s ms or evaluation was otherwise cancelled directly for request [%s]", scriptEvalTimeOut, script)));
+                }
+            }, scriptEvalTimeOut, TimeUnit.MILLISECONDS);
+        }
 
         return evaluationFuture;
     }


[27/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1385' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1385' into tp32

Conflicts:
	CHANGELOG.asciidoc


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

Branch: refs/heads/TINKERPOP-1489
Commit: 04d4e90a66261b8dd3506cb16e947d7122d0458f
Parents: f161f7b d27fc7d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 14 12:03:31 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 14 12:03:31 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/step/map/ProfileTest.java | 38 ++++++++++++++------
 2 files changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04d4e90a/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 7d491b6,05e20bb..f36fe33
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -28,7 -28,7 +28,8 @@@ TinkerPop 3.2.6 (Release Date: NOT OFFI
  
  This release also includes changes from <<release-3-1-8, 3.1.8>>.
  
+ * `ProfileTest` is now less stringent about assertions which will reduce burdens on providers.
 +* `GremlinExecutor` begins timeout of script evaluation at the time the script was submitted and not from the time it began evaluation.
  * `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.
  * Deprecated the `useMapperFromGraph` configuration option for Gremlin Server serializers.
  * `JavaTranslator` is now smart about handling `BulkSet` and `Tree`.


[50/50] [abbrv] tinkerpop git commit: Update Javascript GLV

Posted by sp...@apache.org.
Update Javascript GLV

Address feedback and provide maven integration:
- Reorganize gremlin-javascript into node.js project
- Simplify javascript code generators
- Generate package.json to match project version
- Introduce Promise factory for third-party promise library integration (ie: bluebird)
- Use toList() and next() traversal methods
- Include Remote connection implementation
- Fix enum casing
- Use Maven nodejs plugin
- .gitignore and .npmignore at gremlin-javascript level
- Run integration tests using a gremlin-server instance
- Add gremlin-javascript doc in gremlin-variants.asciidoc


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

Branch: refs/heads/TINKERPOP-1489
Commit: b6f2cddaf9518e5fc36b8bd19e3fb9e2a977ad6f
Parents: b8441c5
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Tue Jun 6 15:05:14 2017 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 17:03:06 2017 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-variants.asciidoc    |   81 +-
 gremlin-javascript/pom.xml                      |  171 +-
 .../javascript/GenerateGremlinJavascript.groovy |   36 +
 .../GraphTraversalSourceGenerator.groovy        |  226 +-
 .../javascript/PackageJsonGenerator.groovy      |   72 +
 .../gremlin/javascript/SymbolHelper.groovy      |   50 +
 .../javascript/TraversalSourceGenerator.groovy  |  437 ++--
 .../javascript/GenerateGremlinJavascript.java   |   32 -
 .../gremlin/javascript/jsr223/SymbolHelper.java |   59 -
 .../javascript/gremlin-javascript/.gitignore    |    5 +
 .../javascript/gremlin-javascript/.npmignore    |   26 +
 .../javascript/gremlin-javascript/README.md     |   39 +
 .../driver/remote-connection.js                 |  107 -
 .../main/javascript/gremlin-javascript/index.js |  113 +-
 .../lib/driver/driver-remote-connection.js      |  200 ++
 .../lib/driver/remote-connection.js             |   84 +
 .../gremlin-javascript/lib/process/bytecode.js  |   99 +
 .../lib/process/graph-traversal.js              | 2095 ++++++++++++++++++
 .../lib/process/traversal-strategy.js           |   88 +
 .../gremlin-javascript/lib/process/traversal.js |  236 ++
 .../gremlin-javascript/lib/structure/graph.js   |  138 ++
 .../lib/structure/io/graph-serializer.js        |  398 ++++
 .../javascript/gremlin-javascript/lib/utils.js  |   62 +
 .../javascript/gremlin-javascript/package.json  |   36 +
 .../process/graph-traversal.js                  | 2016 -----------------
 .../gremlin-javascript/process/traversal.js     |  392 ----
 .../gremlin-javascript/structure/graph.js       |  157 --
 .../structure/io/graph-serializer.js            |  415 ----
 .../test/integration/remote-connection-tests.js |   64 +
 .../test/integration/traversal-test.js          |   71 +
 .../test/unit/exports-test.js                   |   73 +
 .../test/unit/graphson-test.js                  |  112 +
 .../test/unit/traversal-test.js                 |  119 +
 .../javascript/gremlin-javascript/helper.js     |   84 -
 .../gremlin-javascript/test-exports.js          |   87 -
 .../gremlin-javascript/test-graphson.js         |  108 -
 .../gremlin-javascript/test-traversal.js        |   69 -
 pom.xml                                         |    4 +
 38 files changed, 4628 insertions(+), 4033 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index 85fd1aa..e5b705a 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -443,12 +443,12 @@ g.V().Repeat(Out()).Times(2).Values("name").Fold().ToList()
 Bindings
 ~~~~~~~~
 
-When a traversal bytecode is sent over a `IRemoteConnection` (e.g. Gremlin Server), it will be translated, compiled, 
-and then executed. If the same traversal is sent again, translation and compilation can be skipped as the previously 
+When a traversal bytecode is sent over a `IRemoteConnection` (e.g. Gremlin Server), it will be translated, compiled,
+and then executed. If the same traversal is sent again, translation and compilation can be skipped as the previously
 compiled version should be cached. Many traversals are unique up to some parameterization. For instance,
 `g.V(1).Out("created").Values("name")` is considered different from `g.V(4).Out("created").Values("Name")`
-as they have different script "string" representations. However, `g.V(x).Out("created").Values("name")` with bindings of 
-`{x : 1}` and `{x : 4}` are considered the same. If a traversal is going to be executed repeatedly, but with different 
+as they have different script "string" representations. However, `g.V(x).Out("created").Values("name")` with bindings of
+`{x : 1}` and `{x : 4}` are considered the same. If a traversal is going to be executed repeatedly, but with different
 parameters, then bindings should be used. In Gremlin-DotNet, bindings are objects that can be created as follows.
 
 [source,csharp]
@@ -474,7 +474,7 @@ g = g.WithoutStrategies(new SubgraphStrategy());
 names = g.V().Values("name").ToList(); // names: [marko, vadas, lop, josh, ripple, peter]
 
 var edgeValueMaps = g.V().OutE().ValueMap(true).ToList();
-// edgeValueMaps: [[label:created, id:9, weight:0.4], [label:knows, id:7, weight:0.5], [label:knows, id:8, weight:1.0], 
+// edgeValueMaps: [[label:created, id:9, weight:0.4], [label:knows, id:7, weight:0.5], [label:knows, id:8, weight:1.0],
 //     [label:created, id:10, weight:1.0], [label:created, id:11, weight:0.4], [label:created, id:12, weight:0.2]]
 
 g = g.WithComputer(workers: 2, vertices: Has("name", "marko"));
@@ -543,4 +543,75 @@ var graphsonWriter = new GraphSONWriter(
     new Dictionary<Type, IGraphSONSerializer> {{typeof(MyType), new MyClassWriter()}});
 
 var gremlinClient = new GremlinClient(new GremlinServer("localhost", 8182), graphsonReader, graphsonWriter);
+----
+
+[[gremlin-javascript]]
+Gremlin-JavaScript
+------------------
+
+Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the JavaScript language. It targets Node.js runtime
+and can be used on different operating systems on any Node.js 4 or above. Since the JavaScript naming conventions are
+very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript.
+
+[source,bash]
+npm install gremlin-javascript
+
+In Gremlin-JavaScript there exists `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes
+in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with
+<<gremlin-server,GremlinServer>>.
+
+A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`.
+
+[source,javascript]
+----
+const graph = new Graph();
+const g = graph.traversal().withRemote(new DriverRemoteConnection('ws://localhost:8182/gremlin'));
+----
+
+When a traversal from the `GraphTraversalSource` is iterated, the traversal’s `Bytecode` is sent over the wire via
+the registered `RemoteConnection`. The bytecode is used to construct the equivalent traversal at the remote
+traversal source.
+
+Since Gremlin-JavaScript currently doesn't support lambda expressions, all traversals can be translated to
+Gremlin-Java on the remote location (e.g. Gremlin Server).
+
+IMPORTANT: Gremlin-JavaScript’s `Traversal` base class supports the standard Gremlin methods such as `next()` and
+`toList()` Such "terminal" methods trigger the evaluation of the traversal.
+
+RemoteConnection Submission
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a
+`RemoteConnection` using terminal/action methods off of `Traversal`.
+
+* `Traversal.next()`
+* `Traversal.toList()`
+
+Static Enums and Methods
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as
+objects.
+
+These can be used analogously to how they are used in Gremlin-Java.
+
+[source,javascript]
+g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList()
+
+These objects must be required manually from the `process` namespace:
+
+[source,javascript]
+----
+const gremlin = require('gremlin-javascript');
+const P = gremlin.process.P;
+----
+
+Finally, using static `__` anonymous traversals like `__.out()` can be expressed as below:
+
+[source,javascript]
+----
+const gremlin = require('gremlin-javascript');
+const __ = gremlin.process.statics;
+
+g.V().repeat(__.out()).times(2).values("name").fold().toList();
 ----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index b9b78cc..1c9ffcc 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -37,6 +37,7 @@ limitations under the License.
             <version>${groovy.version}</version>
             <classifier>indy</classifier>
         </dependency>
+        <!-- TESTING -->
         <dependency>
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>tinkergraph-gremlin</artifactId>
@@ -58,12 +59,10 @@ limitations under the License.
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
-            <version>${slf4j.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
     <properties>
-        <!-- provides a way to convert maven.test.skip value to skipTests for use in skipping python tests -->
         <maven.test.skip>false</maven.test.skip>
         <skipTests>${maven.test.skip}</skipTests>
         <gremlin.server.dir>${project.parent.basedir}/gremlin-server</gremlin.server.dir>
@@ -86,33 +85,92 @@ limitations under the License.
                         <configuration>
                             <mainClass>org.apache.tinkerpop.gremlin.javascript.GenerateGremlinJavascript</mainClass>
                             <arguments>
-                                <argument>${basedir}/src/main/javascript/gremlin-javascript/process/traversal.js</argument>
-                                <argument>${basedir}/src/main/javascript/gremlin-javascript/process/graph-traversal.js</argument>
+                                <argument>${project.version}</argument>
+                                <argument>${basedir}</argument>
                             </arguments>
                         </configuration>
                     </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.gmavenplus</groupId>
+                <artifactId>gmavenplus-plugin</artifactId>
+                <dependencies>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>1.2.17</version>
+                        <scope>runtime</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.tinkerpop</groupId>
+                        <artifactId>gremlin-server</artifactId>
+                        <version>${project.version}</version>
+                        <scope>runtime</scope>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.codehaus.groovy</groupId>
+                        <artifactId>groovy-ant</artifactId>
+                        <version>${groovy.version}</version>
+                    </dependency>
+                </dependencies>
+                <executions>
                     <execution>
-                        <id>js-tests</id>
-                        <phase>test</phase>
+                        <id>gremlin-server-start</id>
+                        <phase>pre-integration-test</phase>
                         <goals>
-                            <goal>exec</goal>
+                            <goal>execute</goal>
                         </goals>
                         <configuration>
-                            <executable>jjs</executable>
-                            <arguments>
-                                <argument>${basedir}/src/test/javascript/gremlin-javascript/test-exports.js</argument>
-                                <argument>${basedir}/src/test/javascript/gremlin-javascript/test-graphson.js</argument>
-                                <argument>${basedir}/src/test/javascript/gremlin-javascript/test-traversal.js</argument>
-                            </arguments>
+                            <scripts>
+                                <script>
+                                    <![CDATA[
+import org.apache.tinkerpop.gremlin.server.GremlinServer
+import org.apache.tinkerpop.gremlin.server.Settings
+import org.apache.tinkerpop.gremlin.server.Settings.ScriptEngineSettings
+import org.apache.tinkerpop.gremlin.server.op.session.Session
+
+if (${skipIntegrationTests}) return
+log.info("Starting Gremlin Server instances for native testing of gremlin-javascript")
+def settings = Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern.yaml")
+settings.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties"
+settings.scriptEngines["gremlin-groovy"].scripts = ["${gremlin.server.dir}/scripts/generate-modern.groovy"]
+settings.port = 45950
+def server = new GremlinServer(settings)
+server.start().join()
+project.setContextValue("gremlin.javascript.server", server)
+log.info("Gremlin Server started on port 45950")
+]]>
+                                </script>
+                            </scripts>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>gremlin-server-stop</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            <scripts>
+                                <script>
+                                    <![CDATA[
+import org.apache.tinkerpop.gremlin.server.GremlinServer
+import org.apache.tinkerpop.gremlin.server.op.session.Session
+
+if (${skipIntegrationTests}) return
+log.info("Tests for native gremlin-javascript complete")
+def server = project.getContextValue("gremlin.javascript.server")
+log.info("Shutting down $server")
+server.stop().join()
+]]>
+                                </script>
+                            </scripts>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.codehaus.gmavenplus</groupId>
-                <artifactId>gmavenplus-plugin</artifactId>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-clean-plugin</artifactId>
                 <version>3.0.0</version>
@@ -124,6 +182,85 @@ limitations under the License.
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>com.github.eirslett</groupId>
+                <artifactId>frontend-maven-plugin</artifactId>
+                <version>1.4</version>
+                <executions>
+                    <execution>
+                        <id>install node and npm</id>
+                        <goals>
+                            <goal>install-node-and-npm</goal>
+                        </goals>
+                        <phase>generate-test-resources</phase>
+                    </execution>
+                    <execution>
+                        <id>npm install</id>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+                        <phase>generate-test-resources</phase>
+                        <configuration>
+                            <arguments>install</arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>npm test</id>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+                        <phase>integration-test</phase>
+                        <configuration>
+                            <arguments>test</arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+                <configuration>
+                    <skip>${skipIntegrationTests}</skip>
+                    <workingDirectory>src/main/javascript/gremlin-javascript</workingDirectory>
+                    <nodeVersion>v4.8.3</nodeVersion>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
+    <profiles>
+        <!--
+        Provides a way to deploy the gremlin-javascript GLV to npm. This cannot be part of the standard maven execution
+        because npm does not have a staging environment like sonatype for releases. As soon as the release is
+        published it is public. In our release workflow, deploy occurs prior to vote on the release and we can't
+        make this stuff public until the vote is over.
+        -->
+        <profile>
+            <id>glv-javascript-deploy</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.github.eirslett</groupId>
+                        <artifactId>frontend-maven-plugin</artifactId>
+                        <version>1.4</version>
+                        <executions>
+                            <execution>
+                                <id>npm publish</id>
+                                <phase>deploy</phase>
+                                <goals>
+                                    <goal>npm</goal>
+                                </goals>
+                                <configuration>
+                                    <arguments>publish</arguments>
+                                </configuration>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <skip>${skipIntegrationTests}</skip>
+                            <workingDirectory>src/main/javascript/gremlin-javascript</workingDirectory>
+                            <nodeVersion>v4.8.3</nodeVersion>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.groovy
new file mode 100644
index 0000000..ab9eaf1
--- /dev/null
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.groovy
@@ -0,0 +1,36 @@
+/*
+ *  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.javascript
+
+public class GenerateGremlinJavascript {
+    public static void main(String[] args) {
+        String projectVersion = args[0];
+        final String baseDir = args[1];
+        final String jsModuleDir = "${baseDir}/src/main/javascript/gremlin-javascript";
+        Integer versionSnapshotIndex = projectVersion.indexOf("-SNAPSHOT");
+        if (versionSnapshotIndex > 0) {
+            // Use a alpha version x.y.z-alpha1
+            projectVersion = projectVersion.substring(0, versionSnapshotIndex) + "-alpha1";
+        }
+        TraversalSourceGenerator.create("$jsModuleDir/lib/process/traversal.js");
+        GraphTraversalSourceGenerator.create("$jsModuleDir/lib/process/graph-traversal.js");
+        PackageJsonGenerator.create("$jsModuleDir/package.json", projectVersion);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
index 0ae6079..3227f2c 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/GraphTraversalSourceGenerator.groovy
@@ -23,7 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource
 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.process.traversal.dsl.graph.__
-import org.apache.tinkerpop.gremlin.javascript.jsr223.SymbolHelper
+import org.apache.tinkerpop.gremlin.javascript.SymbolHelper
 
 import java.lang.reflect.Modifier
 
@@ -63,45 +63,46 @@ class GraphTraversalSourceGenerator {
 /**
  * @author Jorge Bay Gondra
  */
-(function defineGraphTraversalModule() {
-  "use strict";
-
-  var t = loadModule.call(this, './traversal.js');
-  var remote = loadModule.call(this, '../driver/remote-connection.js');
-  var Bytecode = t.Bytecode;
-  var inherits = t.inherits;
-  var parseArgs = t.parseArgs;
-
-  /**
-   *
-   * @param {Graph} graph
-   * @param {TraversalStrategies} traversalStrategies
-   * @param {Bytecode} [bytecode]
-   * @constructor
-   */
-  function GraphTraversalSource(graph, traversalStrategies, bytecode) {
-    this.graph = graph;
-    this.traversalStrategies = traversalStrategies;
-    this.bytecode = bytecode || new Bytecode();
-  }
-
-  /**
-   * @param remoteConnection
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
-    var traversalStrategy = new t.TraversalStrategies(this.traversalStrategies);
-    traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-    return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
-  };
-
-  /**
-   * Returns the string representation of the GraphTraversalSource.
-   * @returns {string}
-   */
-  GraphTraversalSource.prototype.toString = function () {
-    return 'graphtraversalsource[' + this.graph.toString() + ']';
-  };
+'use strict';
+
+var t = require('./traversal.js');
+var remote = require('../driver/remote-connection');
+var utils = require('../utils');
+var Bytecode = require('./bytecode');
+var TraversalStrategies = require('./traversal-strategy').TraversalStrategies;
+var inherits = utils.inherits;
+var parseArgs = utils.parseArgs;
+
+/**
+ *
+ * @param {Graph} graph
+ * @param {TraversalStrategies} traversalStrategies
+ * @param {Bytecode} [bytecode]
+ * @constructor
+ */
+function GraphTraversalSource(graph, traversalStrategies, bytecode) {
+  this.graph = graph;
+  this.traversalStrategies = traversalStrategies;
+  this.bytecode = bytecode || new Bytecode();
+}
+
+/**
+ * @param remoteConnection
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
+  var traversalStrategy = new TraversalStrategies(this.traversalStrategies);
+  traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
+  return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
+};
+
+/**
+ * Returns the string representation of the GraphTraversalSource.
+ * @returns {string}
+ */
+GraphTraversalSource.prototype.toString = function () {
+  return 'graphtraversalsource[' + this.graph.toString() + ']';
+};
 """)
         GraphTraversalSource.getMethods(). // SOURCE STEPS
                 findAll { GraphTraversalSource.class.equals(it.returnType) }.
@@ -110,40 +111,40 @@ class GraphTraversalSourceGenerator {
                             !it.name.equals(TraversalSource.Symbols.withBindings) &&
                             !it.name.equals(TraversalSource.Symbols.withRemote)
                 }.
-                collect { SymbolHelper.toJs(it.name) }.
+                collect { it.name }.
                 unique().
                 sort { a, b -> a <=> b }.
-                forEach { method ->
+                forEach { methodName ->
                     moduleOutput.append(
                             """
-  /**
-   * ${method} GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.${method} = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
+/**
+ * Graph Traversal Source ${methodName} method.
+ * @param {...Object} args
+ * @returns {GraphTraversalSource}
+ */
+GraphTraversalSource.prototype.${SymbolHelper.toJs(methodName)} = function (args) {
+  var b = new Bytecode(this.bytecode).addSource('$methodName', parseArgs.apply(null, arguments));
+  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
 """)
                 }
-        GraphTraversalSource.getMethods(). // SPAWN STEPS
+        GraphTraversalSource.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
-                collect { SymbolHelper.toJs(it.name) }.
+                collect { it.name }.
                 unique().
                 sort { a, b -> a <=> b }.
-                forEach { method ->
+                forEach { methodName ->
                     moduleOutput.append(
                             """
-  /**
-   * ${method} GraphTraversalSource step method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversalSource.prototype.${method} = function (args) {
-    var b = new Bytecode(this.bytecode).addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
+/**
+ * $methodName GraphTraversalSource step method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversalSource.prototype.${SymbolHelper.toJs(methodName)} = function (args) {
+  var b = new Bytecode(this.bytecode).addStep('$methodName', parseArgs.apply(null, arguments));
+  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+};
 """)
                 }
 ////////////////////
@@ -151,34 +152,35 @@ class GraphTraversalSourceGenerator {
 ////////////////////
         moduleOutput.append(
                 """
-  /**
-   * Represents a graph traversal.
-   * @extends Traversal
-   * @constructor
-   */
-  function GraphTraversal(graph, traversalStrategies, bytecode) {
-    t.Traversal.call(this, graph, traversalStrategies, bytecode);
-  }
-
-  inherits(GraphTraversal, t.Traversal);
+/**
+ * Represents a graph traversal.
+ * @extends Traversal
+ * @constructor
+ */
+function GraphTraversal(graph, traversalStrategies, bytecode) {
+  t.Traversal.call(this, graph, traversalStrategies, bytecode);
+}
+
+inherits(GraphTraversal, t.Traversal);
 """)
         GraphTraversal.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { !it.name.equals("clone") && !it.name.equals("iterate") }.
-                collect { SymbolHelper.toJs(it.name) }.
+                collect { it.name }.
                 unique().
                 sort { a, b -> a <=> b }.
-                forEach { method ->
+                forEach { methodName ->
                     moduleOutput.append(
                             """
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.${method} = function (args) {
-    this.bytecode.addStep('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
-    return this;
-  };
+/**
+ * Graph traversal $methodName method.
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+GraphTraversal.prototype.${SymbolHelper.toJs(methodName)} = function (args) {
+  this.bytecode.addStep('$methodName', parseArgs.apply(null, arguments));
+  return this;
+};
 """)
                 };
 
@@ -186,11 +188,11 @@ class GraphTraversalSourceGenerator {
 // AnonymousTraversal //
 ////////////////////////
         moduleOutput.append("""
-  /**
-   * Contains the static method definitions
-   * @type {Object}
-   */
-  var statics = {};
+/**
+ * Contains the static method definitions
+ * @type {Object}
+ */
+var statics = {};
 """);
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
@@ -202,44 +204,24 @@ class GraphTraversalSourceGenerator {
                 forEach { method ->
                     moduleOutput.append(
                             """
-  /**
-   * ${method}() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.${method} = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.${method}.apply(g, arguments);
-  };
+/**
+ * ${method}() static method
+ * @param {...Object} args
+ * @returns {GraphTraversal}
+ */
+statics.${method} = function (args) {
+  var g = new GraphTraversal(null, null, new Bytecode());
+  return g.${method}.apply(g, arguments);
+};
 """)
                 };
 
         moduleOutput.append("""
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
-
-  var toExport = {
-    GraphTraversal: GraphTraversal,
-    GraphTraversalSource: GraphTraversalSource,
-    statics: statics
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);""")
+module.exports = {
+  GraphTraversal: GraphTraversal,
+  GraphTraversalSource: GraphTraversalSource,
+  statics: statics
+};""");
 
         // save to file
         final File file = new File(graphTraversalSourceFile);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/PackageJsonGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/PackageJsonGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/PackageJsonGenerator.groovy
new file mode 100644
index 0000000..4b4d012
--- /dev/null
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/PackageJsonGenerator.groovy
@@ -0,0 +1,72 @@
+/*
+ *  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.javascript
+
+/**
+ * @author Jorge Bay Gondra
+ */
+class PackageJsonGenerator {
+
+    public static void create(final String traversalSourceFile, final String version) {
+
+        final StringBuilder moduleOutput = new StringBuilder();
+        moduleOutput.append("""{
+  "name": "gremlin-javascript",
+  "version": "${version}",
+  "description": "JavaScript Gremlin Language Variant",
+  "author": "Apache TinkerPop team",
+  "keywords": [
+    "graph",
+    "gremlin",
+    "tinkerpop",
+    "connection",
+    "glv",
+    "driver",
+    "graphdb"
+  ],
+  "license": "Apache-2.0",
+  "dependencies": {
+    "ws": "^3.0.0"
+  },
+  "devDependencies": {
+    "mocha": ">= 1.14.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/tinkerpop.git"
+  },
+  "bugs": {
+    "url": "https://issues.apache.org/jira/browse/TINKERPOP"
+  },
+  "scripts": {
+    "test": "./node_modules/.bin/mocha test --recursive -t 5000",
+    "unit-test": "./node_modules/.bin/mocha test/unit"
+  },
+  "engines": {
+    "node": ">=4"
+  }
+}"""    );
+
+        // save to a file
+        final File file = new File(traversalSourceFile);
+        file.delete()
+        moduleOutput.eachLine { file.append(it + "\n") }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/SymbolHelper.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/SymbolHelper.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/SymbolHelper.groovy
new file mode 100644
index 0000000..ed45cdb
--- /dev/null
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/SymbolHelper.groovy
@@ -0,0 +1,50 @@
+/*
+ *  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.javascript
+
+/**
+ * @author Jorge Bay Gondra
+ */
+public final class SymbolHelper {
+
+    private final static Map<String, String> TO_JS_MAP = new HashMap<>();
+
+    static {
+        TO_JS_MAP.put("in", "in_");
+        TO_JS_MAP.put("from", "from_");
+    }
+
+    private SymbolHelper() {
+        // static methods only, do not instantiate
+    }
+
+    public static String toJs(final String symbol) {
+        return TO_JS_MAP.getOrDefault(symbol, symbol);
+    }
+
+    public static String decapitalize(String string) {
+        if (string == null || string.length() == 0) {
+            return string;
+        }
+        def c = string.toCharArray();
+        c[0] = Character.toLowerCase(c[0]);
+        return new String(c);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
index d5899f0..f3405c3 100644
--- a/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
+++ b/gremlin-javascript/src/main/groovy/org/apache/tinkerpop/gremlin/javascript/TraversalSourceGenerator.groovy
@@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.javascript
 
 import org.apache.tinkerpop.gremlin.process.traversal.P
 import org.apache.tinkerpop.gremlin.util.CoreImports
-import org.apache.tinkerpop.gremlin.javascript.jsr223.SymbolHelper
 
 import java.lang.reflect.Modifier
 
@@ -57,334 +56,178 @@ class TraversalSourceGenerator {
 /**
  * @author Jorge Bay Gondra
  */
-(function defineTraversalModule() {
-  "use strict";
-
-  function Traversal(graph, traversalStrategies, bytecode) {
-    this.graph = graph;
-    this.traversalStrategies = traversalStrategies;
-    this.bytecode = bytecode;
-    this.traversers = null;
-    this.sideEffects = null;
-  }
+'use strict';
+
+var utils = require('../utils');
+var parseArgs = utils.parseArgs;
+var itemDone = Object.freeze({ value: null, done: true });
+var emptyArray = Object.freeze([]);
+
+function Traversal(graph, traversalStrategies, bytecode) {
+  this.graph = graph;
+  this.traversalStrategies = traversalStrategies;
+  this.bytecode = bytecode;
+  this.traversers = null;
+  this.sideEffects = null;
+  this._traversalStrategiesPromise = null;
+  this._traversersIteratorIndex = 0;
+}
 
-  /** @returns {Bytecode} */
-  Traversal.prototype.getBytecode = function () {
-    return this.bytecode;
-  };
+/** @returns {Bytecode} */
+Traversal.prototype.getBytecode = function () {
+  return this.bytecode;
+};
 
-  /** @param {Function} callback */
-  Traversal.prototype.list = function (callback) {
-    var self = this;
-    this.traversalStrategies.applyStrategies(this, function (err) {
-      if (err) {
-        return callback(err);
-      }
-      callback(err, self.traversers);
-    });
-  };
+/**
+ * Returns an Array containing the traverser objects.
+ * @returns {Promise.<Array>}
+ */
+Traversal.prototype.toList = function () {
+  var self = this;
+  return this._applyStrategies().then(function () {
+    if (!self.traversers || self._traversersIteratorIndex === self.traversers.length) {
+      return emptyArray;
+    }
+    var arr = new Array(self.traversers.length - self._traversersIteratorIndex);
+    for (var i = self._traversersIteratorIndex; i < self.traversers.length; i++) {
+      arr[i] = self.traversers[i].object;
+    }
+    self._traversersIteratorIndex = self.traversers.length;
+    return arr;
+  });
+};
 
-  /** @param {Function} callback */
-  Traversal.prototype.one = function (callback) {
-    this.list(function (err, result) {
-      callback(err, result && result.length > 0 ? result[0] : null);
-    });
-  };
+/**
+ * Async iterator method implementation.
+ * Returns a promise containing an iterator item.
+ * @returns {Promise.<{value, done}>}
+ */
+Traversal.prototype.next = function () {
+  var self = this;
+  return this._applyStrategies().then(function () {
+    if (!self.traversers || self._traversersIteratorIndex === self.traversers.length) {
+      return itemDone;
+    }
+    return { value: self.traversers[self._traversersIteratorIndex++].object, done: false };
+  });
+};
+
+Traversal.prototype._applyStrategies = function () {
+  if (this._traversalStrategiesPromise) {
+    // Apply strategies only once
+    return this._traversalStrategiesPromise;
+  }
+  return this._traversalStrategiesPromise = this.traversalStrategies.applyStrategies(this);
+};
 
-  /**
-   * Returns the Bytecode JSON representation of the traversal
-   * @returns {String}
-   */
-  Traversal.prototype.toString = function () {
-    return this.bytecode.toString();
-  };
+/**
+ * Returns the Bytecode JSON representation of the traversal
+ * @returns {String}
+ */
+Traversal.prototype.toString = function () {
+  return this.bytecode.toString();
+};
   """);
 
         moduleOutput.append("""
-  /**
-   * Represents an operation.
-   * @constructor
-   */
-  function P(operator, value, other) {
-    this.operator = operator;
-    this.value = value;
-    this.other = other;
-  }
-
-  /**
-   * Returns the string representation of the instance.
-   * @returns {string}
-   */
-  P.prototype.toString = function () {
-    if (this.other === undefined) {
-      return this.operator + '(' + this.value + ')';
-    }
-    return this.operator + '(' + this.value + ', ' + this.other + ')';
-  };
+/**
+ * Represents an operation.
+ * @constructor
+ */
+function P(operator, value, other) {
+  this.operator = operator;
+  this.value = value;
+  this.other = other;
+}
 
-  function createP(operator, args) {
-    args.unshift(null, operator);
-    return new (Function.prototype.bind.apply(P, args));
+/**
+ * Returns the string representation of the instance.
+ * @returns {string}
+ */
+P.prototype.toString = function () {
+  if (this.other === undefined) {
+    return this.operator + '(' + this.value + ')';
   }
+  return this.operator + '(' + this.value + ', ' + this.other + ')';
+};
+
+function createP(operator, args) {
+  args.unshift(null, operator);
+  return new (Function.prototype.bind.apply(P, args));
+}
 """)
         P.class.getMethods().
                 findAll { Modifier.isStatic(it.getModifiers()) }.
                 findAll { P.class.isAssignableFrom(it.returnType) }.
-                collect { SymbolHelper.toJs(it.name) }.
+                collect { it.name }.
                 unique().
                 sort { a, b -> a <=> b }.
-                each { method ->
+                each { methodName ->
                     moduleOutput.append(
                             """
-  /** @param {...Object} args */
-  P.${method} = function (args) {
-    return createP('${SymbolHelper.toJava(method)}', parseArgs.apply(null, arguments));
-  };
+/** @param {...Object} args */
+P.${SymbolHelper.toJs(methodName)} = function (args) {
+  return createP('$methodName', parseArgs.apply(null, arguments));
+};
 """)
                 };
         moduleOutput.append("""
-  P.prototype.and = function (arg) {
-    return new P('and', this, arg);
-  };
+P.prototype.and = function (arg) {
+  return new P('and', this, arg);
+};
 
-  P.prototype.or = function (arg) {
-    return new P('or', this, arg);
-  };
+P.prototype.or = function (arg) {
+  return new P('or', this, arg);
+};
 """)
 
         moduleOutput.append("""
-  function Traverser(object, bulk) {
-    this.object = object;
-    this.bulk = bulk == undefined ? 1 : bulk;
-  }
-
-  function TraversalSideEffects() {
-
-  }
-
-  /**
-   * Creates a new instance of TraversalStrategies.
-   * @param {TraversalStrategies} [traversalStrategies]
-   * @constructor
-   */
-  function TraversalStrategies(traversalStrategies) {
-    /** @type {Array<TraversalStrategy>} */
-    this.strategies = traversalStrategies ? traversalStrategies.strategies : [];
-  }
-
-  /** @param {TraversalStrategy} strategy */
-  TraversalStrategies.prototype.addStrategy = function (strategy) {
-    this.strategies.push(strategy);
-  };
-
-  /**
-   * @param {Traversal} traversal
-   * @param {Function} callback
-   */
-  TraversalStrategies.prototype.applyStrategies = function (traversal, callback) {
-    eachSeries(this.strategies, function eachStrategy(s, next) {
-      s.apply(traversal, next);
-    }, callback);
-  };
-
-  /**
-   * @abstract
-   * @constructor
-   */
-  function TraversalStrategy() {
-
-  }
-
-  /**
-   * @abstract
-   * @param {Traversal} traversal
-   * @param {Function} callback
-   */
-  TraversalStrategy.prototype.apply = function (traversal, callback) {
-
-  };
-
-  /**
-   * Creates a new instance of Bytecode
-   * @param {Bytecode} [toClone]
-   * @constructor
-   */
-  function Bytecode(toClone) {
-    this._bindings = {};
-    if (!toClone) {
-      this.sourceInstructions = [];
-      this.stepInstructions = [];
-    }
-    else {
-      this.sourceInstructions = toClone.sourceInstructions.slice(0);
-      this.stepInstructions = toClone.sourceInstructions.slice(0);
-    }
-  }
-
-  /**
-   * Adds a new source instructions
-   * @param {String} name
-   * @param {Array} values
-   * @returns {Bytecode}
-   */
-  Bytecode.prototype.addSource = function (name, values) {
-    if (name === undefined) {
-      throw new Error('Name is not defined');
-    }
-    var instruction = new Array(values.length + 1);
-    instruction[0] = name;
-    for (var i = 0; i < values.length; ++i) {
-      instruction[i + 1] = this._convertToArgument(values[i]);
-    }
-    this.sourceInstructions.push(this._generateInstruction(name, values));
-    return this;
-  };
-
-  /**
-   * Adds a new step instructions
-   * @param {String} name
-   * @param {Array} values
-   * @returns {Bytecode}
-   */
-  Bytecode.prototype.addStep = function (name, values) {
-    if (name === undefined) {
-      throw new Error('Name is not defined');
-    }
-    this.stepInstructions.push(this._generateInstruction(name, values));
-    return this;
-  };
-
-  Bytecode.prototype._generateInstruction = function (name, values) {
-    var instruction = new Array(values.length + 1);
-    instruction[0] = name;
-    for (var i = 0; i < values.length; ++i) {
-      instruction[i + 1] = this._convertToArgument(values[i]);
-    }
-    return instruction;
-  };
-
-  /**
-   * Returns the JSON representation of the source and step instructions
-   * @returns {String}
-   */
-  Bytecode.prototype.toString = function () {
-    return (
-      (this.sourceInstructions.length > 0 ? JSON.stringify(this.sourceInstructions) : '') +
-      (this.stepInstructions.length   > 0 ? JSON.stringify(this.stepInstructions) : '')
-    );
-  };
-
-  Bytecode.prototype._convertToArgument = function (value) {
-    return value;
-  };
-
-  function toEnum(typeName, keys) {
-    var result = {};
-    keys.split(' ').forEach(function (k) {
-      if (k === k.toUpperCase()) {
-        k = k.toLowerCase();
-      }
-      result[k] = new EnumValue(typeName, k);
-    });
-    return result;
-  }
-
-  function EnumValue(typeName, elementName) {
-    this.typeName = typeName;
-    this.elementName = elementName;
-  }
+function Traverser(object, bulk) {
+  this.object = object;
+  this.bulk = bulk == undefined ? 1 : bulk;
+}
 
-  // Utility functions
-  /** @returns {Array} */
-  function parseArgs() {
-    return (arguments.length === 1 ? [ arguments[0] ] : Array.apply(null, arguments));
-  }
+function TraversalSideEffects() {
 
-  /**
-   * @param {Array} arr
-   * @param {Function} fn
-   * @param {Function} [callback]
-   */
-  function eachSeries(arr, fn, callback) {
-    if (!Array.isArray(arr)) {
-      throw new TypeError('First parameter is not an Array');
-    }
-    callback = callback || noop;
-    var length = arr.length;
-    if (length === 0) {
-      return callback();
-    }
-    var sync;
-    var index = 1;
-    fn(arr[0], next);
-    if (sync === undefined) {
-      sync = false;
-    }
+}
 
-    function next(err) {
-      if (err) {
-        return callback(err);
-      }
-      if (index >= length) {
-        return callback();
-      }
-      if (sync === undefined) {
-        sync = true;
-      }
-      if (sync) {
-        return process.nextTick(function () {
-          fn(arr[index++], next);
-        });
-      }
-      fn(arr[index++], next);
+function toEnum(typeName, keys) {
+  var result = {};
+  keys.split(' ').forEach(function (k) {
+    var jsKey = k;
+    if (jsKey === jsKey.toUpperCase()) {
+      jsKey = jsKey.toLowerCase();
     }
-  }
+    result[jsKey] = new EnumValue(typeName, k);
+  });
+  return result;
+}
 
-  function inherits(ctor, superCtor) {
-    ctor.super_ = superCtor;
-    ctor.prototype = Object.create(superCtor.prototype, {
-      constructor: {
-        value: ctor,
-        enumerable: false,
-        writable: true,
-        configurable: true
-      }
-    });
-  }
+function EnumValue(typeName, elementName) {
+  this.typeName = typeName;
+  this.elementName = elementName;
+}
 
-  var toExport = {
-    Bytecode: Bytecode,
-    EnumValue: EnumValue,
-    inherits: inherits,
-    P: P,
-    parseArgs: parseArgs,
-    Traversal: Traversal,
-    TraversalSideEffects: TraversalSideEffects,
-    TraversalStrategies: TraversalStrategies,
-    TraversalStrategy: TraversalStrategy,
-    Traverser: Traverser""")
-        for (final Class<? extends Enum> enumClass : CoreImports.getClassImports()
-                .findAll { Enum.class.isAssignableFrom(it) }
-                .sort { a, b -> a.getSimpleName() <=> b.getSimpleName() }
-                .collect()) {
-            moduleOutput.append(",\n    ${SymbolHelper.decapitalize(enumClass.getSimpleName())}: " +
-                    "toEnum('${SymbolHelper.toJs(enumClass.getSimpleName())}', '");
-            enumClass.getEnumConstants()
-                    .sort { a, b -> a.name() <=> b.name() }
-                    .each { value -> moduleOutput.append("${SymbolHelper.toJs(value.name())} "); }
-            moduleOutput.deleteCharAt(moduleOutput.length() - 1).append("')")
+module.exports = {
+  EnumValue: EnumValue,
+  P: P,
+  Traversal: Traversal,
+  TraversalSideEffects: TraversalSideEffects,
+  Traverser: Traverser""")
+        for (final Class<? extends Enum> enumClass : CoreImports.getClassImports().
+                findAll { Enum.class.isAssignableFrom(it) }.
+                sort { a, b -> a.simpleName <=> b.simpleName }) {
+            moduleOutput.append(",\n  ${SymbolHelper.decapitalize(enumClass.simpleName)}: " +
+                    "toEnum('${SymbolHelper.toJs(enumClass.simpleName)}', '");
+            moduleOutput.append(
+                enumClass.getEnumConstants().
+                        sort { a, b -> a.name() <=> b.name() }.
+                        collect { SymbolHelper.toJs(it.name()) }.
+                        join(' '));
+            moduleOutput.append("\')");
         }
 
-        moduleOutput.append("""
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);""")
+        moduleOutput.append("""\n};""");
 
         // save to a file
         final File file = new File(traversalSourceFile);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java b/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java
deleted file mode 100644
index 1656db4..0000000
--- a/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/GenerateGremlinJavascript.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *  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.javascript;
-
-public class GenerateGremlinJavascript {
-
-    private GenerateGremlinJavascript() {
-        // just need the main method
-    }
-
-    public static void main(String[] args) {
-        TraversalSourceGenerator.create(args[0]);
-        GraphTraversalSourceGenerator.create(args[1]);
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java b/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java
deleted file mode 100644
index 535de44..0000000
--- a/gremlin-javascript/src/main/java/org/apache/tinkerpop/gremlin/javascript/jsr223/SymbolHelper.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *  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.javascript.jsr223;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Jorge Bay Gondra
- */
-public final class SymbolHelper {
-
-    private final static Map<String, String> TO_JS_MAP = new HashMap<>();
-    private final static Map<String, String> FROM_JS_MAP = new HashMap<>();
-
-    static {
-        TO_JS_MAP.put("in", "in_");
-        TO_JS_MAP.put("from", "from_");
-        TO_JS_MAP.forEach((k, v) -> FROM_JS_MAP.put(v, k));
-    }
-
-    private SymbolHelper() {
-        // static methods only, do not instantiate
-    }
-
-    public static String toJs(final String symbol) {
-        return TO_JS_MAP.getOrDefault(symbol, symbol);
-    }
-
-    public static String toJava(final String symbol) {
-        return FROM_JS_MAP.getOrDefault(symbol, symbol);
-    }
-
-    public static String decapitalize(String string) {
-        if (string == null || string.length() == 0) {
-            return string;
-        }
-        char c[] = string.toCharArray();
-        c[0] = Character.toLowerCase(c[0]);
-        return new String(c);
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
new file mode 100644
index 0000000..4c7120c
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
@@ -0,0 +1,5 @@
+node_modules/
+.idea/
+npm-debug.log
+# maven plugin com.github.eirslett frontend-maven-plugin installs node.js runtime in "node" folder
+node/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/.npmignore
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.npmignore b/gremlin-javascript/src/main/javascript/gremlin-javascript/.npmignore
new file mode 100644
index 0000000..82943d0
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.npmignore
@@ -0,0 +1,26 @@
+# 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.
+
+*.gz
+*.tgz
+test/
+.DS_Store
+.idea
+node_modules/
+npm-debug.log
+# maven plugin com.github.eirslett frontend-maven-plugin installs node.js runtime in "node" folder
+node/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/README.md
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/README.md b/gremlin-javascript/src/main/javascript/gremlin-javascript/README.md
new file mode 100644
index 0000000..388e175
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/README.md
@@ -0,0 +1,39 @@
+<!--
+
+ 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.
+
+-->
+
+# JavaScript Gremlin Language Variant
+
+[Apache TinkerPopâ„¢][tk] is a graph computing framework for both graph databases (OLTP) and graph analytic systems
+(OLAP). [Gremlin][gremlin] is the graph traversal language of TinkerPop. It can be described as a functional,
+data-flow language that enables users to succinctly express complex traversals on (or queries of) their application's
+property graph.
+
+Gremlin-Javascript implements Gremlin within the JavaScript language and can be used on Node.js.
+
+```bash
+npm install gremlin-javascript
+```
+
+Please see the [reference documentation][docs] at Apache TinkerPop for more information.
+
+[tk]: http://tinkerpop.apache.org
+[gremlin]: http://tinkerpop.apache.org/gremlin.html
+[docs]: http://tinkerpop.apache.org/docs/current/reference/#gremlin-javascript
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
deleted file mode 100644
index e19b537..0000000
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/driver/remote-connection.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineRemoteConnectionModule() {
-  "use strict";
-
-  var t = loadModule.call(this, '../process/traversal.js');
-  var inherits = t.inherits;
-
-  function RemoteConnection(url, traversalSource) {
-    this.url = url;
-    this.traversalSource = traversalSource;
-  }
-
-  /**
-   * @abstract
-   * @param {Bytecode} bytecode
-   * @param {Function} callback
-   */
-  RemoteConnection.prototype.submit = function (bytecode, callback) {
-    throw new Error('submit() needs to be implemented');
-  };
-
-  /**
-   * @extends {Traversal}
-   * @constructor
-   */
-  function RemoteTraversal(traversers, sideEffects) {
-    t.Traversal.call(this, null, null, null);
-    this.traversers = traversers;
-    this.sideEffects = sideEffects;
-  }
-
-  inherits(RemoteTraversal, t.Traversal);
-
-  /**
-   *
-   * @param {RemoteConnection} connection
-   * @extends {TraversalStrategy}
-   * @constructor
-   */
-  function RemoteStrategy(connection) {
-    t.TraversalStrategy.call(this);
-    this.connection = connection;
-  }
-
-  inherits(RemoteStrategy, t.TraversalStrategy);
-
-  /** @override */
-  RemoteStrategy.prototype.apply = function (traversal, callback) {
-    if (traversal.traversers) {
-      return callback();
-    }
-    this.connection.submit(traversal.getBytecode(), function (err, remoteTraversal) {
-      if (err) {
-        return callback(err);
-      }
-      traversal.sideEffects = remoteTraversal.sideEffects;
-      traversal.traversers = remoteTraversal.traversers;
-      callback();
-    });
-  };
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
-
-  var toExport = {
-    RemoteConnection: RemoteConnection,
-    RemoteStrategy: RemoteStrategy,
-    RemoteTraversal: RemoteTraversal
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
index ddcdac2..600ac53 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
@@ -20,73 +20,54 @@
 /**
  * @author Jorge Bay Gondra
  */
-(function exportModule() {
-  "use strict";
+'use strict';
 
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
+var t = require('./lib/process/traversal');
+var gt = require('./lib/process/graph-traversal');
+var strategiesModule = require('./lib/process/traversal-strategy');
+var graph = require('./lib/structure/graph');
+var gs = require('./lib/structure/io/graph-serializer');
+var rc = require('./lib/driver/remote-connection');
+var Bytecode = require('./lib/process/bytecode');
 
-  var t = loadModule.call(this, './process/traversal.js');
-  var gt = loadModule.call(this, './process/graph-traversal.js');
-  var graph = loadModule.call(this, './structure/graph.js');
-  var gs = loadModule.call(this, './structure/io/graph-serializer.js');
-  var rc = loadModule.call(this, './driver/remote-connection.js');
-  var toExport = {
-    driver: {
-      RemoteConnection: rc.RemoteConnection,
-      RemoteStrategy: rc.RemoteStrategy,
-      RemoteTraversal: rc.RemoteTraversal
-    },
-    process: {
-      Bytecode: t.Bytecode,
-      EnumValue: t.EnumValue,
-      P: t.P,
-      Traversal: t.Traversal,
-      TraversalSideEffects: t.TraversalSideEffects,
-      TraversalStrategies: t.TraversalStrategies,
-      TraversalStrategy: t.TraversalStrategy,
-      Traverser: t.Traverser,
-      barrier: t.barrier,
-      cardinality: t.cardinality,
-      column: t.column,
-      direction: t.direction,
-      operator: t.operator,
-      order: t.order,
-      pop: t.pop,
-      scope: t.scope,
-      t: t.t,
-      GraphTraversal: gt.GraphTraversal,
-      GraphTraversalSource: gt.GraphTraversalSource,
-      statics: gt.statics
+module.exports = {
+  driver: {
+    RemoteConnection: rc.RemoteConnection,
+    RemoteStrategy: rc.RemoteStrategy,
+    RemoteTraversal: rc.RemoteTraversal
+  },
+  process: {
+    Bytecode: Bytecode,
+    EnumValue: t.EnumValue,
+    P: t.P,
+    Traversal: t.Traversal,
+    TraversalSideEffects: t.TraversalSideEffects,
+    TraversalStrategies: strategiesModule.TraversalStrategies,
+    TraversalStrategy: strategiesModule.TraversalStrategy,
+    Traverser: t.Traverser,
+    barrier: t.barrier,
+    cardinality: t.cardinality,
+    column: t.column,
+    direction: t.direction,
+    operator: t.operator,
+    order: t.order,
+    pop: t.pop,
+    scope: t.scope,
+    t: t.t,
+    GraphTraversal: gt.GraphTraversal,
+    GraphTraversalSource: gt.GraphTraversalSource,
+    statics: gt.statics
+  },
+  structure: {
+    io: {
+      GraphSONReader: gs.GraphSONReader,
+      GraphSONWriter: gs.GraphSONWriter
     },
-    structure: {
-      io: {
-        GraphSONReader: gs.GraphSONReader,
-        GraphSONWriter: gs.GraphSONWriter
-      },
-      Edge: graph.Edge,
-      Graph: graph.Graph,
-      Path: graph.Path,
-      Property: graph.Property,
-      Vertex: graph.Vertex,
-      VertexProperty: graph.VertexProperty
-    }
-  };
-
-
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
+    Edge: graph.Edge,
+    Graph: graph.Graph,
+    Path: graph.Path,
+    Property: graph.Property,
+    Vertex: graph.Vertex,
+    VertexProperty: graph.VertexProperty
   }
-  return toExport;
-}).call(this);
\ No newline at end of file
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
new file mode 100644
index 0000000..0d6d507
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
@@ -0,0 +1,200 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var crypto = require('crypto');
+var WebSocket = require('ws');
+var util = require('util');
+var RemoteConnection = require('./remote-connection').RemoteConnection;
+var utils = require('../utils');
+var serializer = require('../structure/io/graph-serializer');
+var inherits = utils.inherits;
+var mimeType = 'application/vnd.gremlin-v2.0+json';
+var header = String.fromCharCode(mimeType.length) + mimeType;
+var responseStatusCode = {
+  success: 200,
+  noContent: 204,
+  partialContent: 206
+};
+
+/**
+ * Creates a new instance of DriverRemoteConnection.
+ * @param {String} url The resource uri.
+ * @param {Object} [options] The connection options.
+ * @param {Array} [options.ca] Trusted certificates.
+ * @param {String|Array|Buffer} [options.cert] The certificate key.
+ * @param {String|Buffer} [options.pfx] The private key, certificate, and CA certs.
+ * @param {GraphSONReader} [options.reader] The GraphSON2 reader to use.
+ * @param {Boolean} [options.rejectUnauthorized] Determines whether to verify or not the server certificate.
+ * @param {GraphSONWriter} [options.writer] The GraphSON2 writer to use.
+ * @constructor
+ */
+function DriverRemoteConnection(url, options) {
+  options = options || {};
+  this._ws = new WebSocket(url, {
+    ca: options.ca,
+    cert: options.cert,
+    pfx: options.pfx,
+    rejectUnauthorized: options.rejectUnauthorized
+  });
+  var self = this;
+  this._ws.on('open', function opened () {
+    self.isOpen = true;
+    if (self._openCallback) {
+      self._openCallback();
+    }
+  });
+  this._ws.on('message', function incoming (data) {
+    self._handleMessage(data);
+  });
+  // A map containing the request id and the handler
+  this._responseHandlers = {};
+  this._reader = options.reader || new serializer.GraphSONReader();
+  this._writer = options.writer || new serializer.GraphSONWriter();
+  this._openPromise = null;
+  this._openCallback = null;
+  this._closePromise = null;
+  this.isOpen = false;
+}
+
+inherits(DriverRemoteConnection, RemoteConnection);
+
+/**
+ * Opens the connection, if its not already opened.
+ * @returns {Promise}
+ */
+DriverRemoteConnection.prototype.open = function (promiseFactory) {
+  if (this._closePromise) {
+    return this._openPromise = utils.toPromise(promiseFactory, function promiseHandler(callback) {
+      callback(new Error('Connection has been closed'));
+    });
+  }
+  if (this._openPromise) {
+    return this._openPromise;
+  }
+  var self = this;
+  return this._openPromise = utils.toPromise(promiseFactory, function promiseHandler(callback) {
+    if (self.isOpen) {
+      return callback();
+    }
+    // It will be invoked when opened
+    self._openCallback = callback;
+  });
+};
+
+/** @override */
+DriverRemoteConnection.prototype.submit = function (bytecode, promiseFactory) {
+  var self = this;
+  return this.open().then(function () {
+    return utils.toPromise(promiseFactory, function promiseHandler(callback) {
+      var requestId = getUuid();
+      self._responseHandlers[requestId] = {
+        callback: callback,
+        result: null
+      };
+      var message = bufferFromString(header + JSON.stringify(self._getRequest(requestId, bytecode)));
+      self._ws.send(message);
+    });
+  });
+};
+
+DriverRemoteConnection.prototype._getRequest = function (id, bytecode) {
+  return ({
+    'requestId': { '@type': 'g:UUID', '@value': id },
+    'op': 'bytecode',
+    'processor': 'traversal',
+    'args': {
+      'gremlin': this._writer.adaptObject(bytecode),
+      'aliases': { 'g': 'g'}
+    }
+  });
+};
+
+DriverRemoteConnection.prototype._handleMessage = function (data) {
+  var response = this._reader.read(JSON.parse(data.toString()));
+  var handler = this._responseHandlers[response.requestId];
+  if (response.status.code >= 400) {
+    // callback in error
+    return handler.callback(
+      new Error(util.format('Server error: %s (%d)', response.status.message, response.status.code)));
+  }
+  switch (response.status.code) {
+    case responseStatusCode.noContent:
+      return handler.callback(null, { traversers: []});
+    case responseStatusCode.partialContent:
+      handler.result = handler.result || [];
+      handler.result.push.apply(handler.result, response.result.data);
+      break;
+    default:
+      if (handler.result) {
+        handler.result.push.apply(handler.result, response.result.data);
+      }
+      else {
+        handler.result = response.result.data;
+      }
+      return handler.callback(null, { traversers: handler.result });
+  }
+};
+
+/**
+ * Closes the Connection.
+ * @return {Promise}
+ */
+DriverRemoteConnection.prototype.close = function (promiseFactory) {
+  if (this._closePromise) {
+    return this._closePromise;
+  }
+  var self = this;
+  return this._closePromise = utils.toPromise(promiseFactory, function promiseHandler(callback) {
+    self._ws.on('close', function () {
+      self.isOpen = false;
+      callback();
+    });
+    self._ws.close();
+  });
+};
+
+function getUuid() {
+  var buffer = crypto.randomBytes(16);
+  //clear the version
+  buffer[6] &= 0x0f;
+  //set the version 4
+  buffer[6] |= 0x40;
+  //clear the variant
+  buffer[8] &= 0x3f;
+  //set the IETF variant
+  buffer[8] |= 0x80;
+  var hex = buffer.toString('hex');
+  return (
+    hex.substr(0, 8) + '-' +
+    hex.substr(8, 4) + '-' +
+    hex.substr(12, 4) + '-' +
+    hex.substr(16, 4) + '-' +
+    hex.substr(20, 12));
+}
+
+var bufferFromString = Buffer.from || function newBuffer(text) {
+  return new Buffer(text, 'utf8');
+};
+
+module.exports = DriverRemoteConnection;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js
new file mode 100644
index 0000000..8176c37
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js
@@ -0,0 +1,84 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var t = require('../process/traversal');
+var TraversalStrategy = require('../process/traversal-strategy').TraversalStrategy;
+var utils = require('../utils');
+var inherits = utils.inherits;
+
+function RemoteConnection(url, traversalSource) {
+  this.url = url;
+}
+
+/**
+ * @abstract
+ * @param {Bytecode} bytecode
+ * @param {Function|undefined} promiseFactory
+ * @returns {Promise}
+ */
+RemoteConnection.prototype.submit = function (bytecode, promiseFactory) {
+  throw new Error('submit() was not implemented');
+};
+
+/**
+ * @extends {Traversal}
+ * @constructor
+ */
+function RemoteTraversal(traversers, sideEffects) {
+  t.Traversal.call(this, null, null, null);
+  this.traversers = traversers;
+  this.sideEffects = sideEffects;
+}
+
+inherits(RemoteTraversal, t.Traversal);
+
+/**
+ *
+ * @param {RemoteConnection} connection
+ * @extends {TraversalStrategy}
+ * @constructor
+ */
+function RemoteStrategy(connection) {
+  TraversalStrategy.call(this);
+  this.connection = connection;
+}
+
+inherits(RemoteStrategy, TraversalStrategy);
+
+/** @override */
+RemoteStrategy.prototype.apply = function (traversal, promiseFactory) {
+  if (traversal.traversers) {
+    return utils.resolvedPromise(promiseFactory);
+  }
+  return this.connection.submit(traversal.getBytecode(), promiseFactory).then(function (remoteTraversal) {
+    traversal.sideEffects = remoteTraversal.sideEffects;
+    traversal.traversers = remoteTraversal.traversers;
+  });
+};
+
+module.exports = {
+  RemoteConnection: RemoteConnection,
+  RemoteStrategy: RemoteStrategy,
+  RemoteTraversal: RemoteTraversal
+};

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js
new file mode 100644
index 0000000..9256e6a
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js
@@ -0,0 +1,99 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+/**
+ * Creates a new instance of Bytecode
+ * @param {Bytecode} [toClone]
+ * @constructor
+ */
+function Bytecode(toClone) {
+  if (!toClone) {
+    this.sourceInstructions = [];
+    this.stepInstructions = [];
+  }
+  else {
+    this.sourceInstructions = toClone.sourceInstructions.slice(0);
+    this.stepInstructions = toClone.sourceInstructions.slice(0);
+  }
+}
+
+/**
+ * Adds a new source instructions
+ * @param {String} name
+ * @param {Array} values
+ * @returns {Bytecode}
+ */
+Bytecode.prototype.addSource = function (name, values) {
+  if (name === undefined) {
+    throw new Error('Name is not defined');
+  }
+  var instruction = new Array(values.length + 1);
+  instruction[0] = name;
+  for (var i = 0; i < values.length; ++i) {
+    instruction[i + 1] = this._convertToArgument(values[i]);
+  }
+  this.sourceInstructions.push(this._generateInstruction(name, values));
+  return this;
+};
+
+/**
+ * Adds a new step instructions
+ * @param {String} name
+ * @param {Array} values
+ * @returns {Bytecode}
+ */
+Bytecode.prototype.addStep = function (name, values) {
+  if (name === undefined) {
+    throw new Error('Name is not defined');
+  }
+  this.stepInstructions.push(this._generateInstruction(name, values));
+  return this;
+};
+
+Bytecode.prototype._generateInstruction = function (name, values) {
+  var length = (values ? values.length : 0) + 1;
+  var instruction = new Array(length);
+  instruction[0] = name;
+  for (var i = 1; i < length; i++) {
+    instruction[i] = this._convertToArgument(values[i - 1]);
+  }
+  return instruction;
+};
+
+/**
+ * Returns the JSON representation of the source and step instructions
+ * @returns {String}
+ */
+Bytecode.prototype.toString = function () {
+  return (
+    (this.sourceInstructions.length > 0 ? JSON.stringify(this.sourceInstructions) : '') +
+    (this.stepInstructions.length   > 0 ? JSON.stringify(this.stepInstructions) : '')
+  );
+};
+
+Bytecode.prototype._convertToArgument = function (value) {
+  return value;
+};
+
+module.exports = Bytecode;
\ No newline at end of file


[29/50] [abbrv] tinkerpop git commit: Fixed improper naming of test class CTR

Posted by sp...@apache.org.
Fixed improper naming of test class CTR


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

Branch: refs/heads/TINKERPOP-1489
Commit: 6e86bf513fd9bf946431839d69cc22ae0a052b3d
Parents: 42c3f40
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 14 13:00:48 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 14 13:00:48 2017 -0400

----------------------------------------------------------------------
 ...ctGremlinServerChannelizerIntegrateTest.java | 346 +++++++++++++++++++
 ...tGremlminServerChannelizerIntegrateTest.java | 346 -------------------
 2 files changed, 346 insertions(+), 346 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6e86bf51/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
new file mode 100644
index 0000000..738ca89
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
@@ -0,0 +1,346 @@
+/*
+ * 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.server.channel;
+
+import org.apache.tinkerpop.gremlin.driver.AuthProperties;
+import org.apache.tinkerpop.gremlin.driver.Client;
+import org.apache.tinkerpop.gremlin.driver.Cluster;
+import org.apache.tinkerpop.gremlin.driver.Client;
+import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
+import org.apache.tinkerpop.gremlin.driver.Channelizer;
+import org.apache.tinkerpop.gremlin.server.AbstractGremlinServerIntegrationTest;
+import org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+import org.apache.tinkerpop.gremlin.server.TestClientFactory;
+
+
+import org.apache.http.Consts;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
+import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.rules.ExternalResource;
+
+import java.io.File;
+import java.io.InputStream;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Base64;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.apache.tinkerpop.gremlin.driver.AuthProperties.Property;
+
+abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGremlinServerIntegrationTest {
+
+    private final ObjectMapper mapper = new ObjectMapper();
+    private final Base64.Encoder encoder = Base64.getUrlEncoder();
+
+    protected static final String HTTP = "http";
+    protected static final String WS = "ws";
+    protected static final String HTTPS = "https";
+    protected static final String WSS = "wss";
+    protected static final String WS_AND_HTTP = "wsAndHttp";
+    protected static final String WSS_AND_HTTPS = "wssAndHttps";
+    protected static final String NIO = "nio";
+    protected static final String NIO_SECURE = "nioSecure";
+
+    public abstract String getProtocol();
+    public abstract String getSecureProtocol();
+    public abstract String getChannelizer();
+    public abstract Settings.AuthenticationSettings getAuthSettings();
+
+    /**
+     * Configure specific Gremlin Server settings for specific tests.
+     */
+    @Override
+    public Settings overrideSettings(final Settings settings) {
+        settings.channelizer = getChannelizer();
+        final String nameOfTest = name.getMethodName();
+        Settings.AuthenticationSettings authSettings = getAuthSettings();
+        switch (nameOfTest) {
+            case "shouldReturnResult":
+                break;
+            case "shouldWorkWithSSL":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                break;
+            case "shouldWorkWithAuth":
+                if (authSettings != null) {
+                    settings.authentication = getAuthSettings();
+                }
+                break;
+            case "shouldWorkWithSSLAndAuth":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                if (authSettings != null) {
+                    settings.authentication = getAuthSettings();
+                }
+                break;
+        }
+        return settings;
+    }
+
+    @Test
+    public void shouldReturnResult() throws Exception {
+        final CombinedTestClient client =  new CombinedTestClient(getProtocol());
+        try {
+            client.sendAndAssert("2+2", 4);
+        } finally {
+            client.close();
+        }
+    }
+
+    @Test
+    public void shouldWorkWithSSL() throws Exception {
+        final CombinedTestClient client =  new CombinedTestClient(getSecureProtocol());
+        try {
+            client.sendAndAssert("2+2", 4);
+        } finally {
+            client.close();
+        }
+    }
+
+    @Test
+    public void shouldWorkWithAuth() throws Exception {
+        CombinedTestClient client =  new CombinedTestClient(getProtocol());
+        try {
+            client.sendAndAssertUnauthorized("2+2", "stephen", "notpassword");
+            client.close();
+            client = new CombinedTestClient(getProtocol());
+            client.sendAndAssert("2+2", 4, "stephen", "password");
+            client.close();
+        } catch (Exception e) {
+            client.close();
+            throw e;
+        }
+    }
+
+    @Test
+    public void shouldWorkWithSSLAndAuth() throws Exception {
+        CombinedTestClient client =  new CombinedTestClient(getSecureProtocol());
+        try {
+            client.sendAndAssertUnauthorized("2+2", "stephen", "incorrect-password");
+            client.close();
+            client = new CombinedTestClient(getSecureProtocol());
+            client.sendAndAssert("2+2", 4, "stephen", "password");
+            client.close();
+        } catch (Exception e) {
+            client.close();
+            throw e;
+        }
+    }
+
+    public class CombinedTestClient {
+        private CloseableHttpClient httpClient = null;
+        private Cluster wsCluster = null;
+        private Cluster.Builder wsBuilder = null;
+        private Cluster nioCluster = null;
+        private Cluster.Builder nioBuilder = null;
+        private Client wsClient = null;
+        private Client.ClusteredClient nioClient = null;
+        private boolean secure = false;
+
+
+        public CombinedTestClient(final String protocol) throws Exception {
+            switch (protocol) {
+                case HTTP:
+                    httpClient = HttpClients.createDefault();
+                    break;
+                case HTTPS:
+                    httpClient = createSslHttpClient();
+                    secure = true;
+                    break;
+                case WS:
+                    this.wsBuilder = TestClientFactory.build();
+                    break;
+                case WSS:
+                    this.wsBuilder = TestClientFactory.build();
+                    secure = true;
+                    break;
+                case WS_AND_HTTP:
+                    httpClient = HttpClients.createDefault();
+                    this.wsBuilder = TestClientFactory.build();
+                    break;
+                case WSS_AND_HTTPS:
+                    httpClient = createSslHttpClient();
+                    secure = true;
+                    this.wsBuilder = TestClientFactory.build();
+                    break;
+                case NIO:
+                    this.nioBuilder = TestClientFactory.build();
+                    break;
+                case NIO_SECURE:
+                    this.nioBuilder = TestClientFactory.build();
+                    secure = true;
+                    break;
+            }
+        }
+
+        private CloseableHttpClient createSslHttpClient() throws Exception {
+            final SSLContextBuilder wsBuilder = new SSLContextBuilder();
+            wsBuilder.loadTrustMaterial(null, new TrustStrategy() {
+                @Override
+                public boolean isTrusted(X509Certificate[] chain,
+                    String authType) throws CertificateException {
+                    return true;
+                }
+            });
+            final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(wsBuilder.build(),
+                new AllowAllHostnameVerifier());
+            //This winds up using a PoolingHttpClientConnectionManager so need to pass the
+            //RegistryBuilder
+            final Registry<ConnectionSocketFactory> registry = RegistryBuilder
+                .<ConnectionSocketFactory> create().register("https", sslsf)
+                .build();
+            final PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(registry);
+            return HttpClients
+                .custom()
+                .setConnectionManager(cm)
+                .build();
+
+        }
+
+        public void sendAndAssert(final String gremlin, Object result) throws Exception {
+            sendAndAssert(gremlin, result, null, null);
+        }
+
+        public void close() {
+            if (wsCluster != null) {
+                wsCluster.close();
+            }
+            if (nioCluster != null) {
+                nioCluster.close();
+            }
+        }
+
+        public void sendAndAssertUnauthorized(final String gremlin, final String username, final String password) throws Exception {
+            if (httpClient != null) {
+                final HttpPost httpPost = createPost(gremlin, username, password);
+                try (final CloseableHttpResponse response = httpClient.execute(httpPost)) {
+                    assertEquals(401, response.getStatusLine().getStatusCode());
+                }
+            }
+            if (wsBuilder != null) {
+                setWsClient(username, password);
+                try {
+                    wsClient.submit(gremlin).all().get();
+                    fail("Should not authorize on incorrect auth creds");
+                } catch(Exception e) {
+                    assertEquals("Username and/or password are incorrect", e.getCause().getMessage());
+                }
+            }
+            if (nioBuilder != null) {
+                setNioClient(username, password);
+                try {
+                    nioClient.submit(gremlin);
+                } catch(Exception e) {
+                    assertEquals("Username and/or password are incorrect", e.getCause().getMessage());
+                }
+            }
+
+        }
+
+        public void sendAndAssert(final String gremlin, final Object result, final String username, final String password) throws Exception {
+            if (httpClient != null) {
+                final HttpPost httpPost = createPost(gremlin, username, password);
+                try (final CloseableHttpResponse response = httpClient.execute(httpPost)) {
+                    assertEquals(200, response.getStatusLine().getStatusCode());
+                    assertEquals("application/json", response.getEntity().getContentType().getValue());
+                    final String json = EntityUtils.toString(response.getEntity());
+                    final JsonNode node = mapper.readTree(json);
+                    assertEquals(result, node.get("result").get("data").get(0).intValue());
+                }
+            }
+            if (wsBuilder != null) {
+                setWsClient(username, password);
+                assertEquals(result, wsClient.submit(gremlin).all().get().get(0).getInt());
+            }
+            if (nioClient != null) {
+                assertEquals(result, nioClient.submit(gremlin).all().get().get(0).getInt());
+            }
+        }
+
+        private void setNioClient(final String username, final String password) {
+            nioBuilder.channelizer(Channelizer.NioChannelizer.class.getName());
+            if (username != null && password != null) {
+                final AuthProperties authProps = new AuthProperties()
+                                                .with(Property.USERNAME, username)
+                                                .with(Property.PASSWORD, password);
+
+                nioCluster = nioBuilder.enableSsl(secure).authProperties(authProps).create();
+                nioClient = nioCluster.connect();
+            } else {
+                nioCluster = nioBuilder.enableSsl(secure).create();
+                nioClient = nioCluster.connect();
+            }
+        }
+
+        private void setWsClient(final String username, final String password) {
+            if (username != null && password != null) {
+                final AuthProperties authProps = new AuthProperties()
+                                                .with(Property.USERNAME, username)
+                                                .with(Property.PASSWORD, password);
+
+                wsCluster = wsBuilder.enableSsl(secure).authProperties(authProps).create();
+                wsClient = wsCluster.connect();
+            } else {
+                wsCluster = wsBuilder.enableSsl(secure).create();
+                wsClient = wsCluster.connect();
+            }
+        }
+
+        private HttpPost createPost(final String gremlin, final String username, final String password) {
+            String urlString = TestClientFactory.createURLString();
+            if (secure) {
+                urlString = urlString.replace("http", "https");
+            }
+            final HttpPost httpPost = new HttpPost(urlString);
+            httpPost.addHeader("Content-Type", "application/json");
+            if (username != null && password != null) {
+                final String auth = encoder.encodeToString((username + ":" + password).getBytes());
+                httpPost.addHeader("Authorization", "Basic " + auth);
+            }
+            final String jsonBody = String.format("{\"gremlin\": \"%s\"}", gremlin);
+            httpPost.setEntity(new StringEntity(jsonBody, Consts.UTF_8));
+            return httpPost;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6e86bf51/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java
deleted file mode 100644
index 738ca89..0000000
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlminServerChannelizerIntegrateTest.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * 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.server.channel;
-
-import org.apache.tinkerpop.gremlin.driver.AuthProperties;
-import org.apache.tinkerpop.gremlin.driver.Client;
-import org.apache.tinkerpop.gremlin.driver.Cluster;
-import org.apache.tinkerpop.gremlin.driver.Client;
-import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
-import org.apache.tinkerpop.gremlin.driver.Channelizer;
-import org.apache.tinkerpop.gremlin.server.AbstractGremlinServerIntegrationTest;
-import org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer;
-import org.apache.tinkerpop.gremlin.server.Settings;
-import org.apache.tinkerpop.gremlin.server.TestClientFactory;
-
-
-import org.apache.http.Consts;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
-import org.apache.http.conn.socket.ConnectionSocketFactory;
-import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.conn.ssl.SSLContextBuilder;
-import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
-import org.apache.http.conn.ssl.TrustStrategy;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.util.EntityUtils;
-import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
-import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.rules.ExternalResource;
-
-import java.io.File;
-import java.io.InputStream;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.Base64;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.apache.tinkerpop.gremlin.driver.AuthProperties.Property;
-
-abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGremlinServerIntegrationTest {
-
-    private final ObjectMapper mapper = new ObjectMapper();
-    private final Base64.Encoder encoder = Base64.getUrlEncoder();
-
-    protected static final String HTTP = "http";
-    protected static final String WS = "ws";
-    protected static final String HTTPS = "https";
-    protected static final String WSS = "wss";
-    protected static final String WS_AND_HTTP = "wsAndHttp";
-    protected static final String WSS_AND_HTTPS = "wssAndHttps";
-    protected static final String NIO = "nio";
-    protected static final String NIO_SECURE = "nioSecure";
-
-    public abstract String getProtocol();
-    public abstract String getSecureProtocol();
-    public abstract String getChannelizer();
-    public abstract Settings.AuthenticationSettings getAuthSettings();
-
-    /**
-     * Configure specific Gremlin Server settings for specific tests.
-     */
-    @Override
-    public Settings overrideSettings(final Settings settings) {
-        settings.channelizer = getChannelizer();
-        final String nameOfTest = name.getMethodName();
-        Settings.AuthenticationSettings authSettings = getAuthSettings();
-        switch (nameOfTest) {
-            case "shouldReturnResult":
-                break;
-            case "shouldWorkWithSSL":
-                settings.ssl = new Settings.SslSettings();
-                settings.ssl.enabled = true;
-                break;
-            case "shouldWorkWithAuth":
-                if (authSettings != null) {
-                    settings.authentication = getAuthSettings();
-                }
-                break;
-            case "shouldWorkWithSSLAndAuth":
-                settings.ssl = new Settings.SslSettings();
-                settings.ssl.enabled = true;
-                if (authSettings != null) {
-                    settings.authentication = getAuthSettings();
-                }
-                break;
-        }
-        return settings;
-    }
-
-    @Test
-    public void shouldReturnResult() throws Exception {
-        final CombinedTestClient client =  new CombinedTestClient(getProtocol());
-        try {
-            client.sendAndAssert("2+2", 4);
-        } finally {
-            client.close();
-        }
-    }
-
-    @Test
-    public void shouldWorkWithSSL() throws Exception {
-        final CombinedTestClient client =  new CombinedTestClient(getSecureProtocol());
-        try {
-            client.sendAndAssert("2+2", 4);
-        } finally {
-            client.close();
-        }
-    }
-
-    @Test
-    public void shouldWorkWithAuth() throws Exception {
-        CombinedTestClient client =  new CombinedTestClient(getProtocol());
-        try {
-            client.sendAndAssertUnauthorized("2+2", "stephen", "notpassword");
-            client.close();
-            client = new CombinedTestClient(getProtocol());
-            client.sendAndAssert("2+2", 4, "stephen", "password");
-            client.close();
-        } catch (Exception e) {
-            client.close();
-            throw e;
-        }
-    }
-
-    @Test
-    public void shouldWorkWithSSLAndAuth() throws Exception {
-        CombinedTestClient client =  new CombinedTestClient(getSecureProtocol());
-        try {
-            client.sendAndAssertUnauthorized("2+2", "stephen", "incorrect-password");
-            client.close();
-            client = new CombinedTestClient(getSecureProtocol());
-            client.sendAndAssert("2+2", 4, "stephen", "password");
-            client.close();
-        } catch (Exception e) {
-            client.close();
-            throw e;
-        }
-    }
-
-    public class CombinedTestClient {
-        private CloseableHttpClient httpClient = null;
-        private Cluster wsCluster = null;
-        private Cluster.Builder wsBuilder = null;
-        private Cluster nioCluster = null;
-        private Cluster.Builder nioBuilder = null;
-        private Client wsClient = null;
-        private Client.ClusteredClient nioClient = null;
-        private boolean secure = false;
-
-
-        public CombinedTestClient(final String protocol) throws Exception {
-            switch (protocol) {
-                case HTTP:
-                    httpClient = HttpClients.createDefault();
-                    break;
-                case HTTPS:
-                    httpClient = createSslHttpClient();
-                    secure = true;
-                    break;
-                case WS:
-                    this.wsBuilder = TestClientFactory.build();
-                    break;
-                case WSS:
-                    this.wsBuilder = TestClientFactory.build();
-                    secure = true;
-                    break;
-                case WS_AND_HTTP:
-                    httpClient = HttpClients.createDefault();
-                    this.wsBuilder = TestClientFactory.build();
-                    break;
-                case WSS_AND_HTTPS:
-                    httpClient = createSslHttpClient();
-                    secure = true;
-                    this.wsBuilder = TestClientFactory.build();
-                    break;
-                case NIO:
-                    this.nioBuilder = TestClientFactory.build();
-                    break;
-                case NIO_SECURE:
-                    this.nioBuilder = TestClientFactory.build();
-                    secure = true;
-                    break;
-            }
-        }
-
-        private CloseableHttpClient createSslHttpClient() throws Exception {
-            final SSLContextBuilder wsBuilder = new SSLContextBuilder();
-            wsBuilder.loadTrustMaterial(null, new TrustStrategy() {
-                @Override
-                public boolean isTrusted(X509Certificate[] chain,
-                    String authType) throws CertificateException {
-                    return true;
-                }
-            });
-            final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(wsBuilder.build(),
-                new AllowAllHostnameVerifier());
-            //This winds up using a PoolingHttpClientConnectionManager so need to pass the
-            //RegistryBuilder
-            final Registry<ConnectionSocketFactory> registry = RegistryBuilder
-                .<ConnectionSocketFactory> create().register("https", sslsf)
-                .build();
-            final PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(registry);
-            return HttpClients
-                .custom()
-                .setConnectionManager(cm)
-                .build();
-
-        }
-
-        public void sendAndAssert(final String gremlin, Object result) throws Exception {
-            sendAndAssert(gremlin, result, null, null);
-        }
-
-        public void close() {
-            if (wsCluster != null) {
-                wsCluster.close();
-            }
-            if (nioCluster != null) {
-                nioCluster.close();
-            }
-        }
-
-        public void sendAndAssertUnauthorized(final String gremlin, final String username, final String password) throws Exception {
-            if (httpClient != null) {
-                final HttpPost httpPost = createPost(gremlin, username, password);
-                try (final CloseableHttpResponse response = httpClient.execute(httpPost)) {
-                    assertEquals(401, response.getStatusLine().getStatusCode());
-                }
-            }
-            if (wsBuilder != null) {
-                setWsClient(username, password);
-                try {
-                    wsClient.submit(gremlin).all().get();
-                    fail("Should not authorize on incorrect auth creds");
-                } catch(Exception e) {
-                    assertEquals("Username and/or password are incorrect", e.getCause().getMessage());
-                }
-            }
-            if (nioBuilder != null) {
-                setNioClient(username, password);
-                try {
-                    nioClient.submit(gremlin);
-                } catch(Exception e) {
-                    assertEquals("Username and/or password are incorrect", e.getCause().getMessage());
-                }
-            }
-
-        }
-
-        public void sendAndAssert(final String gremlin, final Object result, final String username, final String password) throws Exception {
-            if (httpClient != null) {
-                final HttpPost httpPost = createPost(gremlin, username, password);
-                try (final CloseableHttpResponse response = httpClient.execute(httpPost)) {
-                    assertEquals(200, response.getStatusLine().getStatusCode());
-                    assertEquals("application/json", response.getEntity().getContentType().getValue());
-                    final String json = EntityUtils.toString(response.getEntity());
-                    final JsonNode node = mapper.readTree(json);
-                    assertEquals(result, node.get("result").get("data").get(0).intValue());
-                }
-            }
-            if (wsBuilder != null) {
-                setWsClient(username, password);
-                assertEquals(result, wsClient.submit(gremlin).all().get().get(0).getInt());
-            }
-            if (nioClient != null) {
-                assertEquals(result, nioClient.submit(gremlin).all().get().get(0).getInt());
-            }
-        }
-
-        private void setNioClient(final String username, final String password) {
-            nioBuilder.channelizer(Channelizer.NioChannelizer.class.getName());
-            if (username != null && password != null) {
-                final AuthProperties authProps = new AuthProperties()
-                                                .with(Property.USERNAME, username)
-                                                .with(Property.PASSWORD, password);
-
-                nioCluster = nioBuilder.enableSsl(secure).authProperties(authProps).create();
-                nioClient = nioCluster.connect();
-            } else {
-                nioCluster = nioBuilder.enableSsl(secure).create();
-                nioClient = nioCluster.connect();
-            }
-        }
-
-        private void setWsClient(final String username, final String password) {
-            if (username != null && password != null) {
-                final AuthProperties authProps = new AuthProperties()
-                                                .with(Property.USERNAME, username)
-                                                .with(Property.PASSWORD, password);
-
-                wsCluster = wsBuilder.enableSsl(secure).authProperties(authProps).create();
-                wsClient = wsCluster.connect();
-            } else {
-                wsCluster = wsBuilder.enableSsl(secure).create();
-                wsClient = wsCluster.connect();
-            }
-        }
-
-        private HttpPost createPost(final String gremlin, final String username, final String password) {
-            String urlString = TestClientFactory.createURLString();
-            if (secure) {
-                urlString = urlString.replace("http", "https");
-            }
-            final HttpPost httpPost = new HttpPost(urlString);
-            httpPost.addHeader("Content-Type", "application/json");
-            if (username != null && password != null) {
-                final String auth = encoder.encodeToString((username + ":" + password).getBytes());
-                httpPost.addHeader("Authorization", "Basic " + auth);
-            }
-            final String jsonBody = String.format("{\"gremlin\": \"%s\"}", gremlin);
-            httpPost.setEntity(new StringEntity(jsonBody, Consts.UTF_8));
-            return httpPost;
-        }
-    }
-}
-


[33/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1552' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1552' into tp32

Conflicts:
	CHANGELOG.asciidoc


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

Branch: refs/heads/TINKERPOP-1489
Commit: 779399a8b49b85a22fbbdf97bb35e329cac16b6d
Parents: a5d60c6 426d141
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 18 09:00:00 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 18 09:00:00 2017 -0400

----------------------------------------------------------------------
 .gitignore                                      |  11 +
 .travis.yml                                     |   5 +
 CHANGELOG.asciidoc                              |   1 +
 docker/Dockerfile                               |   6 +-
 .../developer/development-environment.asciidoc  |  35 +
 docs/src/dev/developer/release.asciidoc         |  18 +-
 docs/src/reference/gremlin-variants.asciidoc    | 190 ++++
 gremlin-dotnet/Gremlin.Net.sln                  |  45 +
 gremlin-dotnet/glv/AnonymousTraversal.template  |  52 +
 gremlin-dotnet/glv/Enum.template                |  35 +
 gremlin-dotnet/glv/GraphTraversal.template      |  75 ++
 .../glv/GraphTraversalSource.template           | 132 +++
 gremlin-dotnet/glv/Gremlin.Net.csproj.template  |  64 ++
 gremlin-dotnet/glv/NamingConversions.template   |  50 +
 gremlin-dotnet/glv/P.template                   |  45 +
 gremlin-dotnet/pom.xml                          | 296 ++++++
 .../src/Gremlin.Net/Driver/Connection.cs        | 162 ++++
 .../src/Gremlin.Net/Driver/ConnectionFactory.cs |  48 +
 .../src/Gremlin.Net/Driver/ConnectionPool.cs    | 114 +++
 .../Driver/Exceptions/ResponseException.cs      |  37 +
 .../src/Gremlin.Net/Driver/GremlinClient.cs     |  95 ++
 .../Driver/GremlinClientExtensions.cs           | 140 +++
 .../src/Gremlin.Net/Driver/GremlinServer.cs     |  70 ++
 .../src/Gremlin.Net/Driver/IConnection.cs       |  35 +
 .../src/Gremlin.Net/Driver/IGremlinClient.cs    |  48 +
 .../Gremlin.Net/Driver/JsonMessageSerializer.cs |  49 +
 .../Driver/Messages/RequestMessage.cs           | 143 +++
 .../Driver/Messages/ResponseMessage.cs          |  40 +
 .../Driver/Messages/ResponseResult.cs           |  37 +
 .../Driver/Messages/ResponseStatus.cs           |  50 +
 .../Driver/Messages/ResponseStatusCode.cs       |  67 ++
 .../src/Gremlin.Net/Driver/ProxyConnection.cs   |  52 +
 .../Driver/Remote/DriverRemoteConnection.cs     |  80 ++
 .../Driver/Remote/DriverRemoteTraversal.cs      |  39 +
 .../Remote/DriverRemoteTraversalSideEffects.cs  | 126 +++
 .../ResultsAggregation/AggregatorFactory.cs     |  44 +
 .../ResultsAggregation/DefaultAggregator.cs     |  42 +
 .../ResultsAggregation/DictionaryAggregator.cs  |  44 +
 .../Driver/ResultsAggregation/IAggregator.cs    |  31 +
 .../ResultsAggregation/TraverserAggregator.cs   |  44 +
 gremlin-dotnet/src/Gremlin.Net/Driver/Tokens.cs | 125 +++
 .../Gremlin.Net/Driver/WebSocketConnection.cs   |  96 ++
 .../src/Gremlin.Net/Gremlin.Net.csproj          |  64 ++
 .../Process/Remote/IRemoteConnection.cs         |  42 +
 .../Process/Remote/RemoteStrategy.cs            |  61 ++
 .../Gremlin.Net/Process/Traversal/Barrier.cs    |  35 +
 .../Gremlin.Net/Process/Traversal/Binding.cs    |  80 ++
 .../Gremlin.Net/Process/Traversal/Bindings.cs   |  42 +
 .../Gremlin.Net/Process/Traversal/Bytecode.cs   |  85 ++
 .../Process/Traversal/Cardinality.cs            |  37 +
 .../src/Gremlin.Net/Process/Traversal/Column.cs |  36 +
 .../Process/Traversal/DefaultTraversal.cs       | 198 ++++
 .../Gremlin.Net/Process/Traversal/Direction.cs  |  37 +
 .../Process/Traversal/GraphSONVersion.cs        |  36 +
 .../Process/Traversal/GraphTraversal.cs         | 948 +++++++++++++++++++
 .../Process/Traversal/GraphTraversalSource.cs   | 194 ++++
 .../Process/Traversal/GryoVersion.cs            |  35 +
 .../Gremlin.Net/Process/Traversal/ITraversal.cs | 102 ++
 .../Process/Traversal/ITraversalSideEffects.cs  |  52 +
 .../Process/Traversal/ITraversalStrategy.cs     |  46 +
 .../Process/Traversal/Instruction.cs            |  52 +
 .../Process/Traversal/NamingConversions.cs      |  91 ++
 .../Gremlin.Net/Process/Traversal/Operator.cs   |  45 +
 .../src/Gremlin.Net/Process/Traversal/Order.cs  |  41 +
 .../src/Gremlin.Net/Process/Traversal/P.cs      | 117 +++
 .../src/Gremlin.Net/Process/Traversal/Pick.cs   |  36 +
 .../src/Gremlin.Net/Process/Traversal/Pop.cs    |  37 +
 .../src/Gremlin.Net/Process/Traversal/Scope.cs  |  36 +
 .../Strategy/AbstractTraversalStrategy.cs       |  86 ++
 .../Strategy/Decoration/ConnectiveStrategy.cs   |  33 +
 .../Strategy/Decoration/ElementIdStrategy.cs    |  32 +
 .../Decoration/HaltedTraverserStrategy.cs       |  36 +
 .../Strategy/Decoration/PartitionStrategy.cs    |  56 ++
 .../Strategy/Decoration/SubgraphStrategy.cs     |  48 +
 .../Decoration/VertexProgramStrategy.cs         |  52 +
 .../Finalization/MatchAlgorithmStrategy.cs      |  36 +
 .../Optimization/AdjacentToIncidentStrategy.cs  |  32 +
 .../Optimization/FilterRankingStrategy.cs       |  32 +
 .../Optimization/GraphFilterStrategy.cs         |  31 +
 .../Optimization/IdentityRemovalStrategy.cs     |  32 +
 .../Optimization/IncidentToAdjacentStrategy.cs  |  33 +
 .../Optimization/InlineFilterStrategy.cs        |  32 +
 .../Optimization/LazyBarrierStrategy.cs         |  33 +
 .../Optimization/MatchPredicateStrategy.cs      |  32 +
 .../Strategy/Optimization/OrderLimitStrategy.cs |  31 +
 .../Optimization/PathProcessorStrategy.cs       |  32 +
 .../Optimization/PathRetractionStrategy.cs      |  31 +
 .../Optimization/RangeByIsCountStrategy.cs      |  32 +
 .../Optimization/RepeatUnrollStrategy.cs        |  31 +
 .../Verification/LambdaRestrictionStrategy.cs   |  32 +
 .../Strategy/Verification/ReadOnlyStrategy.cs   |  32 +
 .../src/Gremlin.Net/Process/Traversal/T.cs      |  38 +
 .../Process/Traversal/TraversalPredicate.cs     |  85 ++
 .../Gremlin.Net/Process/Traversal/Traverser.cs  |  75 ++
 .../src/Gremlin.Net/Process/Traversal/__.cs     | 772 +++++++++++++++
 .../src/Gremlin.Net/Structure/Edge.cs           |  61 ++
 .../src/Gremlin.Net/Structure/Element.cs        |  77 ++
 .../src/Gremlin.Net/Structure/Graph.cs          |  43 +
 .../Structure/IO/GraphSON/BindingSerializer.cs  |  42 +
 .../Structure/IO/GraphSON/BytecodeSerializer.cs |  58 ++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  43 +
 .../Structure/IO/GraphSON/DateSerializer.cs     |  43 +
 .../Structure/IO/GraphSON/DoubleConverter.cs    |  33 +
 .../Structure/IO/GraphSON/EdgeDeserializer.cs   |  43 +
 .../Structure/IO/GraphSON/EdgeSerializer.cs     |  45 +
 .../Structure/IO/GraphSON/EnumSerializer.cs     |  38 +
 .../Structure/IO/GraphSON/FloatConverter.cs     |  33 +
 .../Structure/IO/GraphSON/GraphSONReader.cs     | 123 +++
 .../Structure/IO/GraphSON/GraphSONTokens.cs     |  32 +
 .../Structure/IO/GraphSON/GraphSONUtil.cs       |  62 ++
 .../Structure/IO/GraphSON/GraphSONWriter.cs     | 146 +++
 .../IO/GraphSON/IGraphSONDeserializer.cs        |  41 +
 .../IO/GraphSON/IGraphSONSerializer.cs          |  41 +
 .../Structure/IO/GraphSON/Int32Converter.cs     |  33 +
 .../Structure/IO/GraphSON/Int64Converter.cs     |  33 +
 .../Structure/IO/GraphSON/NumberConverter.cs    |  45 +
 .../Structure/IO/GraphSON/PathDeserializer.cs   |  41 +
 .../IO/GraphSON/PropertyDeserializer.cs         |  38 +
 .../Structure/IO/GraphSON/PropertySerializer.cs |  64 ++
 .../IO/GraphSON/RequestMessageSerializer.cs     |  43 +
 .../IO/GraphSON/TraversalPredicateSerializer.cs |  45 +
 .../IO/GraphSON/TraversalSerializer.cs          |  38 +
 .../IO/GraphSON/TraversalStrategySerializer.cs  |  37 +
 .../Structure/IO/GraphSON/TraverserReader.cs    |  38 +
 .../Structure/IO/GraphSON/UuidDeserializer.cs   |  36 +
 .../Structure/IO/GraphSON/UuidSerializer.cs     |  37 +
 .../Structure/IO/GraphSON/VertexDeserializer.cs |  37 +
 .../IO/GraphSON/VertexPropertyDeserializer.cs   |  41 +
 .../IO/GraphSON/VertexPropertySerializer.cs     |  43 +
 .../Structure/IO/GraphSON/VertexSerializer.cs   |  41 +
 .../src/Gremlin.Net/Structure/Path.cs           | 193 ++++
 .../src/Gremlin.Net/Structure/Property.cs       |  96 ++
 .../src/Gremlin.Net/Structure/Vertex.cs         |  52 +
 .../src/Gremlin.Net/Structure/VertexProperty.cs |  66 ++
 gremlin-dotnet/src/pom.xml                      | 219 +++++
 .../ConfigProvider.cs                           |  47 +
 .../Driver/ConnectionPoolTests.cs               |  90 ++
 .../Driver/GremlinClientAuthenticationTests.cs  |  86 ++
 .../Driver/GremlinClientTests.cs                | 212 +++++
 .../Driver/MessagesTests.cs                     | 147 +++
 .../Gremlin.Net.IntegrationTest.csproj          |  36 +
 .../Process/Remote/RemoteStrategyTests.cs       |  85 ++
 .../BytecodeGenerationTests.cs                  |  76 ++
 .../BytecodeGeneration/StrategiesTests.cs       | 170 ++++
 .../DriverRemoteConnection/EnumTests.cs         |  59 ++
 .../GraphTraversalSourceTests.cs                |  55 ++
 .../GraphTraversalTests.cs                      | 169 ++++
 .../DriverRemoteConnection/PredicateTests.cs    |  58 ++
 .../RemoteConnectionFactory.cs                  |  41 +
 .../DriverRemoteConnection/SideEffectTests.cs   | 221 +++++
 .../DriverRemoteConnection/StrategiesTests.cs   | 193 ++++
 .../Process/Traversal/GraphSONWriterTests.cs    |  50 +
 .../Util/RequestMessageProvider.cs              |  54 ++
 .../appsettings.json                            |   5 +
 .../Driver/DriverRemoteConnectionTests.cs       |  51 +
 .../Driver/GremlinServerTests.cs                |  66 ++
 .../Driver/RequestMessageBuilderTests.cs        |  41 +
 .../Gremlin.Net.UnitTest.csproj                 |  28 +
 .../Process/Traversal/BytecodeTests.cs          |  44 +
 .../Traversal/GraphTraversalSourceTests.cs      |  68 ++
 .../Process/Traversal/PredicateTests.cs         |  50 +
 .../Process/Traversal/Strategy/StrategyTests.cs | 109 +++
 .../Process/Traversal/TestTraversal.cs          |  51 +
 .../Process/Traversal/TestTraversalStrategy.cs  |  50 +
 .../Process/Traversal/TraversalTests.cs         | 177 ++++
 .../Process/Traversal/TraverserTests.cs         |  75 ++
 .../Gremlin.Net.UnitTest/Structure/EdgeTests.cs |  57 ++
 .../GraphSON/BytecodeGraphSONSerializerTests.cs | 153 +++
 .../IO/GraphSON/GraphSONReaderTests.cs          | 308 ++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          | 324 +++++++
 .../IO/GraphSON/StrategyWriterTests.cs          |  66 ++
 .../Structure/IO/GraphSON/TestClass.cs          |  30 +
 .../Structure/IO/GraphSON/TestUtils.cs          |  36 +
 .../Gremlin.Net.UnitTest/Structure/PathTests.cs | 416 ++++++++
 .../Structure/PropertyTests.cs                  | 165 ++++
 .../Structure/VertexPropertyTests.cs            |  69 ++
 .../Structure/VertexTests.cs                    |  80 ++
 gremlin-dotnet/test/pom.xml                     | 205 ++++
 pom.xml                                         |   9 +
 179 files changed, 14228 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/779399a8/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 1d57828,1c14ca6..52d289b
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -28,14 -28,9 +28,15 @@@ TinkerPop 3.2.6 (Release Date: NOT OFFI
  
  This release also includes changes from <<release-3-1-8, 3.1.8>>.
  
 -* Added Gremlin.Net.
++* Added Gremlin.Net as an early preview.
 +* `ProfileTest` is now less stringent about assertions which will reduce burdens on providers.
 +* `GremlinExecutor` begins timeout of script evaluation at the time the script was submitted and not from the time it began evaluation.
 +* `ReferenceFactory` and `DetachedFactory` now detach elements in collections accordingly.
 +* Deprecated `GryoLiteMessageSerializerV1d0` in favor of `HaltedTraverserStrategy`.
  * Deprecated the `useMapperFromGraph` configuration option for Gremlin Server serializers.
 +* `JavaTranslator` is now smart about handling `BulkSet` and `Tree`.
  * Added annotations to the traversal metrics pretty print.
 +* `EdgeOtherVertexStep` is no longer final and can be extended by providers.
  * `EdgeVertexStep` is no longer final and can be extended by providers.
  * Deprecated `Transaction.submit(Function)`.
  * Fixed `HADOOP_GREMLIN_LIBS` parsing for Windows.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/779399a8/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------


[02/50] [abbrv] tinkerpop git commit: added a note on local()-step as recommended by @jeromatron.

Posted by sp...@apache.org.
added a note on local()-step as recommended by @jeromatron.


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

Branch: refs/heads/TINKERPOP-1489
Commit: fb90f881407d49ed6fc56ccfd20684837f418c98
Parents: 6579b01
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Jun 30 12:54:22 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Jun 30 12:54:22 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fb90f881/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 8af40df..3c52d5c 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2617,6 +2617,15 @@ g.V().groupCount().by(label).order(local).by(values,decr)
 g.V().fold().sample(local,2)
 ----
 
+Finally, note that <<local-step,`local()`>>-step is a "hard-scoped step" that transforms any internal traversal into a
+locally-scoped operation. A contrived example is provided below:
+
+[gremlin-groovy,modern]
+----
+g.V().fold().local(unfold().count())
+g.V().fold().count(local)
+----
+
 [[a-note-on-lambdas]]
 A Note On Lambdas
 -----------------


[48/50] [abbrv] tinkerpop git commit: Update Javascript GLV

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
deleted file mode 100644
index 7f36e59..0000000
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/graph-traversal.js
+++ /dev/null
@@ -1,2016 +0,0 @@
-/*
- *  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.
- */
- 
-/**
- * @author Jorge Bay Gondra
- */
-(function defineGraphTraversalModule() {
-  "use strict";
-
-  var t = loadModule.call(this, './traversal.js');
-  var remote = loadModule.call(this, '../driver/remote-connection.js');
-  var Bytecode = t.Bytecode;
-  var inherits = t.inherits;
-  var parseArgs = t.parseArgs;
-
-  /**
-   *
-   * @param {Graph} graph
-   * @param {TraversalStrategies} traversalStrategies
-   * @param {Bytecode} [bytecode]
-   * @constructor
-   */
-  function GraphTraversalSource(graph, traversalStrategies, bytecode) {
-    this.graph = graph;
-    this.traversalStrategies = traversalStrategies;
-    this.bytecode = bytecode || new Bytecode();
-  }
-
-  /**
-   * @param remoteConnection
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
-    var traversalStrategy = new t.TraversalStrategies(this.traversalStrategies);
-    traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-    return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
-  };
-
-  /**
-   * Returns the string representation of the GraphTraversalSource.
-   * @returns {string}
-   */
-  GraphTraversalSource.prototype.toString = function () {
-    return 'graphtraversalsource[' + this.graph.toString() + ']';
-  };
-
-  /**
-   * withBulk GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withBulk = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * withComputer GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withComputer = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withComputer', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * withPath GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withPath = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withPath', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * withSack GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withSack = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withSack', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * withSideEffect GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withSideEffect = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * withStrategies GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withStrategies = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * withoutStrategies GraphTraversalSource method.
-   * @param {...Object} args
-   * @returns {GraphTraversalSource}
-   */
-  GraphTraversalSource.prototype.withoutStrategies = function (args) {
-    var b = new Bytecode(this.bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
-    return new GraphTraversalSource(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * E GraphTraversalSource step method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversalSource.prototype.E = function (args) {
-    var b = new Bytecode(this.bytecode).addStep('E', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * V GraphTraversalSource step method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversalSource.prototype.V = function (args) {
-    var b = new Bytecode(this.bytecode).addStep('V', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * addV GraphTraversalSource step method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversalSource.prototype.addV = function (args) {
-    var b = new Bytecode(this.bytecode).addStep('addV', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * inject GraphTraversalSource step method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversalSource.prototype.inject = function (args) {
-    var b = new Bytecode(this.bytecode).addStep('inject', parseArgs.apply(null, arguments));
-    return new GraphTraversal(this.graph, new t.TraversalStrategies(this.traversalStrategies), b);
-  };
-
-  /**
-   * Represents a graph traversal.
-   * @extends Traversal
-   * @constructor
-   */
-  function GraphTraversal(graph, traversalStrategies, bytecode) {
-    t.Traversal.call(this, graph, traversalStrategies, bytecode);
-  }
-
-  inherits(GraphTraversal, t.Traversal);
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.V = function (args) {
-    this.bytecode.addStep('V', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.addE = function (args) {
-    this.bytecode.addStep('addE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.addInE = function (args) {
-    this.bytecode.addStep('addInE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.addOutE = function (args) {
-    this.bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.addV = function (args) {
-    this.bytecode.addStep('addV', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.aggregate = function (args) {
-    this.bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.and = function (args) {
-    this.bytecode.addStep('and', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.as = function (args) {
-    this.bytecode.addStep('as', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.barrier = function (args) {
-    this.bytecode.addStep('barrier', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.both = function (args) {
-    this.bytecode.addStep('both', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.bothE = function (args) {
-    this.bytecode.addStep('bothE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.bothV = function (args) {
-    this.bytecode.addStep('bothV', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.branch = function (args) {
-    this.bytecode.addStep('branch', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.by = function (args) {
-    this.bytecode.addStep('by', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.cap = function (args) {
-    this.bytecode.addStep('cap', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.choose = function (args) {
-    this.bytecode.addStep('choose', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.coalesce = function (args) {
-    this.bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.coin = function (args) {
-    this.bytecode.addStep('coin', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.constant = function (args) {
-    this.bytecode.addStep('constant', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.count = function (args) {
-    this.bytecode.addStep('count', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.cyclicPath = function (args) {
-    this.bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.dedup = function (args) {
-    this.bytecode.addStep('dedup', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.drop = function (args) {
-    this.bytecode.addStep('drop', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.emit = function (args) {
-    this.bytecode.addStep('emit', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.filter = function (args) {
-    this.bytecode.addStep('filter', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.flatMap = function (args) {
-    this.bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.fold = function (args) {
-    this.bytecode.addStep('fold', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.from_ = function (args) {
-    this.bytecode.addStep('from', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.group = function (args) {
-    this.bytecode.addStep('group', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.groupCount = function (args) {
-    this.bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.groupV3d0 = function (args) {
-    this.bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.has = function (args) {
-    this.bytecode.addStep('has', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.hasId = function (args) {
-    this.bytecode.addStep('hasId', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.hasKey = function (args) {
-    this.bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.hasLabel = function (args) {
-    this.bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.hasNot = function (args) {
-    this.bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.hasValue = function (args) {
-    this.bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.id = function (args) {
-    this.bytecode.addStep('id', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.identity = function (args) {
-    this.bytecode.addStep('identity', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.inE = function (args) {
-    this.bytecode.addStep('inE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.inV = function (args) {
-    this.bytecode.addStep('inV', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.in_ = function (args) {
-    this.bytecode.addStep('in', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.inject = function (args) {
-    this.bytecode.addStep('inject', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.is = function (args) {
-    this.bytecode.addStep('is', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.key = function (args) {
-    this.bytecode.addStep('key', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.label = function (args) {
-    this.bytecode.addStep('label', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.limit = function (args) {
-    this.bytecode.addStep('limit', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.local = function (args) {
-    this.bytecode.addStep('local', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.loops = function (args) {
-    this.bytecode.addStep('loops', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.map = function (args) {
-    this.bytecode.addStep('map', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.mapKeys = function (args) {
-    this.bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.mapValues = function (args) {
-    this.bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.match = function (args) {
-    this.bytecode.addStep('match', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.max = function (args) {
-    this.bytecode.addStep('max', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.mean = function (args) {
-    this.bytecode.addStep('mean', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.min = function (args) {
-    this.bytecode.addStep('min', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.not = function (args) {
-    this.bytecode.addStep('not', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.option = function (args) {
-    this.bytecode.addStep('option', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.optional = function (args) {
-    this.bytecode.addStep('optional', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.or = function (args) {
-    this.bytecode.addStep('or', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.order = function (args) {
-    this.bytecode.addStep('order', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.otherV = function (args) {
-    this.bytecode.addStep('otherV', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.out = function (args) {
-    this.bytecode.addStep('out', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.outE = function (args) {
-    this.bytecode.addStep('outE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.outV = function (args) {
-    this.bytecode.addStep('outV', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.pageRank = function (args) {
-    this.bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.path = function (args) {
-    this.bytecode.addStep('path', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.peerPressure = function (args) {
-    this.bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.profile = function (args) {
-    this.bytecode.addStep('profile', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.program = function (args) {
-    this.bytecode.addStep('program', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.project = function (args) {
-    this.bytecode.addStep('project', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.properties = function (args) {
-    this.bytecode.addStep('properties', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.property = function (args) {
-    this.bytecode.addStep('property', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.propertyMap = function (args) {
-    this.bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.range = function (args) {
-    this.bytecode.addStep('range', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.repeat = function (args) {
-    this.bytecode.addStep('repeat', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.sack = function (args) {
-    this.bytecode.addStep('sack', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.sample = function (args) {
-    this.bytecode.addStep('sample', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.select = function (args) {
-    this.bytecode.addStep('select', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.sideEffect = function (args) {
-    this.bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.simplePath = function (args) {
-    this.bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.store = function (args) {
-    this.bytecode.addStep('store', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.subgraph = function (args) {
-    this.bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.sum = function (args) {
-    this.bytecode.addStep('sum', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.tail = function (args) {
-    this.bytecode.addStep('tail', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.timeLimit = function (args) {
-    this.bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.times = function (args) {
-    this.bytecode.addStep('times', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.to = function (args) {
-    this.bytecode.addStep('to', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.toE = function (args) {
-    this.bytecode.addStep('toE', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.toV = function (args) {
-    this.bytecode.addStep('toV', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.tree = function (args) {
-    this.bytecode.addStep('tree', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.unfold = function (args) {
-    this.bytecode.addStep('unfold', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.union = function (args) {
-    this.bytecode.addStep('union', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.until = function (args) {
-    this.bytecode.addStep('until', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.value = function (args) {
-    this.bytecode.addStep('value', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.valueMap = function (args) {
-    this.bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.values = function (args) {
-    this.bytecode.addStep('values', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  GraphTraversal.prototype.where = function (args) {
-    this.bytecode.addStep('where', parseArgs.apply(null, arguments));
-    return this;
-  };
-
-  /**
-   * Contains the static method definitions
-   * @type {Object}
-   */
-  var statics = {};
-
-  /**
-   * V() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.V = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.V.apply(g, arguments);
-  };
-
-  /**
-   * addE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.addE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.addE.apply(g, arguments);
-  };
-
-  /**
-   * addInE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.addInE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.addInE.apply(g, arguments);
-  };
-
-  /**
-   * addOutE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.addOutE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.addOutE.apply(g, arguments);
-  };
-
-  /**
-   * addV() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.addV = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.addV.apply(g, arguments);
-  };
-
-  /**
-   * aggregate() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.aggregate = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.aggregate.apply(g, arguments);
-  };
-
-  /**
-   * and() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.and = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.and.apply(g, arguments);
-  };
-
-  /**
-   * as() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.as = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.as.apply(g, arguments);
-  };
-
-  /**
-   * barrier() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.barrier = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.barrier.apply(g, arguments);
-  };
-
-  /**
-   * both() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.both = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.both.apply(g, arguments);
-  };
-
-  /**
-   * bothE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.bothE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.bothE.apply(g, arguments);
-  };
-
-  /**
-   * bothV() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.bothV = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.bothV.apply(g, arguments);
-  };
-
-  /**
-   * branch() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.branch = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.branch.apply(g, arguments);
-  };
-
-  /**
-   * cap() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.cap = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.cap.apply(g, arguments);
-  };
-
-  /**
-   * choose() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.choose = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.choose.apply(g, arguments);
-  };
-
-  /**
-   * coalesce() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.coalesce = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.coalesce.apply(g, arguments);
-  };
-
-  /**
-   * coin() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.coin = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.coin.apply(g, arguments);
-  };
-
-  /**
-   * constant() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.constant = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.constant.apply(g, arguments);
-  };
-
-  /**
-   * count() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.count = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.count.apply(g, arguments);
-  };
-
-  /**
-   * cyclicPath() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.cyclicPath = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.cyclicPath.apply(g, arguments);
-  };
-
-  /**
-   * dedup() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.dedup = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.dedup.apply(g, arguments);
-  };
-
-  /**
-   * drop() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.drop = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.drop.apply(g, arguments);
-  };
-
-  /**
-   * emit() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.emit = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.emit.apply(g, arguments);
-  };
-
-  /**
-   * filter() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.filter = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.filter.apply(g, arguments);
-  };
-
-  /**
-   * flatMap() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.flatMap = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.flatMap.apply(g, arguments);
-  };
-
-  /**
-   * fold() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.fold = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.fold.apply(g, arguments);
-  };
-
-  /**
-   * group() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.group = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.group.apply(g, arguments);
-  };
-
-  /**
-   * groupCount() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.groupCount = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.groupCount.apply(g, arguments);
-  };
-
-  /**
-   * groupV3d0() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.groupV3d0 = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.groupV3d0.apply(g, arguments);
-  };
-
-  /**
-   * has() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.has = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.has.apply(g, arguments);
-  };
-
-  /**
-   * hasId() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.hasId = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.hasId.apply(g, arguments);
-  };
-
-  /**
-   * hasKey() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.hasKey = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.hasKey.apply(g, arguments);
-  };
-
-  /**
-   * hasLabel() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.hasLabel = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.hasLabel.apply(g, arguments);
-  };
-
-  /**
-   * hasNot() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.hasNot = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.hasNot.apply(g, arguments);
-  };
-
-  /**
-   * hasValue() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.hasValue = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.hasValue.apply(g, arguments);
-  };
-
-  /**
-   * id() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.id = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.id.apply(g, arguments);
-  };
-
-  /**
-   * identity() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.identity = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.identity.apply(g, arguments);
-  };
-
-  /**
-   * inE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.inE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.inE.apply(g, arguments);
-  };
-
-  /**
-   * inV() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.inV = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.inV.apply(g, arguments);
-  };
-
-  /**
-   * in_() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.in_ = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.in_.apply(g, arguments);
-  };
-
-  /**
-   * inject() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.inject = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.inject.apply(g, arguments);
-  };
-
-  /**
-   * is() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.is = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.is.apply(g, arguments);
-  };
-
-  /**
-   * key() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.key = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.key.apply(g, arguments);
-  };
-
-  /**
-   * label() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.label = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.label.apply(g, arguments);
-  };
-
-  /**
-   * limit() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.limit = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.limit.apply(g, arguments);
-  };
-
-  /**
-   * local() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.local = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.local.apply(g, arguments);
-  };
-
-  /**
-   * loops() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.loops = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.loops.apply(g, arguments);
-  };
-
-  /**
-   * map() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.map = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.map.apply(g, arguments);
-  };
-
-  /**
-   * mapKeys() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.mapKeys = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.mapKeys.apply(g, arguments);
-  };
-
-  /**
-   * mapValues() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.mapValues = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.mapValues.apply(g, arguments);
-  };
-
-  /**
-   * match() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.match = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.match.apply(g, arguments);
-  };
-
-  /**
-   * max() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.max = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.max.apply(g, arguments);
-  };
-
-  /**
-   * mean() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.mean = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.mean.apply(g, arguments);
-  };
-
-  /**
-   * min() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.min = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.min.apply(g, arguments);
-  };
-
-  /**
-   * not() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.not = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.not.apply(g, arguments);
-  };
-
-  /**
-   * optional() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.optional = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.optional.apply(g, arguments);
-  };
-
-  /**
-   * or() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.or = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.or.apply(g, arguments);
-  };
-
-  /**
-   * order() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.order = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.order.apply(g, arguments);
-  };
-
-  /**
-   * otherV() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.otherV = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.otherV.apply(g, arguments);
-  };
-
-  /**
-   * out() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.out = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.out.apply(g, arguments);
-  };
-
-  /**
-   * outE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.outE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.outE.apply(g, arguments);
-  };
-
-  /**
-   * outV() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.outV = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.outV.apply(g, arguments);
-  };
-
-  /**
-   * path() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.path = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.path.apply(g, arguments);
-  };
-
-  /**
-   * project() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.project = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.project.apply(g, arguments);
-  };
-
-  /**
-   * properties() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.properties = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.properties.apply(g, arguments);
-  };
-
-  /**
-   * property() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.property = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.property.apply(g, arguments);
-  };
-
-  /**
-   * propertyMap() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.propertyMap = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.propertyMap.apply(g, arguments);
-  };
-
-  /**
-   * range() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.range = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.range.apply(g, arguments);
-  };
-
-  /**
-   * repeat() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.repeat = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.repeat.apply(g, arguments);
-  };
-
-  /**
-   * sack() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.sack = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.sack.apply(g, arguments);
-  };
-
-  /**
-   * sample() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.sample = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.sample.apply(g, arguments);
-  };
-
-  /**
-   * select() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.select = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.select.apply(g, arguments);
-  };
-
-  /**
-   * sideEffect() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.sideEffect = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.sideEffect.apply(g, arguments);
-  };
-
-  /**
-   * simplePath() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.simplePath = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.simplePath.apply(g, arguments);
-  };
-
-  /**
-   * start() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.start = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.start.apply(g, arguments);
-  };
-
-  /**
-   * store() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.store = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.store.apply(g, arguments);
-  };
-
-  /**
-   * subgraph() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.subgraph = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.subgraph.apply(g, arguments);
-  };
-
-  /**
-   * sum() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.sum = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.sum.apply(g, arguments);
-  };
-
-  /**
-   * tail() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.tail = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.tail.apply(g, arguments);
-  };
-
-  /**
-   * timeLimit() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.timeLimit = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.timeLimit.apply(g, arguments);
-  };
-
-  /**
-   * times() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.times = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.times.apply(g, arguments);
-  };
-
-  /**
-   * to() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.to = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.to.apply(g, arguments);
-  };
-
-  /**
-   * toE() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.toE = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.toE.apply(g, arguments);
-  };
-
-  /**
-   * toV() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.toV = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.toV.apply(g, arguments);
-  };
-
-  /**
-   * tree() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.tree = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.tree.apply(g, arguments);
-  };
-
-  /**
-   * unfold() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.unfold = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.unfold.apply(g, arguments);
-  };
-
-  /**
-   * union() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.union = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.union.apply(g, arguments);
-  };
-
-  /**
-   * until() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.until = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.until.apply(g, arguments);
-  };
-
-  /**
-   * value() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.value = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.value.apply(g, arguments);
-  };
-
-  /**
-   * valueMap() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.valueMap = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.valueMap.apply(g, arguments);
-  };
-
-  /**
-   * values() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.values = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.values.apply(g, arguments);
-  };
-
-  /**
-   * where() static method
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  statics.where = function (args) {
-    var g = new GraphTraversal(null, null, new Bytecode());
-    return g.where.apply(g, arguments);
-  };
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
-
-  var toExport = {
-    GraphTraversal: GraphTraversal,
-    GraphTraversalSource: GraphTraversalSource,
-    statics: statics
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
deleted file mode 100644
index 9709a4f..0000000
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/process/traversal.js
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineTraversalModule() {
-  "use strict";
-
-  function Traversal(graph, traversalStrategies, bytecode) {
-    this.graph = graph;
-    this.traversalStrategies = traversalStrategies;
-    this.bytecode = bytecode;
-    this.traversers = null;
-    this.sideEffects = null;
-  }
-
-  /** @returns {Bytecode} */
-  Traversal.prototype.getBytecode = function () {
-    return this.bytecode;
-  };
-
-  /** @param {Function} callback */
-  Traversal.prototype.list = function (callback) {
-    var self = this;
-    this.traversalStrategies.applyStrategies(this, function (err) {
-      if (err) {
-        return callback(err);
-      }
-      callback(err, self.traversers);
-    });
-  };
-
-  /** @param {Function} callback */
-  Traversal.prototype.one = function (callback) {
-    this.list(function (err, result) {
-      callback(err, result && result.length > 0 ? result[0] : null);
-    });
-  };
-
-  /**
-   * Returns the Bytecode JSON representation of the traversal
-   * @returns {String}
-   */
-  Traversal.prototype.toString = function () {
-    return this.bytecode.toString();
-  };
-  
-  /**
-   * Represents an operation.
-   * @constructor
-   */
-  function P(operator, value, other) {
-    this.operator = operator;
-    this.value = value;
-    this.other = other;
-  }
-
-  /**
-   * Returns the string representation of the instance.
-   * @returns {string}
-   */
-  P.prototype.toString = function () {
-    if (this.other === undefined) {
-      return this.operator + '(' + this.value + ')';
-    }
-    return this.operator + '(' + this.value + ', ' + this.other + ')';
-  };
-
-  function createP(operator, args) {
-    args.unshift(null, operator);
-    return new (Function.prototype.bind.apply(P, args));
-  }
-
-  /** @param {...Object} args */
-  P.between = function (args) {
-    return createP('between', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.eq = function (args) {
-    return createP('eq', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.gt = function (args) {
-    return createP('gt', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.gte = function (args) {
-    return createP('gte', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.inside = function (args) {
-    return createP('inside', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.lt = function (args) {
-    return createP('lt', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.lte = function (args) {
-    return createP('lte', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.neq = function (args) {
-    return createP('neq', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.not = function (args) {
-    return createP('not', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.outside = function (args) {
-    return createP('outside', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.test = function (args) {
-    return createP('test', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.within = function (args) {
-    return createP('within', parseArgs.apply(null, arguments));
-  };
-
-  /** @param {...Object} args */
-  P.without = function (args) {
-    return createP('without', parseArgs.apply(null, arguments));
-  };
-
-  P.prototype.and = function (arg) {
-    return new P('and', this, arg);
-  };
-
-  P.prototype.or = function (arg) {
-    return new P('or', this, arg);
-  };
-
-  function Traverser(object, bulk) {
-    this.object = object;
-    this.bulk = bulk == undefined ? 1 : bulk;
-  }
-
-  function TraversalSideEffects() {
-
-  }
-
-  /**
-   * Creates a new instance of TraversalStrategies.
-   * @param {TraversalStrategies} [traversalStrategies]
-   * @constructor
-   */
-  function TraversalStrategies(traversalStrategies) {
-    /** @type {Array<TraversalStrategy>} */
-    this.strategies = traversalStrategies ? traversalStrategies.strategies : [];
-  }
-
-  /** @param {TraversalStrategy} strategy */
-  TraversalStrategies.prototype.addStrategy = function (strategy) {
-    this.strategies.push(strategy);
-  };
-
-  /**
-   * @param {Traversal} traversal
-   * @param {Function} callback
-   */
-  TraversalStrategies.prototype.applyStrategies = function (traversal, callback) {
-    eachSeries(this.strategies, function eachStrategy(s, next) {
-      s.apply(traversal, next);
-    }, callback);
-  };
-
-  /**
-   * @abstract
-   * @constructor
-   */
-  function TraversalStrategy() {
-
-  }
-
-  /**
-   * @abstract
-   * @param {Traversal} traversal
-   * @param {Function} callback
-   */
-  TraversalStrategy.prototype.apply = function (traversal, callback) {
-
-  };
-
-  /**
-   * Creates a new instance of Bytecode
-   * @param {Bytecode} [toClone]
-   * @constructor
-   */
-  function Bytecode(toClone) {
-    this._bindings = {};
-    if (!toClone) {
-      this.sourceInstructions = [];
-      this.stepInstructions = [];
-    }
-    else {
-      this.sourceInstructions = toClone.sourceInstructions.slice(0);
-      this.stepInstructions = toClone.sourceInstructions.slice(0);
-    }
-  }
-
-  /**
-   * Adds a new source instructions
-   * @param {String} name
-   * @param {Array} values
-   * @returns {Bytecode}
-   */
-  Bytecode.prototype.addSource = function (name, values) {
-    if (name === undefined) {
-      throw new Error('Name is not defined');
-    }
-    var instruction = new Array(values.length + 1);
-    instruction[0] = name;
-    for (var i = 0; i < values.length; ++i) {
-      instruction[i + 1] = this._convertToArgument(values[i]);
-    }
-    this.sourceInstructions.push(this._generateInstruction(name, values));
-    return this;
-  };
-
-  /**
-   * Adds a new step instructions
-   * @param {String} name
-   * @param {Array} values
-   * @returns {Bytecode}
-   */
-  Bytecode.prototype.addStep = function (name, values) {
-    if (name === undefined) {
-      throw new Error('Name is not defined');
-    }
-    this.stepInstructions.push(this._generateInstruction(name, values));
-    return this;
-  };
-
-  Bytecode.prototype._generateInstruction = function (name, values) {
-    var instruction = new Array(values.length + 1);
-    instruction[0] = name;
-    for (var i = 0; i < values.length; ++i) {
-      instruction[i + 1] = this._convertToArgument(values[i]);
-    }
-    return instruction;
-  };
-
-  /**
-   * Returns the JSON representation of the source and step instructions
-   * @returns {String}
-   */
-  Bytecode.prototype.toString = function () {
-    return (
-      (this.sourceInstructions.length > 0 ? JSON.stringify(this.sourceInstructions) : '') +
-      (this.stepInstructions.length   > 0 ? JSON.stringify(this.stepInstructions) : '')
-    );
-  };
-
-  Bytecode.prototype._convertToArgument = function (value) {
-    return value;
-  };
-
-  function toEnum(typeName, keys) {
-    var result = {};
-    keys.split(' ').forEach(function (k) {
-      if (k === k.toUpperCase()) {
-        k = k.toLowerCase();
-      }
-      result[k] = new EnumValue(typeName, k);
-    });
-    return result;
-  }
-
-  function EnumValue(typeName, elementName) {
-    this.typeName = typeName;
-    this.elementName = elementName;
-  }
-
-  // Utility functions
-  /** @returns {Array} */
-  function parseArgs() {
-    return (arguments.length === 1 ? [ arguments[0] ] : Array.apply(null, arguments));
-  }
-
-  /**
-   * @param {Array} arr
-   * @param {Function} fn
-   * @param {Function} [callback]
-   */
-  function eachSeries(arr, fn, callback) {
-    if (!Array.isArray(arr)) {
-      throw new TypeError('First parameter is not an Array');
-    }
-    callback = callback || noop;
-    var length = arr.length;
-    if (length === 0) {
-      return callback();
-    }
-    var sync;
-    var index = 1;
-    fn(arr[0], next);
-    if (sync === undefined) {
-      sync = false;
-    }
-
-    function next(err) {
-      if (err) {
-        return callback(err);
-      }
-      if (index >= length) {
-        return callback();
-      }
-      if (sync === undefined) {
-        sync = true;
-      }
-      if (sync) {
-        return process.nextTick(function () {
-          fn(arr[index++], next);
-        });
-      }
-      fn(arr[index++], next);
-    }
-  }
-
-  function inherits(ctor, superCtor) {
-    ctor.super_ = superCtor;
-    ctor.prototype = Object.create(superCtor.prototype, {
-      constructor: {
-        value: ctor,
-        enumerable: false,
-        writable: true,
-        configurable: true
-      }
-    });
-  }
-
-  var toExport = {
-    Bytecode: Bytecode,
-    EnumValue: EnumValue,
-    inherits: inherits,
-    P: P,
-    parseArgs: parseArgs,
-    Traversal: Traversal,
-    TraversalSideEffects: TraversalSideEffects,
-    TraversalStrategies: TraversalStrategies,
-    TraversalStrategy: TraversalStrategy,
-    Traverser: Traverser,
-    barrier: toEnum('Barrier', 'normSack'),
-    cardinality: toEnum('Cardinality', 'list set single'),
-    column: toEnum('Column', 'keys values'),
-    direction: toEnum('Direction', 'BOTH IN OUT'),
-    operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
-    order: toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr'),
-    pick: toEnum('Pick', 'any none'),
-    pop: toEnum('Pop', 'all first last'),
-    scope: toEnum('Scope', 'global local'),
-    t: toEnum('T', 'id key label value')
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
deleted file mode 100644
index cd408ae..0000000
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/graph.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function defineGraphModule() {
-  "use strict";
-
-  var gt = loadModule.call(this, '../process/graph-traversal.js');
-  var t = loadModule.call(this, '../process/traversal.js');
-  var inherits = t.inherits;
-
-  function Graph() {
-
-  }
-
-  /**
-   * Returns the graph traversal source.
-   * @returns {GraphTraversalSource}
-   */
-  Graph.prototype.traversal = function () {
-    return new gt.GraphTraversalSource(this, new t.TraversalStrategies());
-  };
-
-  Graph.prototype.toString = function () {
-    return 'graph[empty]';
-  };
-
-  function Element(id, label) {
-    this.id = id;
-    this.label = label;
-  }
-
-  /**
-   * Compares this instance to another and determines if they can be considered as equal.
-   * @param {Element} other
-   * @returns {boolean}
-   */
-  Element.prototype.equals = function (other) {
-    return (other instanceof Element) && this.id === other.id;
-  };
-
-  function Vertex(id, label, properties) {
-    Element.call(this, id, label);
-    this.properties = properties;
-  }
-
-  Vertex.prototype.toString = function () {
-    return 'v[' + this.id + ']';
-  };
-
-  inherits(Vertex, Element);
-
-  function Edge(id, outV, label, inV, properties) {
-    Element.call(this, id, label);
-    this.outV = outV;
-    this.inV = inV;
-    this.properties = {};
-    (function adaptProperties(self) {
-      if (properties) {
-        var keys = Object.keys(properties);
-        for (var i = 0; i < keys.length; i++) {
-          var k = keys[i];
-          self.properties[k] = properties[k].value;
-        }
-      }
-    })(this);
-  }
-
-  inherits(Edge, Element);
-
-  Edge.prototype.toString = function () {
-    return 'e[' + this.id + '][' + this.outV.id + '-' + this.label + '->' + this.inV.id + ']';
-  };
-
-  function VertexProperty(id, label, value, properties) {
-    Element.call(this, id, label);
-    this.value = value;
-    this.key = this.label;
-    this.properties = properties;
-  }
-
-  inherits(VertexProperty, Element);
-
-  VertexProperty.prototype.toString = function () {
-    return 'vp[' + this.label + '->' + this.value.substr(0, 20) + ']';
-  };
-
-  function Property(key, value) {
-    this.key = key;
-    this.value = value;
-  }
-
-  Property.prototype.toString = function () {
-    return 'p[' + this.key + '->' + this.value.substr(0, 20) + ']';
-  };
-
-  Property.prototype.equals = function (other) {
-    return (other instanceof Property) && this.key === other.key && this.value === other.value;
-  };
-
-  /**
-   * Represents a walk through a graph as defined by a traversal.
-   * @param {Array} labels
-   * @param {Array} objects
-   * @constructor
-   */
-  function Path(labels, objects) {
-    this.labels = labels;
-    this.objects = objects;
-  }
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
-
-  var toExport = {
-    Edge: Edge,
-    Graph: Graph,
-    Path: Path,
-    Property: Property,
-    Vertex: Vertex,
-    VertexProperty: VertexProperty
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
deleted file mode 100644
index 31652da..0000000
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/structure/io/graph-serializer.js
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- *  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.
- */
-
-/**
- * @author Jorge Bay Gondra
- */
-(function graphSerializerModule() {
-  "use strict";
-
-  var t = loadModule.call(this, '../../process/traversal.js');
-  var g = loadModule.call(this, '../graph.js');
-
-  /**
-   * A type serializer
-   * @typedef {Object} Serializer
-   * @property {Function} serialize
-   * @property {Function} deserialize
-   * @property {Function} [canBeUsedFor]
-   */
-
-  /**
-   * @const
-   * @private
-   */
-  var valueKey = '@value';
-
-  /**
-   * @const
-   * @private
-   */
-  var typeKey = '@type';
-
-  var deserializers = {
-    'g:Traverser': TraverserSerializer,
-    'g:Int32':  NumberSerializer,
-    'g:Int64':  NumberSerializer,
-    'g:Float':  NumberSerializer,
-    'g:Double': NumberSerializer,
-    'g:Vertex': VertexSerializer,
-    'g:Edge': EdgeSerializer,
-    'g:VertexProperty': VertexPropertySerializer,
-    'g:Property': PropertySerializer,
-    'g:Path': PathSerializer
-  };
-
-  var serializers = [
-    NumberSerializer,
-    BytecodeSerializer,
-    TraverserSerializer,
-    PSerializer,
-    LambdaSerializer,
-    EnumSerializer
-  ];
-
-  /**
-   * GraphSON Writer
-   * @param {Object} [options]
-   * @param {Object} options.serializers An object used as an associative array with GraphSON 2 type name as keys and
-   * serializer instances as values, ie: { 'g:Int64': longSerializer }.
-   * @constructor
-   */
-  function GraphSONWriter(options) {
-    this._options = options || {};
-    // Create instance of the default serializers
-    this._serializers = serializers.map(function (serializerConstructor) {
-      var s = new serializerConstructor();
-      s.writer = this;
-      return s;
-    }, this);
-    var customSerializers = this._options.serializers || {};
-    Object.keys(customSerializers).forEach(function (key) {
-      var s = customSerializers[key];
-      if (!s.serialize) {
-        return;
-      }
-      s.writer = this;
-      // Insert custom serializers first
-      this._serializers.unshift(s);
-    }, this);
-  }
-
-  GraphSONWriter.prototype.adaptObject = function (value) {
-    var s;
-    if (Array.isArray(value)) {
-      return value.map(function (item) {
-        return this.adaptObject(item);
-      }, this);
-    }
-    for (var i = 0; i < this._serializers.length; i++) {
-      var currentSerializer = this._serializers[i];
-      if (currentSerializer.canBeUsedFor && currentSerializer.canBeUsedFor(value)) {
-        s = currentSerializer;
-        break;
-      }
-    }
-    if (s) {
-      return s.serialize(value);
-    }
-    // Default (strings / objects / ...)
-    return value;
-  };
-
-  /**
-   * Returns the GraphSON representation of the provided object instance.
-   * @param {Object} obj
-   * @returns {String}
-   */
-  GraphSONWriter.prototype.write = function (obj) {
-    return JSON.stringify(this.adaptObject(obj));
-  };
-
-  /**
-   * GraphSON Reader
-   * @param {Object} [options]
-   * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
-   * deserializer instances as values, ie: { 'g:Int64': longSerializer }.
-   * @constructor
-   */
-  function GraphSONReader(options) {
-    this._options = options || {};
-    this._deserializers = {};
-    Object.keys(deserializers).forEach(function (typeName) {
-      var serializerConstructor = deserializers[typeName];
-      var s = new serializerConstructor();
-      s.reader = this;
-      this._deserializers[typeName] = s;
-    }, this);
-    if (this._options.serializers) {
-      var customSerializers = this._options.serializers || {};
-      Object.keys(customSerializers).forEach(function (key) {
-        var s = customSerializers[key];
-        if (!s.deserialize) {
-          return;
-        }
-        s.reader = this;
-        this._deserializers[key] = s;
-      }, this);
-    }
-  }
-
-  GraphSONReader.prototype.read = function (obj) {
-    if (obj === undefined) {
-      return undefined;
-    }
-    if (Array.isArray(obj)) {
-      return obj.map(function mapEach(item) {
-        return this.read(item);
-      }, this);
-    }
-    var type = obj[typeKey];
-    if (type) {
-      var d = this._deserializers[type];
-      if (d) {
-        // Use type serializer
-        return d.deserialize(obj);
-      }
-      return obj[valueKey];
-    }
-    if (obj && typeof obj === 'object' && obj.constructor === Object) {
-      return this._deserializeObject(obj);
-    }
-    // Default (for boolean, number and other scalars)
-    return obj;
-  };
-
-  GraphSONReader.prototype._deserializeObject = function (obj) {
-    var keys = Object.keys(obj);
-    var result = {};
-    for (var i = 0; i < keys.length; i++) {
-      result[keys[i]] = this.read(obj[keys[i]]);
-    }
-    return result;
-  };
-
-  function NumberSerializer() {
-
-  }
-
-  NumberSerializer.prototype.serialize = function (item) {
-    return item;
-  };
-
-  NumberSerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    return parseFloat(value);
-  };
-
-  NumberSerializer.prototype.canBeUsedFor = function (value) {
-    return (typeof value === 'number');
-  };
-
-  function BytecodeSerializer() {
-
-  }
-
-  BytecodeSerializer.prototype.serialize = function (item) {
-    var bytecode = item;
-    if (item instanceof t.Traversal) {
-      bytecode = item.getBytecode();
-    }
-    var result = {};
-    result[typeKey] = 'g:Bytecode';
-    var resultValue = result[valueKey] = {};
-    var sources = this._serializeInstructions(bytecode.sourceInstructions);
-    if (sources) {
-      resultValue['source'] = sources;
-    }
-    var steps = this._serializeInstructions(bytecode.stepInstructions);
-    if (steps) {
-      resultValue['step'] = steps;
-    }
-    return result;
-  };
-
-  BytecodeSerializer.prototype._serializeInstructions = function (instructions) {
-    if (instructions.length === 0) {
-      return null;
-    }
-    var result = new Array(instructions.length);
-    result[0] = instructions[0];
-    for (var i = 1; i < instructions.length; i++) {
-      result[i] = this.writer.adaptObject(instructions[i]);
-    }
-    return result;
-  };
-
-  BytecodeSerializer.prototype.canBeUsedFor = function (value) {
-    return (value instanceof t.Bytecode) || (value instanceof t.Traversal);
-  };
-
-  function PSerializer() {
-
-  }
-
-  /** @param {P} item */
-  PSerializer.prototype.serialize = function (item) {
-    var result = {};
-    result[typeKey] = 'g:P';
-    var resultValue = result[valueKey] = {
-      'predicate': item.operator
-    };
-    if (item.other == undefined) {
-      resultValue['value'] = this.writer.adaptObject(item.value);
-    }
-    else {
-      resultValue['value'] = [ this.writer.adaptObject(item.value), this.writer.adaptObject(item.other) ];
-    }
-    return result;
-  };
-
-  PSerializer.prototype.canBeUsedFor = function (value) {
-    return (value instanceof t.P);
-  };
-
-  function LambdaSerializer() {
-
-  }
-
-  /** @param {Function} item */
-  LambdaSerializer.prototype.serialize = function (item) {
-    var result = {};
-    result[typeKey] = 'g:Lambda';
-    result[valueKey] = {
-      'arguments': item.length,
-      'language': 'gremlin-javascript',
-      'script': item.toString()
-    };
-    return result;
-  };
-
-  LambdaSerializer.prototype.canBeUsedFor = function (value) {
-    return (typeof value === 'function');
-  };
-
-  function EnumSerializer() {
-
-  }
-
-  /** @param {EnumValue} item */
-  EnumSerializer.prototype.serialize = function (item) {
-    var result = {};
-    result[typeKey] = 'g:' + item.typeName;
-    result[valueKey] = item.elementName;
-    return result;
-  };
-
-  EnumSerializer.prototype.canBeUsedFor = function (value) {
-    return value && value.typeName && value instanceof t.EnumValue;
-  };
-
-  function TraverserSerializer() {
-
-  }
-
-  /** @param {Traverser} item */
-  TraverserSerializer.prototype.serialize = function (item) {
-    var result = {};
-    result[typeKey] = 'g:Traverser';
-    result[valueKey] = {
-      'value': this.writer.adaptObject(item.object),
-      'bulk': this.writer.adaptObject(item.bulk)
-    };
-    return result;
-  };
-
-  TraverserSerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    return new t.Traverser(this.reader.read(value['value']), this.reader.read(value['bulk']));
-  };
-
-  TraverserSerializer.prototype.canBeUsedFor = function (value) {
-    return (value instanceof t.Traverser);
-  };
-
-  function VertexSerializer() {
-
-  }
-
-  VertexSerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    return new g.Vertex(this.reader.read(value['id']), value['label'], this.reader.read(value['properties']));
-  };
-
-  function VertexPropertySerializer() {
-
-  }
-
-  VertexPropertySerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    return new g.VertexProperty(
-      this.reader.read(value['id']),
-      value['label'],
-      this.reader.read(value['value']),
-      this.reader.read(value['properties'])
-    );
-  };
-
-  function PropertySerializer() {
-
-  }
-
-  PropertySerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    return new g.Property(
-      value['key'],
-      this.reader.read(value['value']));
-  };
-
-  function EdgeSerializer() {
-
-  }
-
-  EdgeSerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    return new g.Edge(
-      this.reader.read(value['id']),
-      this.reader.read(value['outV']),
-      value['label'],
-      this.reader.read(value['inV']),
-      this.reader.read(value['properties'])
-    );
-  };
-
-  function PathSerializer() {
-
-  }
-
-  PathSerializer.prototype.deserialize = function (obj) {
-    var value = obj[valueKey];
-    var objects = value['objects'].map(function objectMapItem(o) {
-      return this.reader.read(o);
-    }, this);
-    return new g.Path(this.reader.read(value['labels']), objects);
-  };
-
-  function loadModule(moduleName) {
-    if (typeof require !== 'undefined') {
-      return require(moduleName);
-    }
-    if (typeof load !== 'undefined') {
-      var path = new java.io.File(__DIR__ + moduleName).getCanonicalPath();
-      this.__dependencies = this.__dependencies || {};
-      return this.__dependencies[path] = (this.__dependencies[path] || load(path));
-    }
-    throw new Error('No module loader was found');
-  }
-
-  var toExport = {
-    GraphSONWriter: GraphSONWriter,
-    GraphSONReader: GraphSONReader
-  };
-  if (typeof module !== 'undefined') {
-    // CommonJS
-    module.exports = toExport;
-    return;
-  }
-  // Nashorn and rest
-  return toExport;
-}).call(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
new file mode 100644
index 0000000..df813ad
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
@@ -0,0 +1,64 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var assert = require('assert');
+var Bytecode = require('../../lib/process/bytecode');
+var DriverRemoteConnection = require('../../lib/driver/driver-remote-connection');
+var graphModule = require('../../lib/structure/graph');
+
+var connection;
+
+describe('DriverRemoteConnection', function () {
+  before(function () {
+    connection = new DriverRemoteConnection('ws://localhost:45950/gremlin');
+    return connection.open();
+  });
+  after(function () {
+    return connection.close();
+  });
+  describe('#submit()', function () {
+    it('should send the request and parse the response', function () {
+      return connection.submit(new Bytecode().addStep('addV', [ 'person' ]).addStep('property', [ 'name', 'marko']))
+        .then(function (response) {
+          assert.ok(response);
+          assert.ok(response.traversers);
+          assert.strictEqual(response.traversers.length, 1);
+          assert.ok(response.traversers[0].object instanceof graphModule.Vertex);
+        });
+    });
+    it('should send the request with syntax error and parse the response error', function () {
+      return connection.submit(new Bytecode().addStep('SYNTAX_ERROR'))
+        .catch(function (err) {
+          assert.ok(err);
+          assert.ok(err.message.indexOf('599') > 0);
+        });
+    });
+  });
+});
+
+function delay(ms) {
+  return new Promise(function (resolve) {
+    setTimeout(resolve, ms);
+  });
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f2cdda/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/traversal-test.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/traversal-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/traversal-test.js
new file mode 100644
index 0000000..90afced
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/traversal-test.js
@@ -0,0 +1,71 @@
+/*
+ *  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.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+var assert = require('assert');
+var graphModule = require('../../lib/structure/graph');
+var Graph = graphModule.Graph;
+var Vertex = graphModule.Vertex;
+var utils = require('../../lib/utils');
+var t = require('../../lib/process/traversal');
+var TraversalStrategies = require('../../lib/process/traversal-strategy').TraversalStrategies;
+var DriverRemoteConnection = require('../../lib/driver/driver-remote-connection');
+
+var connection;
+
+describe('Traversal', function () {
+  before(function () {
+    connection = new DriverRemoteConnection('ws://localhost:45950/gremlin');
+    return connection.open();
+  });
+  after(function () {
+    return connection.close();
+  });
+  describe('#toList()', function () {
+    it('should submit the traversal and return a list', function () {
+      var g = new Graph().traversal().withRemote(connection);
+      return g.addV('user').toList().then(function (list) {
+        assert.ok(list);
+        assert.strictEqual(list.length, 1);
+        assert.ok(list[0] instanceof Vertex);
+      });
+    });
+  });
+  describe('#next()', function () {
+    it('should submit the traversal and return an iterator', function () {
+      var g = new Graph().traversal().withRemote(connection);
+      var traversal = g.V().count();
+      return traversal.next()
+        .then(function (item) {
+          assert.ok(item);
+          assert.strictEqual(item.done, false);
+          assert.strictEqual(typeof item.value, 'number');
+          return traversal.next();
+        }).then(function (item) {
+          assert.ok(item);
+          assert.strictEqual(item.done, true);
+          assert.strictEqual(item.value, null);
+        });
+    });
+  });
+});
\ No newline at end of file