[01/12] tinkerpop git commit: Had to trap an exception better in ServerGremlinExecutor during init CTR [Forced Update!]

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1612 54133ad23 -> 5e90ed307 (forced update)


Had to trap an exception better in ServerGremlinExecutor during init CTR


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

Branch: refs/heads/TINKERPOP-1612
Commit: 47e5ae2f319fb6eb20fa131a8136ded682b8045b
Parents: 28dffda
Author: Stephen Mallette 
Authored: Wed Jan 25 16:39:38 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:39:38 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47e5ae2f/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 199c9f8..b9b7280 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
@@ -149,7 +149,13 @@ public class ServerGremlinExecutor {
 // the GremlinExecutor is using the GremlinScriptEngineManager. this 
is a bit of hack, but it at least allows
 // the global bindings to become available after the init scripts are 
run (DefaultGremlinScriptEngineManager
 // runs the init scripts when the GremlinScriptEngine is created.
-settings.scriptEngines.keySet().forEach(engineName -> 
gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join());
+settings.scriptEngines.keySet().forEach(engineName -> {
+try {
+gremlinExecutor.eval("1+1", engineName, 
Collections.emptyMap()).join();
+} catch (Exception ex) {
+logger.warn(String.format("Could not initialize {} 
ScriptEngine as script could not be evaluated - %s", engineName), ex);
+}
+});
 
 // script engine init may have altered the graph bindings or maybe 
even created new ones - need to
 // re-apply those references back



[05/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
--
diff --git 
a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
 
b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
new file mode 100644
index 000..84542e1
--- /dev/null
+++ 
b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
@@ -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.
+ */
+package org.apache.tinkerpop.gremlin.groovy.jsr223;
+
+import groovy.lang.MissingPropertyException;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.apache.tinkerpop.gremlin.util.config.YamlConfiguration;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.script.Bindings;
+import javax.script.CompiledScript;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GremlinGroovyScriptEngineOverGraphTest {
+
+@Test
+public void shouldDoSomeGremlin() throws Exception {
+final Graph graph = TinkerFactory.createModern();
+final GraphTraversalSource g = graph.traversal();
+final ScriptEngine engine = new GremlinGroovyScriptEngine();
+final List list = new ArrayList();
+final Bindings bindings = engine.createBindings();
+bindings.put("g", g);
+bindings.put("marko", convertToVertexId(graph, "marko"));
+bindings.put("temp", list);
+assertEquals(list.size(), 0);
+engine.eval("g.V(marko).out().fill(temp)",bindings);
+assertEquals(list.size(), 3);
+}
+
+@Test
+public void shouldLoadImports() throws Exception {
+final Graph graph = TinkerFactory.createModern();
+final GraphTraversalSource g = graph.traversal();
+final ScriptEngine engineNoImports = new 
GremlinGroovyScriptEngine((CompilerCustomizerProvider) 
NoImportCustomizerProvider.INSTANCE);
+try {
+engineNoImports.eval("Vertex.class.getName()");
+fail("Should have thrown an exception because no imports were 
supplied");
+} catch (Exception se) {
+assertTrue(se instanceof ScriptException);
+}
+
+final ScriptEngine engineWithImports = new 
GremlinGroovyScriptEngine((CompilerCustomizerProvider) new 
DefaultImportCustomizerProvider());
+engineWithImports.put("g", g);
+assertEquals(Vertex.class.getName(), 
engineWithImports.eval("Vertex.class.getName()"));
+assertEquals(2l, 
engineWithImports.eval("g.V().has('age',gt(30)).count().next()"));
+assertEquals(Direction.IN, 

[07/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
deleted file mode 100644
index a478f6f..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
+++ /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.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovySackTest {
-
-public static class Traversals extends SackTest {
-
-@Override
-public Traversal 
get_g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack('hello').V.outE.sack(assign).by(label).inV.sack")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V.outE.sack(sum).by('weight').inV.sack.sum()")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V.repeat(__.outE.sack(sum).by('weight').inV).times(2).sack()")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V().outE.sack(sum, 'weight').inV.sack.sum()")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V.repeat(__.outE.sack(sum, 'weight').inV).times(2).sack")
-}
-
-@Override
-public Traversal 
get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack{[:]}{ 
it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()")
-}
-
-@Override
-public Traversal 
get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(
-final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(1.0d,sum).V(v1Id).local(out('knows').barrier(normSack)).in('knows').barrier.sack",
 "v1Id", v1Id)
-}
-
-@Override
-public Traversal 
get_g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withBulk(false).withSack(1, sum).V.out.barrier.sack")
-}
-
-@Override
-public Traversal 
get_g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack(
-final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withBulk(false).withSack(1.0d, 
sum).V(v1Id).local(outE('knows').barrier(normSack).inV).in('knows').barrier.sack",
 "v1Id", v1Id)
-}
-
-@Override
-Traversal 
get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack()
 {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(BigInteger.TEN.pow(1000), 
assign).V.local(out('knows').barrier(normSack)).in('knows').barrier.sack")
-}

[10/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test


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

Branch: refs/heads/TINKERPOP-1612
Commit: 6b1eef57c83a63ce591ec5cd6150c7573c52e349
Parents: 0427370
Author: Stephen Mallette 
Authored: Tue Jan 24 07:22:07 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:40:39 2017 -0500

--
 gremlin-groovy-test/pom.xml |  64 ---
 .../groovy/loaders/SugarLoaderTest.groovy   | 134 --
 .../gremlin/groovy/util/SugarTestHelper.groovy  |  37 --
 .../step/branch/GroovyBranchTest.groovy |  58 ---
 .../step/branch/GroovyChooseTest.groovy |  62 ---
 .../step/branch/GroovyLocalTest.groovy  |  91 -
 .../step/branch/GroovyOptionalTest.groovy   |  59 ---
 .../step/branch/GroovyRepeatTest.groovy |  88 
 .../step/branch/GroovyUnionTest.groovy  |  77 
 .../traversal/step/filter/GroovyAndTest.groovy  |  52 ---
 .../traversal/step/filter/GroovyCoinTest.groovy |  41 --
 .../step/filter/GroovyCyclicPathTest.groovy |  43 --
 .../step/filter/GroovyDedupTest.groovy  | 113 --
 .../traversal/step/filter/GroovyDropTest.groovy |  51 ---
 .../step/filter/GroovyFilterTest.groovy |  73 
 .../traversal/step/filter/GroovyHasTest.groovy  | 173 
 .../traversal/step/filter/GroovyIsTest.groovy   |  57 ---
 .../traversal/step/filter/GroovyOrTest.groovy   |  47 ---
 .../step/filter/GroovyRangeTest.groovy  | 127 --
 .../step/filter/GroovySampleTest.groovy |  58 ---
 .../step/filter/GroovySimplePathTest.groovy |  43 --
 .../traversal/step/filter/GroovyTailTest.groovy |  92 -
 .../step/filter/GroovyWhereTest.groovy  | 167 
 .../traversal/step/map/GroovyAddEdgeTest.groovy |  85 
 .../step/map/GroovyAddVertexTest.groovy | 101 -
 .../step/map/GroovyCoalesceTest.groovy  |  59 ---
 .../step/map/GroovyConstantTest.groovy  |  42 --
 .../traversal/step/map/GroovyCountTest.groovy   |  71 
 .../traversal/step/map/GroovyFlatMapTest.groovy |  36 --
 .../traversal/step/map/GroovyFoldTest.groovy|  46 ---
 .../traversal/step/map/GroovyGraphTest.groovy   |  55 ---
 .../traversal/step/map/GroovyLoopsTest.groovy   |  56 ---
 .../traversal/step/map/GroovyMapKeysTest.groovy |  43 --
 .../traversal/step/map/GroovyMapTest.groovy |  62 ---
 .../step/map/GroovyMapValuesTest.groovy |  48 ---
 .../traversal/step/map/GroovyMatchTest.groovy   | 381 -
 .../traversal/step/map/GroovyMaxTest.groovy |  47 ---
 .../traversal/step/map/GroovyMeanTest.groovy|  42 --
 .../traversal/step/map/GroovyMinTest.groovy |  47 ---
 .../traversal/step/map/GroovyOrderTest.groovy   | 140 ---
 .../step/map/GroovyPageRankTest.groovy  |  78 
 .../traversal/step/map/GroovyPathTest.groovy|  63 ---
 .../step/map/GroovyPeerPressureTest.groovy  |  48 ---
 .../traversal/step/map/GroovyProfileTest.groovy |  94 -
 .../traversal/step/map/GroovyProgramTest.groovy |  50 ---
 .../traversal/step/map/GroovyProjectTest.groovy |  42 --
 .../step/map/GroovyPropertiesTest.groovy|  60 ---
 .../traversal/step/map/GroovySelectTest.groovy  | 242 ---
 .../traversal/step/map/GroovySumTest.groovy |  42 --
 .../traversal/step/map/GroovyUnfoldTest.groovy  |  48 ---
 .../step/map/GroovyValueMapTest.groovy  |  51 ---
 .../traversal/step/map/GroovyVertexTest.groovy  | 187 -
 .../step/sideEffect/GroovyAggregateTest.groovy  |  53 ---
 .../step/sideEffect/GroovyExplainTest.groovy|  35 --
 .../step/sideEffect/GroovyGroupCountTest.groovy | 101 -
 .../step/sideEffect/GroovyGroupTest.groovy  | 137 ---
 .../step/sideEffect/GroovyGroupTestV3d0.groovy  |  74 
 .../step/sideEffect/GroovyInjectTest.groovy |  42 --
 .../step/sideEffect/GroovySackTest.groovy   |  84 
 .../sideEffect/GroovySideEffectCapTest.groovy   |  45 --
 .../step/sideEffect/GroovySideEffectTest.groovy |  83 
 .../step/sideEffect/GroovyStoreTest.groovy  |  53 ---
 .../step/sideEffect/GroovySubgraphTest.groovy   |  50 ---
 .../step/sideEffect/GroovyTreeTest.groovy   |  69 
 .../groovy/GroovyEnvironmentIntegrateSuite.java |  85 
 .../gremlin/groovy/GroovyEnvironmentSuite.java  |  92 -
 .../engine/GremlinExecutorOverGraphTest.java| 108 -
 ...remlinGroovyScriptEngineFileSandboxTest.java | 120 --
 .../GremlinGroovyScriptEngineIntegrateTest.java |  88 
 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 -
 ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
 

[03/12] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins

2017-01-25 Thread spmallette
TINKERPOP-1612 Configure tests to allow them to pass under new plugins


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

Branch: refs/heads/TINKERPOP-1612
Commit: 0e80defa0f713f93660e10e791dd5d7859204efa
Parents: 6b1eef5
Author: Stephen Mallette 
Authored: Wed Jan 25 06:52:10 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:40:39 2017 -0500

--
 .../gremlin/groovy/engine/GremlinExecutor.java  |  4 +---
 .../gremlin/server/GremlinServerIntegrateTest.java  | 16 +---
 2 files changed, 6 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0e80defa/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 8fdb86e..80e72fd 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
@@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable {
 // deprecated code around this is removed.
 if (!useGremlinScriptEngineManager)
 this.scriptEngines = createScriptEngines();
-else {
+else
 this.scriptEngines = null;
-gremlinScriptEngineManager.getEngineByName("gremlin-groovy");
-}
 
 this.suppliedExecutor = suppliedExecutor;
 this.suppliedScheduledExecutor = suppliedScheduledExecutor;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0e80defa/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 3792022..766ebf3 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
@@ -42,8 +42,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
 import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin;
-import 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider;
 import 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension;
+import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin;
 import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
@@ -64,7 +64,6 @@ import org.junit.Test;
 import java.lang.reflect.Field;
 import java.nio.channels.ClosedChannelException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -76,7 +75,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -93,7 +91,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeThat;
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -170,6 +167,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 return settings;
 case "shouldUseSimpleSandbox":
 
settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(),
 getScriptEngineConfForSimpleSandbox());
+// remove the script because it isn't used in the test but 
also because it's not CompileStatic ready
+

[08/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
deleted file mode 100644
index de33944..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
+++ /dev/null
@@ -1,140 +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.process.traversal.step.map
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovyOrderTest {
-
-public static class Traversals extends OrderTest {
-
-@Override
-public Traversal get_g_V_name_order() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()")
-}
-
-@Override
-public Traversal 
get_g_V_name_order_byXa1_b1X_byXb2_a2X() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, 
b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }")
-}
-
-@Override
-public Traversal get_g_V_order_byXname_incrX_name() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', 
incr).name")
-}
-
-@Override
-public Traversal get_g_V_order_byXnameX_name() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.order.by('name').name")
-}
-
-@Override
-public Traversal 
get_g_V_outE_order_byXweight_decrX_weight() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.outE.order.by('weight', Order.decr).weight")
-}
-
-@Override
-public Traversal 
get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { 
a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) 
}).name")
-}
-
-@Override
-public Traversal> 
get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')")
-}
-
-@Override
-public Traversal> 
get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX(
-final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"""g.V(v1Id).hasLabel("person").map {
-final Map map = [:];
-map[1] = it.age;
-map[2] = it.age * 2;
-map[3] = it.age * 3;
-map[4] = it.age;
-return map;
-}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id)
-}
-
-@Override
-public Traversal get_g_V_order_byXoutE_count__decrX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.order.by(__.outE.count, decr)")
-}
-
-@Override
-public Traversal> 
get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.group.by(label).by(values('name').order().by(decr).fold())")
-}
-
-@Override
-public Traversal 
get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)")
-}
-
-@Override
-public Traversal> 

[11/12] tinkerpop git commit: TINKERPOP-1612 Reconfigure some tests for new plugins.

2017-01-25 Thread spmallette
TINKERPOP-1612 Reconfigure some tests for new plugins.


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

Branch: refs/heads/TINKERPOP-1612
Commit: a1b291504d5a6ba6754f6ce581037adcc108b28f
Parents: 0e80def
Author: Stephen Mallette 
Authored: Wed Jan 25 12:34:09 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:40:39 2017 -0500

--
 .../python/driver/gremlin-server-modern-secure-py.yaml| 3 +--
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java  | 7 +--
 .../gremlin/server/GremlinResultSetIntegrateTest.java | 5 -
 .../gremlin/server/GremlinServerHttpIntegrateTest.java| 5 -
 4 files changed, 14 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1b29150/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 c846cf4..3f23946 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
@@ -32,10 +32,9 @@ graphs: {
   graph: 
src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties}
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
 plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},

org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: 
[src/test/resources/org/apache/tinkerpop/gremlin/python/driver/generate-modern.groovy]}}},
   gremlin-jython: {},
   gremlin-python: {}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1b29150/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 a8164b5..658244d 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
@@ -32,6 +32,7 @@ import 
org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
 import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
+import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin;
 import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
@@ -134,7 +135,9 @@ public class GremlinDriverIntegrateTest extends 
AbstractGremlinServerIntegration
 try {
 final String p = TestHelper.generateTempFileFromResource(
 GremlinDriverIntegrateTest.class, 
"generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath();
-settings.scriptEngines.get("gremlin-groovy").scripts = 
Collections.singletonList(p);
+final Map m = new HashMap<>();
+m.put("files", Collections.singletonList(p));
+
settings.scriptEngines.get("gremlin-groovy").plugins.put(ScriptFileGremlinPlugin.class.getName(),
 m);
 } catch (Exception ex) {
 throw new RuntimeException(ex);
 }
@@ -672,7 +675,7 @@ public class GremlinDriverIntegrateTest extends 
AbstractGremlinServerIntegration
 final Cluster cluster = 
TestClientFactory.build().serializer(serializer).create();
 final Client client = cluster.connect();
 
-

[09/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
deleted file mode 100644
index e1206df..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
+++ /dev/null
@@ -1,43 +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.process.traversal.step.filter
-
-import org.apache.tinkerpop.gremlin.process.traversal.Path
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovySimplePathTest {
-
-public static class Traversals extends SimplePathTest {
-
-@Override
-public Traversal 
get_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V(v1Id).out('created').in('created').simplePath", "v1Id", v1Id);
-}
-
-@Override
-public Traversal 
get_g_V_repeatXboth_simplePathX_timesX3X_path() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.repeat(__.both.simplePath).times(3).path()");
-}
-}
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
deleted file mode 100644
index 38c2a1d..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
+++ /dev/null
@@ -1,92 +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.process.traversal.step.filter
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Matt Frantz (http://github.com/mhfrantz)
- */
-public abstract class GroovyTailTest {
-
-public static class Traversals extends TailTest {
-
-@Override
-public Traversal 
get_g_V_valuesXnameX_order_tailXglobal_2X() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.values('name').order.tail(global, 2)")
-}
-
-@Override
-public Traversal get_g_V_valuesXnameX_order_tailX2X() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.values('name').order.tail(2)")
-}
-
-@Override
-public 

[04/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/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 d4ff8d4..7750ad3 100644
--- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -20,13 +20,12 @@ port: 8182
 scriptEvaluationTimeout: 3
 graphs: {
   graph: conf/tinkergraph-empty.properties}
-plugins:
-  - tinkerpop.tinkergraph
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
-scripts: [scripts/generate-modern-readonly.groovy]}}
+plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+   
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+   org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/generate-modern-readonly.groovy]
 serializers:
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { 
useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: 
{ useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/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 08096f6..5d0a67d 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -20,13 +20,12 @@ port: 8182
 scriptEvaluationTimeout: 3
 graphs: {
   graph: conf/tinkergraph-empty.properties}
-plugins:
-  - tinkerpop.tinkergraph
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
-scripts: [scripts/generate-modern.groovy]}}
+plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+   
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+   org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/generate-modern.groovy]
 serializers:
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { 
useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: 
{ useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/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 1d4003e..0ca8b9c 100644
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ b/gremlin-server/conf/gremlin-server-neo4j.yaml
@@ -31,13 +31,12 @@ scriptEvaluationTimeout: 3
 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
 graphs: {
   graph: conf/neo4j-empty.properties}
-plugins:
-  - tinkerpop.neo4j
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
-scripts: [scripts/empty-sample.groovy]}}
+plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+   
org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+   org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/empty-sample.groovy]
 serializers:
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { 
useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: 
{ useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-server/conf/gremlin-server-rest-modern.yaml
--
diff --git 

[12/12] tinkerpop git commit: TINKERPOP-1612 Fixed cut/paste error in server configuration

2017-01-25 Thread spmallette
TINKERPOP-1612 Fixed cut/paste error in server configuration


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

Branch: refs/heads/TINKERPOP-1612
Commit: 5e90ed3079aec454c7c0752faaecb57736e20a11
Parents: a1b2915
Author: Stephen Mallette 
Authored: Wed Jan 25 18:11:36 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 18:11:36 2017 -0500

--
 gremlin-python/pom.xml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5e90ed30/gremlin-python/pom.xml
--
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index d30ac06..62450a7 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -490,6 +490,8 @@ settings.graphs.graph = 
"${gremlin.server.dir}/conf/tinkergraph-empty.properties
 
settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files
 = ["${gremlin.server.dir}/scripts/generate-modern.groovy"]
 settings.port = 45940
 
+println 
settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files
+
 def server = new GremlinServer(settings)
 server.start().join()
 
@@ -498,7 +500,7 @@ log.info("Gremlin Server with no authentication started on 
port 45940")
 
 def settingsSecure = 
Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern-py.yaml")
 settingsSecure.graphs.graph = 
"${gremlin.server.dir}/conf/tinkergraph-empty.properties"
-settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files
 = ["${gremlin.server.dir}/scripts/generate-modern.groovy"]
+settingsSecure.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files
 = ["${gremlin.server.dir}/scripts/generate-modern.groovy"]
 settingsSecure.port = 45941
 settingsSecure.authentication.className = 
"org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator"
 settingsSecure.authentication.config = [credentialsDb: 
"${gremlin.server.dir}/conf/tinkergraph-credentials.properties"]



[02/12] tinkerpop git commit: Merge branch 'tp32'

2017-01-25 Thread spmallette
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1612
Commit: 04273705c9e8fcf23c9703670709b3b9efaf5cf1
Parents: 46a68f9 47e5ae2
Author: Stephen Mallette 
Authored: Wed Jan 25 16:40:07 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:40:07 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--




[06/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
--
diff --git 
a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
 
b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
deleted file mode 100644
index e3a713d..000
--- 
a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
+++ /dev/null
@@ -1,121 +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.groovy.jsr223.dsl.credential;
-
-import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
-import org.apache.tinkerpop.gremlin.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.hamcrest.MatcherAssert;
-import org.junit.Test;
-
-import static 
org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class CredentialGraphTest extends AbstractGremlinTest {
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldCreateUser() {
-final Vertex v = credentials(graph).createUser("stephen", "secret");
-assertEquals("stephen", v.value("username"));
-assertEquals("user", v.label());
-assertNotEquals("secret", v.value("password"));  // hashed to something
-assertThat(v.value("password").toString().length(), greaterThan(0));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, 
feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES)
-public void shouldRemoveUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("stephen", "secret");
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
-assertEquals(1, credentials(graph).removeUser("stephen"));
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldNotRemoveUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("stephen", "secret");
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
-assertEquals(0, credentials(graph).removeUser("stephanie"));
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldFindUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("marko", "secret");
-final Vertex stephen = credentials(graph).createUser("stephen", 
"secret");
-credentials(graph).createUser("daniel", "secret");
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
-assertEquals(stephen, credentials(graph).findUser("stephen"));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldNotFindUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("marko", "secret");
-credentials(graph).createUser("stephen", "secret");
-credentials(graph).createUser("daniel", "secret");
-

tinkerpop git commit: removed the need for Thread.sleep() in one of the GraphActorsTest.

2017-01-25 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 a406a8827 -> 15575e5a7


removed the need for Thread.sleep() in one of the GraphActorsTest.


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

Branch: refs/heads/TINKERPOP-1564
Commit: 15575e5a784b148f2280bc4629a6aea9c252549d
Parents: a406a88
Author: Marko A. Rodriguez 
Authored: Wed Jan 25 14:40:44 2017 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Jan 25 14:40:44 2017 -0700

--
 .../process/actors/TestSetupTerminateActorProgram.java| 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/15575e5a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/actors/TestSetupTerminateActorProgram.java
--
diff --git 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/actors/TestSetupTerminateActorProgram.java
 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/actors/TestSetupTerminateActorProgram.java
index cffc61a..0347794 100644
--- 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/actors/TestSetupTerminateActorProgram.java
+++ 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/actors/TestSetupTerminateActorProgram.java
@@ -59,6 +59,7 @@ class TestSetupTerminateActorProgram implements 
ActorProgram {
 public void terminate() {
 assertTrue(this.hasSetup);
 worker.send(worker.master(), WORKER_TERMINATE);
+worker.send(worker.master(), "kill");
 }
 };
 }
@@ -74,11 +75,6 @@ class TestSetupTerminateActorProgram implements 
ActorProgram {
 @Override
 public void setup() {
 master.send(master.address(), MASTER_SETUP);
-try {
-Thread.sleep(250);
-} catch (final Exception e) {
-}
-master.send(master.address(), "kill");
 }
 
 @Override
@@ -98,6 +94,7 @@ class TestSetupTerminateActorProgram implements 
ActorProgram {
 assertEquals(1, this.masterSetup);
 assertEquals(0, this.masterTerminate);
 assertEquals(this.workerSetup, this.workerTerminate);
+assertEquals(master.workers().size(), 
master.workers().stream().map(Address::toString).distinct().count());
 master.close();
 }
 }



[1/2] tinkerpop git commit: Had to trap an exception better in ServerGremlinExecutor during init CTR

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/master 46a68f9b7 -> 04273705c


Had to trap an exception better in ServerGremlinExecutor during init CTR


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

Branch: refs/heads/master
Commit: 47e5ae2f319fb6eb20fa131a8136ded682b8045b
Parents: 28dffda
Author: Stephen Mallette 
Authored: Wed Jan 25 16:39:38 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:39:38 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47e5ae2f/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 199c9f8..b9b7280 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
@@ -149,7 +149,13 @@ public class ServerGremlinExecutor {
 // the GremlinExecutor is using the GremlinScriptEngineManager. this 
is a bit of hack, but it at least allows
 // the global bindings to become available after the init scripts are 
run (DefaultGremlinScriptEngineManager
 // runs the init scripts when the GremlinScriptEngine is created.
-settings.scriptEngines.keySet().forEach(engineName -> 
gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join());
+settings.scriptEngines.keySet().forEach(engineName -> {
+try {
+gremlinExecutor.eval("1+1", engineName, 
Collections.emptyMap()).join();
+} catch (Exception ex) {
+logger.warn(String.format("Could not initialize {} 
ScriptEngine as script could not be evaluated - %s", engineName), ex);
+}
+});
 
 // script engine init may have altered the graph bindings or maybe 
even created new ones - need to
 // re-apply those references back



[2/2] tinkerpop git commit: Merge branch 'tp32'

2017-01-25 Thread spmallette
Merge branch 'tp32'


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

Branch: refs/heads/master
Commit: 04273705c9e8fcf23c9703670709b3b9efaf5cf1
Parents: 46a68f9 47e5ae2
Author: Stephen Mallette 
Authored: Wed Jan 25 16:40:07 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:40:07 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--




tinkerpop git commit: Had to trap an exception better in ServerGremlinExecutor during init CTR

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 28dffda6b -> 47e5ae2f3


Had to trap an exception better in ServerGremlinExecutor during init CTR


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

Branch: refs/heads/tp32
Commit: 47e5ae2f319fb6eb20fa131a8136ded682b8045b
Parents: 28dffda
Author: Stephen Mallette 
Authored: Wed Jan 25 16:39:38 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 16:39:38 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47e5ae2f/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 199c9f8..b9b7280 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
@@ -149,7 +149,13 @@ public class ServerGremlinExecutor {
 // the GremlinExecutor is using the GremlinScriptEngineManager. this 
is a bit of hack, but it at least allows
 // the global bindings to become available after the init scripts are 
run (DefaultGremlinScriptEngineManager
 // runs the init scripts when the GremlinScriptEngine is created.
-settings.scriptEngines.keySet().forEach(engineName -> 
gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join());
+settings.scriptEngines.keySet().forEach(engineName -> {
+try {
+gremlinExecutor.eval("1+1", engineName, 
Collections.emptyMap()).join();
+} catch (Exception ex) {
+logger.warn(String.format("Could not initialize {} 
ScriptEngine as script could not be evaluated - %s", engineName), ex);
+}
+});
 
 // script engine init may have altered the graph bindings or maybe 
even created new ones - need to
 // re-apply those references back



tinkerpop git commit: removed the need for the Terminate token. Added a new test case to GraphActorsTest that verifies that message priority is respected. Other minor tweaks.

2017-01-25 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 d013d4052 -> a406a8827


removed the need for the Terminate token. Added a new test case to 
GraphActorsTest that verifies that message priority is respected. Other minor 
tweaks.


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

Branch: refs/heads/TINKERPOP-1564
Commit: a406a882784291575019f991432f0d9ed5106b78
Parents: d013d40
Author: Marko A. Rodriguez 
Authored: Wed Jan 25 14:15:35 2017 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Jan 25 14:15:35 2017 -0700

--
 .../akka/process/actors/ActorMailbox.java   |   2 +-
 .../akka/process/actors/AkkaConfigFactory.java  |   2 +-
 .../process/actors/io/gryo/GryoSerializer.java  |  22 ++--
 .../akka/process/actors/AkkaActorsProvider.java |   4 +-
 .../tinkerpop/gremlin/process/actors/Actor.java |   8 ++
 .../actors/traversal/TraversalActorProgram.java |   8 +-
 .../traversal/TraversalMasterProgram.java   |  23 ++--
 .../traversal/TraversalWorkerProgram.java   |  10 +-
 .../actors/traversal/message/Terminate.java |  28 -
 .../gremlin/process/actors/GraphActorsTest.java |   9 ++
 .../TestMessagePrioritiesActorProgram.java  | 125 +++
 11 files changed, 172 insertions(+), 69 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a406a882/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
index 8505871..2a99a39 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
@@ -146,7 +146,7 @@ public final class ActorMailbox implements MailboxType, 
ProducesMessageQueue message : messages) {
 this.messageTypes.put(
 ClassUtil.getClassOrEnum(message.get(0)),
-Object.class.getCanonicalName().equals(message.get(1)) ?
+null == message.get(1) ?
 null :
 ClassUtil.getClassOrEnum(message.get(1)));
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a406a882/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
index 1422e07..e76562e 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
@@ -58,7 +58,7 @@ final class AkkaConfigFactory {
 stream().
 map(entry -> Arrays.asList(
 ClassUtil.getClassName(entry.getKey()),
-ClassUtil.getClassName(null == 
entry.getValue() ? Object.class : entry.getValue().getClass(.
+null == entry.getValue() ? null : 
ClassUtil.getClassName(entry.getValue().getClass(.
 collect(Collectors.toList(;
 final Iterator keys = configuration.getKeys();
 while (keys.hasNext()) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a406a882/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
index 8d567ba..968b0dc 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
@@ -63,14 +63,6 @@ public final class GryoSerializer implements Serializer {
 }
 // remove Gryo 3.0 classes
  

tinkerpop git commit: AkkaGraphActors now confgiures the GryoSerializer registration using the ActorProgram getMessageTypes().

2017-01-25 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 df5992755 -> d013d4052


AkkaGraphActors now confgiures the GryoSerializer registration using the 
ActorProgram getMessageTypes().


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

Branch: refs/heads/TINKERPOP-1564
Commit: d013d4052a01a33d89a25baf6fdd1e64955ace9a
Parents: df59927
Author: Marko A. Rodriguez 
Authored: Wed Jan 25 13:35:36 2017 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Jan 25 13:35:36 2017 -0700

--
 .../akka/process/actors/AkkaConfigFactory.java  |  2 +-
 .../gremlin/akka/process/actors/Constants.java  |  1 +
 .../process/actors/io/gryo/GryoSerializer.java  | 57 +++-
 3 files changed, 34 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d013d405/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
index a49b545..1422e07 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaConfigFactory.java
@@ -48,7 +48,7 @@ final class AkkaConfigFactory {
 
 static Config generateAkkaConfig(final ActorProgram actorProgram, final 
Configuration configuration) {
 Config config = ConfigFactory.defaultApplication().
-withValue("akka.actor.serialization-bindings", 
ConfigValueFactory.fromMap(GryoSerializer.getSerializerBindings(configuration))).
+withValue(Constants.AKKA_ACTOR_SERIALIZATION_BINDINGS, 
ConfigValueFactory.fromMap(GryoSerializer.getSerializerBindings(actorProgram, 
configuration))).
 withValue("custom-dispatcher.mailbox-requirement", 
ConfigValueFactory.fromAnyRef(ActorMailbox.class.getCanonicalName() + "$" + 
ActorMailbox.ActorSemantics.class.getSimpleName())).
 withValue("custom-dispatcher-mailbox.mailbox-type", 
ConfigValueFactory.fromAnyRef(ActorMailbox.class.getCanonicalName())).
 withValue("akka.actor.mailbox.requirements", 
ConfigValueFactory.fromMap(Collections.singletonMap(ActorMailbox.class.getCanonicalName()
 + "$" + ActorMailbox.ActorSemantics.class.getSimpleName(), 
"custom-dispatcher-mailbox"))).

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d013d405/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/Constants.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/Constants.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/Constants.java
index ed4f383..c54f81a 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/Constants.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/Constants.java
@@ -38,5 +38,6 @@ public final class Constants {
 public static final String AKKA_CLUSTER_SEED_NODES = 
"akka.cluster.seed-nodes";
 public static final String AKKA_CLUSTER_AUTO_DOWN_UNREACHABLE_AFTER = 
"akka.cluster.auto-down-unreachable-after";
 public static final String GREMLIN_AKKA_SYSTEM_NAME = 
"gremlin.akka.system-name";
+public static final String AKKA_ACTOR_SERIALIZATION_BINDINGS = 
"akka.actor.serialization-bindings";
 
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d013d405/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
index 733528c..8d567ba 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/io/gryo/GryoSerializer.java
@@ -24,11 +24,7 @@ import akka.serialization.Serializer;
 import com.typesafe.config.Config;
 import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.configuration.Configuration;

[05/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/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 d4ff8d4..7750ad3 100644
--- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -20,13 +20,12 @@ port: 8182
 scriptEvaluationTimeout: 3
 graphs: {
   graph: conf/tinkergraph-empty.properties}
-plugins:
-  - tinkerpop.tinkergraph
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
-scripts: [scripts/generate-modern-readonly.groovy]}}
+plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+   
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+   org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/generate-modern-readonly.groovy]
 serializers:
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { 
useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: 
{ useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/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 08096f6..5d0a67d 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -20,13 +20,12 @@ port: 8182
 scriptEvaluationTimeout: 3
 graphs: {
   graph: conf/tinkergraph-empty.properties}
-plugins:
-  - tinkerpop.tinkergraph
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
-scripts: [scripts/generate-modern.groovy]}}
+plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+   
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+   org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/generate-modern.groovy]
 serializers:
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { 
useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: 
{ useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/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 1d4003e..0ca8b9c 100644
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ b/gremlin-server/conf/gremlin-server-neo4j.yaml
@@ -31,13 +31,12 @@ scriptEvaluationTimeout: 3
 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
 graphs: {
   graph: conf/neo4j-empty.properties}
-plugins:
-  - tinkerpop.neo4j
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
-scripts: [scripts/empty-sample.groovy]}}
+plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+   
org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+   org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/empty-sample.groovy]
 serializers:
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { 
useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
   - { className: 
org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: 
{ useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-server/conf/gremlin-server-rest-modern.yaml
--
diff --git 

[02/13] tinkerpop git commit: Merge branch 'tp32'

2017-01-25 Thread spmallette
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1612
Commit: 1169f61680f0e0e40d227ca7d818c83eb8341e22
Parents: d18dd02 956f350
Author: Stephen Mallette 
Authored: Wed Jan 25 09:28:30 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 09:28:30 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java   | 6 ++
 1 file changed, 6 insertions(+)
--




[08/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
deleted file mode 100644
index a478f6f..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
+++ /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.
- */
-package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovySackTest {
-
-public static class Traversals extends SackTest {
-
-@Override
-public Traversal 
get_g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack('hello').V.outE.sack(assign).by(label).inV.sack")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V.outE.sack(sum).by('weight').inV.sack.sum()")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V.repeat(__.outE.sack(sum).by('weight').inV).times(2).sack()")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V().outE.sack(sum, 'weight').inV.sack.sum()")
-}
-
-@Override
-public Traversal 
get_g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(0.0d).V.repeat(__.outE.sack(sum, 'weight').inV).times(2).sack")
-}
-
-@Override
-public Traversal 
get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack{[:]}{ 
it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()")
-}
-
-@Override
-public Traversal 
get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(
-final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(1.0d,sum).V(v1Id).local(out('knows').barrier(normSack)).in('knows').barrier.sack",
 "v1Id", v1Id)
-}
-
-@Override
-public Traversal 
get_g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withBulk(false).withSack(1, sum).V.out.barrier.sack")
-}
-
-@Override
-public Traversal 
get_g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack(
-final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withBulk(false).withSack(1.0d, 
sum).V(v1Id).local(outE('knows').barrier(normSack).inV).in('knows').barrier.sack",
 "v1Id", v1Id)
-}
-
-@Override
-Traversal 
get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack()
 {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.withSack(BigInteger.TEN.pow(1000), 
assign).V.local(out('knows').barrier(normSack)).in('knows').barrier.sack")
-}

[12/13] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins

2017-01-25 Thread spmallette
TINKERPOP-1612 Configure tests to allow them to pass under new plugins


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

Branch: refs/heads/TINKERPOP-1612
Commit: 010e66a72a1c6b10af00efa21ff4c65344236551
Parents: 34bbd6a
Author: Stephen Mallette 
Authored: Wed Jan 25 06:52:10 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:22:41 2017 -0500

--
 .../gremlin/groovy/engine/GremlinExecutor.java  |  4 +---
 .../gremlin/server/GremlinServerIntegrateTest.java  | 16 +---
 2 files changed, 6 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/010e66a7/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 8fdb86e..80e72fd 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
@@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable {
 // deprecated code around this is removed.
 if (!useGremlinScriptEngineManager)
 this.scriptEngines = createScriptEngines();
-else {
+else
 this.scriptEngines = null;
-gremlinScriptEngineManager.getEngineByName("gremlin-groovy");
-}
 
 this.suppliedExecutor = suppliedExecutor;
 this.suppliedScheduledExecutor = suppliedScheduledExecutor;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/010e66a7/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 3792022..766ebf3 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
@@ -42,8 +42,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
 import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin;
-import 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider;
 import 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension;
+import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin;
 import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
@@ -64,7 +64,6 @@ import org.junit.Test;
 import java.lang.reflect.Field;
 import java.nio.channels.ClosedChannelException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -76,7 +75,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -93,7 +91,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeThat;
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -170,6 +167,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
 return settings;
 case "shouldUseSimpleSandbox":
 
settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(),
 getScriptEngineConfForSimpleSandbox());
+// remove the script because it isn't used in the test but 
also because it's not CompileStatic ready
+

[06/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
--
diff --git 
a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
 
b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
new file mode 100644
index 000..84542e1
--- /dev/null
+++ 
b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java
@@ -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.
+ */
+package org.apache.tinkerpop.gremlin.groovy.jsr223;
+
+import groovy.lang.MissingPropertyException;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.apache.tinkerpop.gremlin.util.config.YamlConfiguration;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.script.Bindings;
+import javax.script.CompiledScript;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GremlinGroovyScriptEngineOverGraphTest {
+
+@Test
+public void shouldDoSomeGremlin() throws Exception {
+final Graph graph = TinkerFactory.createModern();
+final GraphTraversalSource g = graph.traversal();
+final ScriptEngine engine = new GremlinGroovyScriptEngine();
+final List list = new ArrayList();
+final Bindings bindings = engine.createBindings();
+bindings.put("g", g);
+bindings.put("marko", convertToVertexId(graph, "marko"));
+bindings.put("temp", list);
+assertEquals(list.size(), 0);
+engine.eval("g.V(marko).out().fill(temp)",bindings);
+assertEquals(list.size(), 3);
+}
+
+@Test
+public void shouldLoadImports() throws Exception {
+final Graph graph = TinkerFactory.createModern();
+final GraphTraversalSource g = graph.traversal();
+final ScriptEngine engineNoImports = new 
GremlinGroovyScriptEngine((CompilerCustomizerProvider) 
NoImportCustomizerProvider.INSTANCE);
+try {
+engineNoImports.eval("Vertex.class.getName()");
+fail("Should have thrown an exception because no imports were 
supplied");
+} catch (Exception se) {
+assertTrue(se instanceof ScriptException);
+}
+
+final ScriptEngine engineWithImports = new 
GremlinGroovyScriptEngine((CompilerCustomizerProvider) new 
DefaultImportCustomizerProvider());
+engineWithImports.put("g", g);
+assertEquals(Vertex.class.getName(), 
engineWithImports.eval("Vertex.class.getName()"));
+assertEquals(2l, 
engineWithImports.eval("g.V().has('age',gt(30)).count().next()"));
+assertEquals(Direction.IN, 

[10/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
deleted file mode 100644
index e1206df..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy
+++ /dev/null
@@ -1,43 +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.process.traversal.step.filter
-
-import org.apache.tinkerpop.gremlin.process.traversal.Path
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovySimplePathTest {
-
-public static class Traversals extends SimplePathTest {
-
-@Override
-public Traversal 
get_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V(v1Id).out('created').in('created').simplePath", "v1Id", v1Id);
-}
-
-@Override
-public Traversal 
get_g_V_repeatXboth_simplePathX_timesX3X_path() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.repeat(__.both.simplePath).times(3).path()");
-}
-}
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
deleted file mode 100644
index 38c2a1d..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy
+++ /dev/null
@@ -1,92 +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.process.traversal.step.filter
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Matt Frantz (http://github.com/mhfrantz)
- */
-public abstract class GroovyTailTest {
-
-public static class Traversals extends TailTest {
-
-@Override
-public Traversal 
get_g_V_valuesXnameX_order_tailXglobal_2X() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.values('name').order.tail(global, 2)")
-}
-
-@Override
-public Traversal get_g_V_valuesXnameX_order_tailX2X() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.values('name').order.tail(2)")
-}
-
-@Override
-public 

[07/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
--
diff --git 
a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
 
b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
deleted file mode 100644
index e3a713d..000
--- 
a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java
+++ /dev/null
@@ -1,121 +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.groovy.jsr223.dsl.credential;
-
-import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
-import org.apache.tinkerpop.gremlin.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.hamcrest.MatcherAssert;
-import org.junit.Test;
-
-import static 
org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class CredentialGraphTest extends AbstractGremlinTest {
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldCreateUser() {
-final Vertex v = credentials(graph).createUser("stephen", "secret");
-assertEquals("stephen", v.value("username"));
-assertEquals("user", v.label());
-assertNotEquals("secret", v.value("password"));  // hashed to something
-assertThat(v.value("password").toString().length(), greaterThan(0));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, 
feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES)
-public void shouldRemoveUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("stephen", "secret");
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
-assertEquals(1, credentials(graph).removeUser("stephen"));
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldNotRemoveUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("stephen", "secret");
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
-assertEquals(0, credentials(graph).removeUser("stephanie"));
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldFindUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("marko", "secret");
-final Vertex stephen = credentials(graph).createUser("stephen", 
"secret");
-credentials(graph).createUser("daniel", "secret");
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(true));
-
-assertEquals(stephen, credentials(graph).findUser("stephen"));
-}
-
-@Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-public void shouldNotFindUser() {
-MatcherAssert.assertThat(graph.vertices().hasNext(), is(false));
-credentials(graph).createUser("marko", "secret");
-credentials(graph).createUser("stephen", "secret");
-credentials(graph).createUser("daniel", "secret");
-

[04/13] tinkerpop git commit: Merge branch 'tp32'

2017-01-25 Thread spmallette
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1612
Commit: 46a68f9b7f9eceed8ae10e50d23cfecfe418f4b2
Parents: 1169f61 28dffda
Author: Stephen Mallette 
Authored: Wed Jan 25 13:22:02 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:22:02 2017 -0500

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




[03/13] tinkerpop git commit: Fixed how plugins are bound to a scriptengine.

2017-01-25 Thread spmallette
Fixed how plugins are bound to a scriptengine.

Didn't have the reflection code right for finding the appliesTo method CTR


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

Branch: refs/heads/TINKERPOP-1612
Commit: 28dffda6b55dae775215ed08d5bcd2cfa280b07b
Parents: 956f350
Author: Stephen Mallette 
Authored: Wed Jan 25 13:20:53 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:20:53 2017 -0500

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28dffda6/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 349af8e..8fdb86e 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
@@ -40,6 +40,7 @@ import java.io.FileReader;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -479,8 +480,8 @@ public class GremlinExecutor implements AutoCloseable {
 }
 
 try {
-final Method appliesTo = 
builderClazz.getMethod("appliesTo");
-pluginBuilder = appliesTo.invoke(pluginBuilder, 
language);
+final Method appliesTo = 
builderClazz.getMethod("appliesTo", Collection.class);
+pluginBuilder = appliesTo.invoke(pluginBuilder, 
Collections.singletonList(language));
 } catch (NoSuchMethodException ignored) {
 
 }



[11/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test


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

Branch: refs/heads/TINKERPOP-1612
Commit: 34bbd6a143bc89855132054e0cabbcd841580abe
Parents: 46a68f9
Author: Stephen Mallette 
Authored: Tue Jan 24 07:22:07 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:22:41 2017 -0500

--
 gremlin-groovy-test/pom.xml |  64 ---
 .../groovy/loaders/SugarLoaderTest.groovy   | 134 --
 .../gremlin/groovy/util/SugarTestHelper.groovy  |  37 --
 .../step/branch/GroovyBranchTest.groovy |  58 ---
 .../step/branch/GroovyChooseTest.groovy |  62 ---
 .../step/branch/GroovyLocalTest.groovy  |  91 -
 .../step/branch/GroovyOptionalTest.groovy   |  59 ---
 .../step/branch/GroovyRepeatTest.groovy |  88 
 .../step/branch/GroovyUnionTest.groovy  |  77 
 .../traversal/step/filter/GroovyAndTest.groovy  |  52 ---
 .../traversal/step/filter/GroovyCoinTest.groovy |  41 --
 .../step/filter/GroovyCyclicPathTest.groovy |  43 --
 .../step/filter/GroovyDedupTest.groovy  | 113 --
 .../traversal/step/filter/GroovyDropTest.groovy |  51 ---
 .../step/filter/GroovyFilterTest.groovy |  73 
 .../traversal/step/filter/GroovyHasTest.groovy  | 173 
 .../traversal/step/filter/GroovyIsTest.groovy   |  57 ---
 .../traversal/step/filter/GroovyOrTest.groovy   |  47 ---
 .../step/filter/GroovyRangeTest.groovy  | 127 --
 .../step/filter/GroovySampleTest.groovy |  58 ---
 .../step/filter/GroovySimplePathTest.groovy |  43 --
 .../traversal/step/filter/GroovyTailTest.groovy |  92 -
 .../step/filter/GroovyWhereTest.groovy  | 167 
 .../traversal/step/map/GroovyAddEdgeTest.groovy |  85 
 .../step/map/GroovyAddVertexTest.groovy | 101 -
 .../step/map/GroovyCoalesceTest.groovy  |  59 ---
 .../step/map/GroovyConstantTest.groovy  |  42 --
 .../traversal/step/map/GroovyCountTest.groovy   |  71 
 .../traversal/step/map/GroovyFlatMapTest.groovy |  36 --
 .../traversal/step/map/GroovyFoldTest.groovy|  46 ---
 .../traversal/step/map/GroovyGraphTest.groovy   |  55 ---
 .../traversal/step/map/GroovyLoopsTest.groovy   |  56 ---
 .../traversal/step/map/GroovyMapKeysTest.groovy |  43 --
 .../traversal/step/map/GroovyMapTest.groovy |  62 ---
 .../step/map/GroovyMapValuesTest.groovy |  48 ---
 .../traversal/step/map/GroovyMatchTest.groovy   | 381 -
 .../traversal/step/map/GroovyMaxTest.groovy |  47 ---
 .../traversal/step/map/GroovyMeanTest.groovy|  42 --
 .../traversal/step/map/GroovyMinTest.groovy |  47 ---
 .../traversal/step/map/GroovyOrderTest.groovy   | 140 ---
 .../step/map/GroovyPageRankTest.groovy  |  78 
 .../traversal/step/map/GroovyPathTest.groovy|  63 ---
 .../step/map/GroovyPeerPressureTest.groovy  |  48 ---
 .../traversal/step/map/GroovyProfileTest.groovy |  94 -
 .../traversal/step/map/GroovyProgramTest.groovy |  50 ---
 .../traversal/step/map/GroovyProjectTest.groovy |  42 --
 .../step/map/GroovyPropertiesTest.groovy|  60 ---
 .../traversal/step/map/GroovySelectTest.groovy  | 242 ---
 .../traversal/step/map/GroovySumTest.groovy |  42 --
 .../traversal/step/map/GroovyUnfoldTest.groovy  |  48 ---
 .../step/map/GroovyValueMapTest.groovy  |  51 ---
 .../traversal/step/map/GroovyVertexTest.groovy  | 187 -
 .../step/sideEffect/GroovyAggregateTest.groovy  |  53 ---
 .../step/sideEffect/GroovyExplainTest.groovy|  35 --
 .../step/sideEffect/GroovyGroupCountTest.groovy | 101 -
 .../step/sideEffect/GroovyGroupTest.groovy  | 137 ---
 .../step/sideEffect/GroovyGroupTestV3d0.groovy  |  74 
 .../step/sideEffect/GroovyInjectTest.groovy |  42 --
 .../step/sideEffect/GroovySackTest.groovy   |  84 
 .../sideEffect/GroovySideEffectCapTest.groovy   |  45 --
 .../step/sideEffect/GroovySideEffectTest.groovy |  83 
 .../step/sideEffect/GroovyStoreTest.groovy  |  53 ---
 .../step/sideEffect/GroovySubgraphTest.groovy   |  50 ---
 .../step/sideEffect/GroovyTreeTest.groovy   |  69 
 .../groovy/GroovyEnvironmentIntegrateSuite.java |  85 
 .../gremlin/groovy/GroovyEnvironmentSuite.java  |  92 -
 .../engine/GremlinExecutorOverGraphTest.java| 108 -
 ...remlinGroovyScriptEngineFileSandboxTest.java | 120 --
 .../GremlinGroovyScriptEngineIntegrateTest.java |  88 
 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 -
 ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
 

[09/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test

2017-01-25 Thread spmallette
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
--
diff --git 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
 
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
deleted file mode 100644
index de33944..000
--- 
a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
+++ /dev/null
@@ -1,140 +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.process.traversal.step.map
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal
-import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal
-import org.apache.tinkerpop.gremlin.structure.Vertex
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovyOrderTest {
-
-public static class Traversals extends OrderTest {
-
-@Override
-public Traversal get_g_V_name_order() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()")
-}
-
-@Override
-public Traversal 
get_g_V_name_order_byXa1_b1X_byXb2_a2X() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, 
b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }")
-}
-
-@Override
-public Traversal get_g_V_order_byXname_incrX_name() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', 
incr).name")
-}
-
-@Override
-public Traversal get_g_V_order_byXnameX_name() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.order.by('name').name")
-}
-
-@Override
-public Traversal 
get_g_V_outE_order_byXweight_decrX_weight() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.outE.order.by('weight', Order.decr).weight")
-}
-
-@Override
-public Traversal 
get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() {
-new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { 
a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) 
}).name")
-}
-
-@Override
-public Traversal> 
get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')")
-}
-
-@Override
-public Traversal> 
get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX(
-final Object v1Id) {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"""g.V(v1Id).hasLabel("person").map {
-final Map map = [:];
-map[1] = it.age;
-map[2] = it.age * 2;
-map[3] = it.age * 3;
-map[4] = it.age;
-return map;
-}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id)
-}
-
-@Override
-public Traversal get_g_V_order_byXoutE_count__decrX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.order.by(__.outE.count, decr)")
-}
-
-@Override
-public Traversal> 
get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.group.by(label).by(values('name').order().by(decr).fold())")
-}
-
-@Override
-public Traversal 
get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() {
-new ScriptTraversal<>(g, "gremlin-groovy", 
"g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)")
-}
-
-@Override
-public Traversal> 

