Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1278 40772c05e -> b5f265c7c
Enabled some tests formerly using nashorn on GremlinExecutor Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b5f265c7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b5f265c7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b5f265c7 Branch: refs/heads/TINKERPOP-1278 Commit: b5f265c7c2cc477079eb7c8e8bfc2b5115c302ec Parents: 40772c0 Author: Stephen Mallette <[email protected]> Authored: Mon Jul 18 08:30:50 2016 -0400 Committer: Stephen Mallette <[email protected]> Committed: Mon Jul 18 08:30:50 2016 -0400 ---------------------------------------------------------------------- .../gremlin/groovy/engine/GremlinExecutorTest.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5f265c7/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutorTest.java ---------------------------------------------------------------------- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutorTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutorTest.java index 2abff40..b72b2c4 100644 --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutorTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutorTest.java @@ -164,39 +164,36 @@ public class GremlinExecutorTest { } @Test - @org.junit.Ignore public void shouldEvalScriptWithMapBindingsAndLanguage() throws Exception { final GremlinExecutor gremlinExecutor = GremlinExecutor.build() - .addEngineSettings("nashorn", Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()).create(); + .addEngineSettings("gremlin-groovy", Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()).create(); final Map<String,Object> b = new HashMap<>(); b.put("x", 1); - assertEquals(2.0, gremlinExecutor.eval("1+x", "nashorn", b).get()); + assertEquals(2, gremlinExecutor.eval("1+x", "gremlin-groovy", b).get()); gremlinExecutor.close(); } @Test - @org.junit.Ignore public void shouldEvalScriptWithMapBindingsAndLanguageThenTransform() throws Exception { final GremlinExecutor gremlinExecutor = GremlinExecutor.build() - .addEngineSettings("nashorn", Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()).create(); + .addEngineSettings("gremlin-groovy", Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()).create(); final Map<String,Object> b = new HashMap<>(); b.put("x", 1); - assertEquals(4, gremlinExecutor.eval("1+x", "nashorn", b, r -> ((Double) r).intValue() * 2).get()); + assertEquals(4, gremlinExecutor.eval("1+x", "gremlin-groovy", b, r -> (int) r * 2).get()); gremlinExecutor.close(); } @Test - @org.junit.Ignore public void shouldEvalScriptWithMapBindingsAndLanguageThenConsume() throws Exception { final GremlinExecutor gremlinExecutor = GremlinExecutor.build() - .addEngineSettings("nashorn", Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()).create(); + .addEngineSettings("gremlin-groovy", Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()).create(); final Map<String,Object> b = new HashMap<>(); b.put("x", 1); final CountDownLatch latch = new CountDownLatch(1); final AtomicInteger result = new AtomicInteger(0); - assertEquals(2.0, gremlinExecutor.eval("1+x", "nashorn", b, r -> { - result.set(((Double) r).intValue() * 2); + assertEquals(2, gremlinExecutor.eval("1+x", "gremlin-groovy", b, r -> { + result.set((int) r * 2); latch.countDown(); }).get());
