geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [1/3] geode git commit: fixup
Date Fri, 05 May 2017 20:54:42 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2632-12 bccdb56e2 -> db79d2238


http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/UnregisterInterestTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/UnregisterInterestTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/UnregisterInterestTest.java
index 157e0f3..b894590 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/UnregisterInterestTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/UnregisterInterestTest.java
@@ -14,7 +14,10 @@
  */
 package org.apache.geode.internal.cache.tier.sockets.command;
 
-import static org.mockito.Matchers.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.*;
 
 import org.junit.Before;
@@ -31,9 +34,9 @@ import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
 import org.apache.geode.CancelCriterion;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.operations.UnregisterInterestOperationContext;
 import org.apache.geode.internal.Version;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.tier.CachedRegionHelper;
 import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
@@ -42,7 +45,6 @@ import org.apache.geode.internal.cache.tier.sockets.CacheServerStats;
 import org.apache.geode.internal.cache.tier.sockets.Message;
 import org.apache.geode.internal.cache.tier.sockets.Part;
 import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
-import org.apache.geode.internal.offheap.ReferenceCountHelper;
 import org.apache.geode.internal.security.AuthorizeRequest;
 import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.security.NotAuthorizedException;
@@ -53,6 +55,7 @@ import org.apache.geode.test.junit.categories.UnitTest;
 @PrepareForTest({CacheClientNotifier.class})
 @Category(UnitTest.class)
 public class UnregisterInterestTest {
+
   private static final String REGION_NAME = "region1";
   private static final String KEY = "key1";
   private static final Object CALLBACK_ARG = "arg";
@@ -69,7 +72,7 @@ public class UnregisterInterestTest {
   @Mock
   private LocalRegion region;
   @Mock
-  private Cache cache;
+  private InternalCache cache;
   @Mock
   private CacheServerStats cacheServerStats;
   @Mock
@@ -132,7 +135,6 @@ public class UnregisterInterestTest {
     when(this.serverConnection.getAcceptor()).thenReturn(this.acceptor);
     when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT);
 
-
     when(this.valuePart.getObject()).thenReturn(CALLBACK_ARG);
 
     when(this.unregisterInterestOperationContext.getKey()).thenReturn(KEY);

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
index 86dd967..d610ca0 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/CliUtilDUnitTest.java
@@ -14,27 +14,25 @@
  */
 package org.apache.geode.management.internal.cli;
 
-import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
-import static org.apache.geode.distributed.ConfigurationProperties.NAME;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.geode.cache.Cache;
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
-import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.DistributedRegionMXBean;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.RegionMXBean;
@@ -49,19 +47,10 @@ 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.util.Properties;
-import java.util.Set;
 
 @Category(DistributedTest.class)
 public class CliUtilDUnitTest extends JUnit4CacheTestCase {
 
-  public CliUtilDUnitTest() {
-    super();
-  }
-
   public static final String COMMON_REGION = "region1";
   public static final String COMMON_REGION_GROUP1 = "region_group1";
   public static final String COMMON_REGION_GROUP2 = "region_group2";
@@ -78,7 +67,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
   public static final String GROUP1 = "group1";
   public static final String GROUP2 = "group2";
 
-
   private static final long serialVersionUID = 1L;
 
   @Override
@@ -86,14 +74,12 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     destroySetup();
   }
 
-
   protected final void destroySetup() {
     disconnectAllFromDS();
   }
 
   @SuppressWarnings("serial")
   void setupMembersWithIdsAndGroups() {
-
     final VM vm1 = Host.getHost(0).getVM(0);
     final VM vm2 = Host.getHost(0).getVM(1);
     final VM vm3 = Host.getHost(0).getVM(2);
@@ -106,9 +92,7 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
         createRegion(REGION_MEMBER1_GROUP1);
         createRegion(COMMON_REGION_GROUP1);
         createRegion(COMMON_REGION);
-        // registerFunction();
       }
-
     });
 
     vm2.invoke(new SerializableRunnable() {
@@ -118,7 +102,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
         createRegion(REGION_MEMBER2_GROUP1);
         createRegion(COMMON_REGION_GROUP1);
         createRegion(COMMON_REGION);
-        // registerFunction();
       }
     });
 
