geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [19/54] [abbrv] geode git commit: GEODE-2632: change dependencies on GemFireCacheImpl to InternalCache
Date Mon, 01 May 2017 23:06:46 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/cache/query/internal/IndexManagerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/IndexManagerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/IndexManagerJUnitTest.java
index 929bd46..da439f0 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/IndexManagerJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/IndexManagerJUnitTest.java
@@ -12,8 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-/**
- */
 package org.apache.geode.cache.query.internal;
 
 import static org.junit.Assert.assertFalse;
@@ -42,18 +40,16 @@ import org.apache.geode.test.junit.categories.IntegrationTest;
 public class IndexManagerJUnitTest {
 
   @Before
-  public void setUp() throws java.lang.Exception {
+  public void setUp() throws Exception {
     CacheUtils.startCache();
     Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
     for (int i = 0; i < 4; i++) {
       region.put("" + i, new Portfolio(i));
-      // CacheUtils.log(new Portfolio(i));
     }
-
   }
 
   @After
-  public void tearDown() throws java.lang.Exception {
+  public void tearDown() throws Exception {
     CacheUtils.closeCache();
   }
 
@@ -66,7 +62,7 @@ public class IndexManagerJUnitTest {
    * start time, we can assume that it needs to be reevaluated
    */
   @Test
-  public void testSafeQueryTime() {
+  public void testSafeQueryTime() throws Exception {
     IndexManager.resetIndexBufferTime();
     // fake entry update at LMT of 0 and actual time of 10
     // safe query time set in index manager is going to be 20
@@ -103,7 +99,7 @@ public class IndexManagerJUnitTest {
 
   // Let's test for negative delta's or a system that is slower than others in the cluster
   @Test
-  public void testSafeQueryTimeForASlowNode() {
+  public void testSafeQueryTimeForASlowNode() throws Exception {
     IndexManager.resetIndexBufferTime();
     // fake entry update at LMT of 0 and actual time of 10
     // safe query time set in index manager is going to be -10
@@ -130,7 +126,6 @@ public class IndexManagerJUnitTest {
     assertFalse(IndexManager.needsRecalculation(212, 210));
   }
 
-
   @Test
   public void testBestIndexPick() throws Exception {
     QueryService qs;
@@ -140,7 +135,7 @@ public class IndexManagerJUnitTest {
     QCompiler compiler = new QCompiler();
     List list = compiler.compileFromClause("/portfolios pf");
     ExecutionContext context = new QueryExecutionContext(null, CacheUtils.getCache());
-    context.newScope(context.assosciateScopeID());
+    context.newScope(context.associateScopeID());
 
     Iterator iter = list.iterator();
     while (iter.hasNext()) {
@@ -171,7 +166,6 @@ public class IndexManagerJUnitTest {
     Assert.assertEquals(id2.getMapping()[0], 1);
     Assert.assertEquals(id2.getMapping()[1], 2);
     Assert.assertEquals(id2.getMapping()[2], 0);
-
   }
 
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryFromClauseCanonicalizationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryFromClauseCanonicalizationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryFromClauseCanonicalizationJUnitTest.java
index e625afe..c18e8cb 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryFromClauseCanonicalizationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryFromClauseCanonicalizationJUnitTest.java
@@ -162,7 +162,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     List list = compiler.compileFromClause("/pos pf");
     ExecutionContext context =
         new ExecutionContext(new Object[] {"bindkey"}, CacheUtils.getCache());
-    context.newScope(context.assosciateScopeID());
+    context.newScope(context.associateScopeID());
 
     Iterator iter = list.iterator();
     while (iter.hasNext()) {
@@ -177,7 +177,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     List args = new ArrayList();
     args.add(cl);
     CompiledOperation cop = new CompiledOperation(cp, "get", args);
-    StringBuffer sbuff = new StringBuffer();
+    StringBuilder sbuff = new StringBuilder();
     cop.generateCanonicalizedExpression(sbuff, context);
     assertEquals(sbuff.toString(), "iter1.positions.get('key1')");
 
@@ -187,7 +187,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     // args.add(cb);
     // cop = new CompiledOperation(cp, "get", args);
     //// context.setBindArguments(new Object[]{"bindkey"});
-    // sbuff = new StringBuffer();
+    // sbuff = new StringBuilder();
     // cop.generateCanonicalizedExpression(sbuff, context);
     // assertIndexDetailsEquals(sbuff.toString(),"iter1.positions.get('bindkey')");
     //
@@ -197,7 +197,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     // args = new ArrayList();
     // args.add(cb);
     // cop = new CompiledOperation(cp, "get", args);
-    // sbuff = new StringBuffer();
+    // sbuff = new StringBuilder();
     // cop.generateCanonicalizedExpression(sbuff, context);
     // assertIndexDetailsEquals(sbuff.toString(),"iter1.positions().get('bindkey')");
     //
@@ -207,7 +207,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     // args = new ArrayList();
     // args.add(cb);
     // cop = new CompiledOperation(cp, "get", args);
-    // sbuff = new StringBuffer();
+    // sbuff = new StringBuilder();
     // cop.generateCanonicalizedExpression(sbuff, context);
     // assertIndexDetailsEquals(sbuff.toString(),"iter1.positions.get('bindkey')");
 
@@ -216,7 +216,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     args = new ArrayList();
     args.add(cp1);
     cop = new CompiledOperation(cp, "get", args);
-    sbuff = new StringBuffer();
+    sbuff = new StringBuilder();
     cop.generateCanonicalizedExpression(sbuff, context);
     assertEquals(sbuff.toString(), "iter1.positions.get(iter1.pkid)");
 
@@ -224,7 +224,7 @@ public class QueryFromClauseCanonicalizationJUnitTest {
     cp = new CompiledPath(new CompiledID("pf"), "getPositions");
     cp1 = new CompiledPath(new CompiledID("pf"), "pkid");
     CompiledIndexOperation ciop = new CompiledIndexOperation(cp, cp1);
-    sbuff = new StringBuffer();
+    sbuff = new StringBuilder();
     ciop.generateCanonicalizedExpression(sbuff, context);
     assertEquals(sbuff.toString(), "iter1.positions[iter1.pkid]");
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryUtilsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryUtilsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryUtilsJUnitTest.java
index bb13665..bda8338 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryUtilsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryUtilsJUnitTest.java
@@ -91,7 +91,7 @@ public class QueryUtilsJUnitTest {
       QCompiler compiler = new QCompiler();
       List list = compiler.compileFromClause("/portfolio p, p.positions");
       ExecutionContext context = new ExecutionContext(null, CacheUtils.getCache());
-      context.newScope(context.assosciateScopeID());
+      context.newScope(context.associateScopeID());
       RuntimeIterator[] indexToItrMappping = new RuntimeIterator[1];
       RuntimeIterator expand = null;
       boolean set = false;
@@ -162,7 +162,7 @@ public class QueryUtilsJUnitTest {
       QCompiler compiler = new QCompiler();
       List list = compiler.compileFromClause("/portfolio p, p.positions, /employees e");
       ExecutionContext context = new ExecutionContext(null, CacheUtils.getCache());
-      context.newScope(context.assosciateScopeID());
+      context.newScope(context.associateScopeID());
       RuntimeIterator[] indexToItrMappping = new RuntimeIterator[1];
       RuntimeIterator expand[] = new RuntimeIterator[2];
       boolean set = false;

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
index 302a633..67ab9a4 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
@@ -12,9 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-/**
- * 
- */
 package org.apache.geode.cache.query.internal.index;
 
 import static org.junit.Assert.assertEquals;
@@ -52,15 +49,13 @@ import org.apache.geode.cache.query.internal.RuntimeIterator;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class RangeIndexAPIJUnitTest {
+
   private Region region = null;
 
   @Before
-  public void setUp() throws java.lang.Exception {
+  public void setUp() throws Exception {
     CacheUtils.startCache();
     IndexManager.ENABLE_UPDATE_IN_PROGRESS_INDEX_CALCULATION = false;
     region = CacheUtils.createRegion("portfolios", Portfolio.class);
@@ -77,7 +72,7 @@ public class RangeIndexAPIJUnitTest {
   }
 
   @After
-  public void tearDown() throws java.lang.Exception {
+  public void tearDown() throws Exception {
     IndexManager.ENABLE_UPDATE_IN_PROGRESS_INDEX_CALCULATION = true;
     CacheUtils.closeCache();
   }
@@ -132,8 +127,6 @@ public class RangeIndexAPIJUnitTest {
    * of RangeJunctionCondnEvaluator. Such null or undefined conditions are treated as separate
    * filter operands. This test checks the query method of Index which takes a set of keys which
    * need to be removed from the set
-   * 
-   * @throws Exception
    */
   @Test
   public void testQueryMethod_2() throws Exception {

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionEntryTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionEntryTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionEntryTest.java
index 2f372bc..63a7ba7 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionEntryTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionEntryTest.java
@@ -92,7 +92,7 @@ public class AbstractRegionEntryTest {
     }
 
     @Override
-    protected long getlastModifiedField() {
+    protected long getLastModifiedField() {
       return 0;
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
index be1df18..1fba56d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
@@ -45,6 +45,7 @@ import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.extension.ExtensionPoint;
 import org.apache.geode.internal.cache.extension.SimpleExtensionPoint;
@@ -78,7 +79,7 @@ public class AbstractRegionJUnitTest {
   private static class MockRegion extends AbstractRegion {
 
     /**
-     * @see AbstractRegion#AbstractRegion(GemFireCacheImpl, int, boolean, long, long)
+     * @see AbstractRegion#AbstractRegion(InternalCache, int, boolean, long, long)
      */
     @SuppressWarnings("deprecation")
     private MockRegion(GemFireCacheImpl cache, int serialNumber, boolean isPdxTypeRegion,
@@ -479,7 +480,7 @@ public class AbstractRegionJUnitTest {
     }
 
     @Override
-    protected DistributedMember getMyId() {
+    protected InternalDistributedMember getMyId() {
       throw new UnsupportedOperationException();
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
index 5d81724..caa2ce5 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
@@ -14,14 +14,11 @@
  */
 package org.apache.geode.internal.cache;
 
-import static junit.framework.TestCase.assertNotNull;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.filefilter.DirectoryFileFilter;
@@ -58,20 +55,15 @@ import java.util.Collections;
 import java.util.Properties;
 import java.util.Random;
 
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class BackupJUnitTest {
-  protected static GemFireCacheImpl cache = null;
-  protected static File TMP_DIR;
-  protected static File cacheXmlFile;
 
-  protected static DistributedSystem ds = null;
-  protected static Properties props = new Properties();
+  protected GemFireCacheImpl cache = null;
+  private File tmpDir;
+  protected File cacheXmlFile;
 
-  static {
-  }
+  protected DistributedSystem ds = null;
+  protected Properties props = new Properties();
 
   private File backupDir;
   private File[] diskDirs;
@@ -83,11 +75,11 @@ public class BackupJUnitTest {
 
   @Before
   public void setUp() throws Exception {
-    if (TMP_DIR == null) {
+    if (tmpDir == null) {
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
       String tmpDirName = System.getProperty("java.io.tmpdir");
-      TMP_DIR = tmpDirName == null ? new File("") : new File(tmpDirName);
+      tmpDir = new File(tmpDirName == null ? "" : tmpDirName);
       try {
         URL url = BackupJUnitTest.class.getResource("BackupJUnitTest.cache.xml");
         cacheXmlFile = new File(url.toURI().getPath());
@@ -100,12 +92,12 @@ public class BackupJUnitTest {
 
     createCache();
 
-    backupDir = new File(TMP_DIR, getName() + "backup_Dir");
+    backupDir = new File(tmpDir, getName() + "backup_Dir");
     backupDir.mkdir();
     diskDirs = new File[2];
-    diskDirs[0] = new File(TMP_DIR, getName() + "_diskDir1");
+    diskDirs[0] = new File(tmpDir, getName() + "_diskDir1");
     diskDirs[0].mkdir();
-    diskDirs[1] = new File(TMP_DIR, getName() + "_diskDir2");
+    diskDirs[1] = new File(tmpDir, getName() + "_diskDir2");
     diskDirs[1].mkdir();
   }
 
@@ -134,8 +126,7 @@ public class BackupJUnitTest {
     backupAndRecover(new RegionCreator() {
       public Region createRegion() {
         DiskStoreImpl ds = createDiskStore();
-        Region region = BackupJUnitTest.this.createRegion();
-        return region;
+        return BackupJUnitTest.this.createRegion();
       }
     });
   }
@@ -151,8 +142,7 @@ public class BackupJUnitTest {
         DiskWriteAttributesFactory daf = new DiskWriteAttributesFactory();
         daf.setMaxOplogSize(1);
         rf.setDiskWriteAttributes(daf.create());
-        Region region = rf.create("region");
-        return region;
+        return rf.create("region");
       }
     });
   }
@@ -189,7 +179,7 @@ public class BackupJUnitTest {
     // restore the deleted entry.
     region.put(2047, getBytes(2047));
 
-    for (DiskStoreImpl store : cache.listDiskStoresIncludingRegionOwned()) {
+    for (DiskStore store : cache.listDiskStoresIncludingRegionOwned()) {
       store.flush();
     }
 
@@ -400,7 +390,7 @@ public class BackupJUnitTest {
     while ((line = br.readLine()) != null) {
       System.out.println("OUTPUT:" + line);
       // TODO validate output
-    } ;
+    }
 
     int result = process.waitFor();
     boolean isWindows = script.getName().endsWith("bat");
@@ -420,8 +410,7 @@ public class BackupJUnitTest {
     RegionFactory rf = new RegionFactory();
     rf.setDiskStoreName("diskStore");
     rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-    Region region = rf.create("region");
-    return region;
+    return rf.create("region");
   }
 
   private Region createOverflowRegion() {
@@ -430,12 +419,11 @@ public class BackupJUnitTest {
     rf.setEvictionAttributes(
         EvictionAttributes.createLIFOEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK));
     rf.setDataPolicy(DataPolicy.NORMAL);
-    Region region = rf.create("region");
-    return region;
+    return rf.create("region");
   }
 
   private DiskStore findDiskStore() {
-    return this.cache.findDiskStore("diskStore");
+    return cache.findDiskStore("diskStore");
   }
 
   private DiskStoreImpl createDiskStore() {
@@ -443,12 +431,11 @@ public class BackupJUnitTest {
     dsf.setDiskDirs(diskDirs);
     dsf.setMaxOplogSize(1);
     String name = "diskStore";
-    DiskStoreImpl ds = (DiskStoreImpl) dsf.create(name);
-    return ds;
+    return (DiskStoreImpl) dsf.create(name);
   }
 
-  private static interface RegionCreator {
-    public Region createRegion();
+  private interface RegionCreator {
+    Region createRegion();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/CacheLifecycleListenerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/CacheLifecycleListenerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/CacheLifecycleListenerJUnitTest.java
index 02eaf06..995de03 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/CacheLifecycleListenerJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/CacheLifecycleListenerJUnitTest.java
@@ -41,23 +41,19 @@ public class CacheLifecycleListenerJUnitTest {
 
   @Test
   public void testRemoveNonExistent() throws Exception {
-    final List<CacheLifecycleCallback> cacheCreatedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final List<CacheLifecycleCallback> cacheClosedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final TestCacheLifecycleListener listener =
+    List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<>();
+    List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<>();
+    TestCacheLifecycleListener listener =
         new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
     GemFireCacheImpl.removeCacheLifecycleListener(listener);
   }
 
   @Test
   public void testCallbacks() throws Exception {
-    final List<CacheLifecycleCallback> cacheCreatedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final List<CacheLifecycleCallback> cacheClosedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
+    List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<>();
+    List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<>();
 
-    final TestCacheLifecycleListener listener =
+    TestCacheLifecycleListener listener =
         new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
     try {
       GemFireCacheImpl.addCacheLifecycleListener(listener);
@@ -67,11 +63,11 @@ public class CacheLifecycleListenerJUnitTest {
       // assert no close callback
       assertTrue(cacheClosedCallbacks.isEmpty());
 
-      final Properties props = new Properties();
+      Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
 
-      final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create();
+      InternalCache cache = (InternalCache) new CacheFactory(props).create();
       try {
         // assert one create callback
         assertFalse(cacheCreatedCallbacks.isEmpty());
@@ -98,12 +94,10 @@ public class CacheLifecycleListenerJUnitTest {
 
   @Test
   public void testRemoveBeforeCreate() throws Exception {
-    final List<CacheLifecycleCallback> cacheCreatedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final List<CacheLifecycleCallback> cacheClosedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
+    List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<>();
+    List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<>();
 
-    final TestCacheLifecycleListener listener =
+    TestCacheLifecycleListener listener =
         new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
     try {
       GemFireCacheImpl.addCacheLifecycleListener(listener);
@@ -114,11 +108,11 @@ public class CacheLifecycleListenerJUnitTest {
       // assert no close callback
       assertTrue(cacheClosedCallbacks.isEmpty());
 
-      final Properties props = new Properties();
+      Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
 
-      final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create();
+      InternalCache cache = (InternalCache) new CacheFactory(props).create();
       try {
         // assert no create callback
         assertTrue(cacheCreatedCallbacks.isEmpty());
@@ -139,12 +133,10 @@ public class CacheLifecycleListenerJUnitTest {
 
   @Test
   public void testRemoveBeforeClose() throws Exception {
-    final List<CacheLifecycleCallback> cacheCreatedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final List<CacheLifecycleCallback> cacheClosedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
+    List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<>();
+    List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<>();
 
-    final TestCacheLifecycleListener listener =
+    TestCacheLifecycleListener listener =
         new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
     try {
       GemFireCacheImpl.addCacheLifecycleListener(listener);
@@ -154,11 +146,11 @@ public class CacheLifecycleListenerJUnitTest {
       // assert no close callback
       assertTrue(cacheClosedCallbacks.isEmpty());
 
-      final Properties props = new Properties();
+      Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
 
-      final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create();
+      InternalCache cache = (InternalCache) new CacheFactory(props).create();
       try {
         // assert one create callback
         assertFalse(cacheCreatedCallbacks.isEmpty());
@@ -184,12 +176,10 @@ public class CacheLifecycleListenerJUnitTest {
 
   @Test
   public void testCallbacksRepeat() throws Exception {
-    final List<CacheLifecycleCallback> cacheCreatedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final List<CacheLifecycleCallback> cacheClosedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
+    List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<>();
+    List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<>();
 
-    final TestCacheLifecycleListener listener =
+    TestCacheLifecycleListener listener =
         new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
     try {
       GemFireCacheImpl.addCacheLifecycleListener(listener);
@@ -199,11 +189,11 @@ public class CacheLifecycleListenerJUnitTest {
       // assert no close callback
       assertTrue(cacheClosedCallbacks.isEmpty());
 
-      final Properties props = new Properties();
+      Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
 
-      final GemFireCacheImpl cache1 = (GemFireCacheImpl) new CacheFactory(props).create();
+      InternalCache cache1 = (InternalCache) new CacheFactory(props).create();
       try {
         // assert one create callback
         assertFalse(cacheCreatedCallbacks.isEmpty());
@@ -224,7 +214,7 @@ public class CacheLifecycleListenerJUnitTest {
       assertEquals(1, cacheClosedCallbacks.size());
       assertEquals(cache1, cacheClosedCallbacks.get(0).getCache());
 
-      final GemFireCacheImpl cache2 = (GemFireCacheImpl) new CacheFactory(props).create();
+      InternalCache cache2 = (InternalCache) new CacheFactory(props).create();
       try {
         // assert two create callback
         assertFalse(cacheCreatedCallbacks.isEmpty());
@@ -256,23 +246,21 @@ public class CacheLifecycleListenerJUnitTest {
 
   @Test
   public void testAddAfterCreate() throws Exception {
-    final List<CacheLifecycleCallback> cacheCreatedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
-    final List<CacheLifecycleCallback> cacheClosedCallbacks =
-        new ArrayList<CacheLifecycleCallback>();
+    List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<>();
+    List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<>();
 
-    final TestCacheLifecycleListener listener =
+    TestCacheLifecycleListener listener =
         new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
     // assert no create callback
     assertTrue(cacheCreatedCallbacks.isEmpty());
     // assert no close callback
     assertTrue(cacheClosedCallbacks.isEmpty());
 
-    final Properties props = new Properties();
+    Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
 
-    final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create();
+    InternalCache cache = (InternalCache) new CacheFactory(props).create();
     try {
       try {
         // assert no create callback
@@ -296,25 +284,23 @@ public class CacheLifecycleListenerJUnitTest {
     }
   }
 
-  private static final class CacheLifecycleCallback {
+  private static class CacheLifecycleCallback {
 
-    private final GemFireCacheImpl cache;
-    private final long timeStamp;
+    private InternalCache cache;
 
-    CacheLifecycleCallback(GemFireCacheImpl cache) {
+    CacheLifecycleCallback(InternalCache cache) {
       this.cache = cache;
-      this.timeStamp = System.currentTimeMillis();
     }
 
-    GemFireCacheImpl getCache() {
+    InternalCache getCache() {
       return this.cache;
     }
   }
 
-  private static final class TestCacheLifecycleListener implements CacheLifecycleListener {
+  private static class TestCacheLifecycleListener implements CacheLifecycleListener {
 
-    private final List<CacheLifecycleCallback> cacheCreatedCallbacks;
-    private final List<CacheLifecycleCallback> cacheClosedCallbacks;
+    private List<CacheLifecycleCallback> cacheCreatedCallbacks;
+    private List<CacheLifecycleCallback> cacheClosedCallbacks;
 
     TestCacheLifecycleListener(List<CacheLifecycleCallback> cacheCreatedCallbacks,
         List<CacheLifecycleCallback> cacheClosedCallbacks) {
@@ -323,12 +309,12 @@ public class CacheLifecycleListenerJUnitTest {
     }
 
     @Override
-    public void cacheCreated(GemFireCacheImpl cache) {
+    public void cacheCreated(InternalCache cache) {
       this.cacheCreatedCallbacks.add(new CacheLifecycleCallback(cache));
     }
 
     @Override
-    public void cacheClosed(GemFireCacheImpl cache) {
+    public void cacheClosed(InternalCache cache) {
       this.cacheClosedCallbacks.add(new CacheLifecycleCallback(cache));
     }
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
index 5333726..913d56d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
@@ -12,9 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-/**
- * DiskRegionTestingBase: This class is extended to write more JUnit tests for Disk Regions.
- */
 package org.apache.geode.internal.cache;
 
 import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_TIME_STATISTICS;
@@ -51,6 +48,8 @@ import java.util.Iterator;
 import java.util.Properties;
 
 /**
+ * DiskRegionTestingBase: This class is extended to write more JUnit tests for Disk Regions.
+ * <p>
  * All disk region unit tests extend this base class , common method to be used in all tests are
  * present here.
  * 
@@ -144,14 +143,14 @@ public abstract class DiskRegionTestingBase {
             root.localDestroyRegion("teardown");
             logWriter.info(
                 "<ExpectedException action=remove>RegionDestroyedException</ExpectedException>");
-          } catch (RegionDestroyedException e) {
+          } catch (RegionDestroyedException ignore) {
             // ignore
           }
         }
       }
 
-      for (DiskStoreImpl dstore : ((GemFireCacheImpl) cache).listDiskStoresIncludingRegionOwned()) {
-        dstore.waitForClose();
+      for (DiskStore dstore : ((InternalCache) cache).listDiskStoresIncludingRegionOwned()) {
+        ((DiskStoreImpl) dstore).waitForClose();
       }
     } finally {
       closeCache();
@@ -216,7 +215,7 @@ public abstract class DiskRegionTestingBase {
             ioe = e;
             try {
               Thread.sleep(1000);
-            } catch (Exception igore) {
+            } catch (Exception ignore) {
             }
           }
         }
@@ -253,7 +252,7 @@ public abstract class DiskRegionTestingBase {
    */
   protected void put100Int() {
     for (int i = 0; i < 100; i++) {
-      region.put(new Integer(i), new Integer(i));
+      region.put(i, i);
     }
   }
 
@@ -266,7 +265,7 @@ public abstract class DiskRegionTestingBase {
       assertEquals(100, region.size());
     }
     for (int i = 0; i < 100; i++) {
-      Integer key = new Integer(i);
+      Integer key = i;
       assertTrue(region.containsKey(key));
       assertEquals(key, region.get(key));
     }
@@ -278,7 +277,7 @@ public abstract class DiskRegionTestingBase {
   protected void putTillOverFlow(Region region) {
     int i = 0;
     for (i = 0; i < 1010; i++) {
-      region.put(new Integer(i + 200), new Integer(i + 200));
+      region.put(i + 200, i + 200);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
index 0dbe75f..ee3d7f7 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
@@ -14,31 +14,29 @@
  */
 package org.apache.geode.internal.cache;
 
-import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.file.Files;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
-import org.apache.geode.internal.ClassPathLoader;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import java.util.regex.Pattern;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.filefilter.DirectoryFileFilter;
 import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.admin.AdminDistributedSystem;
 import org.apache.geode.admin.AdminDistributedSystemFactory;
 import org.apache.geode.admin.AdminException;
@@ -47,6 +45,7 @@ import org.apache.geode.admin.DistributedSystemConfig;
 import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.DiskStore;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.RegionShortcut;
@@ -54,8 +53,8 @@ import org.apache.geode.cache.persistence.PersistentID;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.ClassBuilder;
+import org.apache.geode.internal.ClassPathLoader;
 import org.apache.geode.internal.DeployedJar;
-import org.apache.geode.internal.JarDeployer;
 import org.apache.geode.internal.cache.persistence.BackupManager;
 import org.apache.geode.internal.util.IOUtils;
 import org.apache.geode.internal.util.TransformUtils;
@@ -68,22 +67,6 @@ import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.file.Files;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
 
 /**
  * Tests for the incremental backup feature.
@@ -104,12 +87,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
   /**
    * End value for data load.
    */
-  private int dataEnd = dataStart + DATA_INCREMENT;
+  private int dataEnd = this.dataStart + DATA_INCREMENT;
 
   /**
    * Regular expression used to search for member operation log files.
    */
-  private final static String OPLOG_REGEX = ".*\\.[kdc]rf$";
+  private static final String OPLOG_REGEX = ".*\\.[kdc]rf$";
 
   /**
    * Creates test regions for a member.
@@ -123,22 +106,18 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
       getRegionFactory(cache).setDiskStoreName("fooStore").create("fooRegion");
       getRegionFactory(cache).setDiskStoreName("barStore").create("barRegion");
     }
-
   };
 
-  protected RegionFactory<Integer, String> getRegionFactory(Cache cache) {
+  private RegionFactory<Integer, String> getRegionFactory(Cache cache) {
     return cache.createRegionFactory(RegionShortcut.PARTITION_PERSISTENT);
   }
 
   /**
    * A FileFilter that looks for a timestamped gemfire backup directory.
    */
-  private final static FileFilter backupDirFilter = new FileFilter() {
-    @Override
-    public boolean accept(File file) {
-      // This will break in about 90 years...
-      return (file.isDirectory() && file.getName().startsWith("20"));
-    }
+  private static final FileFilter backupDirFilter = file -> {
+    // This will break in about 90 years...
+    return file.isDirectory() && file.getName().startsWith("20");
   };
 
   /**
@@ -213,7 +192,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
   @SuppressWarnings("unchecked")
   private Set<PersistentID> getMissingMembers(VM vm) {
     return (Set<PersistentID>) vm.invoke(new SerializableCallable("getMissingMembers") {
-
+      @Override
       public Object call() {
         return AdminDistributedSystemImpl
             .getMissingPersistentMembers(getSystem().getDistributionManager());
@@ -229,7 +208,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    */
   private BackupStatus baseline(VM vm) {
     return (BackupStatus) vm.invoke(new SerializableCallable("Backup all members.") {
-
+      @Override
       public Object call() {
         DistributedSystemConfig config;
         AdminDistributedSystem adminDS = null;
@@ -258,7 +237,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    */
   private BackupStatus incremental(VM vm) {
     return (BackupStatus) vm.invoke(new SerializableCallable("Backup all members.") {
-
+      @Override
       public Object call() {
         DistributedSystemConfig config;
         AdminDistributedSystem adminDS = null;
@@ -287,7 +266,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    */
   private BackupStatus incremental2(VM vm) {
     return (BackupStatus) vm.invoke(new SerializableCallable("Backup all members.") {
-
+      @Override
       public Object call() {
         DistributedSystemConfig config;
         AdminDistributedSystem adminDS = null;
@@ -343,23 +322,17 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    * @return a PersistentID for a member's disk store.
    */
   private PersistentID getPersistentID(final VM vm, final String diskStoreName) {
-    final PersistentID id = (PersistentID) vm.invoke(new SerializableCallable() {
-      @Override
-      public Object call() {
-        PersistentID id = null;
-        Collection<DiskStoreImpl> diskStores = ((GemFireCacheImpl) getCache()).listDiskStores();
-        for (DiskStoreImpl diskStore : diskStores) {
-          if (diskStore.getName().equals(diskStoreName)) {
-            id = diskStore.getPersistentID();
-            break;
-          }
+    return vm.invoke(() -> {
+      PersistentID id = null;
+      Collection<DiskStore> diskStores = ((InternalCache) getCache()).listDiskStores();
+      for (DiskStore diskStore : diskStores) {
+        if (diskStore.getName().equals(diskStoreName)) {
+          id = ((DiskStoreImpl) diskStore).getPersistentID();
+          break;
         }
-
-        return id;
       }
+      return id;
     });
-
-    return id;
   }
 
   /**
@@ -380,22 +353,19 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    *        disconnected).
    */
   private PersistentID disconnect(final VM disconnectVM, final VM testVM) {
-    final PersistentID id = (PersistentID) disconnectVM.invoke(new SerializableCallable() {
-      @Override
-      public Object call() {
-        PersistentID id = null;
-        Collection<DiskStoreImpl> diskStores = ((GemFireCacheImpl) getCache()).listDiskStores();
-        for (DiskStoreImpl diskStore : diskStores) {
-          if (diskStore.getName().equals("fooStore")) {
-            id = diskStore.getPersistentID();
-            break;
-          }
+    final PersistentID id = disconnectVM.invoke(() -> {
+      PersistentID persistentID = null;
+      Collection<DiskStore> diskStores = ((InternalCache) getCache()).listDiskStores();
+      for (DiskStore diskStore : diskStores) {
+        if (diskStore.getName().equals("fooStore")) {
+          persistentID = ((DiskStoreImpl) diskStore).getPersistentID();
+          break;
         }
+      }
 
-        getSystem().disconnect();
+      getSystem().disconnect();
 
-        return id;
-      }
+      return persistentID;
     });
 
     final Set<PersistentID> missingMembers = new HashSet<>();
@@ -405,7 +375,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
         missingMembers.clear();
         missingMembers.addAll(getMissingMembers(testVM));
 
-        return (missingMembers.contains(id));
+        return missingMembers.contains(id);
       }
 
       @Override
@@ -423,7 +393,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    * @param vm a member of the distributed system.
    */
   private void openCache(VM vm) {
-    vm.invoke(createRegions);
+    vm.invoke(this.createRegions);
   }
 
   /**
@@ -435,15 +405,14 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     vm.invoke(new SerializableRunnable() {
       @Override
       public void run() {
-        Collection<DiskStoreImpl> backupInProgress =
-            ((GemFireCacheImpl) getCache()).listDiskStores();
+        Collection<DiskStore> backupInProgress = ((InternalCache) getCache()).listDiskStores();
         List<DiskStoreImpl> backupCompleteList = new LinkedList<>();
 
         while (backupCompleteList.size() < backupInProgress.size()) {
-          for (DiskStoreImpl diskStore : backupInProgress) {
-            if ((null == diskStore.getInProgressBackup())
-                && (!backupCompleteList.contains(diskStore))) {
-              backupCompleteList.add(diskStore);
+          for (DiskStore diskStore : backupInProgress) {
+            if (((DiskStoreImpl) diskStore).getInProgressBackup() == null
+                && !backupCompleteList.contains(diskStore)) {
+              backupCompleteList.add((DiskStoreImpl) diskStore);
             }
           }
         }
@@ -470,9 +439,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
   }
 
   /**
-   * Peforms a second incremental backup.
-   * 
-   * @return
+   * Performs a second incremental backup.
    */
   private BackupStatus performIncremental2() {
     return incremental2(Host.getHost(0).getVM(1));
@@ -519,7 +486,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     File[] memberDirs = dateDirs[0].listFiles(new FileFilter() {
       @Override
       public boolean accept(File file) {
-        return (file.isDirectory() && (file.getName().contains(memberId)));
+        return file.isDirectory() && file.getName().contains(memberId);
       }
     });
 
@@ -546,9 +513,8 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    * 
    * @param command a shell command.
    * @return the exit value of processing the shell command.
-   * @throws Exception bad, really bad.
    */
-  private int execute(String command) throws Exception {
+  private int execute(String command) throws IOException, InterruptedException {
     final ProcessBuilder builder = new ProcessBuilder(command);
     builder.redirectErrorStream(true);
     final Process process = builder.start();
@@ -559,11 +525,11 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     new Thread(new Runnable() {
       @Override
       public void run() {
-        BufferedReader reader = null;
 
         try {
-          reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
-          String line = null;
+          BufferedReader reader =
+              new BufferedReader(new InputStreamReader(process.getInputStream()));
+          String line;
 
           do {
             line = reader.readLine();
@@ -572,7 +538,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
 
           reader.close();
         } catch (IOException e) {
-          log("Excecute: error while reading standard in: " + e.getMessage());
+          log("Execute: error while reading standard in: " + e.getMessage());
         }
       }
     }).start();
@@ -583,11 +549,10 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     new Thread(new Runnable() {
       @Override
       public void run() {
-        BufferedReader reader = null;
-
         try {
-          reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
-          String line = null;
+          BufferedReader reader =
+              new BufferedReader(new InputStreamReader(process.getErrorStream()));
+          String line;
 
           do {
             line = reader.readLine();
@@ -608,7 +573,8 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    * 
    * @param backupDir the member's backup directory containing the restore script.
    */
-  private void performRestore(File memberDir, File backupDir) throws Exception {
+  private void performRestore(File memberDir, File backupDir)
+      throws IOException, InterruptedException {
     /*
      * The restore script will not restore if there is an if file in the copy to directory. Remove
      * these files first.
@@ -699,7 +665,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
   @Override
   public final void postSetUp() throws Exception {
     createDataRegions();
-    createRegions.run();
+    this.createRegions.run();
     loadMoreData();
 
     log("Data region created and populated.");
@@ -720,8 +686,6 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    * present in both the baseline and member's disk store should not be copied during the
    * incremental backup. Additionally, the restore script should reference and copy operation logs
    * from the baseline backup.
-   * 
-   * @throws Exception
    */
   @Test
   public void testIncrementalBackup() throws Exception {
@@ -900,7 +864,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
       public boolean done() {
         missingMembers.clear();
         missingMembers.addAll(getMissingMembers(Host.getHost(0).getVM(1)));
-        return (!missingMembers.contains(missingMember));
+        return !missingMembers.contains(missingMember);
       }
 
       @Override
@@ -1028,13 +992,14 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
      * Custom incremental backup callable that retrieves the current baseline before deletion.
      */
     SerializableCallable callable = new SerializableCallable("Backup all members.") {
-      private File baselineDir = getBaselineBackupDir();
+      private final File baselineDir = getBaselineBackupDir();
 
+      @Override
       public Object call() {
-        DistributedSystemConfig config;
         AdminDistributedSystem adminDS = null;
         try {
-          config = AdminDistributedSystemFactory.defineDistributedSystem(getSystem(), "");
+          DistributedSystemConfig config =
+              AdminDistributedSystemFactory.defineDistributedSystem(getSystem(), "");
           adminDS = AdminDistributedSystemFactory.getDistributedSystem(config);
           adminDS.connect();
           return adminDS.backupAllMembers(getIncrementalDir(), this.baselineDir);
@@ -1079,8 +1044,6 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * Successful if a user deployed jar file is included as part of the backup.
-   * 
-   * @throws Exception
    */
   @Test
   public void testBackupUserDeployedJarFiles() throws Exception {
@@ -1094,13 +1057,10 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Deploy a "dummy" jar to the VM.
      */
-    File deployedJarFile = (File) vm0.invoke(new SerializableCallable() {
-      @Override
-      public Object call() throws Exception {
-        DeployedJar deployedJar =
-            ClassPathLoader.getLatest().getJarDeployer().deploy(jarName, classBytes);
-        return deployedJar.getFile();
-      }
+    File deployedJarFile = vm0.invoke(() -> {
+      DeployedJar deployedJar =
+          ClassPathLoader.getLatest().getJarDeployer().deploy(jarName, classBytes);
+      return deployedJar.getFile();
     });
 
     assertTrue(deployedJarFile.exists());
@@ -1124,12 +1084,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Get the VM's user directory.
      */
-    final String vmDir = (String) vm0.invoke(new SerializableCallable() {
-      @Override
-      public Object call() throws Exception {
-        return System.getProperty("user.dir");
-      }
-    });
+    final String vmDir = vm0.invoke(() -> System.getProperty("user.dir"));
 
     File backupDir = getBackupDirForMember(getBaselineDir(), getMemberId(vm0));
 
@@ -1138,7 +1093,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Cleanup "dummy" jar from file system.
      */
-    Pattern pattern = Pattern.compile("^" + jarName + ".*#\\d++$");
+    Pattern pattern = Pattern.compile('^' + jarName + ".*#\\d++$");
     deleteMatching(new File("."), pattern);
 
     // Execute the restore
@@ -1179,7 +1134,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Cleanup "dummy" jar from file system.
      */
-    pattern = Pattern.compile("^" + jarName + ".*#\\d++$");
+    pattern = Pattern.compile('^' + jarName + ".*#\\d++$");
     deleteMatching(new File(vmDir), pattern);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCacheCloseDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
index 81e9794..4027680 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
@@ -148,7 +148,7 @@ public class PartitionedRegionCacheCloseDUnitTest extends PartitionedRegionDUnit
 
           public void run2() {
 
-            Cache cache = getCache();
+            InternalCache cache = (InternalCache) getCache();
             LogWriter logger = cache.getLogger();
 
             final Region root = PartitionedRegionHelper.getPRRoot(cache);

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java
index 9b8f400..692515e 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java
@@ -561,7 +561,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
     registerPrRegion = new CacheSerializableRunnable("register") {
       @Override
       public void run2() throws CacheException {
-        Cache cache = getCache();
+        InternalCache cache = (InternalCache) getCache();
         Region root = PartitionedRegionHelper.getPRRoot(cache);
         // Region allPartitionedRegions = PartitionedRegionHelper
         // .getPRConfigRegion(root, cache);

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java
index c22c68d..a38a3d9 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java
@@ -195,7 +195,7 @@ public class PartitionedRegionDestroyDUnitTest extends PartitionedRegionDUnitTes
 
           public void run2() throws CacheException {
 
-            Cache cache = getCache();
+            InternalCache cache = getCache();
             Region rootRegion = PartitionedRegionHelper.getPRRoot(cache);
             // Region allPRs = PartitionedRegionHelper.getPRConfigRegion(rootRegion,
             // getCache());

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
index 9364390..0d69fa6 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
@@ -124,8 +124,8 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends PartitionedR
       private static final long serialVersionUID = 1L;
 
       public void run() {
-        Cache c = getCache();
-        Region rootReg = PartitionedRegionHelper.getPRRoot(c);
+        InternalCache cache = (InternalCache) getCache();
+        Region rootReg = PartitionedRegionHelper.getPRRoot(cache);
         rootReg.getAttributesMutator()
             .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
       }
@@ -144,8 +144,8 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends PartitionedR
 
           public void run() {
             try {
-              Cache c = getCache();
-              Region rootReg = PartitionedRegionHelper.getPRRoot(c);
+              InternalCache cache = getCache();
+              Region rootReg = PartitionedRegionHelper.getPRRoot(cache);
               CacheListener[] cls = rootReg.getAttributes().getCacheListeners();
               assertEquals(2, cls.length);
               CertifiableTestCacheListener ctcl = (CertifiableTestCacheListener) cls[1];
@@ -256,7 +256,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends PartitionedR
     SerializableRunnable validator =
         new CacheSerializableRunnable("validateNodeFailMetaDataCleanUp") {
           public void run2() throws CacheException {
-            Cache cache = getCache();
+            InternalCache cache = getCache();
             Region rootReg = PartitionedRegionHelper.getPRRoot(cache);
             CacheListener[] cls = rootReg.getAttributes().getCacheListeners();
             assertEquals(2, cls.length);

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
index f19ba1c..169e270 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
@@ -153,7 +153,7 @@ public class PartitionedRegionQueryEvaluatorIntegrationTest {
   }
 
   private void clearAllPartitionedRegion(PartitionedRegion pr) {
-    Cache cache = pr.getCache();
+    InternalCache cache = pr.getCache();
     Region allPR = PartitionedRegionHelper.getPRRoot(cache);
     allPR.clear();
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java
index 2824d74..18bc2a1 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java
@@ -37,7 +37,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 public class PartitionedRegionTestHelper
 
 {
-  static Cache cache = null;
+  static InternalCache cache = null;
 
   /**
    * This method creates a partitioned region with all the default values. The cache created is a
@@ -194,18 +194,18 @@ public class PartitionedRegionTestHelper
    * 
    * @return
    */
-  public static synchronized Cache createCache() {
+  public static synchronized InternalCache createCache() {
     if (cache == null) {
       Properties dsp = new Properties();
       dsp.setProperty(MCAST_PORT, "0");
       dsp.setProperty(LOCATORS, "");
       DistributedSystem sys = DistributedSystem.connect(dsp);
       try {
-        cache = CacheFactory.create(sys);
+        cache = (InternalCache) CacheFactory.create(sys);
       } catch (CacheExistsException exp) {
-        cache = CacheFactory.getInstance(sys);
+        cache = (InternalCache) CacheFactory.getInstance(sys);
       } catch (RegionExistsException rex) {
-        cache = CacheFactory.getInstance(sys);
+        cache = (InternalCache) CacheFactory.getInstance(sys);
       }
     }
     return cache;

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
index 2e6225b..8eecaec 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/TXManagerImplTest.java
@@ -51,7 +51,7 @@ public class TXManagerImplTest {
 
   @Before
   public void setUp() {
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     dm = mock(DistributionManager.class);
     txMgr = new TXManagerImpl(mock(CachePerfStats.class), cache);
     txid = new TXId(null, 0);

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
index b802b8e..2f0d138 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
@@ -19,6 +19,7 @@ import static org.junit.Assert.*;
 
 import java.util.Properties;
 
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -37,7 +38,7 @@ import org.apache.geode.test.junit.categories.IntegrationTest;
 @Category({IntegrationTest.class, ClientSubscriptionTest.class})
 public class BlockingHARegionJUnitTest {
 
-  private static Cache cache = null;
+  private static InternalCache cache = null;
 
   /** boolean to record an exception occurence in another thread **/
   private static volatile boolean exceptionOccured = false;
@@ -53,7 +54,7 @@ public class BlockingHARegionJUnitTest {
     if (cache != null) {
       cache.close(); // fault tolerance
     }
-    cache = CacheFactory.create(DistributedSystem.connect(props));
+    cache = (InternalCache) CacheFactory.create(DistributedSystem.connect(props));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAExpiryDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAExpiryDUnitTest.java
index e568896..3dda4c8 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAExpiryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAExpiryDUnitTest.java
@@ -18,6 +18,7 @@ import static org.junit.Assert.*;
 
 import java.util.Properties;
 
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -65,7 +66,7 @@ public class HAExpiryDUnitTest extends JUnit4DistributedTestCase {
 
   VM vm3 = null;
 
-  protected static Cache cache = null;
+  protected static InternalCache cache = null;
 
   static String regionQueueName = "regionQueue1";
 
@@ -227,7 +228,7 @@ public class HAExpiryDUnitTest extends JUnit4DistributedTestCase {
     assertNotNull(ds);
     ds.disconnect();
     ds = getSystem(props);
-    cache = CacheFactory.create(ds);
+    cache = (InternalCache) CacheFactory.create(ds);
     assertNotNull(cache);
   }
 
@@ -242,7 +243,7 @@ public class HAExpiryDUnitTest extends JUnit4DistributedTestCase {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
-    CacheListener serverListener = new vmListener();
+    CacheListener serverListener = new VMListener();
     factory.setCacheListener(serverListener);
     RegionAttributes attrs = factory.create();
     cache.createRegion(REGION_NAME, attrs);
@@ -255,24 +256,22 @@ public class HAExpiryDUnitTest extends JUnit4DistributedTestCase {
       cache.getDistributedSystem().disconnect();
     }
   }
-}
-
-
-/**
- * This listener performs the put of Conflatable object in the regionqueue.
- */
 
-class vmListener extends CacheListenerAdapter {
-  public void afterCreate(EntryEvent event) {
-    Cache cache = event.getRegion().getCache();
-    HARegion regionForQueue = (HARegion) cache.getRegion(
-        Region.SEPARATOR + HARegionQueue.createRegionName(HAExpiryDUnitTest.regionQueueName));
-    HARegionQueue regionqueue = regionForQueue.getOwner();
-    try {
-      regionqueue.put(new ConflatableObject(event.getKey(), event.getNewValue(),
-          new EventID(new byte[] {1}, 1, 1), false, "region1"));
-    } catch (Exception e) {
-      e.printStackTrace();
+  /**
+   * This listener performs the put of Conflatable object in the regionqueue.
+   */
+  static class VMListener extends CacheListenerAdapter {
+    public void afterCreate(EntryEvent event) {
+      Cache cache = event.getRegion().getCache();
+      HARegion regionForQueue = (HARegion) cache.getRegion(
+          Region.SEPARATOR + HARegionQueue.createRegionName(HAExpiryDUnitTest.regionQueueName));
+      HARegionQueue regionqueue = regionForQueue.getOwner();
+      try {
+        regionqueue.put(new ConflatableObject(event.getKey(), event.getNewValue(),
+            new EventID(new byte[] {1}, 1, 1), false, "region1"));
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
index 27777e1..c2e778e 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Properties;
 
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -72,7 +73,7 @@ public class HAGIIBugDUnitTest extends JUnit4DistributedTestCase {
 
   VM vm3 = null;
 
-  protected static Cache cache = null;
+  protected static InternalCache cache = null;
 
   static String regionQueueName = "regionQueue1";
 
@@ -135,7 +136,7 @@ public class HAGIIBugDUnitTest extends JUnit4DistributedTestCase {
     assertNotNull(ds);
     ds.disconnect();
     ds = getSystem(props);
-    cache = CacheFactory.create(ds);
+    cache = (InternalCache) CacheFactory.create(ds);
     assertNotNull(cache);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAHelper.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAHelper.java
index bff156d..0d67544 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAHelper.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAHelper.java
@@ -17,15 +17,15 @@ package org.apache.geode.internal.cache.ha;
 import java.util.Map;
 
 import org.apache.geode.internal.cache.HARegion;
+import org.apache.geode.internal.cache.ha.HARegionQueue.MapWrapper;
 
 /**
  * Helper class to access the required functions of this package from outside the package.
  */
-
 public class HAHelper {
 
   public static String getRegionQueueName(String proxyId) {
-    return HARegionQueue.createRegionName(proxyId.toString());
+    return HARegionQueue.createRegionName(proxyId);
   }
 
   public static HARegionQueue getRegionQueue(HARegion hr) {

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
index 5fb0295..470426e 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
@@ -22,6 +22,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.ha.HARegionQueue.MapWrapper;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.apache.logging.log4j.Logger;
 import org.junit.After;
@@ -54,7 +56,7 @@ public class HARQAddOperationJUnitTest {
   private static final Logger logger = LogService.getLogger();
 
   /** The cache instance */
-  protected Cache cache = null;
+  protected InternalCache cache = null;
 
   /** Logger for this test */
   protected LogWriter logWriter = null;
@@ -92,8 +94,8 @@ public class HARQAddOperationJUnitTest {
   /**
    * Creates the cache instance for the test
    */
-  private Cache createCache() throws CacheException {
-    return new CacheFactory().set(MCAST_PORT, "0").create();
+  private InternalCache createCache() throws CacheException {
+    return (InternalCache) new CacheFactory().set(MCAST_PORT, "0").create();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionDUnitTest.java
index e46782a..c73fa68 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionDUnitTest.java
@@ -18,6 +18,7 @@ import static org.junit.Assert.*;
 
 import java.util.Properties;
 
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -50,7 +51,7 @@ public class HARegionDUnitTest extends JUnit4DistributedTestCase {
 
   VM vm1 = null;
 
-  private static Cache cache = null;
+  private static InternalCache cache = null;
   private static final String REGION_NAME = "HARegionDUnitTest_region";
 
   /** constructor */
@@ -83,13 +84,13 @@ public class HARegionDUnitTest extends JUnit4DistributedTestCase {
    * @return
    * @throws Exception
    */
-  private Cache createCache() throws Exception {
+  private InternalCache createCache() throws Exception {
     Properties props = new Properties();
     DistributedSystem ds = getSystem(props);
     ds.disconnect();
     ds = getSystem(props);
-    Cache cache = null;
-    cache = CacheFactory.create(ds);
+    InternalCache cache = null;
+    cache = (InternalCache) CacheFactory.create(ds);
     if (cache == null) {
       throw new Exception("CacheFactory.create() returned null ");
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java
index 14be90e..6ead4c1 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -59,7 +60,7 @@ public class HARegionQueueDUnitTest extends JUnit4DistributedTestCase {
   private static volatile boolean toCnt = true;
   private static volatile Thread createQueuesThread;
 
-  private static Cache cache = null;
+  private static InternalCache cache = null;
   private static HARegionQueue hrq = null;
   private static Thread[] opThreads;
 
@@ -98,13 +99,13 @@ public class HARegionQueueDUnitTest extends JUnit4DistributedTestCase {
   /**
    * create cache
    */
-  private Cache createCache() throws CacheException {
+  private InternalCache createCache() throws CacheException {
     Properties props = new Properties();
     DistributedSystem ds = getSystem(props);
     ds.disconnect();
     ds = getSystem(props);
-    Cache cache = null;
-    cache = CacheFactory.create(ds);
+    InternalCache cache = null;
+    cache = (InternalCache) CacheFactory.create(ds);
     if (cache == null) {
       throw new CacheException("CacheFactory.create() returned null ") {};
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
index 796b27f..ae91f68 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
@@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.awaitility.Awaitility;
 
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.After;
 import org.junit.Before;
@@ -63,7 +64,7 @@ import org.apache.geode.test.junit.categories.IntegrationTest;
 public class HARegionQueueJUnitTest {
 
   /** The cache instance */
-  protected Cache cache = null;
+  protected InternalCache cache = null;
 
   /** Logger for this test */
   protected LogWriter logger;
@@ -95,8 +96,8 @@ public class HARegionQueueJUnitTest {
   /**
    * Creates the cache instance for the test
    */
-  private Cache createCache() throws CacheException {
-    return new CacheFactory().set(MCAST_PORT, "0").create();
+  private InternalCache createCache() throws CacheException {
+    return (InternalCache) new CacheFactory().set(MCAST_PORT, "0").create();
   }
 
   /**
@@ -817,7 +818,7 @@ public class HARegionQueueJUnitTest {
    */
   static class HARQTestClass extends HARegionQueue.TestOnlyHARegionQueue {
 
-    public HARQTestClass(String REGION_NAME, Cache cache, HARegionQueueJUnitTest test)
+    public HARQTestClass(String REGION_NAME, InternalCache cache, HARegionQueueJUnitTest test)
         throws IOException, ClassNotFoundException, CacheException, InterruptedException {
       super(REGION_NAME, cache);
     }
@@ -1544,7 +1545,7 @@ public class HARegionQueueJUnitTest {
     props.put(LOG_LEVEL, "config");
     // props.put("mcast-port","11111");
     try {
-      cache = CacheFactory.create(DistributedSystem.connect(props));
+      cache = (InternalCache) CacheFactory.create(DistributedSystem.connect(props));
     } catch (Exception e1) {
       throw new AssertionError("Test failed because of exception. Exception=", e1);
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStartStopJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStartStopJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStartStopJUnitTest.java
index 3445b33..f7ee8eb 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStartStopJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStartStopJUnitTest.java
@@ -23,6 +23,7 @@ import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.RegionQueue;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.apache.geode.test.junit.categories.IntegrationTest;
@@ -48,11 +49,11 @@ public class HARegionQueueStartStopJUnitTest {
    * @return the cache instance
    * @throws CacheException - thrown if any exception occurs in cache creation
    */
-  private Cache createCache() throws CacheException {
+  private InternalCache createCache() throws CacheException {
     final Properties props = new Properties();
     props.setProperty(LOCATORS, "");
     props.setProperty(MCAST_PORT, "0");
-    return CacheFactory.create(DistributedSystem.connect(props));
+    return (InternalCache) CacheFactory.create(DistributedSystem.connect(props));
   }
 
   /**
@@ -64,7 +65,7 @@ public class HARegionQueueStartStopJUnitTest {
    * @throws CacheException
    * @throws InterruptedException
    */
-  private RegionQueue createHARegionQueue(String name, Cache cache)
+  private RegionQueue createHARegionQueue(String name, InternalCache cache)
       throws IOException, ClassNotFoundException, CacheException, InterruptedException {
     RegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name, cache,
         HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
@@ -75,7 +76,7 @@ public class HARegionQueueStartStopJUnitTest {
   public void testStartStop() {
     try {
       boolean exceptionOccured = false;
-      Cache cache = createCache();
+      InternalCache cache = createCache();
       createHARegionQueue("test", cache);
       Assert.assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting() != null);
       HARegionQueue.stopHAServices();

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStatsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStatsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStatsJUnitTest.java
index 49efed7..f7fe5de 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStatsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueStatsJUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.internal.cache.ha;
 import org.apache.geode.cache.*;
 import org.apache.geode.internal.cache.Conflatable;
 import org.apache.geode.internal.cache.EventID;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
@@ -39,7 +40,7 @@ import static org.junit.Assert.assertNotNull;
 public class HARegionQueueStatsJUnitTest {
 
   /** The cache instance */
-  protected Cache cache = null;
+  protected InternalCache cache = null;
 
   /**
    * Create the cache in setup. Currently the HA related stats are active under fine logging only.
@@ -67,8 +68,8 @@ public class HARegionQueueStatsJUnitTest {
    * @return the cache instance
    * @throws CacheException - thrown if any exception occurs in cache creation
    */
-  private Cache createCache() throws CacheException {
-    return new CacheFactory().set(MCAST_PORT, "0").create();
+  private InternalCache createCache() throws CacheException {
+    return (InternalCache) new CacheFactory().set(MCAST_PORT, "0").create();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/ha/TestBlockingHARegionQueue.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/TestBlockingHARegionQueue.java b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/TestBlockingHARegionQueue.java
index c445d60..2ae699e 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/TestBlockingHARegionQueue.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/TestBlockingHARegionQueue.java
@@ -20,6 +20,7 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheException;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 /**
@@ -43,7 +44,7 @@ public class TestBlockingHARegionQueue extends HARegionQueue.TestOnlyHARegionQue
 
   boolean takeWhenPeekInProgress = false;
 
-  public TestBlockingHARegionQueue(String regionName, Cache cache)
+  public TestBlockingHARegionQueue(String regionName, InternalCache cache)
       throws IOException, ClassNotFoundException, CacheException, InterruptedException {
     super(regionName, cache);
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
index 11254e7..7b88679 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
@@ -51,6 +51,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.cache.CacheLifecycleListener;
 import org.apache.geode.internal.cache.DiskRegion;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.control.InternalResourceManager;
 import org.apache.geode.internal.cache.control.InternalResourceManager.ResourceObserver;
@@ -209,13 +210,13 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
     AsyncInvocation<?> asyncCreate = vm0.invokeAsync(() -> {
       cll = new CacheLifecycleListener() {
         @Override
-        public void cacheCreated(GemFireCacheImpl cache) {
+        public void cacheCreated(InternalCache cache) {
           calledCreateCache.set(true);
           Awaitility.await().atMost(90, TimeUnit.SECONDS).until(() -> cache.isCacheAtShutdownAll());
         }
 
         @Override
-        public void cacheClosed(GemFireCacheImpl cache) {
+        public void cacheClosed(InternalCache cache) {
           calledCloseCache.set(true);
         }
       };
@@ -544,9 +545,6 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
 
     assertEquals(vm0Buckets, getBucketList(vm0, "region"));
 
-    // checkRecoveredFromDisk(vm0, 0, true);
-    // checkRecoveredFromDisk(vm1, 0, false);
-
     checkData(vm0, 0, numBuckets, "a", "region");
     checkData(vm1, 0, numBuckets, "a", "region");
 
@@ -554,20 +552,8 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
     checkData(vm0, numBuckets, 113, "b", "region");
   }
 
-
-  // public void testRepeat() throws Throwable {
-  // for (int i=0; i<10; i++) {
-  // System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> run #"+i);
-  // testShutdownAllWithMembersWaiting();
-  // tearDown();
-  // setUp();
-  // }
-  // }
-
   /**
    * Test for 43551. Do a shutdown all with some members waiting on recovery.
-   * 
-   * @throws Throwable
    */
   @Test
   public void testShutdownAllWithMembersWaiting() throws Throwable {
@@ -664,11 +650,9 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
 
   private SerializableRunnable getCreateDRRunnable(final String regionName,
       final String diskStoreName) {
-    SerializableRunnable createDR = new SerializableRunnable("create DR") {
-      Cache cache;
-
+    return new SerializableRunnable("create DR") {
       public void run() {
-        cache = getCache();
+        Cache cache = ShutdownAllDUnitTest.this.getCache();
 
         DiskStore ds = cache.findDiskStore(diskStoreName);
         if (ds == null) {
@@ -681,7 +665,6 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
         cache.createRegion(regionName, af.create());
       }
     };
-    return createDR;
   }
 
   protected void addCacheServer(VM vm, final int port) {
@@ -723,8 +706,8 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
 
   private SerializableRunnable getCreatePRRunnable(final String regionName,
       final String diskStoreName, final int redundancy) {
-    SerializableRunnable createPR = new SerializableRunnable("create pr") {
-
+    return new SerializableRunnable("create pr") {
+      @Override
       public void run() {
         final CountDownLatch recoveryDone;
         if (redundancy > 0) {
@@ -741,7 +724,7 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
           recoveryDone = null;
         }
 
-        Cache cache = getCache();
+        Cache cache = ShutdownAllDUnitTest.this.getCache();
 
         if (diskStoreName != null) {
           DiskStore ds = cache.findDiskStore(diskStoreName);
@@ -772,7 +755,6 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
         }
       }
     };
-    return createPR;
   }
 
   protected void createData(VM vm, final int startKey, final int endKey, final String value,
@@ -888,7 +870,7 @@ public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
     public void afterUpdate(EntryEvent event) {
       try {
         latch.await();
-      } catch (InterruptedException e) {
+      } catch (InterruptedException ignore) {
         Thread.currentThread().interrupt();
       }
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/dd98a558/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
index 5d4096e..de06a5e 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
@@ -42,6 +42,7 @@ import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.cache.FixedPartitionAttributesImpl;
 import org.apache.geode.internal.cache.HARegion;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionRegionConfig;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.PartitionedRegionHelper;
@@ -94,7 +95,7 @@ public class FixedPartitioningTestBase extends JUnit4DistributedTestCase {
 
   protected static VM member4 = null;
 
-  static Cache cache = null;
+  static InternalCache cache = null;
 
   protected static PartitionedRegion region_FPR = null;
 
@@ -148,7 +149,7 @@ public class FixedPartitioningTestBase extends JUnit4DistributedTestCase {
       assertNotNull(ds);
       ds.disconnect();
       ds = getSystem(props);
-      cache = CacheFactory.create(ds);
+      cache = (InternalCache) CacheFactory.create(ds);
       assertNotNull(cache);
     } catch (Exception e) {
       org.apache.geode.test.dunit.Assert.fail("Failed while creating the cache", e);


Mime
View raw message