You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/08/22 20:19:19 UTC

[1/7] tinkerpop git commit: Add null checking for configuration

Repository: tinkerpop
Updated Branches:
  refs/heads/tp33 b34515a91 -> 65820569f


Add null checking for configuration


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

Branch: refs/heads/tp33
Commit: 32a8ee6d2faed5bfbb36dd30d17dff7d6cff03e0
Parents: f49b279
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Aug 21 15:13:25 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Aug 21 15:18:50 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java | 2 +-
 .../apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/32a8ee6d/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
index 701c85c..b018938 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
@@ -57,7 +57,7 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
             graph.close();
         }
 
-        if (configuration.containsKey(Neo4jGraph.CONFIG_DIRECTORY)) {
+        if (null != configuration && configuration.containsKey(Neo4jGraph.CONFIG_DIRECTORY)) {
             // this is a non-in-sideEffects configuration so blow away the directory
             final File graphDirectory = new File(configuration.getString(Neo4jGraph.CONFIG_DIRECTORY));
             deleteDirectory(graphDirectory);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/32a8ee6d/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
index 7f0e6f3..911137d 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
@@ -85,7 +85,7 @@ public class TinkerGraphProvider extends AbstractGraphProvider {
             graph.close();
 
         // in the even the graph is persisted we need to clean up
-        final String graphLocation = configuration.getString(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, null);
+        final String graphLocation = null != configuration ? configuration.getString(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, null) : null;
         if (graphLocation != null) {
             final File f = new File(graphLocation);
             f.delete();


[3/7] tinkerpop git commit: Merge branch 'graphprovider-clear-tp32' into graphprovider-clear-tp33

Posted by sp...@apache.org.
Merge branch 'graphprovider-clear-tp32' into graphprovider-clear-tp33


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

Branch: refs/heads/tp33
Commit: bf94f43f39c7812adec402730aaa2a8ed8526900
Parents: b46c295 038b9cd
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Aug 21 18:24:42 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Aug 21 18:24:42 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/AbstractGremlinTest.java   |  4 +++-
 .../org/apache/tinkerpop/gremlin/GraphProvider.java     | 12 +++++++++---
 .../gremlin/neo4j/AbstractNeo4jGraphProvider.java       |  2 +-
 .../gremlin/tinkergraph/TinkerGraphProvider.java        |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf94f43f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------


[2/7] tinkerpop git commit: Update javadoc and comments for clear method; Remove unused import

Posted by sp...@apache.org.
Update javadoc and comments for clear method;
Remove unused import


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

Branch: refs/heads/tp33
Commit: 038b9cd759d0ac97a3c3820ec55026938d4c74be
Parents: 32a8ee6
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Aug 21 15:14:16 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Aug 21 17:33:34 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/AbstractGremlinTest.java   |  4 +++-
 .../org/apache/tinkerpop/gremlin/GraphProvider.java     | 12 +++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/038b9cd7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 8485d56..a03e351 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -31,7 +31,6 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.rules.TestName;
 import org.slf4j.Logger;
@@ -133,6 +132,8 @@ public abstract class AbstractGremlinTest {
     public void tearDown() throws Exception {
         if (null != graphProvider) {
             graphProvider.getTestListener().ifPresent(l -> l.onTestEnd(this.getClass(), name.getMethodName()));
+
+            // GraphProvider that has implemented the clear method must check null for graph and config.
             graphProvider.clear(graph, config);
 
             // All GraphProvider objects should be an instance of ManagedGraphProvider, as this is handled by GraphManager
@@ -144,6 +145,7 @@ public abstract class AbstractGremlinTest {
                 logger.warn("The {} is not of type ManagedGraphProvider and therefore graph instances may leak between test cases.", graphProvider.getClass());
 
             g = null;
+            graph = null;
             config = null;
             graphProvider = null;
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/038b9cd7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
index c785cfc..30af95a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
@@ -125,8 +125,8 @@ public interface GraphProvider {
     }
 
     /**
-     * Creates a new {@link Graph} instance from the Configuration object using {@link GraphFactory}. The assumption
-     * here is that the {@code Configuration} has been created by one of the
+     * Creates a new {@link Graph} instance from the {@link org.apache.commons.configuration.Configuration} object using {@link GraphFactory}.
+     * The assumption here is that the {@code Configuration} has been created by one of the
      * {@link #newGraphConfiguration(String, Class, String, LoadGraphWith.GraphData)} methods and has therefore
      * already been modified by the implementation as necessary for {@link Graph} creation.
      */
@@ -149,6 +149,9 @@ public interface GraphProvider {
      * to construct the graph.  The default implementation simply calls
      * {@link #clear(Graph, org.apache.commons.configuration.Configuration)} with
      * a null graph argument.
+     * <p/>
+     * Implementations should be able to accept an argument of null for the {@code org.apache.commons.configuration.Configuration}
+     * as well, and a proper handling is needed. Otherwise, a NullPointerException may be thrown.
      */
     public default void clear(final Configuration configuration) throws Exception {
         clear(null, configuration);
@@ -160,10 +163,13 @@ public interface GraphProvider {
      * For a brute force approach, implementers can simply delete data directories provided in the configuration.
      * Implementers may choose a more elegant approach if it exists.
      * <p/>
-     * Implementations should be able to accept an argument of null for the Graph, in which case the only action
+     * Implementations should be able to accept an argument of null for the {@code Graph}, in which case the only action
      * that can be performed is a clear given the configuration.  The method will typically be called this way
      * as clean up task on setup to ensure that a persisted graph has a clear space to create a test graph.
      * <p/>
+     * Implementations should be able to accept an argument of null for the {@code org.apache.commons.configuration.Configuration}
+     * as well, and a proper handling is needed. Otherwise, a NullPointerException may be thrown.
+     * <p/>
      * Calls to this method may occur multiple times for a specific test. Develop this method to be idempotent.
      */
     public void clear(final Graph graph, final Configuration configuration) throws Exception;


[5/7] tinkerpop git commit: Merge branch 'pr-917' into tp32

Posted by sp...@apache.org.
Merge branch 'pr-917' into tp32


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

Branch: refs/heads/tp33
Commit: 6a6959a33c24eea9777bc7c2c6df31954a6ca1c2
Parents: ca3a343 038b9cd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 22 16:16:34 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 22 16:16:34 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/AbstractGremlinTest.java   |  4 +++-
 .../org/apache/tinkerpop/gremlin/GraphProvider.java     | 12 +++++++++---
 .../gremlin/neo4j/AbstractNeo4jGraphProvider.java       |  2 +-
 .../gremlin/tinkergraph/TinkerGraphProvider.java        |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[7/7] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/tp33
Commit: 65820569f9eb47f8435699d2308bbedc94306b7b
Parents: a8931d5 6a6959a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 22 16:17:23 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 22 16:17:23 2018 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[6/7] tinkerpop git commit: Merge branch 'pr-918' into tp33

Posted by sp...@apache.org.
Merge branch 'pr-918' into tp33


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

Branch: refs/heads/tp33
Commit: a8931d581c26d355b92285400239ec588246bd4f
Parents: b34515a 6efd47d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 22 16:16:54 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 22 16:16:54 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/util/TinkerGraphProvider.java     |  2 +-
 .../apache/tinkerpop/gremlin/AbstractGremlinTest.java   |  5 +++--
 .../org/apache/tinkerpop/gremlin/GraphProvider.java     | 12 +++++++++---
 .../gremlin/neo4j/AbstractNeo4jGraphProvider.java       |  2 +-
 .../gremlin/tinkergraph/TinkerGraphProvider.java        |  2 +-
 5 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[4/7] tinkerpop git commit: Add null checking for configuration; Remove unused import

Posted by sp...@apache.org.
Add null checking for configuration;
Remove unused import


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

Branch: refs/heads/tp33
Commit: 6efd47da55c1d621714c481b21cf8b4494585680
Parents: bf94f43
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Aug 21 18:28:59 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Aug 21 18:28:59 2018 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java     | 2 +-
 .../java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java     | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6efd47da/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
index 7a87414..bd2d20b 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
@@ -85,7 +85,7 @@ public class TinkerGraphProvider extends AbstractGraphProvider {
             graph.close();
 
         // in the even the graph is persisted we need to clean up
-        final String graphLocation = configuration.getString(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, null);
+        final String graphLocation = null != configuration ? configuration.getString(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, null) : null;
         if (graphLocation != null) {
             final File f = new File(graphLocation);
             f.delete();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6efd47da/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 2ccf762..a614252 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -41,7 +41,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Random;
 import java.util.Set;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;