geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject [28/40] geode git commit: GEODE-2632: fix ParallelQueueRemovalMessageJUnitTest
Date Thu, 27 Apr 2017 18:48:03 GMT
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/42a7d5f5
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/42a7d5f5
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/42a7d5f5

Branch: refs/heads/feature/GEM-1299
Commit: 42a7d5f5d96d2a804f8dfaecf54f5344e078a628
Parents: ba2a2d2
Author: Kirk Lund <klund@apache.org>
Authored: Wed Apr 26 11:03:44 2017 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Wed Apr 26 11:03:44 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/42a7d5f5/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/42a7d5f5/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";


Mime
View raw message