@@ -129,7 +112,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
         createRegion(REGION_MEMBER1_GROUP2);
         createRegion(COMMON_REGION_GROUP2);
         createRegion(COMMON_REGION);
-        // registerFunction();
       }
     });
 
@@ -140,7 +122,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
         createRegion(REGION_MEMBER2_GROUP2);
         createRegion(COMMON_REGION_GROUP2);
         createRegion(COMMON_REGION);
-        // registerFunction();
       }
     });
 
@@ -150,7 +131,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
         startManager();
       }
     });
-
   }
 
   private void startManager() {
@@ -205,11 +185,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     LogWriterUtils.getLogWriter().info("Manager federation is complete");
   }
 
-  private void registerFunction() {
-    Function funct = new DunitFunction("DunitFunction");
-    FunctionService.registerFunction(funct);
-  }
-
   @SuppressWarnings("rawtypes")
   private Region createRegion(String regionName) {
     RegionFactory regionFactory = getCache().createRegionFactory(RegionShortcut.REPLICATE);
@@ -237,13 +212,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     assertNotNull(service.getMemberMXBean());
   }
 
-  @Test
-  public void testFileToBytes() {
-
-    // CliUtil.filesToBytes(fileNames)
-
-  }
-
   @SuppressWarnings("serial")
   @Test
   public void testCliUtilMethods() {
@@ -262,7 +230,7 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     final String id = (String) vm1.invoke(new SerializableCallable() {
       @Override
       public Object call() throws Exception {
-        Cache cache = getCache();
+        InternalCache cache = getCache();
         return cache.getDistributedSystem().getDistributedMember().getId();
       }
     });
@@ -290,10 +258,8 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
         getRegionAssociatedMembers();
       }
     });
-
   }
 
