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 2018/03/12 15:56:33 UTC

[01/13] tinkerpop git commit: TINKERPOP-1908 Bump to Groovy 2.4.14 [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1896 8e23f5b12 -> c82d06e05 (forced update)


TINKERPOP-1908 Bump to Groovy 2.4.14


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

Branch: refs/heads/TINKERPOP-1896
Commit: f409564bb1d59b3b9d09e130bf56a0da48c771f3
Parents: a61dd58
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 2 06:52:09 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 2 11:59:36 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                               | 1 +
 .../jsr223/GremlinGroovyScriptEngineCompileStaticTest.java       | 4 ++--
 .../groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java  | 4 ++--
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java     | 2 +-
 .../tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java | 2 +-
 pom.xml                                                          | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f409564b/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a24b1fb..f73e063 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-2-8]]
 === TinkerPop 3.2.8 (Release Date: NOT OFFICIALLY RELEASED YET)
 
+* Bumped to Groovy 2.4.14.
 * Added `checkAdjacentVertices` option to `SubgraphStrategy`.
 * Modified `GremlinDslProcessor` so that it generated the `getAnonymousTraversalClass()` method to return the DSL version of `__`.
 * Added the "Kitchen Sink" test data set.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f409564b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
index 6f3383e..0007925 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineCompileStaticTest.java
@@ -48,7 +48,7 @@ public class GremlinGroovyScriptEngineCompileStaticTest {
         } catch (ScriptException se) {
             final Throwable root = ExceptionUtils.getRootCause(se);
             assertEquals(MultipleCompilationErrorsException.class, root.getClass());
-            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is right and if the method exists."));
+            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is correct and if the method exists."));
         }
     }
 
@@ -66,7 +66,7 @@ public class GremlinGroovyScriptEngineCompileStaticTest {
         } catch (ScriptException se) {
             final Throwable root = ExceptionUtils.getRootCause(se);
             assertEquals(MultipleCompilationErrorsException.class, root.getClass());
-            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is right and if the method exists."));
+            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is correct and if the method exists."));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f409564b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
index 6c70e8e..a0c6b0c 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java
@@ -49,7 +49,7 @@ public class GremlinGroovyScriptEngineTypeCheckedTest {
         } catch (ScriptException se) {
             final Throwable root = ExceptionUtils.getRootCause(se);
             assertEquals(MultipleCompilationErrorsException.class, root.getClass());
-            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is right and if the method exists."));
+            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is correct and if the method exists."));
         }
     }
 
@@ -67,7 +67,7 @@ public class GremlinGroovyScriptEngineTypeCheckedTest {
         } catch (ScriptException se) {
             final Throwable root = ExceptionUtils.getRootCause(se);
             assertEquals(MultipleCompilationErrorsException.class, root.getClass());
-            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is right and if the method exists."));
+            assertThat(se.getMessage(), containsString("[Static type checking] - Cannot find matching method java.lang.Object#getRed(). Please check if the declared type is correct and if the method exists."));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f409564b/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 9662ab7..c5ff608 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
@@ -405,7 +405,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
             final ResponseException rex = (ResponseException) inner;
             assertEquals("java.lang.ArithmeticException", rex.getRemoteExceptionHierarchy().get().get(0));
             assertEquals(1, rex.getRemoteExceptionHierarchy().get().size());
-            assertThat(rex.getRemoteStackTrace().get(), startsWith("java.lang.ArithmeticException: Division by zero\n\tat java.math.BigDecimal.divide(BigDecimal.java:1742)\n\tat org.codehaus.groovy.runtime.typehandling.BigDecimalMath.divideImpl(BigDecimalMath.java:68)\n\tat org.codehaus.groovy.runtime.typehandling.IntegerMath.divideImpl(IntegerMath.java:49)\n\tat org.codehaus.groovy.runtime.dgmimpl.NumberNumberDiv$NumberNumber.invoke(NumberNumberDiv.java:323)\n\tat org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)\n"));
+            assertThat(rex.getRemoteStackTrace().get(), startsWith("java.lang.ArithmeticException: Division by zero\n\tat java.math.BigDecimal.divide(BigDecimal.java"));
         }
 
         // should not die completely just because we had a bad serialization error.  that kind of stuff happens

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f409564b/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 baf4c02..df7b734 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
@@ -853,7 +853,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             final JsonNode node = mapper.readTree(json);
             assertEquals("java.lang.ArithmeticException", node.get(Tokens.STATUS_ATTRIBUTE_EXCEPTIONS).get(0).asText());
             assertEquals(1, node.get(Tokens.STATUS_ATTRIBUTE_EXCEPTIONS).size());
