geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [01/50] [abbrv] geode git commit: GEODE-2632: change dependencies on GemFireCacheImpl to InternalCache [Forced Update!]
Date Thu, 11 May 2017 21:23:07 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2632-15 1adfdadc9 -> 153db276f (forced update)


http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
index c000109..583aa56 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
@@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.jmock.Expectations;
 import org.jmock.Mockery;
+import org.jmock.lib.concurrent.Synchroniser;
 import org.jmock.lib.legacy.ClassImposteriser;
 import org.junit.After;
 import org.junit.Before;
@@ -74,6 +75,7 @@ public class ListIndexFunctionJUnitTest {
     mockContext = new Mockery() {
       {
         setImposteriser(ClassImposteriser.INSTANCE);
+        setThreadingPolicy(new Synchroniser());
       }
     };
     mockCounter = new AtomicLong(0l);

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java
index 1966a08..917361f 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java
@@ -26,8 +26,10 @@ import org.apache.geode.cache.RegionExistsException;
 import org.apache.geode.cache.TimeoutException;
 import org.apache.geode.cache.client.ClientCache;
 import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.internal.JUnit3DistributedTestCase;
 
@@ -70,27 +72,27 @@ public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase
    * Finish what {@code beginCacheXml} started. It does this be generating a cache.xml file and then
    * creating a real cache using that cache.xml.
    */
-  public final void finishCacheXml(final String name, final boolean useSchema,
+  public final void finishCacheXml(final File root, final String name, final boolean useSchema,
       final String xmlVersion) {
-    delegate.finishCacheXml(name, useSchema, xmlVersion);
+    delegate.finishCacheXml(root, name, useSchema, xmlVersion);
   }
 
   /**
    * Return a cache for obtaining regions, created lazily.
    */
-  public final Cache getCache() {
+  public final InternalCache getCache() {
     return delegate.getCache();
   }
 
-  public final Cache getCache(final CacheFactory factory) {
+  public final InternalCache getCache(final CacheFactory factory) {
     return delegate.getCache(factory);
   }
 
-  public final Cache getCache(final boolean client) {
+  public final InternalCache getCache(final boolean client) {
     return delegate.getCache(client);
   }
 
-  public final Cache getCache(final boolean client, final CacheFactory factory) {
+  public final InternalCache getCache(final boolean client, final CacheFactory factory) {
     return delegate.getCache(client, factory);
   }
 
@@ -99,7 +101,7 @@ public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase
    *
    * @since GemFire 6.5
    */
-  public final ClientCache getClientCache(final ClientCacheFactory factory) {
+  public final InternalClientCache getClientCache(final ClientCacheFactory factory) {
     return delegate.getClientCache(factory);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
index 4ccf8c2..60f47c4 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -39,10 +39,12 @@ import org.apache.geode.cache.TimeoutException;
 import org.apache.geode.cache.client.ClientCache;
 import org.apache.geode.cache.client.ClientCacheFactory;
 import org.apache.geode.cache.client.PoolManager;
+import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionMessageObserver;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.xmlcache.CacheCreation;
@@ -79,7 +81,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
    * <p>
    * Field is static so it doesn't get serialized with SerializableRunnable inner classes.
    */
-  private static Cache cache;
+  private static InternalCache cache;
 
   private final CacheTestFixture cacheTestFixture;
 
@@ -112,20 +114,20 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
       try {
         System.setProperty(
             DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
-        Cache newCache;
+        InternalCache newCache;
         if (client) {
           System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "locators", "");
           System.setProperty(DistributionConfig.GEMFIRE_PREFIX + MCAST_PORT, "0");
-          newCache = (Cache) new ClientCacheFactory(getSystem().getProperties()).create();
+          newCache = (InternalCache) new ClientCacheFactory(getSystem().getProperties()).create();
         } else {
           if (factory == null) {
-            newCache = CacheFactory.create(getSystem());
+            newCache = (InternalCache) CacheFactory.create(getSystem());
           } else {
             Properties props = getSystem().getProperties();
             for (Map.Entry entry : props.entrySet()) {
               factory.set((String) entry.getKey(), (String) entry.getValue());
             }
-            newCache = factory.create();
+            newCache = (InternalCache) factory.create();
           }
         }
         cache = newCache;
@@ -154,7 +156,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
       try {
         System.setProperty(
             DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
-        Cache newCache = CacheFactory.create(getLonerSystem());
+        InternalCache newCache = (InternalCache) CacheFactory.create(getLonerSystem());
         cache = newCache;
       } catch (CacheExistsException e) {
         Assert.fail("the cache already exists", e); // TODO: remove error handling
@@ -211,10 +213,10 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
    * Finish what {@code beginCacheXml} started. It does this be generating a cache.xml file and then
    * creating a real cache using that cache.xml.
    */
-  public final void finishCacheXml(final String name, final boolean useSchema,
+  public final void finishCacheXml(final File root, final String name, final boolean useSchema,
       final String xmlVersion) {
     synchronized (JUnit4CacheTestCase.class) {
-      File dir = new File("XML_" + xmlVersion);
+      File dir = new File(root, "XML_" + xmlVersion);
       dir.mkdirs();
       File file = new File(dir, name + ".xml");
       try {
@@ -222,8 +224,8 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
         CacheXmlGenerator.generate(cache, pw, useSchema, xmlVersion);
         pw.close();
       } catch (IOException ex) {
-        Assert.fail("IOException during cache.xml generation to " + file, ex); // TODO: remove error
-                                                                               // handling
+        // TODO: remove error handling
+        Assert.fail("IOException during cache.xml generation to " + file, ex);
       }
       cache = null;
       GemFireCacheImpl.testCacheXml = file;
@@ -238,24 +240,24 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
   /**
    * Return a cache for obtaining regions, created lazily.
    */
-  public final Cache getCache() {
+  public final InternalCache getCache() {
     return getCache(false);
   }
 
-  public final Cache getCache(final CacheFactory factory) {
+  public final InternalCache getCache(final CacheFactory factory) {
     return getCache(false, factory);
   }
 
-  public final Cache getCache(final Properties properties) {
+  public final InternalCache getCache(final Properties properties) {
     getSystem(properties);
     return getCache();
   }
 
-  public final Cache getCache(final boolean client) {
+  public final InternalCache getCache(final boolean client) {
     return getCache(client, null);
   }
 
-  public final Cache getCache(final boolean client, final CacheFactory factory) {
+  public final InternalCache getCache(final boolean client, final CacheFactory factory) {
     synchronized (JUnit4CacheTestCase.class) {
       final GemFireCacheImpl gemFireCache = GemFireCacheImpl.getInstance();
       if (gemFireCache != null && !gemFireCache.isClosed()
@@ -288,7 +290,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
    *
    * @since GemFire 6.5
    */
-  public final ClientCache getClientCache(final ClientCacheFactory factory) {
+  public final InternalClientCache getClientCache(final ClientCacheFactory factory) {
     synchronized (JUnit4CacheTestCase.class) {
       final GemFireCacheImpl gemFireCache = GemFireCacheImpl.getInstance();
       if (gemFireCache != null && !gemFireCache.isClosed()
@@ -308,12 +310,12 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
       if (cache == null || cache.isClosed()) {
         cache = null;
         disconnectFromDS();
-        cache = (Cache) factory.create();
+        cache = (InternalCache) factory.create();
       }
       if (cache != null) {
         IgnoredException.addIgnoredException("java.net.ConnectException");
       }
-      return (ClientCache) cache;
+      return (InternalClientCache) cache;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVM.java b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVM.java
index 3e8630b..d02ce74 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVM.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVM.java
@@ -24,14 +24,10 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.internal.logging.LogService;
 
-/**
- *
- */
 public class RemoteDUnitVM extends UnicastRemoteObject implements RemoteDUnitVMIF {
-
   private static final Logger logger = LogService.getLogger();
 
-  public RemoteDUnitVM() throws RemoteException {
+  RemoteDUnitVM() throws RemoteException {
     super();
   }
 
@@ -40,37 +36,38 @@ public class RemoteDUnitVM extends UnicastRemoteObject implements RemoteDUnitVMI
    * the object. Does this synchronously (does not spawn a thread). This method is used by the unit
    * test framework, dunit.
    *
-   * @param obj the object to execute the method on
+   * @param target the object to execute the method on
    * @param methodName the name of the method to execute
    * @return the result of method execution
    */
-  public MethExecutorResult executeMethodOnObject(Object obj, String methodName) {
-    String name = obj.getClass().getName() + "." + methodName + " on object: " + obj;
+  @Override
+  public MethExecutorResult executeMethodOnObject(Object target, String methodName) {
+    String name = target.getClass().getName() + '.' + methodName + " on object: " + target;
     long start = start(name);
-    MethExecutorResult result = MethExecutor.executeObject(obj, methodName);
+    MethExecutorResult result = MethExecutor.executeObject(target, methodName);
     logDelta(name, start, result);
     return result;
   }
 
   protected long start(String name) {
-    logger.info("Received method: " + name);
-    long start = System.nanoTime();
-    return start;
+    logger.info("Received method: {}", name);
+    return System.nanoTime();
   }
 
-  protected void logDelta(String name, long start, MethExecutorResult result) {
+  private void logDelta(String name, long start, MethExecutorResult result) {
     long delta = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
-    logger.info("Got result: " + result.toString() + " from " + name + " (took " + delta + " ms)");
+    logger.info("Got result: {} from {} (took {} ms)", result, name, delta);
   }
 
   /**
    * Executes a given instance method on a given object with the given arguments.
    */
-  public MethExecutorResult executeMethodOnObject(Object obj, String methodName, Object[] args) {
-    String name = obj.getClass().getName() + "." + methodName
-        + (args != null ? " with " + args.length + " args" : "") + " on object: " + obj;
+  @Override
+  public MethExecutorResult executeMethodOnObject(Object target, String methodName, Object[] args) {
+    String name = target.getClass().getName() + '.' + methodName
+        + (args != null ? " with " + args.length + " args" : "") + " on object: " + target;
     long start = start(name);
-    MethExecutorResult result = MethExecutor.executeObject(obj, methodName, args);
+    MethExecutorResult result = MethExecutor.executeObject(target, methodName, args);
     logDelta(name, start, result);
     return result;
   }
@@ -85,7 +82,7 @@ public class RemoteDUnitVM extends UnicastRemoteObject implements RemoteDUnitVMI
    * @return the result of method execution
    */
   public MethExecutorResult executeMethodOnClass(String className, String methodName) {
-    String name = className + "." + methodName;
+    String name = className + '.' + methodName;
     long start = start(name);
     MethExecutorResult result = MethExecutor.execute(className, methodName);
     logDelta(name, start, result);
@@ -96,10 +93,11 @@ public class RemoteDUnitVM extends UnicastRemoteObject implements RemoteDUnitVMI
   /**
    * Executes a given static method in a given class with the given arguments.
    */
+  @Override
   public MethExecutorResult executeMethodOnClass(String className, String methodName,
       Object[] args) {
     String name =
-        className + "." + methodName + (args != null ? " with " + args.length + " args" : "");
+        className + '.' + methodName + (args != null ? " with " + args.length + " args" : "");
     long start = start(name);
     MethExecutorResult result = MethExecutor.execute(className, methodName, args);
     logDelta(name, start, result);
@@ -107,22 +105,25 @@ public class RemoteDUnitVM extends UnicastRemoteObject implements RemoteDUnitVMI
   }
 
   public void executeTask(int tsid, int type, int index) throws RemoteException {
-    throw new UnsupportedOperationException();
-
+    throw new UnsupportedOperationException("executeTask is not implemented");
   }
 
   public void runShutdownHook() throws RemoteException {
-
+    throw new UnsupportedOperationException("runShutdownHook is not implemented");
   }
 
   public void notifyDynamicActionComplete(int actionId) throws RemoteException {
-    throw new UnsupportedOperationException();
-
+    throw new UnsupportedOperationException("notifyDynamicActionComplete is not implemented");
   }
 
+  @Override
   public void shutDownVM() throws RemoteException {
     ChildVM.stopVM();
   }
 
-  public void disconnectVM() throws RemoteException {}
+  public void disconnectVM() throws RemoteException {
+    throw new UnsupportedOperationException("disconnectVM is not implemented");
+  }
+
+  private static final long serialVersionUID = 251934856609958734L;
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVMIF.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVMIF.java b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVMIF.java
index d2cc533..9db6b06 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVMIF.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/RemoteDUnitVMIF.java
@@ -21,12 +21,12 @@ import hydra.MethExecutorResult;
 
 public interface RemoteDUnitVMIF extends Remote {
 
-  MethExecutorResult executeMethodOnObject(Object o, String methodName) throws RemoteException;
+  MethExecutorResult executeMethodOnObject(Object target, String methodName) throws RemoteException;
 
-  MethExecutorResult executeMethodOnObject(Object o, String methodName, Object[] args)
+  MethExecutorResult executeMethodOnObject(Object target, String methodName, Object[] args)
       throws RemoteException;
 
-  MethExecutorResult executeMethodOnClass(String name, String methodName, Object[] args)
+  MethExecutorResult executeMethodOnClass(String className, String methodName, Object[] args)
       throws RemoteException;
 
   void shutDownVM() throws RemoteException;

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/CqQueryImpl.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/CqQueryImpl.java b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/CqQueryImpl.java
index 07e3171..f680b63 100644
--- a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/CqQueryImpl.java
+++ b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/CqQueryImpl.java
@@ -215,7 +215,8 @@ public abstract class CqQueryImpl implements InternalCqQuery {
     }
 
     // Set Query ExecutionContext, that will be used in later execution.
-    this.setQueryExecutionContext(new QueryExecutionContext(null, this.cqService.getCache()));
+    this.setQueryExecutionContext(
+        new QueryExecutionContext(null, (InternalCache) this.cqService.getCache()));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
index c484105..2f13fac 100644
--- a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
+++ b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
@@ -44,7 +44,7 @@ import org.apache.geode.cache.query.internal.CompiledSelect;
 import org.apache.geode.cache.query.internal.CqStateImpl;
 import org.apache.geode.cache.query.internal.DefaultQuery;
 import org.apache.geode.i18n.StringId;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.Token;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
@@ -216,7 +216,6 @@ public class ServerCQImpl extends CqQueryImpl implements DataSerializable, Serve
       }
     }
 
-    // this.cqService.addToCqEventKeysMap(this);
     this.updateCqCreateStats();
 
     // Initialize the state of CQ.
@@ -283,7 +282,7 @@ public class ServerCQImpl extends CqQueryImpl implements DataSerializable, Serve
    * @return String modified query.
    */
   private Query constructServerSideQuery() throws QueryException {
-    GemFireCacheImpl cache = (GemFireCacheImpl) cqService.getCache();
+    InternalCache cache = cqService.getInternalCache();
     DefaultQuery locQuery = (DefaultQuery) cache.getLocalQueryService().newQuery(this.queryString);
     CompiledSelect select = locQuery.getSimpleSelect();
     CompiledIteratorDef from = (CompiledIteratorDef) select.getIterators().get(0);
@@ -371,8 +370,6 @@ public class ServerCQImpl extends CqQueryImpl implements DataSerializable, Serve
     if (!CqServiceProvider.MAINTAIN_KEYS) {
       return;
     }
-    // this.logger.fine("Marking key in Results Cache For CQ :" +
-    // this.cqName + " key :" + key);
 
     if (this.cqResultKeys != null) {
       synchronized (this.cqResultKeys) {

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
index 8bdef9b..9eada5b 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
@@ -14,32 +14,39 @@
  */
 package org.apache.geode.cache.lucene.internal;
 
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.lucene.LuceneServiceProvider;
-import org.apache.geode.distributed.internal.*;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.logging.log4j.Logger;
-
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Collection;
 
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.lucene.LuceneServiceProvider;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.MessageWithReply;
+import org.apache.geode.distributed.internal.PooledDistributionMessage;
+import org.apache.geode.distributed.internal.ReplyException;
+import org.apache.geode.distributed.internal.ReplyMessage;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.logging.LogService;
+
 public class DestroyLuceneIndexMessage extends PooledDistributionMessage
     implements MessageWithReply {
 
+  private static final Logger logger = LogService.getLogger();
+
   private int processorId;
 
   private String regionPath;
 
   private String indexName;
 
-  private static final Logger logger = LogService.getLogger();
-
   /* For serialization */
-  public DestroyLuceneIndexMessage() {}
+  public DestroyLuceneIndexMessage() {
+    // nothing
+  }
 
   protected DestroyLuceneIndexMessage(Collection recipients, int processorId, String regionPath,
       String indexName) {
@@ -59,7 +66,7 @@ public class DestroyLuceneIndexMessage extends PooledDistributionMessage
             + "; indexName=" + this.indexName);
       }
       try {
-        Cache cache = GemFireCacheImpl.getInstance();
+        InternalCache cache = GemFireCacheImpl.getInstance();
         LuceneServiceImpl impl = (LuceneServiceImpl) LuceneServiceProvider.get(cache);
         impl.destroyIndex(this.indexName, this.regionPath, false);
         if (logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
index 3756b81..5ae62b9 100755
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
@@ -15,7 +15,6 @@
 package org.apache.geode.cache.lucene.internal.cli;
 
 import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.Function;
@@ -27,6 +26,7 @@ import org.apache.geode.cache.lucene.internal.cli.functions.LuceneDestroyIndexFu
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneListIndexFunction;
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneSearchIndexFunction;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.internal.security.IntegratedSecurityService;
@@ -61,8 +61,7 @@ import java.util.stream.Collectors;
 /**
  * The LuceneIndexCommands class encapsulates all Geode shell (Gfsh) commands related to Lucene
  * indexes defined in Geode.
- * </p>
- * 
+ *
  * @see AbstractCommandsSupport
  * @see LuceneIndexDetails
  * @see LuceneListIndexFunction
@@ -187,7 +186,7 @@ public class LuceneIndexCommands extends AbstractCommandsSupport {
 
     this.securityService.authorizeRegionManage(regionPath);
     try {
-      final Cache cache = getCache();
+      final InternalCache cache = getCache();
       LuceneIndexInfo indexInfo = new LuceneIndexInfo(indexName, regionPath, fields, analyzers);
       final ResultCollector<?, ?> rc =
           this.executeFunctionOnAllMembers(createIndexFunction, indexInfo);
@@ -383,7 +382,7 @@ public class LuceneIndexCommands extends AbstractCommandsSupport {
     // region members. Then send the function to the remaining members to handle the case where
     // the index has been created, but not the region
     XmlEntity xmlEntity = null;
-    Cache cache = getCache();
+    InternalCache cache = getCache();
     Set<DistributedMember> regionMembers = getRegionMembers(cache, regionPath);
     Set<DistributedMember> normalMembers = getNormalMembers(cache);
     LuceneDestroyIndexInfo indexInfo = new LuceneDestroyIndexInfo(indexName, regionPath);
@@ -422,11 +421,11 @@ public class LuceneIndexCommands extends AbstractCommandsSupport {
     return xmlEntity;
   }
 
-  protected Set<DistributedMember> getRegionMembers(Cache cache, String regionPath) {
+  protected Set<DistributedMember> getRegionMembers(InternalCache cache, String regionPath) {
     return CliUtil.getMembersForeRegionViaFunction(cache, regionPath, true);
   }
 
-  protected Set<DistributedMember> getNormalMembers(Cache cache) {
+  protected Set<DistributedMember> getNormalMembers(InternalCache cache) {
     return CliUtil.getAllNormalMembers(cache);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
index e4b4b4f..d4dca4a 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
@@ -16,7 +16,10 @@ package org.apache.geode.cache.lucene.internal.cli;
 
 import static org.junit.Assert.*;
 import static org.mockito.Matchers.isA;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.eq;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -29,7 +32,6 @@ import java.util.Set;
 
 import junitparams.JUnitParamsRunner;
 import junitparams.Parameters;
-import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -39,7 +41,6 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.lucene.internal.LuceneIndexStats;
@@ -48,10 +49,12 @@ import org.apache.geode.cache.lucene.internal.cli.functions.LuceneDescribeIndexF
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneDestroyIndexFunction;
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneListIndexFunction;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.internal.util.CollectionUtils;
 import org.apache.geode.management.cli.Result.Status;
 import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.ResultBuilder;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
@@ -61,11 +64,10 @@ import org.apache.geode.test.junit.categories.UnitTest;
 /**
  * The LuceneIndexCommandsJUnitTest class is a test suite of test cases testing the contract and
  * functionality of the LuceneIndexCommands class.
- * </p>
- * 
+ *
  * @see LuceneIndexCommands
  * @see LuceneIndexDetails
- * @see org.apache.geode.cache.lucene.internal.cli.functions.LuceneListIndexFunction
+ * @see LuceneListIndexFunction
  * @see org.jmock.Expectations
  * @see org.jmock.Mockery
  * @see org.jmock.lib.legacy.ClassImposteriser
@@ -79,8 +81,7 @@ public class LuceneIndexCommandsJUnitTest {
 
   @Test
   public void testListIndexWithoutStats() {
-
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final String serverName = "mockServer";
     final AbstractExecution mockFunctionExecutor =
         mock(AbstractExecution.class, "Function Executor");
@@ -102,7 +103,6 @@ public class LuceneIndexCommandsJUnitTest {
 
     results.add(CollectionUtils.asSet(indexDetails2, indexDetails1, indexDetails3));
 
-
     when(mockFunctionExecutor.execute(isA(LuceneListIndexFunction.class)))
         .thenReturn(mockResultCollector);
     when(mockResultCollector.getResult()).thenReturn(results);
@@ -128,8 +128,7 @@ public class LuceneIndexCommandsJUnitTest {
 
   @Test
   public void testListIndexWithStats() {
-
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final String serverName = "mockServer";
     final AbstractExecution mockFunctionExecutor =
         mock(AbstractExecution.class, "Function Executor");
@@ -180,7 +179,7 @@ public class LuceneIndexCommandsJUnitTest {
 
   @Test
   public void testCreateIndex() throws Exception {
-    final Cache mockCache = mock(Cache.class);
+    final InternalCache mockCache = mock(InternalCache.class);
     final ResultCollector mockResultCollector = mock(ResultCollector.class);
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
 
@@ -206,13 +205,11 @@ public class LuceneIndexCommandsJUnitTest {
     assertEquals(Arrays.asList("member1", "member2", "member3"), data.retrieveAllValues("Member"));
     assertEquals(Arrays.asList("Successfully created lucene index", "Failed: Index creation failed",
         "Successfully created lucene index"), data.retrieveAllValues("Status"));
-
   }
 
   @Test
   public void testDescribeIndex() throws Exception {
-
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final String serverName = "mockServer";
     final ResultCollector mockResultCollector = mock(ResultCollector.class, "ResultCollector");
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
@@ -249,8 +246,7 @@ public class LuceneIndexCommandsJUnitTest {
 
   @Test
   public void testSearchIndex() throws Exception {
-
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final ResultCollector mockResultCollector = mock(ResultCollector.class, "ResultCollector");
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
 
@@ -275,7 +271,7 @@ public class LuceneIndexCommandsJUnitTest {
 
   @Test
   public void testSearchIndexWithPaging() throws Exception {
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final Gfsh mockGfsh = mock(Gfsh.class);
     final ResultCollector mockResultCollector = mock(ResultCollector.class, "ResultCollector");
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
@@ -339,13 +335,11 @@ public class LuceneIndexCommandsJUnitTest {
 
     assertEquals(expectedPage1, actualPageResults.get(18));
     assertEquals("\t\tPage 1 of 4", actualPageResults.get(19));
-
   }
 
   @Test
   public void testSearchIndexWithKeysOnly() throws Exception {
-
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final ResultCollector mockResultCollector = mock(ResultCollector.class, "ResultCollector");
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
 
@@ -368,8 +362,7 @@ public class LuceneIndexCommandsJUnitTest {
 
   @Test
   public void testSearchIndexWhenSearchResultsHaveSameScore() throws Exception {
-
-    final Cache mockCache = mock(Cache.class, "Cache");
+    final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
     final ResultCollector mockResultCollector = mock(ResultCollector.class, "ResultCollector");
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
 
@@ -546,7 +539,7 @@ public class LuceneIndexCommandsJUnitTest {
   }
 
   private LuceneIndexCommands createTestLuceneIndexCommandsForDestroyIndex() {
-    final Cache mockCache = mock(Cache.class);
+    final InternalCache mockCache = mock(InternalCache.class);
     final ResultCollector mockResultCollector = mock(ResultCollector.class);
     final LuceneIndexCommands commands = spy(createIndexCommands(mockCache, null));
 
@@ -584,22 +577,21 @@ public class LuceneIndexCommandsJUnitTest {
       data.accumulate("score", expectedResults[i].getScore());
     }
     CommandResult commandResult = (CommandResult) ResultBuilder.buildResult(data);
-    StringBuffer buffer = new StringBuffer();
-    while (commandResult.hasNextLine())
+    StringBuilder buffer = new StringBuilder();
+    while (commandResult.hasNextLine()) {
       buffer.append(commandResult.nextLine());
+    }
     return buffer.toString();
   }
 
   private List<Set<LuceneSearchResults>> getSearchResults(LuceneSearchResults... results) {
     final List<Set<LuceneSearchResults>> queryResultsList = new ArrayList<>();
     HashSet<LuceneSearchResults> queryResults = new HashSet<>();
-    for (LuceneSearchResults result : results)
-      queryResults.add(result);
+    Collections.addAll(queryResults, results);
     queryResultsList.add(queryResults);
     return queryResultsList;
   }
 
-
   private LuceneIndexStats getMockIndexStats(int queries, int commits, int updates, int docs) {
     LuceneIndexStats mockIndexStats = mock(LuceneIndexStats.class);
     when(mockIndexStats.getQueryExecutions()).thenReturn(queries);
@@ -609,7 +601,7 @@ public class LuceneIndexCommandsJUnitTest {
     return mockIndexStats;
   }
 
-  private LuceneIndexCommands createIndexCommands(final Cache cache,
+  private LuceneIndexCommands createIndexCommands(final InternalCache cache,
       final Execution functionExecutor) {
     return new LuceneTestIndexCommands(cache, functionExecutor);
   }
@@ -635,22 +627,22 @@ public class LuceneIndexCommandsJUnitTest {
 
   private static class LuceneTestIndexCommands extends LuceneIndexCommands {
 
-    private final Cache cache;
+    private final InternalCache cache;
     private final Execution functionExecutor;
 
-    protected LuceneTestIndexCommands(final Cache cache, final Execution functionExecutor) {
-      assert cache != null : "The Cache cannot be null!";
+    protected LuceneTestIndexCommands(final InternalCache cache, final Execution functionExecutor) {
+      assert cache != null : "The InternalCache cannot be null!";
       this.cache = cache;
       this.functionExecutor = functionExecutor;
     }
 
     @Override
-    protected Cache getCache() {
+    protected InternalCache getCache() {
       return this.cache;
     }
 
     @Override
-    protected Set<DistributedMember> getMembers(final Cache cache) {
+    protected Set<DistributedMember> getMembers(final InternalCache cache) {
       assertSame(getCache(), cache);
       return Collections.emptySet();
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
----------------------------------------------------------------------
diff --git a/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java b/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
index ab8b5b0..0f1a995 100644
--- a/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
+++ b/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
@@ -443,6 +443,7 @@ public class AutoBalancer implements Declarable {
     }
 
     InternalCache getCache() {
+      // TODO: delete this double-checking
       if (cache == null) {
         synchronized (this) {
           if (cache == null) {
@@ -461,6 +462,7 @@ public class AutoBalancer implements Declarable {
 
     @Override
     public boolean acquireAutoBalanceLock() {
+      // TODO: delete this double-checking
       if (!isLockAcquired.get()) {
         synchronized (isLockAcquired) {
           if (!isLockAcquired.get()) {
@@ -501,7 +503,7 @@ public class AutoBalancer implements Declarable {
     }
   }
 
-  private class SystemClockTimeProvider implements TimeProvider {
+  private static class SystemClockTimeProvider implements TimeProvider {
     @Override
     public long currentTimeMillis() {
       return System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
index eb46258..a5c09d3 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
@@ -18,19 +18,18 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.wan.GatewayReceiver;
 import org.apache.geode.cache.wan.GatewayReceiverFactory;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.xmlcache.CacheCreation;
 import org.apache.geode.internal.cache.xmlcache.GatewayReceiverCreation;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 /**
- * 
  * @since GemFire 7.0
  */
 public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
@@ -51,13 +50,13 @@ public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
 
   private List<GatewayTransportFilter> filters = new ArrayList<GatewayTransportFilter>();
 
-  private Cache cache;
+  private InternalCache cache;
 
   public GatewayReceiverFactoryImpl() {
-
+    // nothing
   }
 
-  public GatewayReceiverFactoryImpl(Cache cache) {
+  public GatewayReceiverFactoryImpl(InternalCache cache) {
     this.cache = cache;
   }
 
@@ -116,7 +115,7 @@ public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
       recv = new GatewayReceiverImpl(this.cache, this.startPort, this.endPort, this.timeBetPings,
           this.socketBuffSize, this.bindAdd, this.filters, this.hostnameForSenders,
           this.manualStart);
-      ((GemFireCacheImpl) cache).addGatewayReceiver(recv);
+      this.cache.addGatewayReceiver(recv);
       InternalDistributedSystem system =
           (InternalDistributedSystem) this.cache.getDistributedSystem();
       system.handleResourceEvent(ResourceEvent.GATEWAYRECEIVER_CREATE, recv);
@@ -134,7 +133,7 @@ public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
       recv = new GatewayReceiverCreation(this.cache, this.startPort, this.endPort,
           this.timeBetPings, this.socketBuffSize, this.bindAdd, this.filters,
           this.hostnameForSenders, this.manualStart);
-      ((CacheCreation) cache).addGatewayReceiver(recv);
+      this.cache.addGatewayReceiver(recv);
     }
     return recv;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
index d953d7f..5e26a46 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
@@ -23,16 +23,15 @@ import java.util.List;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.wan.GatewayReceiver;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.AvailablePort;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
@@ -65,12 +64,12 @@ public class GatewayReceiverImpl implements GatewayReceiver {
 
   private CacheServer receiver;
 
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
 
-  public GatewayReceiverImpl(Cache cache, int startPort, int endPort, int timeBetPings,
+  public GatewayReceiverImpl(InternalCache cache, int startPort, int endPort, int timeBetPings,
       int buffSize, String bindAdd, List<GatewayTransportFilter> filters, String hostnameForSenders,
       boolean manualStart) {
-    this.cache = (GemFireCacheImpl) cache;
+    this.cache = cache;
 
     /*
      * If user has set hostNameForSenders then it should take precedence over bindAddress. If user
@@ -151,17 +150,17 @@ public class GatewayReceiverImpl implements GatewayReceiver {
       receiver.setMaximumTimeBetweenPings(timeBetPings);
       receiver.setHostnameForClients(host);
       receiver.setBindAddress(bindAdd);
-      receiver.setGroups(new String[] {GatewayReceiverImpl.RECEIVER_GROUP});
+      receiver.setGroups(new String[] {GatewayReceiver.RECEIVER_GROUP});
       ((CacheServerImpl) receiver).setGatewayTransportFilter(this.filters);
       try {
-        ((CacheServerImpl) receiver).start();
+        receiver.start();
         started = true;
       } catch (BindException be) {
         if (be.getCause() != null
             && be.getCause().getMessage().contains("assign requested address")) {
           throw new GatewayReceiverException(
               LocalizedStrings.SocketCreator_FAILED_TO_CREATE_SERVER_SOCKET_ON_0_1
-                  .toLocalizedString(new Object[] {bindAdd, Integer.valueOf(this.port)}));
+                  .toLocalizedString(new Object[] {bindAdd, this.port}));
         }
         // ignore as this port might have been used by other threads.
         logger.warn(LocalizedMessage.create(LocalizedStrings.GatewayReceiver_Address_Already_In_Use,
@@ -208,11 +207,6 @@ public class GatewayReceiverImpl implements GatewayReceiver {
           LocalizedStrings.GatewayReceiver_IS_NOT_RUNNING.toLocalizedString());
     }
     receiver.stop();
-
-    // InternalDistributedSystem system = ((GemFireCacheImpl) this.cache)
-    // .getDistributedSystem();
-    // system.handleResourceEvent(ResourceEvent.GATEWAYRECEIVER_STOP, this);
-
   }
 
   public String getHost() {
@@ -237,7 +231,7 @@ public class GatewayReceiverImpl implements GatewayReceiver {
         .append("; maximumTimeBetweenPings=").append(getMaximumTimeBetweenPings())
         .append("; socketBufferSize=").append(getSocketBufferSize()).append("; isManualStart=")
         .append(isManualStart()).append("; group=")
-        .append(Arrays.toString(new String[] {GatewayReceiverImpl.RECEIVER_GROUP})).append("]")
+        .append(Arrays.toString(new String[] {GatewayReceiver.RECEIVER_GROUP})).append("]")
         .toString();
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
index 8da5613..3eec101 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
@@ -14,38 +14,35 @@
  */
 package org.apache.geode.internal.cache.wan;
 
-
 import java.io.IOException;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.internal.cache.tier.sockets.MessageTooLargeException;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelException;
-import org.apache.geode.cache.Cache;
+import org.apache.geode.GemFireIOException;
 import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.cache.client.ServerConnectivityException;
 import org.apache.geode.cache.client.ServerOperationException;
 import org.apache.geode.cache.client.internal.Connection;
+import org.apache.geode.cache.client.internal.SenderProxy;
 import org.apache.geode.cache.client.internal.pooling.ConnectionDestroyedException;
 import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.distributed.internal.ServerLocation;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
+import org.apache.geode.internal.cache.tier.sockets.MessageTooLargeException;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
 import org.apache.geode.pdx.PdxRegistryMismatchException;
 import org.apache.geode.security.GemFireSecurityException;
-import org.apache.geode.cache.client.internal.SenderProxy;
 
 /**
  * @since GemFire 7.0
- *
  */
 public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDispatcher {
 
@@ -326,7 +323,7 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
 
     // Here we might wait on a connection to another server if I was secondary
     // so don't start waiting until I am primary
-    Cache cache = this.sender.getCache();
+    InternalCache cache = this.sender.getCache();
     if (cache != null && !cache.isClosed()) {
       if (this.sender.isPrimary() && (this.connection != null)) {
         if (this.ackReaderThread == null || !this.ackReaderThread.isRunning()) {
@@ -551,7 +548,7 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
      */
     private volatile boolean shutdown = false;
 
-    private final GemFireCacheImpl cache;
+    private final InternalCache cache;
 
     private volatile boolean ackReaderThreadRunning = false;
 
@@ -562,7 +559,7 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
     public AckReaderThread(GatewaySender sender, String name) {
       super("AckReaderThread for : " + name);
       this.setDaemon(true);
-      this.cache = (GemFireCacheImpl) ((AbstractGatewaySender) sender).getCache();
+      this.cache = ((AbstractGatewaySender) sender).getCache();
     }
 
     public void waitForRunningAckReaderThreadRunningState() {
@@ -671,13 +668,8 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
         }
         ackReaderThreadRunning = false;
       }
-
     }
 
-    /**
-     * @param exception
-     * 
-     */
     protected void logBatchExceptions(BatchException70 exception) {
       try {
         for (BatchException70 be : exception.getExceptions()) {
@@ -785,7 +777,6 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
       } catch (ConnectionDestroyedException e) {
         logger.info("AckReader shutting down and connection already destroyed");
       }
-
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
index 2c7925b..467c622 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
@@ -221,11 +221,6 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
     }
 
     if (this.attrs.isParallel()) {
-      // if(this.attrs.getDispatcherThreads() != 1){
-      // throw new GatewaySenderException(
-      // LocalizedStrings.GatewaySenderImpl_PARALLEL_GATEWAY_SENDER_0_CANNOT_BE_CREATED_WITH_DISPATCHER_THREADS_OTHER_THAN_1
-      // .toLocalizedString(id));
-      // }
       if ((this.attrs.getOrderPolicy() != null)
           && this.attrs.getOrderPolicy().equals(OrderPolicy.THREAD)) {
         throw new GatewaySenderException(
@@ -234,14 +229,14 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
       }
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new ParallelGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
 
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new ParallelGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     } else {
       if (this.attrs.getAsyncEventListeners().size() > 0) {
@@ -254,14 +249,14 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
       }
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new SerialGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
 
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new SerialGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     }
     return sender;
@@ -287,13 +282,13 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
 
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new ParallelGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new ParallelGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     } else {
       if (this.attrs.getOrderPolicy() == null && this.attrs.getDispatcherThreads() > 1) {
@@ -301,13 +296,13 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
       }
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new SerialGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new SerialGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     }
     return sender;

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
index c2d4673..daeeb6f 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
@@ -18,6 +18,7 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.EntryOperation;
 import org.apache.geode.cache.asyncqueue.AsyncEventListener;
+import org.apache.geode.cache.wan.GatewayEventFilter;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
@@ -25,7 +26,6 @@ import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.EventID;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegionHelper;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
@@ -79,7 +79,7 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
       // Only notify the type registry if this is a WAN gateway queue
       if (!isAsyncEventQueue()) {
-        ((GemFireCacheImpl) getCache()).getPdxRegistry().gatewaySenderStarted(this);
+        getCache().getPdxRegistry().gatewaySenderStarted(this);
       }
       new UpdateAttributesProcessor(this).distribute(false);
 
@@ -135,11 +135,11 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
   @Override
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append("ParallelGatewaySender{");
-    sb.append("id=" + getId());
-    sb.append(",remoteDsId=" + getRemoteDSId());
-    sb.append(",isRunning =" + isRunning());
+    sb.append("id=").append(getId());
+    sb.append(",remoteDsId=").append(getRemoteDSId());
+    sb.append(",isRunning =").append(isRunning());
     sb.append("}");
     return sb.toString();
   }
@@ -158,7 +158,7 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
     pf.manualStart = isManualStart();
     pf.dispatcherThreads = getDispatcherThreads();
     pf.orderPolicy = getOrderPolicy();
-    for (org.apache.geode.cache.wan.GatewayEventFilter filter : getGatewayEventFilters()) {
+    for (GatewayEventFilter filter : getGatewayEventFilters()) {
       pf.eventFiltersClassNames.add(filter.getClass().getName());
     }
     for (GatewayTransportFilter filter : getGatewayTransportFilters()) {

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
index b300460..fe83d60 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
@@ -26,7 +26,6 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.EventID;
-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.internal.cache.UpdateAttributesProcessor;
@@ -93,7 +92,7 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
       // Only notify the type registry if this is a WAN gateway queue
       if (!isAsyncEventQueue()) {
-        ((GemFireCacheImpl) getCache()).getPdxRegistry().gatewaySenderStarted(this);
+        getCache().getPdxRegistry().gatewaySenderStarted(this);
       }
       new UpdateAttributesProcessor(this).distribute(false);
 
@@ -178,12 +177,12 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
   @Override
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append("SerialGatewaySender{");
-    sb.append("id=" + getId());
-    sb.append(",remoteDsId=" + getRemoteDSId());
-    sb.append(",isRunning =" + isRunning());
-    sb.append(",isPrimary =" + isPrimary());
+    sb.append("id=").append(getId());
+    sb.append(",remoteDsId=").append(getRemoteDSId());
+    sb.append(",isRunning =").append(isRunning());
+    sb.append(",isPrimary =").append(isPrimary());
     sb.append("}");
     return sb.toString();
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/test/java/org/apache/geode/cache/CacheXml70GatewayDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/cache/CacheXml70GatewayDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/cache/CacheXml70GatewayDUnitTest.java
index 83b2cf4..25cffb3 100644
--- a/geode-wan/src/test/java/org/apache/geode/cache/CacheXml70GatewayDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/cache/CacheXml70GatewayDUnitTest.java
@@ -14,18 +14,12 @@
  */
 package org.apache.geode.cache;
 
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
 import static org.junit.Assert.*;
 
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
 import java.util.Properties;
 import java.util.Set;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.asyncqueue.AsyncEventListener;
@@ -48,14 +42,12 @@ import org.apache.geode.internal.cache.xmlcache.CacheXml;
 import org.apache.geode.internal.cache.xmlcache.ParallelGatewaySenderCreation;
 import org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation;
 import org.apache.geode.internal.cache.xmlcache.SerialGatewaySenderCreation;
+import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
 public class CacheXml70GatewayDUnitTest extends CacheXmlTestCase {
 
-  public CacheXml70GatewayDUnitTest() {
-    super();
-  }
-
+  @Override
   protected String getGemFireVersion() {
     return CacheXml.VERSION_7_0;
   }
@@ -64,7 +56,7 @@ public class CacheXml70GatewayDUnitTest extends CacheXmlTestCase {
    * Added to test the scenario of defect #50600.
    */
   @Test
-  public void testAsyncEventQueueWithGatewayEventFilter() {
+  public void testAsyncEventQueueWithGatewayEventFilter() throws Exception {
     getSystem();
     CacheCreation cache = new CacheCreation();
 
@@ -128,7 +120,7 @@ public class CacheXml70GatewayDUnitTest extends CacheXmlTestCase {
   }
 
   @Test
-  public void testParallelGatewaySender() throws CacheException {
+  public void testParallelGatewaySender() throws Exception {
     getSystem();
     CacheCreation cache = new CacheCreation();
 
@@ -166,7 +158,7 @@ public class CacheXml70GatewayDUnitTest extends CacheXmlTestCase {
   }
 
   @Test
-  public void testSerialGatewaySender() throws CacheException {
+  public void testSerialGatewaySender() throws Exception {
     getSystem();
     CacheCreation cache = new CacheCreation();
     GatewaySenderFactory gatewaySenderFactory = cache.createGatewaySenderFactory();
@@ -206,18 +198,23 @@ public class CacheXml70GatewayDUnitTest extends CacheXmlTestCase {
   }
 
   public static class MyGatewayEventFilter implements GatewayEventFilter, Declarable {
+    @Override
     public void afterAcknowledgement(GatewayQueueEvent event) {}
 
+    @Override
     public boolean beforeEnqueue(GatewayQueueEvent event) {
       return true;
     }
 
+    @Override
     public boolean beforeTransmit(GatewayQueueEvent event) {
       return true;
     }
 
+    @Override
     public void close() {}
 
+    @Override
     public void init(Properties properties) {}
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/test/java/org/apache/geode/cache/CacheXml80GatewayDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/cache/CacheXml80GatewayDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/cache/CacheXml80GatewayDUnitTest.java
index 3b78217..5c256df 100644
--- a/geode-wan/src/test/java/org/apache/geode/cache/CacheXml80GatewayDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/cache/CacheXml80GatewayDUnitTest.java
@@ -14,39 +14,40 @@
  */
 package org.apache.geode.cache;
 
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
 import static org.junit.Assert.*;
 
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import java.io.IOException;
 import java.util.Properties;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.cache.asyncqueue.AsyncEventQueue;
 import org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory;
-import org.apache.geode.cache.wan.*;
-import org.apache.geode.cache30.*;
+import org.apache.geode.cache.wan.GatewayEventSubstitutionFilter;
+import org.apache.geode.cache.wan.GatewayReceiver;
+import org.apache.geode.cache.wan.GatewayReceiverFactory;
+import org.apache.geode.cache.wan.GatewaySender;
+import org.apache.geode.cache.wan.GatewaySenderFactory;
+import org.apache.geode.cache.wan.GatewayTransportFilter;
+import org.apache.geode.cache30.CacheXml70DUnitTest;
+import org.apache.geode.cache30.CacheXmlTestCase;
+import org.apache.geode.cache30.MyGatewayTransportFilter1;
+import org.apache.geode.cache30.MyGatewayTransportFilter2;
 import org.apache.geode.internal.cache.xmlcache.CacheCreation;
 import org.apache.geode.internal.cache.xmlcache.CacheXml;
+import org.apache.geode.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
 public class CacheXml80GatewayDUnitTest extends CacheXmlTestCase {
 
-  public CacheXml80GatewayDUnitTest() {
-    super();
-  }
-
+  @Override
   protected String getGemFireVersion() {
     return CacheXml.VERSION_8_0;
   }
 
   @Test
-  public void testGatewayReceiverWithManualStartTRUE() throws CacheException {
+  public void testGatewayReceiverWithManualStartTRUE() throws Exception {
     // getSystem();
     CacheCreation cache = new CacheCreation();
 
@@ -62,11 +63,9 @@ public class CacheXml80GatewayDUnitTest extends CacheXmlTestCase {
     GatewayTransportFilter myStreamFilter2 = new MyGatewayTransportFilter2();
     gatewayReceiverFactory.addGatewayTransportFilter(myStreamFilter2);
     GatewayReceiver receiver1 = gatewayReceiverFactory.create();
-    try {
-      receiver1.start();
-    } catch (IOException e) {
-      fail("Could not start GatewayReceiver");
-    }
+
+    receiver1.start();
+
     testXml(cache);
     Cache c = getCache();
     assertNotNull(c);
@@ -77,7 +76,7 @@ public class CacheXml80GatewayDUnitTest extends CacheXmlTestCase {
   }
 
   @Test
-  public void testAsyncEventQueueWithSubstitutionFilter() {
+  public void testAsyncEventQueueWithSubstitutionFilter() throws Exception {
     getSystem();
     CacheCreation cache = new CacheCreation();
 
@@ -101,7 +100,7 @@ public class CacheXml80GatewayDUnitTest extends CacheXmlTestCase {
   }
 
   @Test
-  public void testGatewaySenderWithSubstitutionFilter() {
+  public void testGatewaySenderWithSubstitutionFilter() throws Exception {
     getSystem();
     CacheCreation cache = new CacheCreation();
 
@@ -136,12 +135,15 @@ public class CacheXml80GatewayDUnitTest extends CacheXmlTestCase {
   public static class MyGatewayEventSubstitutionFilter
       implements GatewayEventSubstitutionFilter, Declarable {
 
+    @Override
     public Object getSubstituteValue(EntryEvent event) {
       return event.getKey();
     }
 
+    @Override
     public void close() {}
 
+    @Override
     public void init(Properties properties) {}
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
index 3556e08..4c37e0d 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
@@ -1606,6 +1606,11 @@ public class ParallelWANPersistenceEnabledGatewaySenderDUnitTest extends WANTest
     }
   }
 
+  /**
+   * setIgnoreQueue has lots of callers by reflection
+   * <p>
+   * TODO: add DistributedRestoreSystemProperties Rule and delete this mess and make constant final
+   */
   public static void setIgnoreQueue(boolean shouldIgnore) {
     ColocationHelper.IGNORE_UNRECOVERED_QUEUE = shouldIgnore;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
index 34f0a8b..b6b6712 100644
--- a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
@@ -49,6 +49,7 @@ import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.internal.admin.remote.ShutdownAllRequest;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.extension.Extensible;
 import org.apache.geode.internal.cache.extension.Extension;
 import org.apache.geode.internal.cache.extension.mock.MockCacheExtension;
@@ -144,7 +145,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
       localProps.setProperty(DEPLOY_WORKING_DIR, workingDir.getCanonicalPath());
 
       getSystem(localProps);
-      Cache cache = getCache();
+      InternalCache cache = getCache();
 
       assertNotNull(cache);
 
@@ -215,7 +216,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
       localProps.setProperty(DEPLOY_WORKING_DIR, workingDir.getCanonicalPath());
 
       getSystem(localProps);
-      Cache cache = getCache();
+      InternalCache cache = getCache();
 
       assertNotNull(cache);
 
@@ -420,7 +421,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
       localProps.setProperty(DEPLOY_WORKING_DIR, workingDir.getCanonicalPath());
 
       getSystem(localProps);
-      Cache cache = getCache();
+      InternalCache cache = getCache();
       assertNotNull(cache);
       return getAllNormalMembers(cache);
     });

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-web/src/test/java/org/apache/geode/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/org/apache/geode/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java b/geode-web/src/test/java/org/apache/geode/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
index 80e26fd..c61cd6b 100644
--- a/geode-web/src/test/java/org/apache/geode/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
+++ b/geode-web/src/test/java/org/apache/geode/management/internal/web/controllers/support/LoginHandlerInterceptorJUnitTest.java
@@ -14,13 +14,17 @@
  */
 package org.apache.geode.management.internal.web.controllers.support;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
-import org.apache.geode.management.internal.security.ResourceConstants;
-import org.apache.geode.test.junit.categories.UnitTest;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import edu.umd.cs.mtc.MultithreadedTestCase;
+import edu.umd.cs.mtc.TestFramework;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.lib.concurrent.Synchroniser;
@@ -30,13 +34,8 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import edu.umd.cs.mtc.MultithreadedTestCase;
-import edu.umd.cs.mtc.TestFramework;
+import org.apache.geode.management.internal.security.ResourceConstants;
+import org.apache.geode.test.junit.categories.UnitTest;
 
 /**
  * The LoginHandlerInterceptorJUnitTest class is a test suite of test cases to test the contract and

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-web/src/test/java/org/apache/geode/management/internal/web/http/ClientHttpRequestJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/org/apache/geode/management/internal/web/http/ClientHttpRequestJUnitTest.java b/geode-web/src/test/java/org/apache/geode/management/internal/web/http/ClientHttpRequestJUnitTest.java
index a407363..a95a58e 100644
--- a/geode-web/src/test/java/org/apache/geode/management/internal/web/http/ClientHttpRequestJUnitTest.java
+++ b/geode-web/src/test/java/org/apache/geode/management/internal/web/http/ClientHttpRequestJUnitTest.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.jmock.Mockery;
+import org.jmock.lib.concurrent.Synchroniser;
 import org.jmock.lib.legacy.ClassImposteriser;
 import org.junit.After;
 import org.junit.Before;
@@ -59,6 +60,7 @@ public class ClientHttpRequestJUnitTest extends AbstractWebTestCase {
   public void setUp() {
     mockContext = new Mockery();
     mockContext.setImposteriser(ClassImposteriser.INSTANCE);
+    mockContext.setThreadingPolicy(new Synchroniser());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-web/src/test/java/org/apache/geode/management/internal/web/http/converter/SerializableObjectHttpMessageConverterJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/org/apache/geode/management/internal/web/http/converter/SerializableObjectHttpMessageConverterJUnitTest.java b/geode-web/src/test/java/org/apache/geode/management/internal/web/http/converter/SerializableObjectHttpMessageConverterJUnitTest.java
index f5495b3..329924e 100644
--- a/geode-web/src/test/java/org/apache/geode/management/internal/web/http/converter/SerializableObjectHttpMessageConverterJUnitTest.java
+++ b/geode-web/src/test/java/org/apache/geode/management/internal/web/http/converter/SerializableObjectHttpMessageConverterJUnitTest.java
@@ -24,6 +24,7 @@ import java.util.Calendar;
 
 import org.jmock.Expectations;
 import org.jmock.Mockery;
+import org.jmock.lib.concurrent.Synchroniser;
 import org.jmock.lib.legacy.ClassImposteriser;
 import org.junit.After;
 import org.junit.Before;
@@ -57,6 +58,7 @@ public class SerializableObjectHttpMessageConverterJUnitTest {
   public void setUp() {
     mockContext = new Mockery();
     mockContext.setImposteriser(ClassImposteriser.INSTANCE);
+    mockContext.setThreadingPolicy(new Synchroniser());
   }
 
   @After


Mime
View raw message