-
   public void verifyFindAllMatchingMembers() {
     try {
       Set<DistributedMember> set = CliUtil.findMembersOrThrow(GROUP1, null);
@@ -302,7 +268,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
       assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
       assertEquals(true, containsMember(set, MEMBER_2_GROUP1));
 
-
       set = CliUtil.findMembersOrThrow("group1,group2", null);
       assertNotNull(set);
       assertEquals(4, set.size());
@@ -311,13 +276,11 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
       assertEquals(true, containsMember(set, MEMBER_1_GROUP2));
       assertEquals(true, containsMember(set, MEMBER_2_GROUP2));
 
-
       set = CliUtil.findMembersOrThrow(null, MEMBER_1_GROUP1);
       assertNotNull(set);
       assertEquals(1, set.size());
       assertEquals(true, containsMember(set, MEMBER_1_GROUP1));
 
-
       set = CliUtil.findMembersOrThrow(null, "member1_group1,member2_group2");
       assertNotNull(set);
       assertEquals(2, set.size());
@@ -337,24 +300,20 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     return returnValue;
   }
 
-
   public void getDistributedMemberByNameOrId(String name, String id) {
-
     DistributedMember member = CliUtil.getDistributedMemberByNameOrId(name);
     assertNotNull(member);
 
     member = CliUtil.getDistributedMemberByNameOrId(id);
     assertNotNull(member);
-
   }
 
-
   public void verifyExecuteFunction() {
     DunitFunction function = new DunitFunction("myfunction");
     Set<DistributedMember> set;
     try {
       @SuppressWarnings("rawtypes")
-      Region region1 = CacheFactory.getAnyInstance().getRegion(COMMON_REGION);
+      Region region1 = getCache().getRegion(COMMON_REGION);
       region1.clear();
       set = CliUtil.findMembersOrThrow(GROUP1, null);
       assertEquals(2, set.size());
@@ -370,20 +329,12 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     }
   }
 
-
   public void getRegionAssociatedMembers() {
-
     String region_group1 = "/region_group1";
     String region1 = "/region1";
     String region_member2_group1 = "/region_member2_group1";
 
-    /*
-     * String region_member1_group1 ="/region_member1_group1"; String region_member1_group2
-     * ="/region_member1_group2"; String region_member2_group2 ="/region_member2_group2"; String
-     * region_group2 ="/region_group2";
-     */
-
-    Cache cache = getCache();
+    InternalCache cache = getCache();
 
     Set<DistributedMember> set = CliUtil.getRegionAssociatedMembers(region1, cache, true);
     assertNotNull(set);
@@ -394,7 +345,7 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     assertEquals(true, containsMember(set, MEMBER_2_GROUP2));
 
     /*
-     * "FIXME - Abhishek" This is failing because last param is not considered in method set =
+     * TODO: This is failing because last param is not considered in method set =
      * CliUtil.getRegionAssociatedMembers(region1, cache, false); assertNotNull(set);
      * assertIndexDetailsEquals(1, set.size());
      */
@@ -409,7 +360,6 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     assertNotNull(set);
     assertEquals(1, set.size());
     assertEquals(true, containsMember(set, MEMBER_2_GROUP1));
-
   }
 
   public static class DunitFunction extends FunctionAdapter {
@@ -424,7 +374,7 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
     @Override
     public void execute(FunctionContext context) {
       Object object = context.getArguments();
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
       @SuppressWarnings("rawtypes")
       Region region = cache.getRegion(COMMON_REGION);
       String id = cache.getDistributedSystem().getDistributedMember().getName();
@@ -440,4 +390,3 @@ public class CliUtilDUnitTest extends JUnit4CacheTestCase {
   }
 
 }
-

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AbstractCommandsSupportJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AbstractCommandsSupportJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AbstractCommandsSupportJUnitTest.java
index 6c52dad..91a59f8 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AbstractCommandsSupportJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AbstractCommandsSupportJUnitTest.java
@@ -30,11 +30,11 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.internal.util.CollectionUtils;
 import org.apache.geode.management.cli.CliMetaData;
@@ -46,8 +46,7 @@ import org.apache.geode.test.junit.categories.UnitTest;
  * The AbstractCommandsSupportJUnitTest class is a test suite of test cases testing the contract and
  * functionality of the AbstractCommandsSupport class for implementing GemFire shell (Gfsh)
  * commands.
- * </p>
- * 
+ *
  * @see org.apache.geode.management.internal.cli.commands.AbstractCommandsSupport
  * @see org.jmock.Expectations
  * @see org.jmock.Mockery
@@ -74,7 +73,7 @@ public class AbstractCommandsSupportJUnitTest {
     mockContext = null;
   }
 
-  private AbstractCommandsSupport createAbstractCommandsSupport(final Cache cache) {
+  private AbstractCommandsSupport createAbstractCommandsSupport(final InternalCache cache) {
     return new TestCommands(cache);
   }
 
@@ -152,7 +151,7 @@ public class AbstractCommandsSupportJUnitTest {
 
   @Test
   public void testGetMemberWithMatchingMemberId() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedSystem mockDistributedSystem =
         mockContext.mock(DistributedSystem.class, "DistributedSystem");
@@ -179,7 +178,7 @@ public class AbstractCommandsSupportJUnitTest {
 
   @Test
   public void testGetMemberWithMatchingMemberName() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedSystem mockDistributedSystem =
         mockContext.mock(DistributedSystem.class, "DistributedSystem");
@@ -206,7 +205,7 @@ public class AbstractCommandsSupportJUnitTest {
 
   @Test
   public void testGetMemberWithMatchingMemberNameCaseInsensitive() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedSystem mockDistributedSystem =
         mockContext.mock(DistributedSystem.class, "DistributedSystem");
@@ -233,7 +232,7 @@ public class AbstractCommandsSupportJUnitTest {
 
   @Test(expected = MemberNotFoundException.class)
   public void testGetMemberThrowsMemberNotFoundException() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedSystem mockDistributedSystem =
         mockContext.mock(DistributedSystem.class, "DistributedSystem");
@@ -266,7 +265,7 @@ public class AbstractCommandsSupportJUnitTest {
 
   @Test
   public void testGetMembers() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedSystem mockDistributedSystem =
         mockContext.mock(DistributedSystem.class, "DistributedSystem");
@@ -299,7 +298,7 @@ public class AbstractCommandsSupportJUnitTest {
 
   @Test
   public void testGetMembersContainsOnlySelf() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedSystem mockDistributedSystem =
         mockContext.mock(DistributedSystem.class, "DistributedSystem");
@@ -343,7 +342,7 @@ public class AbstractCommandsSupportJUnitTest {
       });
 
       final AbstractCommandsSupport commands =
-          createAbstractCommandsSupport(mockContext.mock(Cache.class));
+          createAbstractCommandsSupport(mockContext.mock(InternalCache.class));
 
       assertFalse(FunctionService.isRegistered("testRegister"));
       assertSame(mockFunction, commands.register(mockFunction));
@@ -372,7 +371,7 @@ public class AbstractCommandsSupportJUnitTest {
       });
 
       final AbstractCommandsSupport commands =
-          createAbstractCommandsSupport(mockContext.mock(Cache.class));
+          createAbstractCommandsSupport(mockContext.mock(InternalCache.class));
 
       FunctionService.registerFunction(registeredFunction);
 
@@ -416,15 +415,15 @@ public class AbstractCommandsSupportJUnitTest {
 
   private static class TestCommands extends AbstractCommandsSupport {
 
-    private final Cache cache;
+    private final InternalCache cache;
 
-    protected TestCommands(final Cache cache) {
-      assert cache != null : "The Cache cannot be null!";
+    protected TestCommands(final InternalCache cache) {
+      assert cache != null : "The InternalCache cannot be null!";
       this.cache = cache;
     }
 
     @Override
-    protected Cache getCache() {
+    protected InternalCache getCache() {
       return this.cache;
     }
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
index 6291142..9aeccad 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
@@ -32,7 +32,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
@@ -48,13 +47,11 @@ import org.apache.geode.management.internal.cli.util.DiskStoreNotFoundException;
 import org.apache.geode.management.internal.cli.util.MemberNotFoundException;
 import org.apache.geode.test.junit.categories.UnitTest;
 
-
 /**
  * The DiskStoreCommandsJUnitTest class is a test suite of test cases testing the contract and
  * functionality of the DiskStoreCommands class implementing commands in the GemFire shell (gfsh)
  * that access and modify disk stores in GemFire.
- * </p>
- * 
+ *
  * @see org.apache.geode.management.internal.cli.commands.DiskStoreCommands
  * @see org.apache.geode.management.internal.cli.domain.DiskStoreDetails
  * @see org.apache.geode.management.internal.cli.functions.DescribeDiskStoreFunction
@@ -87,7 +84,7 @@ public class DiskStoreCommandsJUnitTest {
     mockContext = null;
   }
 
-  private DiskStoreCommands createDiskStoreCommands(final Cache cache,
+  private DiskStoreCommands createDiskStoreCommands(final InternalCache cache,
       final DistributedMember distributedMember, final Execution functionExecutor) {
     return new TestDiskStoreCommands(cache, distributedMember, functionExecutor);
   }
@@ -102,7 +99,7 @@ public class DiskStoreCommandsJUnitTest {
     final String diskStoreName = "mockDiskStore";
     final String memberId = "mockMember";
 
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -145,7 +142,7 @@ public class DiskStoreCommandsJUnitTest {
     final String diskStoreName = "mockDiskStore";
     final String memberId = "mockMember";
 
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -175,7 +172,7 @@ public class DiskStoreCommandsJUnitTest {
     final String diskStoreName = "mockDiskStore";
     final String memberId = "mockMember";
 
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -211,7 +208,7 @@ public class DiskStoreCommandsJUnitTest {
     final String diskStoreName = "mockDiskStore";
     final String memberId = "mockMember";
 
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -247,7 +244,7 @@ public class DiskStoreCommandsJUnitTest {
     final String diskStoreName = "mockDiskStore";
     final String memberId = "mockMember";
 
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -289,7 +286,7 @@ public class DiskStoreCommandsJUnitTest {
 
   @Test
   public void testGetDiskStoreList() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockDistributedMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -338,7 +335,7 @@ public class DiskStoreCommandsJUnitTest {
 
   @Test(expected = RuntimeException.class)
   public void testGetDiskStoreListThrowsRuntimeException() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockDistributedMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -365,7 +362,7 @@ public class DiskStoreCommandsJUnitTest {
 
   @Test
   public void testGetDiskStoreListReturnsFunctionInvocationTargetExceptionInResults() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final DistributedMember mockDistributedMember =
         mockContext.mock(DistributedMember.class, "DistributedMember");
@@ -408,12 +405,12 @@ public class DiskStoreCommandsJUnitTest {
 
   private static class TestDiskStoreCommands extends DiskStoreCommands {
 
-    private final Cache cache;
+    private final InternalCache cache;
     private final DistributedMember distributedMember;
     private final Execution functionExecutor;
 
-    public TestDiskStoreCommands(final Cache cache, final DistributedMember distributedMember,
-        final Execution functionExecutor) {
+    public TestDiskStoreCommands(final InternalCache cache,
+        final DistributedMember distributedMember, final Execution functionExecutor) {
       assert cache != null : "The Cache cannot be null!";
       this.cache = cache;
       this.distributedMember = distributedMember;
@@ -421,7 +418,7 @@ public class DiskStoreCommandsJUnitTest {
     }
 
     @Override
-    protected Cache getCache() {
+    protected InternalCache getCache() {
       return this.cache;
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
index 0e2a41e..2af3fea 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
@@ -14,17 +14,28 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
-import static org.apache.geode.distributed.ConfigurationProperties.NAME;
-import static org.apache.geode.test.dunit.Assert.assertEquals;
-import static org.apache.geode.test.dunit.Assert.assertFalse;
-import static org.apache.geode.test.dunit.Assert.assertNotEquals;
-import static org.apache.geode.test.dunit.Assert.assertNotNull;
-import static org.apache.geode.test.dunit.Assert.assertNotSame;
-import static org.apache.geode.test.dunit.Assert.assertTrue;
-import static org.apache.geode.test.dunit.Assert.fail;
-import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
-import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
-import static org.apache.geode.test.dunit.Wait.waitForCriterion;
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.test.dunit.Assert.*;
+import static org.apache.geode.test.dunit.IgnoredException.*;
+import static org.apache.geode.test.dunit.LogWriterUtils.*;
+import static org.apache.geode.test.dunit.Wait.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -43,6 +54,7 @@ import org.apache.geode.cache.query.internal.QCompiler;
 import org.apache.geode.cache.util.CacheListenerAdapter;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.management.DistributedRegionMXBean;
 import org.apache.geode.management.ManagementService;
@@ -74,21 +86,6 @@ import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.FlakyTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Random;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * Dunit class for testing gemfire data commands : get, put, remove, select, rebalance
@@ -133,7 +130,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
   final static int COUNT = 5;
 
   public String getMemberId() {
-    Cache cache = getCache();
+    InternalCache cache = getCache();
     return cache.getDistributedSystem().getDistributedMember().getId();
   }
 
@@ -148,7 +145,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
     vm1.invoke(new SerializableRunnable() {
       public void run() {
-        Cache cache = getCache();
+        InternalCache cache = getCache();
         RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
         Region dataRegion = regionFactory.create(DATA_REGION_NAME);
         assertNotNull(dataRegion);
@@ -185,7 +182,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
     vm2.invoke(new SerializableRunnable() {
       public void run() {
-        Cache cache = getCache();
+        InternalCache cache = getCache();
         RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
         Region dataRegion = regionFactory.create(DATA_REGION_NAME);
         assertNotNull(dataRegion);
@@ -231,7 +228,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     SerializableRunnable checkRegionMBeans = new SerializableRunnable() {
       @Override
       public void run() {
-        Cache cache = getCache();
+        InternalCache cache = getCache();
         final ManagementService service = ManagementService.getManagementService(cache);
 
         final WaitCriterion waitForMaangerMBean = new WaitCriterion() {
@@ -396,7 +393,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
   private void doQueryRegionsAssociatedMembers(String queryTemplate, int expectedMembers,
       boolean returnAll, String... regions) {
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
 
     String query = queryTemplate;
     int i = 1;
@@ -618,8 +615,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     testGetPutLocateEntryFromShellAndGemfire(doubleKey, doubleValue, Double.class, true, true);
   }
 
-  private void testGetPutLocateEntryFromShellAndGemfire(final Object key, final Object value,
-      Class klass, boolean addRegionPath, boolean expResult) {
+  private void testGetPutLocateEntryFromShellAndGemfire(final Serializable key,
+      final Serializable value, Class klass, boolean addRegionPath, boolean expResult) {
 
     final VM vm1 = Host.getHost(0).getVM(1);
 
@@ -1045,7 +1042,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
     vm1.invoke(checkPutIfAbsentKeys);
     vm2.invoke(checkPutIfAbsentKeys);
-
   }
 
   @Category(FlakyTest.class) // GEODE-1496 (http)
@@ -1194,7 +1190,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       validateResult(cmdResult, true);
       validateLocationsResult(cmdResult, 6); // 3 Regions X 2 members = 6
     }
-
   }
 
   @Test
@@ -1533,7 +1528,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       command = command + " " + "--key=" + keyJson + " --value=" + valueJson + " --region="
           + DATA_REGION_NAME_PATH;
       command = command + " --key-class=" + Key1.class.getCanonicalName() + " --value-class="
-          + Value2.class.getCanonicalName();;
+          + Value2.class.getCanonicalName();
       CommandResult cmdResult = executeCommand(command);
       printCommandOutput(cmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -1563,7 +1558,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       command = command + " " + "--key=" + keyJson + " --value=" + valueJson + " --region="
           + DATA_REGION_NAME_PATH;
       command = command + " --key-class=" + Key1.class.getCanonicalName() + " --value-class="
-          + Car.class.getCanonicalName();;
+          + Car.class.getCanonicalName();
       CommandResult cmdResult = executeCommand(command);
       printCommandOutput(cmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -1775,14 +1770,14 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
         }
       });
 
-      /**
+      /*
        * Add CacheListener
        */
 
       manager.invoke(addCacheListenerInvocations(regionName));
       vm1.invoke(addCacheListenerInvocations(regionName));
 
-      /**
+      /*
        * Import the data
        */
 
@@ -1799,7 +1794,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       getLogWriter().info(resultAsString);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
-      /**
+      /*
        * Validate the region entries after import They must match the entries before export
        */
 
@@ -1812,14 +1807,14 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
         }
       });
 
-      /**
+      /*
        * Verify callbacks were not invoked
        */
 
       manager.invoke(verifyCacheListenerInvocations(regionName, false));
       vm1.invoke(verifyCacheListenerInvocations(regionName, false));
 
-      /**
+      /*
        * Import the data with invokeCallbacks=true
        */
 
@@ -1842,7 +1837,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       commandResultToString(cmdResult);
       assertEquals(Result.Status.OK, cmdResult.getStatus());
 
-      /**
+      /*
        * Verify callbacks were invoked
        */
 
@@ -2272,7 +2267,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
   }
 
   public void waitForListClientMbean(final String regionName) {
-
     final VM manager = Host.getHost(0).getVM(0);
 
     manager.invoke(new SerializableRunnable() {
@@ -2332,7 +2326,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
   @Test
   public void testRegionsViaMbeanAndFunctions() {
-
     setupForGetPutRemoveLocateEntry("tesSimplePut");
     waitForListClientMbean(DATA_REGION_NAME_PATH);
     final VM manager = Host.getHost(0).getVM(0);
@@ -2360,7 +2353,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
     String memSizeFromFunctionCall = (String) manager.invoke(new SerializableCallable() {
       public Object call() {
-        Cache cache = GemFireCacheImpl.getInstance();
+        InternalCache cache = GemFireCacheImpl.getInstance();
         CliUtil.getMembersForeRegionViaFunction(cache, DATA_REGION_NAME_PATH, true);
         return ""
             + CliUtil.getMembersForeRegionViaFunction(cache, DATA_REGION_NAME_PATH, true).size();
@@ -2403,7 +2396,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
 
     String memSizeFromFunctionCall = (String) manager.invoke(new SerializableCallable() {
       public Object call() {
-        Cache cache = GemFireCacheImpl.getInstance();
+        InternalCache cache = GemFireCacheImpl.getInstance();
         return ""
             + CliUtil.getMembersForeRegionViaFunction(cache, REBALANCE_REGION_NAME, true).size();
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
index f2e168a..e3a644d 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
@@ -32,7 +32,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
@@ -80,7 +79,8 @@ public class IndexCommandsJUnitTest {
     mockContext = null;
   }
 
-  private IndexCommands createIndexCommands(final Cache cache, final Execution functionExecutor) {
+  private IndexCommands createIndexCommands(final InternalCache cache,
+      final Execution functionExecutor) {
     return new TestIndexCommands(cache, functionExecutor);
   }
 
@@ -91,7 +91,7 @@ public class IndexCommandsJUnitTest {
 
   @Test
   public void testGetIndexListing() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final AbstractExecution mockFunctionExecutor =
         mockContext.mock(AbstractExecution.class, "Function Executor");
@@ -132,7 +132,7 @@ public class IndexCommandsJUnitTest {
 
   @Test(expected = RuntimeException.class)
   public void testGetIndexListingThrowsRuntimeException() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final Execution mockFunctionExecutor = mockContext.mock(Execution.class, "Function Executor");
 
@@ -155,7 +155,7 @@ public class IndexCommandsJUnitTest {
 
   @Test
   public void testGetIndexListingReturnsFunctionInvocationTargetExceptionInResults() {
-    final Cache mockCache = mockContext.mock(Cache.class, "Cache");
+    final InternalCache mockCache = mockContext.mock(InternalCache.class, "InternalCache");
 
     final AbstractExecution mockFunctionExecutor =
         mockContext.mock(AbstractExecution.class, "Function Executor");
@@ -192,18 +192,18 @@ public class IndexCommandsJUnitTest {
 
   private static class TestIndexCommands extends IndexCommands {
 
-    private final Cache cache;
+    private final InternalCache cache;
     private final Execution functionExecutor;
 
-    protected TestIndexCommands(final Cache cache, final Execution functionExecutor) {
-      assert cache != null : "The Cache cannot be null!";
+    protected TestIndexCommands(final InternalCache cache, final Execution functionExecutor) {
+      assert cache != null : "The InternalCache cannot be null!";
       assert functionExecutor != null : "The function executor cannot be null!";
       this.cache = cache;
       this.functionExecutor = functionExecutor;
     }
 
     @Override
-    protected Cache getCache() {
+    protected InternalCache getCache() {
       return this.cache;
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/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/db79d223/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 fa45927..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,9 +32,6 @@ import java.util.Set;
 
 import junitparams.JUnitParamsRunner;
 import junitparams.Parameters;
-
-import org.apache.geode.internal.cache.InternalCache;
-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;
@@ -41,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;
@@ -50,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;
@@ -63,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
@@ -81,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");
@@ -104,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);
@@ -130,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");
@@ -182,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));
 
@@ -208,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));
@@ -251,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));
 
@@ -277,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));
@@ -341,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));
 
@@ -370,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));
 
@@ -548,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));
 
@@ -586,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);
@@ -611,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);
   }
@@ -637,17 +627,17 @@ 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;
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/db79d223/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);
     });


Mime
View raw message