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 2015/10/08 14:20:06 UTC

incubator-tinkerpop git commit: Initialize the underlying Client in ReboundClient.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/tp30 1c39c99b9 -> 8eb71e17e


Initialize the underlying Client in ReboundClient.

Without this change you get problems if you try to use the ReboundClient without first making a successful submit() on the Client that spawned ReboundClient.  Unfortunately the completeness of the original integration test hid this problem from showing itself - fixed that too.


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

Branch: refs/heads/tp30
Commit: 8eb71e17e68134cdf4bb86d43b30071becac4b9a
Parents: 1c39c99
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Oct 8 08:17:57 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Oct 8 08:17:57 2015 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/tinkerpop/gremlin/driver/Client.java   | 5 ++++-
 .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java    | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8eb71e17/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
index 4076df9..b54d6dc 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
@@ -351,8 +351,11 @@ public abstract class Client {
 
         @Override
         public synchronized Client init() {
-            // no init required
             if (close.isDone()) throw new IllegalStateException("Client is closed");
+
+            // the underlying client may not have been init'd
+            clusteredClient.init();
+
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8eb71e17/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 98c9d61..288aa3a 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
@@ -678,7 +678,8 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
             assertEquals(ResponseStatusCode.SERVER_ERROR_SCRIPT_EVALUATION, re.getResponseStatusCode());
         }
 
-        final Vertex v = client.rebind("graph").submit("g.addVertex('name','stephen')").all().get().get(0).getVertex();
+        final Client rebound = cluster.connect().rebind("graph");
+        final Vertex v = rebound.submit("g.addVertex('name','stephen')").all().get().get(0).getVertex();
         assertEquals("stephen", v.value("name"));
 
         cluster.close();