-            assertThat(node.get(Tokens.STATUS_ATTRIBUTE_STACK_TRACE).asText(), startsWith("java.lang.ArithmeticException: Division by zero\n\tat java.math.BigDecimal.divide(BigDecimal.java:1742)\n\tat org.codehaus.groovy.runtime.typehandling.BigDecimalMath.divideImpl(BigDecimalMath.java:68)\n\tat org.codehaus.groovy.runtime.typehandling.IntegerMath.divideImpl(IntegerMath.java:49)\n\tat org.codehaus.groovy.runtime.dgmimpl.NumberNumberDiv$NumberNumber.invoke(NumberNumberDiv.java:323)\n\tat org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)\n"));
+            assertThat(node.get(Tokens.STATUS_ATTRIBUTE_STACK_TRACE).asText(), startsWith("java.lang.ArithmeticException: Division by zero\n\tat java.math.BigDecimal.divide(BigDecimal.java"));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f409564b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f6ff536..a83ded5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -141,7 +141,7 @@ limitations under the License.
         <commons.configuration.version>1.10</commons.configuration.version>
         <commons.lang.version>2.6</commons.lang.version>
         <commons.lang3.version>3.3.1</commons.lang3.version>
-        <groovy.version>2.4.11</groovy.version>
+        <groovy.version>2.4.14</groovy.version>
         <hadoop.version>2.7.2</hadoop.version>
         <java.tuples.version>1.2</java.tuples.version>
         <javadoc-plugin.version>2.10.4</javadoc-plugin.version>


[04/13] tinkerpop git commit: fixed link - CTR

Posted by sp...@apache.org.
fixed link - CTR


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

Branch: refs/heads/TINKERPOP-1896
Commit: 97fb12e79edfcf613f9a988beca4be731fc0ac48
Parents: 34f924e
Author: Robert Dale <ro...@gmail.com>
Authored: Fri Mar 9 07:33:03 2018 -0500
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Mar 9 07:33:03 2018 -0500

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/97fb12e7/docs/src/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/index.asciidoc b/docs/src/index.asciidoc
index 5cc3dd5..f07bd99 100644
--- a/docs/src/index.asciidoc
+++ b/docs/src/index.asciidoc
@@ -57,7 +57,7 @@ Note the "+" following the link in each table entry - it forces an asciidoc line
 A gentle introduction to TinkerPop and the Gremlin traversal language that is divided into five, ten and fifteen minute tutorial blocks.
 |image:gremlin-dashboard.png[] |link:http://tinkerpop.apache.org/docs/x.y.z/tutorials/the-gremlin-console/[The Gremlin Console] +
 Provides a detailed look at The Gremlin Console and how it can be used when working with TinkerPop.
-^|image:gremlin-anatomy.png[width=125] |link:http://tinkerpop.apache.org/docs/x.y.z/gremlins-anatomy/[Gremlin's Anatomy]
+^|image:gremlin-anatomy.png[width=125] |link:http://tinkerpop.apache.org/docs/x.y.z/tutorials/gremlins-anatomy/[Gremlin's Anatomy]
 Identifies and explains the component parts of a Gremlin traversal.
 ^|image:gremlin-chef.png[width=125] |link:http://tinkerpop.apache.org/docs/x.y.z/recipes/[Gremlin Recipes]
 A collection of best practices and common traversal patterns for Gremlin.


[08/13] tinkerpop git commit: TINKERPOP-1918 Fixed some return types in the gherkin tests CTR

Posted by sp...@apache.org.
TINKERPOP-1918 Fixed some return types in the gherkin tests CTR


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

Branch: refs/heads/TINKERPOP-1896
Commit: f38c2bbf15c456f5067c0b65873e33756329269e
Parents: bbb1377
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Mar 12 08:23:05 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 12 08:23:05 2018 -0400

