tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [35/50] tinkerpop git commit: TINKERPOP-1976 Removed an OptOut from RemoteGraph
Date Thu, 09 Aug 2018 14:55:30 GMT
TINKERPOP-1976 Removed an OptOut from RemoteGraph

Carved out a special case for a behavior that is specific to remote operations around side-effects


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

Branch: refs/heads/TINKERPOP-1967
Commit: 682bdde6c58f992b20ad919279c7da691c1dc210
Parents: c03b575
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Mon Aug 6 15:10:52 2018 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Aug 9 07:28:09 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/remote/RemoteGraph.java     |  4 ----
 .../driver/remote/DriverRemoteTraversalSideEffects.java   |  3 ++-
 .../gremlin/process/AbstractGremlinProcessTest.java       | 10 +++++++++-
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682bdde6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
index 1ea7d42..3699fea 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
@@ -48,10 +48,6 @@ import java.util.Iterator;
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD)
 @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER)
 @Graph.OptOut(
-        test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest",
-        method = "g_V_hasXnoX_groupCountXaX_capXaX",
-        reason = "This test asserts an empty side-effect which reflects as a null rather
than an \"empty\" and thus doesn't assert")
-@Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest",
         method = "*",
         reason = "The test suite does not support profiling or lambdas and for groovy tests:
'Could not locate method: GraphTraversalSource.withStrategies([{traversalCategory=interface
org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$DecorationStrategy}])'")

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682bdde6/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
index 4305567..791c70e 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
@@ -30,6 +30,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
@@ -88,7 +89,7 @@ public class DriverRemoteTraversalSideEffects extends AbstractRemoteTraversalSid
                 final Result result = client.submitAsync(msg).get().all().get().get(0);
                 sideEffects.put(key, null == result ? null : result.getObject());
             } catch (Exception ex) {
-                // we use to try to catch  "no found" situations returned from the server
here and then null the
+                // we use to try to catch "no found" situations returned from the server
here and then null the
                 // side-effect for the requested key. doesn't seem like there is a need for
that now because calls
                 // to get() now initially trigger a call the keys() so you would know all
of the keys available on
                 // the server and would validate them up front throwing sideEffectKeyDoesNotExist(key)
which thus

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682bdde6/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
index 96dee1d..c3f4dc2 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.GraphManager;
+import org.apache.tinkerpop.gremlin.process.remote.traversal.RemoteTraversalSideEffects;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
@@ -96,8 +97,15 @@ public abstract class AbstractGremlinProcessTest extends AbstractGremlinTest
{
             final Class clazz = (Class) keysClasses[i + 1];
             assertThat(sideEffects.keys().contains(key), is(true));
             assertThat(sideEffects.exists(key), is(true));
-            assertEquals(clazz, sideEffects.get((String) keysClasses[i]).getClass());
             assertThat(sideEffects.exists(UUID.randomUUID().toString()), is(false));
+
+            // there is slightly different behavior for remote side-effects so carving out
a few asserts with that
+            // in mind. the client really doesnt' really have a way of knowing what type
of object to create when it
+            // gets an empty iterator so it makes the result null and therefore we end up
with a NPE if we try to
+            // access it. the rest of the behavior is solid so better to do this than OptOut
I think
+            if (!(sideEffects instanceof RemoteTraversalSideEffects)) {
+                assertEquals(clazz, sideEffects.get((String) keysClasses[i]).getClass());
+            }
         }
         assertEquals(sideEffects.keys().size(), counter);
         assertThat(sideEffects.keys().contains(UUID.randomUUID().toString()), is(false));


Mime
View raw message