This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch ci-fix
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/ci-fix by this push:
     new 6fa6d0f  Only load up neo4j if present on classpath
6fa6d0f is described below

commit 6fa6d0fa58f89943969b3bf5c347fab0cf7a727d
Author: Stephen Mallette <[email protected]>
AuthorDate: Tue Dec 28 19:50:30 2021 -0500

    Only load up neo4j if present on classpath
---
 .../gremlin/server/AbstractGremlinServerIntegrationTest.java  | 11 +++++++----
 .../gremlin/server/GremlinServerSessionIntegrateTest.java     |  4 ++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
index 634063e..6819771 100644
--- 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
+++ 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
@@ -155,14 +155,17 @@ public abstract class 
AbstractGremlinServerIntegrationTest {
         return (directory.delete());
     }
 
-    protected static void assumeNeo4jIsPresent() {
-        boolean neo4jIncludedForTesting;
+    protected static boolean isNeo4jPresent() {
         try {
             Class.forName("org.neo4j.tinkerpop.api.impl.Neo4jGraphAPIImpl");
-            neo4jIncludedForTesting = true;
+            return true;
         } catch (Exception ex) {
-            neo4jIncludedForTesting = false;
+            return false;
         }
+    }
+
+    protected static void assumeNeo4jIsPresent() {
+        boolean neo4jIncludedForTesting = isNeo4jPresent();
         assumeThat("Neo4j implementation was not included for testing - run 
with -DincludeNeo4j", neo4jIncludedForTesting, is(true));
     }
 }
diff --git 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index ddf39d3..4ac1027 100644
--- 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -119,14 +119,14 @@ public class GremlinServerSessionIntegrateTest extends 
AbstractGremlinServerInte
             case 
"shouldExecuteInSessionAndSessionlessWithoutOpeningTransactionWithSingleClient":
             case "shouldExecuteInSessionWithTransactionManagement":
             case "shouldRollbackOnEvalExceptionForManagedTransaction":
-                clearNeo4j(settings);
+                if (isNeo4jPresent()) clearNeo4j(settings);
                 break;
         }
 
         return settings;
     }
 
-    private static void clearNeo4j(Settings settings) {
+    private static void clearNeo4j(final Settings settings) {
         deleteDirectory(new File("/tmp/neo4j"));
         settings.graphs.put("graph", "conf/neo4j-empty.properties");
     }

Reply via email to