[13/13] tinkerpop git commit: TINKERPOP-1612 Reconfigure some tests for new plugins.

2017-01-25 Thread spmallette
TINKERPOP-1612 Reconfigure some tests for new plugins.


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

Branch: refs/heads/TINKERPOP-1612
Commit: 54133ad233404535bb89e11e09533cfe2d19423b
Parents: 010e66a
Author: Stephen Mallette 
Authored: Wed Jan 25 12:34:09 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:22:41 2017 -0500

--
 .../python/driver/gremlin-server-modern-secure-py.yaml| 3 +--
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java  | 7 +--
 .../gremlin/server/GremlinResultSetIntegrateTest.java | 5 -
 .../gremlin/server/GremlinServerHttpIntegrateTest.java| 5 -
 4 files changed, 14 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54133ad2/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 c846cf4..3f23946 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
@@ -32,10 +32,9 @@ graphs: {
   graph: 
src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties}
 scriptEngines: {
   gremlin-groovy: {
-imports: [java.lang.Math],
-staticImports: [java.lang.Math.PI],
 plugins: { 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},

org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+   org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: 
[src/test/resources/org/apache/tinkerpop/gremlin/python/driver/generate-modern.groovy]}}},
   gremlin-jython: {},
   gremlin-python: {}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54133ad2/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 a8164b5..658244d 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
