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 2016/03/17 23:44:13 UTC

[40/50] incubator-tinkerpop git commit: Changed premise of ResultQueue test a bit which allows it to pass.

Changed premise of ResultQueue test a bit which allows it to pass.

Not sure why this wasn't failing on master unless there was something new in TINKERPOP-575 that was introduced that made it fail here.  ResultQueue needs to fail incomplete Futures if the batch is marked with error.


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

Branch: refs/heads/TINKERPOP-575
Commit: fb26142425ea2560c1fcd3c00f63acd1d6210c73
Parents: 5b409c5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Mar 17 15:43:24 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Mar 17 17:01:36 2016 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/driver/ResultQueueTest.java  | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/fb261424/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ResultQueueTest.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ResultQueueTest.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ResultQueueTest.java
index 12f85ec..59be4ea 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ResultQueueTest.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ResultQueueTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.driver;
 
+import org.apache.commons.lang.exception.ExceptionUtils;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -141,22 +142,22 @@ public class ResultQueueTest extends AbstractResultQueueTest {
     }
 
     @Test
-    public void shouldAwaitEverythingAndFlushOnMarkError() throws Exception {
-        // not so sure this is good behavior (i.e. flushing whatever has arrived up to the error)
+    public void shouldAwaitFailTheFutureOnMarkError() throws Exception {
         final CompletableFuture<List<Result>> future = resultQueue.await(4);
         resultQueue.add(new Result("test1"));
         resultQueue.add(new Result("test2"));
         resultQueue.add(new Result("test3"));
 
         assertThat(future.isDone(), is(false));
-        resultQueue.markError(new Exception());
+        resultQueue.markError(new Exception("no worky"));
         assertThat(future.isDone(), is(true));
 
-        final List<Result> results = future.get();
-        assertEquals("test1", results.get(0).getString());
-        assertEquals("test2", results.get(1).getString());
-        assertEquals("test3", results.get(2).getString());
-        assertEquals(3, results.size());
+        try {
+            future.get();
+        } catch (Exception ex) {
+            final Throwable t = ExceptionUtils.getRootCause(ex);
+            assertEquals("no worky", t.getMessage());
+        }
     }
 
     @Test