----------------------------------------------------------------------
 .../Gherkin/GherkinTestRunner.cs                        |  5 -----
 gremlin-test/features/sideEffect/Sack.feature           | 12 ++++++------
 2 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f38c2bbf/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index 4a1d646..9d0f15d 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@ -40,11 +40,6 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
         private static readonly IDictionary<string, IgnoreReason> IgnoredScenarios =
             new Dictionary<string, IgnoreReason>
             {
-                {
-                    "g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack",
-                    IgnoreReason.NumericalValuesHaveWrongTypes
-                },
-                {"g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack", IgnoreReason.NumericalValuesHaveWrongTypes},
                 {"g_V_hasIdXwithinXemptyXX_count", IgnoreReason.PWithinWrapsArgumentsInArray},
                 {"g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX", IgnoreReason.PWithinWrapsArgumentsInArray},
                 {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f38c2bbf/gremlin-test/features/sideEffect/Sack.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Sack.feature b/gremlin-test/features/sideEffect/Sack.feature
index 89e3946..8d97c0c 100644
--- a/gremlin-test/features/sideEffect/Sack.feature
+++ b/gremlin-test/features/sideEffect/Sack.feature
@@ -92,10 +92,10 @@ Feature: Step - sack()
     When iterated to list
     Then the result should be unordered
       | result |
-      | d[3].l |
-      | d[1].l |
-      | d[1].l |
-      | d[1].l |
+      | d[3].i |
+      | d[1].i |
+      | d[1].i |
+      | d[1].i |
 
   Scenario: g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack
     Given the modern graph
@@ -107,5 +107,5 @@ Feature: Step - sack()
     When iterated to list
     Then the result should be unordered
       | result |
-      | d[1.0].d |
-      | d[1.0].d |
\ No newline at end of file
+      | d[1.0].m |
+      | d[1.0].m |
\ No newline at end of file


[03/13] tinkerpop git commit: fix build docs error - CTR

Posted by sp...@apache.org.
fix build docs error - CTR


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

Branch: refs/heads/TINKERPOP-1896
Commit: 34f924e50db3a20a3ba538c4e16bbfcfa9e7b873
Parents: 7bff988
Author: Robert Dale <ro...@gmail.com>
Authored: Thu Mar 8 15:52:40 2018 -0500
Committer: Robert Dale <ro...@gmail.com>
Committed: Thu Mar 8 15:52:40 2018 -0500

----------------------------------------------------------------------
 docs/src/recipes/olap-spark-yarn.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34f924e5/docs/src/recipes/olap-spark-yarn.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/olap-spark-yarn.asciidoc b/docs/src/recipes/olap-spark-yarn.asciidoc
index 634adeb..1543829 100644
--- a/docs/src/recipes/olap-spark-yarn.asciidoc
+++ b/docs/src/recipes/olap-spark-yarn.asciidoc
@@ -105,6 +105,7 @@ conf.setProperty('spark.executor.extraClassPath', "./$archive/*:$hadoopConfDir")
 conf.setProperty('spark.driver.extraLibraryPath', "$hadoop/lib/native:$hadoop/lib/native/Linux-amd64-64")
 conf.setProperty('spark.executor.extraLibraryPath', "$hadoop/lib/native:$hadoop/lib/native/Linux-amd64-64")
 conf.setProperty('gremlin.spark.persistContext', 'true')
+hdfs.copyFromLocal('data/tinkerpop-modern.kryo', 'tinkerpop-modern.kryo')
 graph = GraphFactory.open(conf)
 g = graph.traversal().withComputer(SparkGraphComputer)
 g.V().group().by(values('name')).by(both().count())


[02/13] tinkerpop git commit: TINKERPOP-1884 Bump to Netty 4.0.56.Final

Posted by sp...@apache.org.
TINKERPOP-1884 Bump to Netty 4.0.56.Final


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

Branch: refs/heads/TINKERPOP-1896
Commit: eefc4dbf04396b57e1ff1d66292e5bedaf5ee1da
Parents: 4db0991
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Mar 3 09:41:34 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sat Mar 3 10:47:00 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 pom.xml            | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eefc4dbf/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a24b1fb..9544e2a 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -34,6 +34,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Removed hardcoded expectation in metrics serialization test suite as different providers may have different outputs.
 * Added `IndexedTraverserSet` which indexes on the value of a `Traverser` thus improving performance when used.
 * Utilized `IndexedTraverserSet` in `TraversalVertexProgram` to avoid extra iteration when doing `Vertex` lookups.
+* Bumped to Netty 4.0.56.Final.
 * Fixed a bug in Gremlin Console which prevented handling of `gremlin.sh` flags that had an "=" between the flag and its arguments.
 * Fixed bug where `SparkMessenger` was not applying the `edgeFunction` from `MessageScope`.
 * Fixed a bug in `ComputerAwareStep` that didn't handle `reset()` properly and thus occasionally produced some extra traversers.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eefc4dbf/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f6ff536..90e8215 100644
--- a/pom.xml
+++ b/pom.xml
@@ -147,7 +147,7 @@ limitations under the License.
         <javadoc-plugin.version>2.10.4</javadoc-plugin.version>
         <jcabi.version>1.1</jcabi.version>
         <metrics.version>3.0.2</metrics.version>
-        <netty.version>4.0.53.Final</netty.version>
+        <netty.version>4.0.56.Final</netty.version>
         <slf4j.version>1.7.21</slf4j.version>
         <snakeyaml.version>1.15</snakeyaml.version>
         <spark.version>1.6.1</spark.version>


[10/13] tinkerpop git commit: TINKERPOP-1895 Fixed jython based evaluations of withStrategies

Posted by sp...@apache.org.
TINKERPOP-1895 Fixed jython based evaluations of withStrategies

Similar to TINKERPOP-1896 in that a lambda would trigger a scriptengine evaluation with jython which would fail when withStrategies() was used as the JythonTranslator was actually producing Python valid code rather than Jython valid code.


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

Branch: refs/heads/TINKERPOP-1896
Commit: f3172bc55ef3e8f298dccfeb18c9fe6b4c27767c
Parents: 5feadbd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 9 09:38:35 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 12 11:56:16 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                               |  1 +
 .../gremlin/python/jsr223/JythonTranslator.java  | 19 +++++++++++++++++++
 .../gremlin/python/jsr223/PythonTranslator.java  | 14 ++++++++------
 .../python/jsr223/JythonTranslatorTest.java      | 13 +++++++++++++
 4 files changed, 41 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f3172bc5/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a761003..350fce8 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -31,6 +31,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Bumped to Jackson 2.9.4.
 * Added `idleConnectionTimeout` and `keepAliveInterval` to Gremlin Server that enables a "ping" and auto-close for seemingly dead clients.
 * Fixed a bug where lambdas in `gremlin-python` would trigger a failure if steps using python-only symbols were present (such as `as_()`).
+* Fixed a bug where lambdas in `gremlin-python` would trigger a failure if `withStrategies()` was evaluated.
 * Fixed a bug in `NumberHelper` that led to wrong min/max results if numbers exceeded the Integer limits.
 * Delayed setting of the request identifier until `RequestMessage` construction by the builder.
 * Improved error messaging for failed serialization and deserialization of request/response messages.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f3172bc5/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
index f8a5bc3..3d7d9fe 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
@@ -19,8 +19,17 @@
 
 package org.apache.tinkerpop.gremlin.python.jsr223;
 
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationConverter;
+import org.apache.commons.configuration.MapConfiguration;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
 
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -63,4 +72,14 @@ public final class JythonTranslator extends PythonTranslator {
         // jython one can just pass them through.
         return methodName;
     }
+
+    @Override
+    protected String resolveTraversalStrategyProxy(final TraversalStrategyProxy proxy) {
+        // since this is jython we don't need a traversal proxy here - we need the actual JVM version of the strategy
+        // since this script will be executed in Jython. 
+        if (proxy.getConfiguration().isEmpty())
+            return proxy.getStrategyClass().getCanonicalName() + ".instance()";
+        else
+            return proxy.getStrategyClass().getCanonicalName() + ".create(new org.apache.commons.configuration.MapConfiguration(" + convertToString(ConfigurationConverter.getMap(proxy.getConfiguration())) + "))";
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f3172bc5/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 7c74b85..d8c73f0 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -139,7 +139,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         return traversalScript.toString();
     }
 
-    private String convertToString(final Object object) {
+    protected String convertToString(final Object object) {
         if (object instanceof Bytecode.Binding)
             return ((Bytecode.Binding) object).variable();
         else if (object instanceof Bytecode)
@@ -172,11 +172,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         } else if (object instanceof Long)
             return object + "L";
         else if (object instanceof TraversalStrategyProxy) {
-            final TraversalStrategyProxy proxy = (TraversalStrategyProxy) object;
-            if (proxy.getConfiguration().isEmpty())
-                return "TraversalStrategy(\"" + proxy.getStrategyClass().getSimpleName() + "\")";
-            else
-                return "TraversalStrategy(\"" + proxy.getStrategyClass().getSimpleName() + "\"," + convertToString(ConfigurationConverter.getMap(proxy.getConfiguration())) + ")";
+            return resolveTraversalStrategyProxy((TraversalStrategyProxy) object);
         } else if (object instanceof TraversalStrategy) {
             return convertToString(new TraversalStrategyProxy((TraversalStrategy) object));
         } else if (object instanceof Boolean)
@@ -242,4 +238,10 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         return SymbolHelper.toPython(methodName);
     }
 
+    protected String resolveTraversalStrategyProxy(final TraversalStrategyProxy proxy) {
+        if (proxy.getConfiguration().isEmpty())
+            return "TraversalStrategy(\"" + proxy.getStrategyClass().getSimpleName() + "\")";
+        else
+            return "TraversalStrategy(\"" + proxy.getStrategyClass().getSimpleName() + "\"," + convertToString(ConfigurationConverter.getMap(proxy.getConfiguration())) + ")";
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f3172bc5/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
index 86e3b78..e35898b 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
@@ -24,6 +24,7 @@ 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.process.traversal.strategy.decoration.TranslationStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
@@ -103,4 +104,16 @@ public class JythonTranslatorTest {
 
         assertEquals(6, o.size());
     }
+
+    @Test
+    public void shouldTranslateToJythonWhenUsingLambdasAndStrategies() throws Exception {
+        // the jython translation kicks in when you add a lambda so ensure that it translates when strategies are
+        // present
+        GraphTraversalSource g = TinkerFactory.createModern().traversal();
+        g = g.withStrategies(new TranslationStrategy(g, JythonTranslator.of("g")));
+        final List<Object> o = g.withStrategies(ReadOnlyStrategy.instance()).
+                V().has("name").map(Lambda.function("lambda x: type(x.get())")).toList();
+
+        assertEquals(6, o.size());
+    }
 }


[06/13] tinkerpop git commit: Make decimal serialization in Gremlin.Net culture independent CTR

Posted by sp...@apache.org.
Make decimal serialization in Gremlin.Net culture independent CTR

This led tests fail on my system and probably leads to broken
serialization of gx:BigDecimal on systems with ',' as the decimal
separator.


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

Branch: refs/heads/TINKERPOP-1896
Commit: ab66ed384b8c95475755dff1c558e392e0cc7e8c
Parents: 552820a
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Sat Mar 10 16:29:42 2018 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Sat Mar 10 16:29:42 2018 +0100

----------------------------------------------------------------------
 .../src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab66ed38/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
index 53dad94..8127415 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
@@ -23,6 +23,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using Newtonsoft.Json.Linq;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -44,7 +45,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             object value = objectData;
             if (StringifyValue)
             {
-                value = value?.ToString();
+                value = string.Format(CultureInfo.InvariantCulture, "{0}", value);
             }
             return GraphSONUtil.ToTypedValue(GraphSONTypeName, value, Prefix);
         }


[13/13] tinkerpop git commit: TINKERPOP-1896 Fixed bug in lambda processing for python

Posted by sp...@apache.org.
TINKERPOP-1896 Fixed bug in lambda processing for python

When a lambda is in a traversal, the bytecode gets pushed to a scriptengine for evaluation. For python that means, using the JythonTranslator. Prior to this change the JythonTranslator largely relied on the PythonTranslator to convert bytecode to Jython-syntaxed Gremlin. The problem there is that in the JythonScriptEngine, the Traversal bindings are Java objects and so if translated to pure Python syntax, traversal steps like as() become as_() and thus not part of the Java API that is expected - and then errors. Not sure why this didn't come up sooner, but it really only ends up being an issue if you are using bytecode, use gremlin server, use jython in gremlin server and then submit a traversal with a lambda - so perhaps that hasn't been a common combination.


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

Branch: refs/heads/TINKERPOP-1896
Commit: 5feadbddba308a6999649dffb193cf7d31b4645c
Parents: f80a542
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Mar 8 17:15:34 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 12 11:56:16 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../jsr223/GremlinJythonScriptEngine.java       |  7 +--
 .../gremlin/python/jsr223/JythonTranslator.java |  9 ++++
 .../gremlin/python/jsr223/PythonTranslator.java | 19 +++++---
 .../python/jsr223/JythonTranslatorTest.java     | 47 +++++++++-----------
 5 files changed, 44 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5feadbdd/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 66fbbb2..a761003 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,6 +30,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Fixed deserialization of `P.not()` for GraphSON.
 * Bumped to Jackson 2.9.4.
 * Added `idleConnectionTimeout` and `keepAliveInterval` to Gremlin Server that enables a "ping" and auto-close for seemingly dead clients.
+* Fixed a bug where lambdas in `gremlin-python` would trigger a failure if steps using python-only symbols were present (such as `as_()`).
 * Fixed a bug in `NumberHelper` that led to wrong min/max results if numbers exceeded the Integer limits.
 * Delayed setting of the request identifier until `RequestMessage` construction by the builder.
 * Improved error messaging for failed serialization and deserialization of request/response messages.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5feadbdd/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
index 10f4790..a28a58f 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
@@ -41,11 +41,11 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GremlinJythonScriptEngine implements GremlinScriptEngine {
 
@@ -123,10 +123,7 @@ public class GremlinJythonScriptEngine implements GremlinScriptEngine {
         // extract the named traversalsource prior to that happening so that bytecode bindings can share the same
         // namespace as global bindings (e.g. traversalsources and graphs).
         if (traversalSource.equals(HIDDEN_G))
-            throw new IllegalArgumentException("The traversalSource cannot have the name " + HIDDEN_G+ " - it is reserved");
-
-        if (bindings.containsKey(HIDDEN_G))
-            throw new IllegalArgumentException("Bindings cannot include " + HIDDEN_G + " - it is reserved");
+            throw new IllegalArgumentException("The traversalSource cannot have the name " + HIDDEN_G + " - it is reserved");
 
         if (!bindings.containsKey(traversalSource))
             throw new IllegalArgumentException("The bindings available to the ScriptEngine do not contain a traversalSource named: " + traversalSource);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5feadbdd/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
index 0eb8961..f8a5bc3 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.util.function.Lambda;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class JythonTranslator extends PythonTranslator {
 
@@ -54,4 +55,12 @@ public final class JythonTranslator extends PythonTranslator {
         else
             return "JythonUnknownArgLambda(" + lambdaString + ")";
     }
+
+    @Override
+    protected String resolveSymbol(final String methodName) {
+        // since this is Jython we should expect the Gremlin to conform to the java classes to which the engine is
+        // bound - therefore, unlike the python engine which converts java names to python friendly ones, this
+        // jython one can just pass them through.
+        return methodName;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5feadbdd/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 4af4578..7c74b85 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -56,6 +56,7 @@ import java.util.stream.Stream;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class PythonTranslator implements Translator.ScriptTranslator {
 
@@ -114,7 +115,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
                     instruction.getArguments()[0].toString().contains("TranslationStrategy"))
                 continue;
             else if (0 == arguments.length)
-                traversalScript.append(".").append(SymbolHelper.toPython(methodName)).append("()");
+                traversalScript.append(".").append(resolveSymbol(methodName)).append("()");
             else if (methodName.equals("range") && 2 == arguments.length)
                 traversalScript.append("[").append(arguments[0]).append(":").append(arguments[1]).append("]");
             else if (methodName.equals("limit") && 1 == arguments.length)
@@ -123,7 +124,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
                 traversalScript.append(".").append(arguments[0]);
             else {
                 traversalScript.append(".");
-                String temp = SymbolHelper.toPython(methodName) + "(";
+                String temp = resolveSymbol(methodName) + "(";
                 for (final Object object : arguments) {
                     temp = temp + convertToString(object) + ",";
                 }
@@ -131,7 +132,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
             }
             // clip off __.
             if (this.importStatics && traversalScript.substring(0, 3).startsWith("__.")
-                    && !NO_STATIC.stream().filter(name -> traversalScript.substring(3).startsWith(SymbolHelper.toPython(name))).findAny().isPresent()) {
+                    && !NO_STATIC.stream().filter(name -> traversalScript.substring(3).startsWith(resolveSymbol(name))).findAny().isPresent()) {
                 traversalScript.delete(0, 3);
             }
         }
@@ -183,13 +184,13 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         else if (object instanceof Class)
             return ((Class) object).getCanonicalName();
         else if (object instanceof VertexProperty.Cardinality)
-            return "Cardinality." + SymbolHelper.toPython(object.toString());
+            return "Cardinality." + resolveSymbol(object.toString());
         else if (object instanceof SackFunctions.Barrier)
-            return "Barrier." + SymbolHelper.toPython(object.toString());
+            return "Barrier." + resolveSymbol(object.toString());
         else if (object instanceof TraversalOptionParent.Pick)
-            return "Pick." + SymbolHelper.toPython(object.toString());
+            return "Pick." + resolveSymbol(object.toString());
         else if (object instanceof Enum)
-            return convertStatic(((Enum) object).getDeclaringClass().getSimpleName() + ".") + SymbolHelper.toPython(object.toString());
+            return convertStatic(((Enum) object).getDeclaringClass().getSimpleName() + ".") + resolveSymbol(object.toString());
         else if (object instanceof P)
             return convertPToString((P) object, new StringBuilder()).toString();
         else if (object instanceof Element) {
@@ -237,4 +238,8 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         return lambdaString.startsWith("lambda") ? lambdaString : "lambda " + lambdaString;
     }
 
+    protected String resolveSymbol(final String methodName) {
+        return SymbolHelper.toPython(methodName);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5feadbdd/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
index 5165120..86e3b78 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
@@ -22,11 +22,11 @@ package org.apache.tinkerpop.gremlin.python.jsr223;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 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.process.traversal.strategy.decoration.TranslationStrategy;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -37,39 +37,15 @@ import static org.junit.Assert.assertFalse;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-@Ignore
 public class JythonTranslatorTest {
 
-    /*@Test
-    public void shouldHandleStrategies() throws Exception {
-        GraphTraversalSource g = TinkerFactory.createModern().traversal();
-        g = g.withStrategies(new HashMap<String, Object>() {{
-            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
-            put(SubgraphStrategy.VERTICES, __.has("name", "marko"));
-        }});
-        final Bindings bindings = new SimpleBindings();
-        bindings.put("g", g);
-        //System.out.println(JythonTranslator.of("g").translate(g.V().values("name").asAdmin().getBytecode()));
-        Traversal.Admin<Vertex, String> traversal = ((GremlinScriptEngine) ScriptEngineCache.get("gremlin-jython")).eval(g.V().values("name").asAdmin().getBytecode(), bindings);
-        assertEquals("marko", traversal.next());
-        assertFalse(traversal.hasNext());
-        //
-        g = g.withStrategies(new HashMap<String, Object>() {{
-            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
-            put(SubgraphStrategy.VERTICES, __.has("name", "marko"));
-        }}, Collections.singletonMap(ReadOnlyStrategy.STRATEGY, ReadOnlyStrategy.class.getCanonicalName()));
-        //System.out.println(JythonTranslator.of("g").translate(g.V().values("name").asAdmin().getBytecode()));
-        traversal = ((GremlinScriptEngine) ScriptEngineCache.get("gremlin-jython")).eval(g.V().values("name").asAdmin().getBytecode(), bindings);
-        assertEquals("marko", traversal.next());
-        assertFalse(traversal.hasNext());
-    }*/
-
     @Test
     public void shouldSupportStringSupplierLambdas() throws Exception {
         GraphTraversalSource g = TinkerFactory.createModern().traversal();
         g = g.withStrategies(new TranslationStrategy(g, JythonTranslator.of("g")));
-        GraphTraversal.Admin<Vertex, Integer> t = g.withSideEffect("lengthSum", 0).withSack(1)
+        final GraphTraversal.Admin<Vertex, Integer> t = g.withSideEffect("lengthSum", 0).withSack(1)
                 .V()
                 .filter(Lambda.predicate("x : x.get().label() == 'person'"))
                 .flatMap(Lambda.function("lambda x : x.get().vertices(Direction.OUT)"))
@@ -110,4 +86,21 @@ public class JythonTranslatorTest {
     public void shouldHaveValidToString() {
         assertEquals("translator[h:gremlin-jython]", JythonTranslator.of("h").toString());
     }
+
+    @Test
+    public void shouldTranslateToJythonAndNotPython() throws Exception {
+        // the jython translation bind "g" to java classes and thus does not require the strict python syntax which
+        // converts steps like as() to as_(). if those steps are converted then the traversal does not evaluate
+        // properly in the python engine. not much of an assertion here to worry about - just need to ensure that
+        // the traversal with such steps evaluates to success
+        GraphTraversalSource g = TinkerFactory.createModern().traversal();
+        g = g.withStrategies(new TranslationStrategy(g, JythonTranslator.of("g")));
+        final List<Object> o = g.V().has("name").
+                match(__.as("x").label().as("lbl"),
+                        __.as("x").id().as("id")).
+                select("lbl", "id").
+                                 map(Lambda.function("lambda x: type(x.get())")).toList();
+
+        assertEquals(6, o.size());
+    }
 }


[11/13] tinkerpop git commit: TINKERPOP-1898 Can't seem to fix this in a consistent way given jython evaluation

Posted by sp...@apache.org.
TINKERPOP-1898 Can't seem to fix this in a consistent way given jython evaluation

Jython seems to have problems with varargs that are not easily resolved. Nothing I've tried works consistently. Sometimes it works and other times not.


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

Branch: refs/heads/TINKERPOP-1896
Commit: c82d06e05cfcc05607dd2d84c0c2d1475f0a0ddf
Parents: c677a21
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Mar 12 11:53:57 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 12 11:56:16 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java      | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c82d06e0/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
index 343819c..3165df3 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.Read
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -108,6 +109,7 @@ public class JythonTranslatorTest {
     }
 
     @Test
+    @Ignore("TINKERPOP-1898 - ultimately seems to be a problem with jython and varargs - doesn't act consistently")
     public void shouldTranslateToJythonWhenUsingLambdasAndStrategies() throws Exception {
         // the jython translation kicks in when you add a lambda so ensure that it translates when strategies are
         // present


[07/13] tinkerpop git commit: TINKERPOP-1892 Add better ignore reasons for tests in Gremlin.Net CTR

Posted by sp...@apache.org.
TINKERPOP-1892 Add better ignore reasons for tests in Gremlin.Net CTR


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

Branch: refs/heads/TINKERPOP-1896
Commit: bbb13772a791ae7116551ba1d62ea7d136fe60c7
Parents: ab66ed3
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Sun Mar 11 16:10:17 2018 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Sun Mar 11 16:10:17 2018 +0100

----------------------------------------------------------------------
 .../Gherkin/GherkinTestRunner.cs                | 32 +++++++++++++++++---
 .../Gherkin/IgnoreException.cs                  | 17 ++++++++---
 2 files changed, 40 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbb13772/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index f3e823a..4a1d646 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@ -37,11 +37,33 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
 {
     public class GherkinTestRunner
     {
-        private static readonly IDictionary<string, IgnoreReason> IgnoredScenarios = new Dictionary<string, IgnoreReason> {
-            { "g_V_hasLabelXpersonX_hasXage_notXlteX10X_andXnotXbetweenX11_20XXXX_andXltX29X_orXeqX35XXXX_name", IgnoreReason.NeedsFurtherInvestigation }, // TINKERPOP-1859??
-            { "g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX", IgnoreReason.NeedsFurtherInvestigation }, // TINKERPOP-1859??
-            { "g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack", IgnoreReason.NeedsFurtherInvestigation } // TINKERPOP-1907
-        };
+        private static readonly IDictionary<string, IgnoreReason> IgnoredScenarios =
+            new Dictionary<string, IgnoreReason>
+            {
+                {
+                    "g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack",
+                    IgnoreReason.NumericalValuesHaveWrongTypes
+                },
+                {"g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack", IgnoreReason.NumericalValuesHaveWrongTypes},
+                {"g_V_hasIdXwithinXemptyXX_count", IgnoreReason.PWithinWrapsArgumentsInArray},
+                {"g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX", IgnoreReason.PWithinWrapsArgumentsInArray},
+                {
+                    "g_V_hasLabelXpersonX_hasXage_notXlteX10X_andXnotXbetweenX11_20XXXX_andXltX29X_orXeqX35XXXX_name",
+                    IgnoreReason.PNotCreatedCorrectlyByGherkinRunner
+                },
+                {
+                    "g_V_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_bothXknowsX_bothXknowsX_asXdX_whereXc__notXeqXaX_orXeqXdXXXX_selectXa_b_c_dX",
+                    IgnoreReason.PNotCreatedCorrectlyByGherkinRunner
+                },
+                {
+                    "g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_whereXa_gtXbX_orXeqXbXXX_byXageX_byXweightX_byXweightX_selectXa_cX_byXnameX",
+                    IgnoreReason.PNotCreatedCorrectlyByGherkinRunner
+                },
+                {
+                    "g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_inXcreatedX_asXdX_whereXa_ltXbX_orXgtXcXX_andXneqXdXXX_byXageX_byXweightX_byXinXcreatedX_valuesXageX_minX_selectXa_c_dX",
+                    IgnoreReason.PNotCreatedCorrectlyByGherkinRunner
+                }
+            };
         
         private static class Keywords
         {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbb13772/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
index 0179994..c8cb29a 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
@@ -41,10 +41,17 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
             switch (reason)
             {
                 case IgnoreReason.LambdaNotSupported:
-                    reasonSuffix = " because lambdas are not supported in Gremlin.NET";
+                    reasonSuffix = " because lambdas are not supported in Gremlin.NET (TINKERPOP-1854)";
                     break;
-                case IgnoreReason.NeedsFurtherInvestigation:
-                    reasonSuffix = " as further investigation is required";
+                case IgnoreReason.PNotCreatedCorrectlyByGherkinRunner:
+                    reasonSuffix =
+                        " because the Gherkin runner can't call methods in TraversalPredicate class (TINKERPOP-1919)";
+                    break;
+                case IgnoreReason.NumericalValuesHaveWrongTypes:
+                    reasonSuffix = " because the asserts currently fail due to type mismatches (TINKERPOP-1918)";
+                    break;
+                case IgnoreReason.PWithinWrapsArgumentsInArray:
+                    reasonSuffix = " because P.Within() arguments are incorrectly wrapped in an array (TINKERPOP-1920)";
                     break;
             }
             return $"Scenario ignored" + reasonSuffix;
@@ -54,6 +61,8 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
     public enum IgnoreReason
     {
         LambdaNotSupported,
-        NeedsFurtherInvestigation
+        PNotCreatedCorrectlyByGherkinRunner,
+        NumericalValuesHaveWrongTypes,
+        PWithinWrapsArgumentsInArray
     }
 }
\ No newline at end of file


[09/13] tinkerpop git commit: Merge branch 'TINKERPOP-1884' into tp32

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


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

Branch: refs/heads/TINKERPOP-1896
Commit: f80a54277d488bae49d4e08032d26b50199189a0
Parents: f38c2bb eefc4db
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Mar 12 10:04:17 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 12 10:04:17 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 pom.xml            | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f80a5427/pom.xml
----------------------------------------------------------------------


[12/13] tinkerpop git commit: TINKERPOP-1898 Specifically tested SubgraphStrategy for jython evaluation

Posted by sp...@apache.org.
TINKERPOP-1898 Specifically tested SubgraphStrategy for jython evaluation


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

Branch: refs/heads/TINKERPOP-1896
Commit: c677a21d3fde73c496145915c66e7963c5290f69
Parents: f3172bc
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 9 10:17:09 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 12 11:56:16 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/python/jsr223/JythonTranslator.java   | 2 +-
 .../gremlin/python/jsr223/JythonTranslatorTest.java         | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c677a21d/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
index 3d7d9fe..e043278 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslator.java
@@ -80,6 +80,6 @@ public final class JythonTranslator extends PythonTranslator {
         if (proxy.getConfiguration().isEmpty())
             return proxy.getStrategyClass().getCanonicalName() + ".instance()";
         else
-            return proxy.getStrategyClass().getCanonicalName() + ".create(new org.apache.commons.configuration.MapConfiguration(" + convertToString(ConfigurationConverter.getMap(proxy.getConfiguration())) + "))";
+            return proxy.getStrategyClass().getCanonicalName() + ".create(org.apache.commons.configuration.MapConfiguration(" + convertToString(ConfigurationConverter.getMap(proxy.getConfiguration())) + "))";
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c677a21d/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
index e35898b..343819c 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 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.process.traversal.strategy.decoration.SubgraphStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -33,6 +34,7 @@ import org.junit.Test;
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.hasLabel;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
@@ -111,9 +113,10 @@ public class JythonTranslatorTest {
         // present
         GraphTraversalSource g = TinkerFactory.createModern().traversal();
         g = g.withStrategies(new TranslationStrategy(g, JythonTranslator.of("g")));
-        final List<Object> o = g.withStrategies(ReadOnlyStrategy.instance()).
-                V().has("name").map(Lambda.function("lambda x: type(x.get())")).toList();
+        final List<Object> o = g.withStrategies(ReadOnlyStrategy.instance(),
+                                                SubgraphStrategy.build().checkAdjacentVertices(false).vertices(hasLabel("person")).create()).
+                                 V().has("name").map(Lambda.function("lambda x: type(x.get())")).toList();
 
-        assertEquals(6, o.size());
+        assertEquals(4, o.size());
     }
 }


[05/13] tinkerpop git commit: Merge branch 'TINKERPOP-1908' into tp32

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


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

Branch: refs/heads/TINKERPOP-1896
Commit: 552820a0c2539c94ce9e9621913baf4c5aafe2d5
Parents: 97fb12e f409564
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 9 10:28:29 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 9 10:28:29 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                               | 1 +
 .../jsr223/GremlinGroovyScriptEngineCompileStaticTest.java       | 4 ++--
 .../groovy/jsr223/GremlinGroovyScriptEngineTypeCheckedTest.java  | 4 ++--
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java     | 2 +-
 .../tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java | 2 +-
 pom.xml                                                          | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/552820a0/pom.xml
----------------------------------------------------------------------