@@ -32,6 +32,7 @@ import 
org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
 import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
+import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin;
 import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
@@ -134,7 +135,9 @@ public class GremlinDriverIntegrateTest extends 
AbstractGremlinServerIntegration
 try {
 final String p = TestHelper.generateTempFileFromResource(
 GremlinDriverIntegrateTest.class, 
"generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath();
-settings.scriptEngines.get("gremlin-groovy").scripts = 
Collections.singletonList(p);
+final Map m = new HashMap<>();
+m.put("files", Collections.singletonList(p));
+
settings.scriptEngines.get("gremlin-groovy").plugins.put(ScriptFileGremlinPlugin.class.getName(),
 m);
 } catch (Exception ex) {
 throw new RuntimeException(ex);
 }
@@ -672,7 +675,7 @@ public class GremlinDriverIntegrateTest extends 
AbstractGremlinServerIntegration
 final Cluster cluster = 
TestClientFactory.build().serializer(serializer).create();
 final Client client = cluster.connect();
 
-

tinkerpop git commit: Fixed how plugins are bound to a scriptengine.

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 956f35056 -> 28dffda6b


Fixed how plugins are bound to a scriptengine.

Didn't have the reflection code right for finding the appliesTo method CTR


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

Branch: refs/heads/tp32
Commit: 28dffda6b55dae775215ed08d5bcd2cfa280b07b
Parents: 956f350
Author: Stephen Mallette 
Authored: Wed Jan 25 13:20:53 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:20:53 2017 -0500

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28dffda6/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 349af8e..8fdb86e 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
@@ -40,6 +40,7 @@ import java.io.FileReader;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -479,8 +480,8 @@ public class GremlinExecutor implements AutoCloseable {
 }
 
 try {
-final Method appliesTo = 
builderClazz.getMethod("appliesTo");
-pluginBuilder = appliesTo.invoke(pluginBuilder, 
language);
+final Method appliesTo = 
builderClazz.getMethod("appliesTo", Collection.class);
+pluginBuilder = appliesTo.invoke(pluginBuilder, 
Collections.singletonList(language));
 } catch (NoSuchMethodException ignored) {
 
 }



[1/2] tinkerpop git commit: Fixed how plugins are bound to a scriptengine.

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/master 1169f6168 -> 46a68f9b7


Fixed how plugins are bound to a scriptengine.

Didn't have the reflection code right for finding the appliesTo method CTR


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

Branch: refs/heads/master
Commit: 28dffda6b55dae775215ed08d5bcd2cfa280b07b
Parents: 956f350
Author: Stephen Mallette 
Authored: Wed Jan 25 13:20:53 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:20:53 2017 -0500

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28dffda6/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 349af8e..8fdb86e 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
@@ -40,6 +40,7 @@ import java.io.FileReader;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -479,8 +480,8 @@ public class GremlinExecutor implements AutoCloseable {
 }
 
 try {
-final Method appliesTo = 
builderClazz.getMethod("appliesTo");
-pluginBuilder = appliesTo.invoke(pluginBuilder, 
language);
+final Method appliesTo = 
builderClazz.getMethod("appliesTo", Collection.class);
+pluginBuilder = appliesTo.invoke(pluginBuilder, 
Collections.singletonList(language));
 } catch (NoSuchMethodException ignored) {
 
 }



[2/2] tinkerpop git commit: Merge branch 'tp32'

2017-01-25 Thread spmallette
Merge branch 'tp32'


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

Branch: refs/heads/master
Commit: 46a68f9b7f9eceed8ae10e50d23cfecfe418f4b2
Parents: 1169f61 28dffda
Author: Stephen Mallette 
Authored: Wed Jan 25 13:22:02 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 13:22:02 2017 -0500

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




tinkerpop git commit: jesus...by way of China. ActorPrograms now have a Map<Class, BinaryOperator> getMessageTypes() which allow messagesa to be combinined at the worker accordingly. For instance, dou

2017-01-25 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 12cce2b82 -> df5992755


jesus...by way of China. ActorPrograms now have a Map 
getMessageTypes() which allow messagesa to be combinined at the worker 
accordingly. For instance, doubles can be Operator.sum. If a null binary 
operator is provided, then a simple message queue append is used. Added 
TestMessageCombinerActorProgram to GraphActorsTest to verify combiners are 
working appropriately.  JavaDoc and other stuffs here and there.


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

Branch: refs/heads/TINKERPOP-1564
Commit: df599275533bdd9cea48d46447a7076166491152
Parents: 12cce2b
Author: Marko A. Rodriguez 
Authored: Wed Jan 25 09:53:10 2017 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Jan 25 09:53:10 2017 -0700

--
 .../akka/process/actors/ActorMailbox.java   |  51 ---
 .../akka/process/actors/AkkaConfigFactory.java  |  12 +-
 .../tinkerpop/gremlin/process/actors/Actor.java |   6 +
 .../gremlin/process/actors/ActorProgram.java|  17 ++-
 .../actors/traversal/TraversalActorProgram.java |  25 ++--
 .../traversal/TraversalMasterProgram.java   |  39 +++---
 .../traversal/TraversalWorkerProgram.java   |  21 ++-
 .../tinkerpop/gremlin/util/ClassUtil.java   |  23 ++-
 .../gremlin/process/actors/GraphActorsTest.java |  10 ++
 .../TestMessageCombinersActorProgram.java   | 140 +++
 10 files changed, 266 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df599275/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
--
diff --git 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
index 7a4bc4d..8505871 100644
--- 
a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
+++ 
b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actors/ActorMailbox.java
@@ -29,32 +29,36 @@ import com.typesafe.config.Config;
 import org.apache.tinkerpop.gremlin.process.actors.ActorsResult;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import 
org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
+import org.apache.tinkerpop.gremlin.util.ClassUtil;
 import scala.Option;
 
 import java.util.ArrayList;
+import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Queue;
+import java.util.function.BinaryOperator;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public final class ActorMailbox implements MailboxType, 
ProducesMessageQueue {
 
-private final List messagePriorities = new ArrayList<>();
+private final LinkedHashMap messageTypes = new 
LinkedHashMap<>();
 
 public static class ActorMessageQueue implements MessageQueue, 
ActorSemantics {
-private final List messagePriorities;
+private final Map messageTypes;
 private final List messages;
 private ActorsResult result = null;
 private ActorRef home = null;
 private final Object MUTEX = new Object();
 
 
-public ActorMessageQueue(final List messagePriorities) {
-this.messagePriorities = messagePriorities;
-this.messages = new ArrayList<>(this.messagePriorities.size());
-for (final Class clazz : this.messagePriorities) {
+public ActorMessageQueue(final Map 
messageTypes) {
+this.messageTypes = messageTypes;
+this.messages = new ArrayList<>(this.messageTypes.size());
+for (final Class clazz : this.messageTypes.keySet()) {
 final Queue queue;
 if (Traverser.class.isAssignableFrom(clazz))
 queue = new TraverserSet<>();
@@ -73,12 +77,19 @@ public final class ActorMailbox implements MailboxType, 
ProducesMessageQueue entry : 
this.messageTypes.entrySet()) {
+final Class clazz = entry.getKey();
 if (clazz.isInstance(message)) {
-this.messages.get(i).offer(message instanceof 
Traverser ? message : handle);
+if (null != entry.getValue()) {
+

tinkerpop git commit: Fixed a gremlin server bug with global bindings

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 d08a68f32 -> 956f35056


Fixed a gremlin server bug with global bindings

TraversalSources established in init scripts using the new plugin system 
weren't getting set to the GraphManager given the fact that the 
GremlinScriptEngineManager does runs the scripts when the GremlinScriptEngine 
is first initialized. By forcing the GremlinScriptEngine to initialize with a 
throw-away script the init scripts will execute. This is a bit of a hack - will 
consider other solutions for 3.3.0. CTR


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

Branch: refs/heads/tp32
Commit: 956f35056a967ecf1d8e74dc04bb227ba4823047
Parents: d08a68f
Author: Stephen Mallette 
Authored: Wed Jan 25 09:24:49 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 09:24:49 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java   | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/956f3505/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 2b2f1f1..199c9f8 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
@@ -145,6 +145,12 @@ public class ServerGremlinExecutor {
 
 logger.info("Initialized GremlinExecutor and configured 
ScriptEngines.");
 
+// force each scriptengine to process something so that the init 
scripts will fire (this is necessary if
+// the GremlinExecutor is using the GremlinScriptEngineManager. this 
is a bit of hack, but it at least allows
+// the global bindings to become available after the init scripts are 
run (DefaultGremlinScriptEngineManager
+// runs the init scripts when the GremlinScriptEngine is created.
+settings.scriptEngines.keySet().forEach(engineName -> 
gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join());
+
 // script engine init may have altered the graph bindings or maybe 
even created new ones - need to
 // re-apply those references back
 gremlinExecutor.getGlobalBindings().entrySet().stream()



[2/2] tinkerpop git commit: Merge branch 'tp32'

2017-01-25 Thread spmallette
Merge branch 'tp32'


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

Branch: refs/heads/master
Commit: 1169f61680f0e0e40d227ca7d818c83eb8341e22
Parents: d18dd02 956f350
Author: Stephen Mallette 
Authored: Wed Jan 25 09:28:30 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 09:28:30 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java   | 6 ++
 1 file changed, 6 insertions(+)
--




[1/2] tinkerpop git commit: Fixed a gremlin server bug with global bindings

2017-01-25 Thread spmallette
Repository: tinkerpop
Updated Branches:
  refs/heads/master d18dd021a -> 1169f6168


Fixed a gremlin server bug with global bindings

TraversalSources established in init scripts using the new plugin system 
weren't getting set to the GraphManager given the fact that the 
GremlinScriptEngineManager does runs the scripts when the GremlinScriptEngine 
is first initialized. By forcing the GremlinScriptEngine to initialize with a 
throw-away script the init scripts will execute. This is a bit of a hack - will 
consider other solutions for 3.3.0. CTR


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

Branch: refs/heads/master
Commit: 956f35056a967ecf1d8e74dc04bb227ba4823047
Parents: d08a68f
Author: Stephen Mallette 
Authored: Wed Jan 25 09:24:49 2017 -0500
Committer: Stephen Mallette 
Committed: Wed Jan 25 09:24:49 2017 -0500

--
 .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java   | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/956f3505/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 2b2f1f1..199c9f8 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
@@ -145,6 +145,12 @@ public class ServerGremlinExecutor {
 
 logger.info("Initialized GremlinExecutor and configured 
ScriptEngines.");
 
+// force each scriptengine to process something so that the init 
scripts will fire (this is necessary if
+// the GremlinExecutor is using the GremlinScriptEngineManager. this 
is a bit of hack, but it at least allows
+// the global bindings to become available after the init scripts are 
run (DefaultGremlinScriptEngineManager
+// runs the init scripts when the GremlinScriptEngine is created.
+settings.scriptEngines.keySet().forEach(engineName -> 
gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join());
+
 // script engine init may have altered the graph bindings or maybe 
even created new ones - need to
 // re-apply those references back
 gremlinExecutor.getGlobalBindings().entrySet().stream()



tinkerpop git commit: javadoc'ing and code reorganization.

2017-01-25 Thread okram
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 b81dbc3b7 -> 12cce2b82


javadoc'ing and code reorganization.


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

Branch: refs/heads/TINKERPOP-1564
Commit: 12cce2b8249a936ea0db8245dc8e044b2f3f7e59
Parents: b81dbc3
Author: Marko A. Rodriguez 
Authored: Wed Jan 25 07:08:24 2017 -0700
Committer: Marko A. Rodriguez 
Committed: Wed Jan 25 07:08:24 2017 -0700

--
 .../tinkerpop/gremlin/process/actors/Actor.java | 18 +++-
 .../gremlin/process/actors/ActorProgram.java| 35 ---
 .../traversal/TraversalMasterProgram.java   | 14 ++-
 .../traversal/TraversalWorkerProgram.java   | 96 ++--
 .../traversal/step/filter/DedupGlobalStep.java  |  2 +-
 5 files changed, 102 insertions(+), 63 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12cce2b8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/Actor.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/Actor.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/Actor.java
index 0f75e20..aec8632 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/Actor.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/Actor.java
@@ -36,7 +36,7 @@ import java.util.List;
 public interface Actor {
 
 /**
- * Get the {@link Address} of the actors.
+ * Get the {@link Address} of the actor.
  *
  * @return the actors's address
  */
@@ -81,14 +81,30 @@ public interface Actor {
  */
 public Partitioner partitioner();
 
+/**
+ * The master actor is responsible for yielding the final result of 
the computation.
+ *
+ * @param result the final result of the computation
+ */
 public void setResult(final R result);
 
 }
 
 public interface Worker extends Actor {
 
+/**
+ * Get the worker actor's address.
+ *
+ * @return the worker actor's address
+ */
+@Override
 public Address.Worker address();
 
+/**
+ * Get the address of the worker's master actor.
+ *
+ * @return the master actor's address
+ */
 public Address.Master master();
 
 /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12cce2b8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/ActorProgram.java
--
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/ActorProgram.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/ActorProgram.java
index 4063090..d1db2e1 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/ActorProgram.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/ActorProgram.java
@@ -114,46 +114,59 @@ public interface ActorProgram extends Cloneable {
 }
 
 /**
- * The Worker program is executed by a worker process in the {@link 
GraphActors} system.
+ * The Master program is executed by the master process in the {@link 
GraphActors} system.
  * There are many workers and a single master.
- * All workers execute the same program.
  *
- * @param  The message type accepted by the worker
+ * @param  The message type accepted by the master
  */
-public static interface Worker {
-
+public static interface Master {
 /**
- * This method is evaluated when the worker process is spawned.
+ * This method is evaluated when the master actor is spawned.
  */
 public void setup();
 
 /**
- * This method is evaluated when the worker receives a new message.
+ * This method is evaluated when the master actor receives a new 
message.
  *
  * @param message the received message
  */
 public void execute(final M message);
 
 /**
- * This method is evaluated when the worker process is destroyed.
+ * This method is evaluated when the master actor is destroyed.
  */
 public void terminate();
 
 }
 
+
 /**
- * The Master program is executed by the master process in the {@link 
GraphActors} system.
+ * The Worker program is executed by a worker process in the {@link 
GraphActors} system.
  * There are 

tinkerpop git commit: format, organize imports only

2017-01-25 Thread rdale
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1602 705c93412 -> b18f59cd7


format, organize imports only


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

Branch: refs/heads/TINKERPOP-1602
Commit: b18f59cd768da3d1c6f8298545303e86aadd3ce5
Parents: 705c934
Author: Robert Dale 
Authored: Wed Jan 25 06:27:43 2017 -0500
Committer: Robert Dale 
Committed: Wed Jan 25 06:27:43 2017 -0500

--
 .../gremlin/server/GremlinServerIntegrateTest.java   | 15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b18f59cd/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 6e6d1ff..fe00a43 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
@@ -55,7 +55,6 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
 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;
 import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
@@ -80,7 +79,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -96,7 +94,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeThat;
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -106,13 +103,13 @@ import static org.junit.Assert.assertEquals;
  */
 public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegrationTest {
 
-   private static final String SERVER_KEY = 
"src/test/resources/server.key.pk8";
-   private static final String SERVER_CRT = 
"src/test/resources/server.crt";
-   private static final String KEY_PASS = "changeit";
-   private static final String CLIENT_KEY = 
"src/test/resources/client.key.pk8";
-   private static final String CLIENT_CRT = 
"src/test/resources/client.crt";
+private static final String SERVER_KEY = 
"src/test/resources/server.key.pk8";
+private static final String SERVER_CRT = "src/test/resources/server.crt";
+private static final String KEY_PASS = "changeit";
+private static final String CLIENT_KEY = 
"src/test/resources/client.key.pk8";
+private static final String CLIENT_CRT = "src/test/resources/client.crt";
 
-   private Log4jRecordingAppender recordingAppender = null;
+private Log4jRecordingAppender recordingAppender = null;
 private final Supplier graphGetter = () -> 
server.getServerGremlinExecutor().getGraphManager().getGraphs().get("graph");
 private final Configuration conf = new BaseConfiguration() {{
 setProperty(Graph.GRAPH, RemoteGraph.class.getName());