GEODE-2632: fix ParallelQueueRemovalMessageJUnitTest

Fakes.cache() mocks GemFireCacheImpl without specifying a "when"
for getRegion(String). When that method is final, Mockito can't
override it, so it ends up calling getRegion(String, boolean)
which is overridden by the test. When it's non-final Mockito
overrides it but the test doesn't specify a "when" so the
getRegion(String) method becomes a no-op.

This change restores final on getRegion(String) and removes
@Ignore from the test.


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

Branch: refs/heads/feature/GEM-1299
Commit: b2493bf066f7743b5a297243ef118cba67fda685
Parents: e2ba308
Author: Kirk Lund <kl...@apache.org>
Authored: Wed Apr 26 11:03:44 2017 -0700
Committer: zhouxh <gz...@pivotal.io>
Committed: Wed Apr 26 23:28:49 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/geode/internal/cache/GemFireCacheImpl.java     | 2 +-
 .../cache/wan/parallel/ParallelQueueRemovalMessageJUnitTest.java   | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/b2493bf0/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index 74ec96c..978e863 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -3144,7 +3144,7 @@ public class GemFireCacheImpl
    * TODO: any changes to this method breaks 
ParallelQueueRemovalMessageJUnitTest
    */
   @Override
-  public Region getRegion(String path) {
+  public final Region getRegion(String path) {
     return getRegion(path, false);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/b2493bf0/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessageJUnitTest.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessageJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessageJUnitTest.java
index 1a8bbf3..b7ee5c8 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessageJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessageJUnitTest.java
@@ -26,7 +26,6 @@ import java.util.Set;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import jdk.nashorn.internal.ir.annotations.Ignore;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -62,7 +61,6 @@ import org.apache.geode.test.fake.Fakes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
-@Ignore() // minor changes to GemFireCacheImpl break this test
 public class ParallelQueueRemovalMessageJUnitTest {
 
   private static final String GATEWAY_SENDER_ID = "ny";

Reply via email to