You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2018/10/05 17:14:56 UTC

[27/35] tinkerpop git commit: Moved tests that fail periodically to integration tests.

Moved tests that fail periodically to integration tests.

These tests require Grape and external resources to pass. Those resources seem to be less dependable on Travis sometimes and causes test failures. CTR


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

Branch: refs/heads/TINKERPOP-2058
Commit: 4bdb006c5ee418f27ef7bb8a9330714ce414c50f
Parents: ca034f1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 5 06:38:42 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Oct 5 06:53:21 2018 -0400

----------------------------------------------------------------------
 .../jsr223/GremlinGroovyScriptEngineTest.java   | 33 ++---------------
 .../GremlinGroovyScriptEngineIntegrateTest.java | 37 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdb006c/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
index 54e997f..2803c24 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
@@ -38,7 +38,8 @@ import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
 import javax.script.ScriptException;
 import javax.script.SimpleBindings;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.SystemColor;
 import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -266,36 +267,6 @@ public class GremlinGroovyScriptEngineTest {
     }
 
     @Test
-    public void shouldLoadImportsViaDependencyManagerFromDependencyGatheredByUse() throws Exception {
-        final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE);
-        try {
-            engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)");
-            fail("Should have thrown an exception because no imports were supplied");
-        } catch (Exception se) {
-            assertTrue(se instanceof ScriptException);
-        }
-
-        engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath")));
-        engine.use("org.apache.commons", "commons-math3", "3.2");
-        assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"));
-    }
-
-    @Test
-    public void shouldAllowsUseToBeExecutedAfterImport() throws Exception {
-        final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE);
-        try {
-            engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)");
-            fail("Should have thrown an exception because no imports were supplied");
-        } catch (Exception se) {
-            assertTrue(se instanceof ScriptException);
-        }
-
-        engine.use("org.apache.commons", "commons-math3", "3.2");
-        engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath")));
-        assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"));
-    }
-
-    @Test
     public void shouldAllowsMultipleImports() throws Exception {
         final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE);
         try {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdb006c/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java
index 5242d3b..c595209 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java
@@ -18,16 +18,23 @@
  */
 package org.apache.tinkerpop.gremlin.jsr223;
 
+import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
+import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.javatuples.Pair;
 import org.junit.Ignore;
 import org.junit.Test;
 
+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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -52,4 +59,34 @@ public class GremlinGroovyScriptEngineIntegrateTest {
             }
         }
     }
+
+    @Test
+    public void shouldLoadImportsViaDependencyManagerFromDependencyGatheredByUse() throws Exception {
+        final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE);
+        try {
+            engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)");
+            fail("Should have thrown an exception because no imports were supplied");
+        } catch (Exception se) {
+            assertTrue(se instanceof ScriptException);
+        }
+
+        engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath")));
+        engine.use("org.apache.commons", "commons-math3", "3.2");
+        assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"));
+    }
+
+    @Test
+    public void shouldAllowsUseToBeExecutedAfterImport() throws Exception {
+        final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE);
+        try {
+            engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)");
+            fail("Should have thrown an exception because no imports were supplied");
+        } catch (Exception se) {
+            assertTrue(se instanceof ScriptException);
+        }
+
+        engine.use("org.apache.commons", "commons-math3", "3.2");
+        engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath")));
+        assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"));
+    }
 }