Repository: geode
Updated Branches:
  refs/heads/develop a6c28a65e -> 857cd292e


GEODE-2400: The WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest 
should return false for local callable
in negative case since there's no more remote message.


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

Branch: refs/heads/develop
Commit: 857cd292e8e5d52e5b7a367682e445552a3de25b
Parents: a6c28a6
Author: zhouxh <gz...@pivotal.io>
Authored: Wed Feb 8 23:02:51 2017 -0800
Committer: zhouxh <gz...@pivotal.io>
Committed: Wed Feb 8 23:06:18 2017 -0800

----------------------------------------------------------------------
 ...arallelGatewaySenderFlushedCoordinatorJUnitTest.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/857cd292/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest.java
index 8279130..d957f91 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest.java
@@ -60,7 +60,7 @@ public class 
WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest
         new WaitUntilParallelGatewaySenderFlushedCoordinator(this.sender, 
1000l,
             TimeUnit.MILLISECONDS, false);
     WaitUntilParallelGatewaySenderFlushedCoordinator coordinatorSpy = 
spy(coordinator);
-    doReturn(getSuccessfulCallables()).when(coordinatorSpy)
+    doReturn(getSuccessfulCallables(true)).when(coordinatorSpy)
         .buildWaitUntilBucketRegionQueueFlushedCallables(this.region);
     boolean result = coordinatorSpy.waitUntilFlushed();
     assertTrue(result);
@@ -84,7 +84,7 @@ public class 
WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest
         new WaitUntilParallelGatewaySenderFlushedCoordinator(this.sender, 
1000l,
             TimeUnit.MILLISECONDS, true);
     WaitUntilParallelGatewaySenderFlushedCoordinator coordinatorSpy = 
spy(coordinator);
-    doReturn(getSuccessfulCallables()).when(coordinatorSpy)
+    doReturn(getSuccessfulCallables(true)).when(coordinatorSpy)
         .buildWaitUntilBucketRegionQueueFlushedCallables(this.region);
     boolean result = coordinatorSpy.waitUntilFlushed();
     assertTrue(result);
@@ -96,18 +96,18 @@ public class 
WaitUntilParallelGatewaySenderFlushedCoordinatorJUnitTest
         new WaitUntilParallelGatewaySenderFlushedCoordinator(this.sender, 
1000l,
             TimeUnit.MILLISECONDS, true);
     WaitUntilParallelGatewaySenderFlushedCoordinator coordinatorSpy = 
spy(coordinator);
-    doReturn(getSuccessfulCallables()).when(coordinatorSpy)
+    doReturn(getSuccessfulCallables(false)).when(coordinatorSpy)
         .buildWaitUntilBucketRegionQueueFlushedCallables(this.region);
     boolean result = coordinatorSpy.waitUntilFlushed();
     assertFalse(result);
   }
 
-  private List<WaitUntilBucketRegionQueueFlushedCallable> 
getSuccessfulCallables()
-      throws Exception {
+  private List<WaitUntilBucketRegionQueueFlushedCallable> 
getSuccessfulCallables(
+      boolean expectedResult) throws Exception {
     List callables = new ArrayList();
     WaitUntilBucketRegionQueueFlushedCallable callable =
         mock(WaitUntilBucketRegionQueueFlushedCallable.class);
-    when(callable.call()).thenReturn(true);
+    when(callable.call()).thenReturn(expectedResult);
     callables.add(callable);
     return callables;
   }

Reply via email to