geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [2/2] incubator-geode git commit: Test cleanup
Date Thu, 28 Apr 2016 02:19:05 GMT
Test cleanup


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

Branch: refs/heads/feature/GEODE-1276
Commit: e4f513ef2eebb8ccad976aeb901ebb91f56b902c
Parents: 98adc3c
Author: Kirk Lund <klund@apache.org>
Authored: Wed Apr 27 19:18:52 2016 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Wed Apr 27 19:18:52 2016 -0700

----------------------------------------------------------------------
 .../domain/CacheElementJUnitTest.java           | 11 +--
 .../configuration/utils/XmlUtilsJUnitTest.java  | 45 +++-------
 ...tionCodesForDistributedSystemMXBeanTest.java |  3 +-
 .../WanCommandsControllerJUnitTest.java         |  2 +-
 .../gemfire/pdx/ByteSourceJUnitTest.java        |  8 +-
 .../gemfire/pdx/OffHeapByteSourceJUnitTest.java |  4 +-
 .../test/process/MainLauncherJUnitTest.java     |  8 +-
 .../internal/LuceneEventListenerJUnitTest.java  |  7 +-
 .../LuceneIndexForPartitionedRegionTest.java    | 27 +++---
 .../LuceneQueryResultsImplJUnitTest.java        |  2 -
 .../PartitionedRepositoryManagerJUnitTest.java  |  7 +-
 .../internal/StringQueryProviderJUnitTest.java  |  2 +-
 .../directory/RegionDirectoryJUnitTest.java     |  5 +-
 .../DistributedScoringJUnitTest.java            | 10 +--
 .../distributed/EntryScoreJUnitTest.java        |  7 +-
 .../LuceneFunctionContextJUnitTest.java         |  7 +-
 .../distributed/LuceneFunctionJUnitTest.java    | 91 ++++++++++----------
 .../TopEntriesCollectorJUnitTest.java           | 29 +++----
 .../TopEntriesFunctionCollectorJUnitTest.java   | 31 +++----
 .../distributed/TopEntriesJUnitTest.java        | 16 ++--
 .../filesystem/FileSystemJUnitTest.java         | 45 +++-------
 .../HeterogeneousLuceneSerializerJUnitTest.java | 14 +--
 .../serializer/PdxFieldMapperJUnitTest.java     | 34 ++++----
 .../ReflectionFieldMapperJUnitTest.java         |  6 +-
 .../xml/LuceneIndexXmlGeneratorJUnitTest.java   | 27 +++---
 .../xml/LuceneIndexXmlParserJUnitTest.java      |  4 +-
 .../ShellCommandsControllerJUnitTest.java       |  4 +-
 ...entVariablesHandlerInterceptorJUnitTest.java |  6 +-
 .../web/http/ClientHttpRequestJUnitTest.java    |  4 +-
 .../RestHttpOperationInvokerJUnitTest.java      | 14 +--
 .../SimpleHttpOperationInvokerJUnitTest.java    |  8 +-
 .../web/util/ConvertUtilsJUnitTest.java         |  4 +-
 32 files changed, 218 insertions(+), 274 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/domain/CacheElementJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/domain/CacheElementJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/domain/CacheElementJUnitTest.java
index df58d1a..274332a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/domain/CacheElementJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/domain/CacheElementJUnitTest.java
@@ -16,16 +16,13 @@
  */
 package com.gemstone.gemfire.management.internal.configuration.domain;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map.Entry;
-
 import javax.xml.XMLConstants;
 
 import org.junit.Test;
@@ -46,13 +43,12 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
  * Test cases for {@link CacheElement}.
  *
  * @see CacheElement
- *
  * @since 8.1
  */
 @Category(UnitTest.class)
 public class CacheElementJUnitTest {
 
-  private static final Document loadSchema(final String schemaLocation) throws Exception {
+  private Document loadSchema(final String schemaLocation) throws Exception {
     final CacheXmlParser entityResolver = new CacheXmlParser();
     final XMLReader xmlReader = XMLReaderFactory.createXMLReader();
     xmlReader.setEntityResolver(entityResolver);
@@ -97,7 +93,6 @@ public class CacheElementJUnitTest {
    * correct order. If we change to use choice for all elements then we can
    * abandon this mapping.
    * 
-   * @throws IOException
    * @since 8.1
    */
   @Test
@@ -134,7 +129,7 @@ public class CacheElementJUnitTest {
     assertTrue("Extra entries in map.", !entries.hasNext());
   }
 
-  protected void assertEntry(final String expectedName, final int expectedOrder, final Entry<String, CacheElement> entry) {
+  private void assertEntry(final String expectedName, final int expectedOrder, final Entry<String, CacheElement> entry) {
     assertEquals("Entry key out of order.", expectedName, entry.getKey());
     assertEquals("Entry value name out of order.", expectedName, entry.getValue().getName());
     assertEquals("Entry value order out of order.", expectedOrder, entry.getValue().getOrder());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/utils/XmlUtilsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/utils/XmlUtilsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/utils/XmlUtilsJUnitTest.java
index 6c1bcca..f0d8c83 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/utils/XmlUtilsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/utils/XmlUtilsJUnitTest.java
@@ -53,13 +53,10 @@ public class XmlUtilsJUnitTest {
 
   /**
    * Test method for {@link XmlUtils#buildSchemaLocationMap(String)}.
-   * @throws IOException 
-   * @throws ParserConfigurationException 
-   * @throws SAXException 
    */
   @Test
-  public void testBuildSchemaLocationMapAttribute() throws SAXException, ParserConfigurationException, IOException {
-    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(this.getClass().getResourceAsStream(
+  public void testBuildSchemaLocationMapAttribute() throws Exception {
+    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(getClass().getResourceAsStream(
         "XmlUtilsJUnitTest.testBuildSchemaLocationMapAttribute.xml")));
     final String schemaLocationAttribute = XmlUtils.getAttribute(doc.getDocumentElement(), W3C_XML_SCHEMA_INSTANCE_ATTRIBUTE_SCHEMA_LOCATION,
         W3C_XML_SCHEMA_INSTANCE_NS_URI);
@@ -85,21 +82,18 @@ public class XmlUtilsJUnitTest {
 
   /**
    * Test method for {@link XmlUtils#buildSchemaLocationMap(Map, String)}.
-   * @throws IOException 
-   * @throws ParserConfigurationException 
-   * @throws SAXException 
    */
   @Test
-  public void testBuildSchemaLocationMapMapOfStringListOfStringAttribute() throws SAXException, ParserConfigurationException, IOException {
+  public void testBuildSchemaLocationMapMapOfStringListOfStringAttribute() throws Exception {
     Map<String, List<String>> schemaLocationMap = new HashMap<>();
 
-    final Document doc1 = XmlUtils.createDocumentFromReader(new InputStreamReader(this.getClass().getResourceAsStream(
+    final Document doc1 = XmlUtils.createDocumentFromReader(new InputStreamReader(getClass().getResourceAsStream(
         "XmlUtilsJUnitTest.testBuildSchemaLocationMapAttribute.xml")));
     final String schemaLocationAttribute1 = XmlUtils.getAttribute(doc1.getDocumentElement(), W3C_XML_SCHEMA_INSTANCE_ATTRIBUTE_SCHEMA_LOCATION,
         W3C_XML_SCHEMA_INSTANCE_NS_URI);
     schemaLocationMap = XmlUtils.buildSchemaLocationMap(schemaLocationMap, schemaLocationAttribute1);
 
-    final Document doc2 = XmlUtils.createDocumentFromReader(new InputStreamReader(this.getClass().getResourceAsStream(
+    final Document doc2 = XmlUtils.createDocumentFromReader(new InputStreamReader(getClass().getResourceAsStream(
         "XmlUtilsJUnitTest.testBuildSchemaLocationMapMapOfStringListOfStringAttribute.xml")));
     final String schemaLocationAttribute2 = XmlUtils.getAttribute(doc2.getDocumentElement(), W3C_XML_SCHEMA_INSTANCE_ATTRIBUTE_SCHEMA_LOCATION,
         W3C_XML_SCHEMA_INSTANCE_NS_URI);
@@ -132,13 +126,10 @@ public class XmlUtilsJUnitTest {
   /**
    * Test method for {@link XmlUtils#buildSchemaLocationMap(Map, String)}.
    * Asserts map is empty if schemaLocation attribute is <code>null</code>.
-   * @throws IOException 
-   * @throws ParserConfigurationException 
-   * @throws SAXException 
    */
   @Test
-  public void testBuildSchemaLocationMapNullAttribute() throws SAXException, ParserConfigurationException, IOException {
-    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(this.getClass().getResourceAsStream(
+  public void testBuildSchemaLocationMapNullAttribute() throws Exception {
+    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(getClass().getResourceAsStream(
         "XmlUtilsJUnitTest.testBuildSchemaLocationMapNullAttribute.xml")));
     final String schemaLocationAttribute = XmlUtils.getAttribute(doc.getDocumentElement(), W3C_XML_SCHEMA_INSTANCE_ATTRIBUTE_SCHEMA_LOCATION,
         W3C_XML_SCHEMA_INSTANCE_NS_URI);
@@ -150,13 +141,10 @@ public class XmlUtilsJUnitTest {
   /**
    * Test method for {@link XmlUtils#buildSchemaLocationMap(Map, String)}.
    * Asserts map is empty if schemaLocation attribute is empty.
-   * @throws IOException 
-   * @throws ParserConfigurationException 
-   * @throws SAXException 
    */
   @Test
-  public void testBuildSchemaLocationMapEmptyAttribute() throws SAXException, ParserConfigurationException, IOException {
-    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(this.getClass().getResourceAsStream(
+  public void testBuildSchemaLocationMapEmptyAttribute() throws Exception {
+    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(getClass().getResourceAsStream(
         "XmlUtilsJUnitTest.testBuildSchemaLocationMapEmptyAttribute.xml")));
     final String schemaLocationAttribute = XmlUtils.getAttribute(doc.getDocumentElement(), W3C_XML_SCHEMA_INSTANCE_ATTRIBUTE_SCHEMA_LOCATION,
         W3C_XML_SCHEMA_INSTANCE_NS_URI);
@@ -168,14 +156,10 @@ public class XmlUtilsJUnitTest {
   /**
    * Test method for
    * {@link XmlUtils#querySingleElement(Node, String, XPathContext)}.
-   * @throws XPathExpressionException 
-   * @throws IOException 
-   * @throws ParserConfigurationException 
-   * @throws SAXException 
    */
   @Test
-  public void testQuerySingleElement() throws XPathExpressionException, SAXException, ParserConfigurationException, IOException {
-    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(this.getClass().getResourceAsStream(
+  public void testQuerySingleElement() throws Exception {
+    final Document doc = XmlUtils.createDocumentFromReader(new InputStreamReader(getClass().getResourceAsStream(
         "XmlUtilsJUnitTest.testQuerySingleElement.xml")));
     final Element root = doc.getDocumentElement();
     final String cacheNamespace = "http://geode.apache.org/schema/cache";
@@ -208,19 +192,16 @@ public class XmlUtilsJUnitTest {
     try {
       XmlUtils.querySingleElement(root, q4, cacheXPathContext);
       fail("Expected XPathExpressionException");
-    } catch (XPathExpressionException e) {
+    } catch (XPathExpressionException expected) {
       // ignore
     }
-
   }
 
   /**
    * Test method for {@link XmlUtils#changeNamespace(Node, String, String)}.
-   * @throws XPathExpressionException 
-   * @throws ParserConfigurationException 
    */
   @Test
-  public void testChangeNamespace() throws XPathExpressionException, ParserConfigurationException {
+  public void testChangeNamespace() throws Exception {
     Document doc = XmlUtils.getDocumentBuilder().newDocument();
     Element root = doc.createElement("root");
     root = (Element) doc.appendChild(root);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
index 8b7edbf..2ffedb0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
@@ -26,12 +26,13 @@ import org.junit.experimental.categories.Category;
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
 import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
 import com.gemstone.gemfire.management.internal.security.ResourceOperationContext.ResourceOperationCode;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 /**
  * Tests operation codes for DistributedSystemMXBean operations.
  */
-@Category(UnitTest.class)
+@Category({ UnitTest.class, SecurityTest.class })
 public class OperationCodesForDistributedSystemMXBeanTest {
 
   private final String[] distributedSystemMXBeanOperations = {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/WanCommandsControllerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/WanCommandsControllerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/WanCommandsControllerJUnitTest.java
index 4a36384..03d39fd 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/WanCommandsControllerJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/WanCommandsControllerJUnitTest.java
@@ -125,7 +125,7 @@ public class WanCommandsControllerJUnitTest {
    * performed by two different classes. Then we could mock the executor
    * class while testing just the command string definition class.
    */
-  public static class TestableWanCommandsController extends WanCommandsController {
+  private static class TestableWanCommandsController extends WanCommandsController {
 
     protected String testableCommand;
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/pdx/ByteSourceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/ByteSourceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ByteSourceJUnitTest.java
index 11ac89c..fd9c5e3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/ByteSourceJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ByteSourceJUnitTest.java
@@ -39,7 +39,10 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
 public class ByteSourceJUnitTest {
-  
+
+  /**
+   * Override as needed in subclass.
+   */
   protected ByteSource createByteSource(byte[] bytes) {
     return ByteSourceFactory.wrap(bytes);
   }
@@ -617,6 +620,9 @@ public class ByteSourceJUnitTest {
     }
   }
 
+  /**
+   * Override as needed in subclass.
+   */
   protected boolean isTestOffHeap() {
     return false;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/pdx/OffHeapByteSourceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/OffHeapByteSourceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/OffHeapByteSourceJUnitTest.java
index 7946b7e..c914e3f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/OffHeapByteSourceJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/OffHeapByteSourceJUnitTest.java
@@ -35,12 +35,12 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 public class OffHeapByteSourceJUnitTest extends ByteSourceJUnitTest {
 
   @Before
-  public void setUp() throws Exception {
+  public final void setUp() throws Exception {
     MemoryAllocatorImpl.createForUnitTest(new NullOutOfOffHeapMemoryListener(), new NullOffHeapMemoryStats(), new SlabImpl[]{new SlabImpl(1024*1024)});
   }
 
   @After
-  public void tearDown() throws Exception {
+  public final void tearDown() throws Exception {
     MemoryAllocatorImpl.freeOffHeapMemory();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-core/src/test/java/com/gemstone/gemfire/test/process/MainLauncherJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/process/MainLauncherJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/process/MainLauncherJUnitTest.java
index 5d1c05f..230a9d4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/process/MainLauncherJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/process/MainLauncherJUnitTest.java
@@ -43,14 +43,14 @@ public class MainLauncherJUnitTest {
 
   private static final long TIMEOUT_SECONDS = 10;
 
-  @Rule
-  public final TextFromStandardInputStream systemInMock = emptyStandardInputStream();
-  
   private static volatile boolean flag = false;
-  
+
   private final String launchedClass = getClass().getName();
   private ExecutorService futures;
 
+  @Rule
+  public final TextFromStandardInputStream systemInMock = emptyStandardInputStream();
+  
   @Before
   public void before() {
     flag = false;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
index b0e3cc0..9660393 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
@@ -20,16 +20,13 @@ package com.gemstone.gemfire.cache.lucene.internal;
 
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.atLeast;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.*;
 
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
 import junit.framework.AssertionFailedError;
-
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.Mockito;
@@ -37,9 +34,9 @@ import org.mockito.Mockito;
 import com.gemstone.gemfire.cache.Operation;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
+import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository;
 import com.gemstone.gemfire.cache.lucene.internal.repository.RepositoryManager;
 import com.gemstone.gemfire.internal.cache.BucketNotFoundException;
-import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
index 74d4e34..ff22f85 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
@@ -16,31 +16,28 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package com.gemstone.gemfire.cache.lucene.internal;
 
+import static org.junit.Assert.*;
 import static org.mockito.Mockito.*;
 
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.PartitionAttributes;
-import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.RegionFactory;
 import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueueFactory;
 import com.gemstone.gemfire.cache.asyncqueue.internal.AsyncEventQueueFactoryImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.extension.ExtensionPoint;
 import com.gemstone.gemfire.test.fake.Fakes;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.ExpectedException;
-
 @Category(UnitTest.class)
 public class LuceneIndexForPartitionedRegionTest {
 
@@ -53,7 +50,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String regionPath = "regionName";
     Cache cache = null;
     LuceneIndexForPartitionedRegion index = new LuceneIndexForPartitionedRegion(name, regionPath, cache);
-    Assert.assertEquals(name, index.getName());
+    assertEquals(name, index.getName());
   }
 
   @Test
@@ -62,7 +59,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String regionPath = "regionName";
     Cache cache = null;
     LuceneIndexForPartitionedRegion index = new LuceneIndexForPartitionedRegion(name, regionPath, cache);
-    Assert.assertEquals(regionPath, index.getRegionPath());
+    assertEquals(regionPath, index.getRegionPath());
   }
 
   @Test
@@ -75,7 +72,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String fileRegionName = index.createFileRegionName();
     when(cache.getRegion(fileRegionName)).thenReturn(region);
 
-    Assert.assertTrue(index.fileRegionExists(fileRegionName));
+    assertTrue(index.fileRegionExists(fileRegionName));
   }
 
   @Test
@@ -87,7 +84,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String fileRegionName = index.createFileRegionName();
     when(cache.getRegion(fileRegionName)).thenReturn(null);
 
-    Assert.assertFalse(index.fileRegionExists(fileRegionName));
+    assertFalse(index.fileRegionExists(fileRegionName));
   }
 
   @Test
@@ -100,7 +97,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String chunkRegionName = index.createChunkRegionName();
     when(cache.getRegion(chunkRegionName)).thenReturn(region);
 
-    Assert.assertTrue(index.chunkRegionExists(chunkRegionName));
+    assertTrue(index.chunkRegionExists(chunkRegionName));
   }
 
   @Test
@@ -112,7 +109,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String chunkRegionName = index.createChunkRegionName();
     when(cache.getRegion(chunkRegionName)).thenReturn(null);
 
-    Assert.assertFalse(index.chunkRegionExists(chunkRegionName));
+    assertFalse(index.chunkRegionExists(chunkRegionName));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryResultsImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryResultsImplJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryResultsImplJUnitTest.java
index 0398de1..9c3a65e 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryResultsImplJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryResultsImplJUnitTest.java
@@ -25,13 +25,11 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.Mockito;
-import org.mockito.internal.stubbing.defaultanswers.ForwardsInvocations;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/PartitionedRepositoryManagerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/PartitionedRepositoryManagerJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/PartitionedRepositoryManagerJUnitTest.java
index d6abca0..4532d16 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/PartitionedRepositoryManagerJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/PartitionedRepositoryManagerJUnitTest.java
@@ -18,11 +18,8 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.*;
 
 import java.io.IOException;
 import java.util.Arrays;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProviderJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProviderJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProviderJUnitTest.java
index a223c6e..dded69c 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProviderJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProviderJUnitTest.java
@@ -36,7 +36,7 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class StringQueryProviderJUnitTest {
 
-  LuceneIndex mockIndex;
+  private LuceneIndex mockIndex;
 
   @Before
   public void initMocksAndCommonObjects() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
index 92a822b..e8118c5 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
@@ -22,12 +22,12 @@ import java.io.IOException;
 import java.nio.file.Path;
 import java.util.concurrent.ConcurrentHashMap;
 
+import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
 import org.apache.lucene.store.BaseDirectoryTestCase;
 import org.apache.lucene.store.Directory;
 import org.junit.Rule;
 import org.junit.experimental.categories.Category;
 
-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
 import com.gemstone.gemfire.cache.lucene.internal.filesystem.ChunkKey;
 import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
@@ -44,7 +44,8 @@ public class RegionDirectoryJUnitTest extends BaseDirectoryTestCase {
 
   @Rule
   public SystemPropertiesRestoreRule restoreProps = new SystemPropertiesRestoreRule();
-  
+
+  @Override
   protected Directory getDirectory(Path path) throws IOException {
     
     //This is super lame, but log4j automatically sets the system property, and the lucene

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/DistributedScoringJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/DistributedScoringJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/DistributedScoringJUnitTest.java
index c8b1747..7bcc761 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/DistributedScoringJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/DistributedScoringJUnitTest.java
@@ -46,11 +46,11 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class DistributedScoringJUnitTest {
 
-  String[] indexedFields = new String[] { "txt" };
-  HeterogeneousLuceneSerializer mapper = new HeterogeneousLuceneSerializer(indexedFields);
+  private String[] indexedFields = new String[] { "txt" };
+  private HeterogeneousLuceneSerializer mapper = new HeterogeneousLuceneSerializer(indexedFields);
 
-  final StandardAnalyzer analyzer = new StandardAnalyzer();
-  Region<String, String> region;
+  private final StandardAnalyzer analyzer = new StandardAnalyzer();
+  private Region<String, String> region;
 
   @Before
   public void createMocks() {
@@ -58,7 +58,7 @@ public class DistributedScoringJUnitTest {
     Mockito.when(region.isDestroyed()).thenReturn(false);
   }
 
-  /*
+  /**
    * The goal of this test is to verify fair scoring if entries are uniformly distributed. It compares ordered results
    * from a single IndexRepository (IR) with merged-ordered results from multiple repositories (ir1, ir2, ir3). The
    * records inserted in IR are same as the combined records in irX. This simulates merging of results from buckets of a

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/EntryScoreJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/EntryScoreJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/EntryScoreJUnitTest.java
index 93d09c8..bcb34e2 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/EntryScoreJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/EntryScoreJUnitTest.java
@@ -18,7 +18,8 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.distributed;
 
-import org.junit.Assert;
+import static org.junit.Assert.*;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -34,7 +35,7 @@ public class EntryScoreJUnitTest {
     LuceneServiceImpl.registerDataSerializables();
     EntryScore entry = new EntryScore("entry", .1f);
     EntryScore copy = CopyHelper.deepCopy(entry);
-    Assert.assertEquals("entry", copy.getKey());
-    Assert.assertEquals(.1f, copy.getScore(), 0f);
+    assertEquals("entry", copy.getKey());
+    assertEquals(.1f, copy.getScore(), 0f);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionContextJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionContextJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionContextJUnitTest.java
index eea8f3c..39a4dde 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionContextJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionContextJUnitTest.java
@@ -18,15 +18,12 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.distributed;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
-import org.junit.Assert;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.mockito.Mockito;
 
 import com.gemstone.gemfire.CopyHelper;
-import com.gemstone.gemfire.cache.lucene.LuceneIndex;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryFactory;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryProvider;
 import com.gemstone.gemfire.cache.lucene.internal.LuceneServiceImpl;
@@ -55,7 +52,7 @@ public class LuceneFunctionContextJUnitTest {
 
     LuceneFunctionContext<TopEntriesCollector> copy = CopyHelper.deepCopy(context);
     assertEquals(123, copy.getLimit());
-    Assert.assertNotNull(copy.getQueryProvider());
+    assertNotNull(copy.getQueryProvider());
     assertEquals("text", ((StringQueryProvider) copy.getQueryProvider()).getQueryString());
     assertEquals(TopEntriesCollectorManager.class, copy.getCollectorManager().getClass());
     assertEquals("test", ((TopEntriesCollectorManager) copy.getCollectorManager()).getId());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
index 0e0d28a..f5f1374 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
@@ -18,7 +18,7 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.distributed;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -57,38 +57,37 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class LuceneFunctionJUnitTest {
 
-  Mockery mocker;
+  private Mockery mockery;
 
-  String regionPath = "/region";
-  String indexName = "index";
-  final EntryScore r1_1 = new EntryScore("key-1-1", .5f);
-  final EntryScore r1_2 = new EntryScore("key-1-2", .4f);
-  final EntryScore r1_3 = new EntryScore("key-1-3", .3f);
-  final EntryScore r2_1 = new EntryScore("key-2-1", .45f);
-  final EntryScore r2_2 = new EntryScore("key-2-2", .35f);
+  private String regionPath = "/region";
+  private final EntryScore r1_1 = new EntryScore("key-1-1", .5f);
+  private final EntryScore r1_2 = new EntryScore("key-1-2", .4f);
+  private final EntryScore r1_3 = new EntryScore("key-1-3", .3f);
+  private final EntryScore r2_1 = new EntryScore("key-2-1", .45f);
+  private final EntryScore r2_2 = new EntryScore("key-2-2", .35f);
 
-  InternalRegionFunctionContext mockContext;
-  ResultSender<TopEntriesCollector> mockResultSender;
-  Region<Object, Object> mockRegion;
+  private InternalRegionFunctionContext mockContext;
+  private ResultSender<TopEntriesCollector> mockResultSender;
+  private Region<Object, Object> mockRegion;
 
-  RepositoryManager mockRepoManager;
-  IndexRepository mockRepository1;
-  IndexRepository mockRepository2;
-  IndexResultCollector mockCollector;
-  InternalLuceneService mockService;
-  InternalLuceneIndex mockIndex;
+  private RepositoryManager mockRepoManager;
+  private IndexRepository mockRepository1;
+  private IndexRepository mockRepository2;
+  private IndexResultCollector mockCollector;
+  private InternalLuceneService mockService;
+  private InternalLuceneIndex mockIndex;
 
-  ArrayList<IndexRepository> repos;
-  LuceneFunctionContext<IndexResultCollector> searchArgs;
-  LuceneQueryProvider queryProvider;
-  Query query;
+  private ArrayList<IndexRepository> repos;
+  private LuceneFunctionContext<IndexResultCollector> searchArgs;
+  private LuceneQueryProvider queryProvider;
+  private Query query;
 
   private InternalCache mockCache;
 
   @Test
   public void testRepoQueryAndMerge() throws Exception {
     final AtomicReference<TopEntriesCollector> result = new AtomicReference<>();
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -149,7 +148,7 @@ public class LuceneFunctionJUnitTest {
 
     searchArgs = new LuceneFunctionContext<IndexResultCollector>(queryProvider, "indexName", null, 3);
 
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -206,9 +205,9 @@ public class LuceneFunctionJUnitTest {
 
   @Test
   public void injectCustomCollectorManager() throws Exception {
-    final CollectorManager mockManager = mocker.mock(CollectorManager.class);
+    final CollectorManager mockManager = mockery.mock(CollectorManager.class);
     searchArgs = new LuceneFunctionContext<IndexResultCollector>(queryProvider, "indexName", mockManager);
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -257,7 +256,7 @@ public class LuceneFunctionJUnitTest {
 
   @Test
   public void testIndexRepoQueryFails() throws Exception {
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -283,7 +282,7 @@ public class LuceneFunctionJUnitTest {
 
   @Test
   public void testBucketNotFound() throws Exception {
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -306,9 +305,9 @@ public class LuceneFunctionJUnitTest {
 
   @Test
   public void testReduceError() throws Exception {
-    final CollectorManager mockManager = mocker.mock(CollectorManager.class);
+    final CollectorManager mockManager = mockery.mock(CollectorManager.class);
     searchArgs = new LuceneFunctionContext<IndexResultCollector>(queryProvider, "indexName", mockManager);
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -338,9 +337,9 @@ public class LuceneFunctionJUnitTest {
 
   @Test
   public void queryProviderErrorIsHandled() throws Exception {
-    queryProvider = mocker.mock(LuceneQueryProvider.class);
+    queryProvider = mockery.mock(LuceneQueryProvider.class);
     searchArgs = new LuceneFunctionContext<IndexResultCollector>(queryProvider, "indexName");
-    mocker.checking(new Expectations() {
+    mockery.checking(new Expectations() {
       {
         oneOf(mockContext).getDataSet();
         will(returnValue(mockRegion));
@@ -369,35 +368,35 @@ public class LuceneFunctionJUnitTest {
 
   @Before
   public void createMocksAndCommonObjects() throws Exception {
-    mocker = new Mockery() {
+    mockery = new Mockery() {
       {
         setImposteriser(ClassImposteriser.INSTANCE);
         setThreadingPolicy(new Synchroniser());
       }
     };
 
-    mockContext = mocker.mock(InternalRegionFunctionContext.class);
-    mockResultSender = mocker.mock(ResultSender.class);
-    mockRegion = mocker.mock(Region.class);
+    mockContext = mockery.mock(InternalRegionFunctionContext.class);
+    mockResultSender = mockery.mock(ResultSender.class);
+    mockRegion = mockery.mock(Region.class);
 
-    mockRepoManager = mocker.mock(RepositoryManager.class);
-    mockRepository1 = mocker.mock(IndexRepository.class, "repo1");
-    mockRepository2 = mocker.mock(IndexRepository.class, "repo2");
-    mockCollector = mocker.mock(IndexResultCollector.class);
+    mockRepoManager = mockery.mock(RepositoryManager.class);
+    mockRepository1 = mockery.mock(IndexRepository.class, "repo1");
+    mockRepository2 = mockery.mock(IndexRepository.class, "repo2");
+    mockCollector = mockery.mock(IndexResultCollector.class);
 
     repos = new ArrayList<IndexRepository>();
     repos.add(mockRepository1);
     repos.add(mockRepository2);
     
-    mockIndex = mocker.mock(InternalLuceneIndex.class);
-    mockService = mocker.mock(InternalLuceneService.class);
-    mockCache = mocker.mock(InternalCache.class);
+    mockIndex = mockery.mock(InternalLuceneIndex.class);
+    mockService = mockery.mock(InternalLuceneService.class);
+    mockCache = mockery.mock(InternalCache.class);
 
     queryProvider = new StringQueryProvider("gemfire:lucene");
     
     searchArgs = new LuceneFunctionContext<IndexResultCollector>(queryProvider, "indexName");
     
-    mocker.checking(new Expectations() {{
+    mockery.checking(new Expectations() {{
       allowing(mockRegion).getCache();
       will(returnValue(mockCache));
       allowing(mockRegion).getFullPath();
@@ -417,7 +416,7 @@ public class LuceneFunctionJUnitTest {
 
   @After
   public void validateMock() {
-    mocker.assertIsSatisfied();
-    mocker = null;
+    mockery.assertIsSatisfied();
+    mockery = null;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesCollectorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesCollectorJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesCollectorJUnitTest.java
index e634945..9e2f310 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesCollectorJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesCollectorJUnitTest.java
@@ -18,12 +18,11 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.distributed;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -36,18 +35,18 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class TopEntriesCollectorJUnitTest {
 
-  EntryScore r1_1 = new EntryScore("1-1", .9f);
-  EntryScore r1_2 = new EntryScore("1-2", .7f);
-  EntryScore r1_3 = new EntryScore("1-3", .5f);
+  private EntryScore r1_1 = new EntryScore("1-1", .9f);
+  private EntryScore r1_2 = new EntryScore("1-2", .7f);
+  private EntryScore r1_3 = new EntryScore("1-3", .5f);
 
-  EntryScore r2_1 = new EntryScore("2-1", .85f);
-  EntryScore r2_2 = new EntryScore("2-2", .65f);
+  private EntryScore r2_1 = new EntryScore("2-1", .85f);
+  private EntryScore r2_2 = new EntryScore("2-2", .65f);
 
-  EntryScore r3_1 = new EntryScore("3-1", .8f);
-  EntryScore r3_2 = new EntryScore("3-2", .6f);
-  EntryScore r3_3 = new EntryScore("3-3", .4f);
+  private EntryScore r3_1 = new EntryScore("3-1", .8f);
+  private EntryScore r3_2 = new EntryScore("3-2", .6f);
+  private EntryScore r3_3 = new EntryScore("3-3", .4f);
 
-  TopEntriesCollectorManager manager;
+  private TopEntriesCollectorManager manager;
 
   @Before
   public void setup() {
@@ -122,16 +121,16 @@ public class TopEntriesCollectorJUnitTest {
     TopEntriesJUnitTest.verifyResultOrder(c1.getEntries().getHits(), r1_1, r1_2, r1_3);
 
     ListScanner scanner = new ListScanner(c1.getEntries().getHits());
-    Assert.assertTrue(scanner.hasNext());
+    assertTrue(scanner.hasNext());
     assertEquals(r1_1.getKey(), scanner.peek().getKey());
     assertEquals(r1_1.getKey(), scanner.next().getKey());
-    Assert.assertTrue(scanner.hasNext());
+    assertTrue(scanner.hasNext());
     assertEquals(r1_2.getKey(), scanner.peek().getKey());
     assertEquals(r1_2.getKey(), scanner.next().getKey());
-    Assert.assertTrue(scanner.hasNext());
+    assertTrue(scanner.hasNext());
     assertEquals(r1_3.getKey(), scanner.peek().getKey());
     assertEquals(r1_3.getKey(), scanner.next().getKey());
-    Assert.assertFalse(scanner.hasNext());
+    assertFalse(scanner.hasNext());
 
     assertEquals(3, c1.getEntries().getHits().size());
     TopEntriesJUnitTest.verifyResultOrder(c1.getEntries().getHits(), r1_1, r1_2, r1_3);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesFunctionCollectorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesFunctionCollectorJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesFunctionCollectorJUnitTest.java
index bbfb735..4172761 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesFunctionCollectorJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesFunctionCollectorJUnitTest.java
@@ -18,10 +18,9 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.distributed;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
 
 import java.io.IOException;
 import java.util.Collection;
@@ -29,12 +28,10 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.ArgumentMatcher;
-import org.mockito.Mockito;
 
 import com.gemstone.gemfire.CancelCriterion;
 import com.gemstone.gemfire.cache.execute.FunctionException;
@@ -44,8 +41,8 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class TopEntriesFunctionCollectorJUnitTest {
 
-  EntryScore r1_1, r1_2, r2_1, r2_2;
-  TopEntriesCollector result1, result2;
+  private EntryScore r1_1, r1_2, r2_1, r2_2;
+  private TopEntriesCollector result1, result2;
 
   @Before
   public void initializeCommonObjects() {
@@ -211,7 +208,7 @@ public class TopEntriesFunctionCollectorJUnitTest {
     collector.endResults();
 
     TopEntries merged = collector.getResult();
-    Assert.assertNotNull(merged);
+    assertNotNull(merged);
     assertEquals(3, merged.size());
     TopEntriesJUnitTest.verifyResultOrder(merged.getHits(), r1_1, r2_1, r1_2);
   }
@@ -224,7 +221,7 @@ public class TopEntriesFunctionCollectorJUnitTest {
     collector.endResults();
 
     TopEntries merged = collector.getResult();
-    Assert.assertNotNull(merged);
+    assertNotNull(merged);
     assertEquals(4, merged.size());
     TopEntriesJUnitTest.verifyResultOrder(merged.getHits(), r1_1, r2_1, r1_2, r2_2);
   }
@@ -237,12 +234,12 @@ public class TopEntriesFunctionCollectorJUnitTest {
     collector.endResults();
     
     TopEntries merged = collector.getResult();
-    Assert.assertNotNull(merged);
+    assertNotNull(merged);
     assertEquals(4, merged.size());
     TopEntriesJUnitTest.verifyResultOrder(merged.getHits(), r1_1, r2_1, r1_2, r2_2);
     
     merged = collector.getResult();
-    Assert.assertNotNull(merged);
+    assertNotNull(merged);
     assertEquals(4, merged.size());
     TopEntriesJUnitTest.verifyResultOrder(merged.getHits(), r1_1, r2_1, r1_2, r2_2);
   }
@@ -251,11 +248,11 @@ public class TopEntriesFunctionCollectorJUnitTest {
   public void mergeResultsCustomCollectorManager() throws Exception {
     TopEntries resultEntries = new TopEntries();
     TopEntriesCollector mockCollector = mock(TopEntriesCollector.class);
-    Mockito.doReturn(resultEntries).when(mockCollector).getEntries();
+    doReturn(resultEntries).when(mockCollector).getEntries();
 
     CollectorManager<TopEntriesCollector> mockManager = mock(CollectorManager.class);
-    Mockito.doReturn(mockCollector).when(mockManager)
-        .reduce(Mockito.argThat(new ArgumentMatcher<Collection<TopEntriesCollector>>() {
+    doReturn(mockCollector).when(mockManager)
+        .reduce(argThat(new ArgumentMatcher<Collection<TopEntriesCollector>>() {
           @Override
           public boolean matches(Object argument) {
             Collection<TopEntriesCollector> collectors = (Collection<TopEntriesCollector>) argument;
@@ -282,7 +279,7 @@ public class TopEntriesFunctionCollectorJUnitTest {
     collector.endResults();
 
     TopEntries merged = collector.getResult();
-    Assert.assertNotNull(merged);
+    assertNotNull(merged);
     assertEquals(2, merged.size());
     TopEntriesJUnitTest.verifyResultOrder(merged.getHits(), r2_1, r2_2);
   }
@@ -290,7 +287,7 @@ public class TopEntriesFunctionCollectorJUnitTest {
   @Test(expected = FunctionException.class)
   public void testExceptionDuringMerge() throws Exception {
     TopEntriesCollectorManager mockManager = mock(TopEntriesCollectorManager.class);
-    Mockito.doThrow(new IOException()).when(mockManager).reduce(any(Collection.class));
+    doThrow(new IOException()).when(mockManager).reduce(any(Collection.class));
 
     LuceneFunctionContext<TopEntriesCollector> context = new LuceneFunctionContext<>(null, null, mockManager);
     TopEntriesFunctionCollector collector = new TopEntriesFunctionCollector(context);
@@ -315,7 +312,7 @@ public class TopEntriesFunctionCollectorJUnitTest {
   @Test
   public void testCollectorName() {
     GemFireCacheImpl mockCache = mock(GemFireCacheImpl.class);
-    Mockito.doReturn("server").when(mockCache).getName();
+    doReturn("server").when(mockCache).getName();
 
     TopEntriesFunctionCollector function = new TopEntriesFunctionCollector(null, mockCache);
     assertEquals("server", function.id);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesJUnitTest.java
index 923553c..410d0ef 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/TopEntriesJUnitTest.java
@@ -18,8 +18,7 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.distributed;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.util.Collection;
 import java.util.Iterator;
@@ -40,12 +39,12 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class TopEntriesJUnitTest {
 
-  Mockery mockContext;
+  private Mockery mockContext;
 
-  EntryScore r1_1 = new EntryScore("3", .9f);
-  EntryScore r1_2 = new EntryScore("1", .8f);
-  EntryScore r2_1 = new EntryScore("2", 0.85f);
-  EntryScore r2_2 = new EntryScore("4", 0.1f);
+  private EntryScore r1_1 = new EntryScore("3", .9f);
+  private EntryScore r1_2 = new EntryScore("1", .8f);
+  private EntryScore r2_1 = new EntryScore("2", 0.85f);
+  private EntryScore r2_2 = new EntryScore("4", 0.1f);
 
   @Test
   public void testPopulateTopEntries() {
@@ -115,7 +114,8 @@ public class TopEntriesJUnitTest {
     assertEquals(3, copy.size());
     verifyResultOrder(copy.getHits(), r1_1, r2_1, r1_2);
   }
-  
+
+  // TODO: extract to lucene test util class
   public static void verifyResultOrder(Collection<EntryScore> list, EntryScore... expectedEntries) {
     Iterator<EntryScore> iter = list.iterator();
     for (EntryScore expectedEntry : expectedEntries) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/filesystem/FileSystemJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/filesystem/FileSystemJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/filesystem/FileSystemJUnitTest.java
index 31dca00..1d936ca 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/filesystem/FileSystemJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/filesystem/FileSystemJUnitTest.java
@@ -18,13 +18,9 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.filesystem;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -67,7 +63,7 @@ public class FileSystemJUnitTest {
    * A test of reading and writing to a file.
    */
   @Test
-  public void testReadWriteBytes() throws IOException {
+  public void testReadWriteBytes() throws Exception {
     long start = System.currentTimeMillis();
     
     File file1= system.createFile("testFile1");
@@ -143,7 +139,7 @@ public class FileSystemJUnitTest {
    * but they should not hurt each other.
    */
   @Test
-  public void testCloneReader() throws IOException {
+  public void testCloneReader() throws Exception {
     File file1= system.createFile("testFile1");
     
     byte[] data = writeRandomBytes(file1);
@@ -180,7 +176,7 @@ public class FileSystemJUnitTest {
    * A test that skip can jump to the correct position in the stream
    */
   @Test
-  public void testSeek() throws IOException {
+  public void testSeek() throws Exception {
     File file= system.createFile("testFile1");
 
     ByteArrayOutputStream expected = new ByteArrayOutputStream();
@@ -238,10 +234,9 @@ public class FileSystemJUnitTest {
 
   /**
    * Test basic file operations - rename, delete, listFiles.
-   * @throws IOException
    */
   @Test
-  public void testFileOperations() throws IOException {
+  public void testFileOperations() throws Exception {
     String name1 = "testFile1";
     File file1= system.createFile(name1);
     byte[] file1Data = writeRandomBytes(file1);
@@ -292,19 +287,17 @@ public class FileSystemJUnitTest {
   
   /**
    * Test what happens if you have an unclosed stream and you create a new file.
-   * @throws IOException
    */
   @Test
-  public void testUnclosedStreamSmallFile() throws IOException {
+  public void testUnclosedStreamSmallFile() throws Exception {
     doUnclosedStream(SMALL_CHUNK);
   }
   
   /**
    * Test what happens if you have an unclosed stream and you create a new file.
-   * @throws IOException
    */
   @Test
-  public void testUnclosedStreamLargeFile() throws IOException {
+  public void testUnclosedStreamLargeFile() throws Exception {
     doUnclosedStream(LARGE_CHUNK);
   }
   
@@ -346,7 +339,7 @@ public class FileSystemJUnitTest {
    * the partial rename.
    */
   @Test
-  public void testPartialRename() throws IOException {
+  public void testPartialRename() throws Exception {
 
     final CountOperations countOperations = new CountOperations();
     //Create a couple of mock regions where we count the operations
@@ -387,7 +380,7 @@ public class FileSystemJUnitTest {
     try {
       system.renameFile(name2, name3);
       fail("should have seen an error");
-    } catch(CacheClosedException e) {
+    } catch(CacheClosedException expectedException) {
       
     }
     
@@ -413,7 +406,7 @@ public class FileSystemJUnitTest {
    * the partial rename.
    */
   @Test
-  public void testPartialDelete() throws IOException {
+  public void testPartialDelete() throws Exception {
 
     final CountOperations countOperations = new CountOperations();
     //Create a couple of mock regions where we count the operations
@@ -456,8 +449,7 @@ public class FileSystemJUnitTest {
     try {
       system.deleteFile(name2);
       fail("should have seen an error");
-    } catch(CacheClosedException e) {
-      
+    } catch(CacheClosedException expectedException) {
     }
     
     system = new FileSystem(fileRegion, chunkRegion);
@@ -471,17 +463,8 @@ public class FileSystemJUnitTest {
       file2 = system.getFile(name2);
       assertContents(expected.toByteArray(), file2);
     }
-    
   }
 
-  private File getOrCreateFile(String name) throws IOException {
-    try {
-      return system.getFile(name);
-    } catch(FileNotFoundException e) {
-      return system.createFile(name);
-    }
-  }
-  
   private void assertContents(byte[] data, File file) throws IOException {
     assertEquals(data.length, file.getLength());
     
@@ -512,11 +495,11 @@ public class FileSystemJUnitTest {
     outputStream.close();
   }
   
-  public byte[] getRandomBytes() {
+  private byte[] getRandomBytes() {
     return getRandomBytes(rand.nextInt(LARGE_CHUNK) + SMALL_CHUNK);
   }
-  
-  public byte[] getRandomBytes(int length) {
+
+  private byte[] getRandomBytes(int length) {
     byte[] data = new byte[length];
     rand.nextBytes(data);
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/HeterogeneousLuceneSerializerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/HeterogeneousLuceneSerializerJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/HeterogeneousLuceneSerializerJUnitTest.java
index 0cafc57..3bce904 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/HeterogeneousLuceneSerializerJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/HeterogeneousLuceneSerializerJUnitTest.java
@@ -18,12 +18,12 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.repository.serializer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
 
 import org.apache.lucene.document.Document;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.mockito.Mockito;
 
 import com.gemstone.gemfire.pdx.PdxInstance;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
@@ -68,12 +68,12 @@ public class HeterogeneousLuceneSerializerJUnitTest {
     assertEquals(3.0, doc2.getField("d").numericValue());
     assertEquals(4.0f, doc2.getField("f").numericValue());
     
-    PdxInstance i = Mockito.mock(PdxInstance.class);
+    PdxInstance i = mock(PdxInstance.class);
     
-    Mockito.when(i.hasField("s")).thenReturn(true);
-    Mockito.when(i.hasField("i")).thenReturn(true);
-    Mockito.when(i.getField("s")).thenReturn("a");
-    Mockito.when(i.getField("i")).thenReturn(5);
+    when(i.hasField("s")).thenReturn(true);
+    when(i.hasField("i")).thenReturn(true);
+    when(i.getField("s")).thenReturn("a");
+    when(i.getField("i")).thenReturn(5);
     
     Document doc3 = new Document();
     mapper.toDocument(i, doc3);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxFieldMapperJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxFieldMapperJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxFieldMapperJUnitTest.java
index fab1bc3..278e818 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxFieldMapperJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxFieldMapperJUnitTest.java
@@ -18,12 +18,12 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.repository.serializer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
 
 import org.apache.lucene.document.Document;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.mockito.Mockito;
 
 import com.gemstone.gemfire.pdx.PdxInstance;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
@@ -40,13 +40,12 @@ public class PdxFieldMapperJUnitTest {
     String[] fields = new String[] {"s", "i"};
     PdxLuceneSerializer mapper = new PdxLuceneSerializer(fields);
     
-    PdxInstance i = Mockito.mock(PdxInstance.class);
-    
-    Mockito.when(i.hasField("s")).thenReturn(true);
-    Mockito.when(i.hasField("i")).thenReturn(true);
-    Mockito.when(i.getField("s")).thenReturn("a");
-    Mockito.when(i.getField("i")).thenReturn(5);
+    PdxInstance i = mock(PdxInstance.class);
     
+    when(i.hasField("s")).thenReturn(true);
+    when(i.hasField("i")).thenReturn(true);
+    when(i.getField("s")).thenReturn("a");
+    when(i.getField("i")).thenReturn(5);
     
     Document doc = new Document();
     mapper.toDocument(i, doc);
@@ -61,17 +60,16 @@ public class PdxFieldMapperJUnitTest {
     String[] fields = new String[] {"s", "i", "s2", "o"};
     PdxLuceneSerializer mapper = new PdxLuceneSerializer(fields);
     
-    PdxInstance i = Mockito.mock(PdxInstance.class);
-    
-    Mockito.when(i.hasField("s")).thenReturn(true);
-    Mockito.when(i.hasField("i")).thenReturn(true);
-    Mockito.when(i.hasField("o")).thenReturn(true);
-    Mockito.when(i.hasField("o2")).thenReturn(true);
-    Mockito.when(i.getField("s")).thenReturn("a");
-    Mockito.when(i.getField("i")).thenReturn(5);
-    Mockito.when(i.getField("o")).thenReturn(new Object());
-    Mockito.when(i.getField("o2")).thenReturn(new Object());
+    PdxInstance i = mock(PdxInstance.class);
     
+    when(i.hasField("s")).thenReturn(true);
+    when(i.hasField("i")).thenReturn(true);
+    when(i.hasField("o")).thenReturn(true);
+    when(i.hasField("o2")).thenReturn(true);
+    when(i.getField("s")).thenReturn("a");
+    when(i.getField("i")).thenReturn(5);
+    when(i.getField("o")).thenReturn(new Object());
+    when(i.getField("o2")).thenReturn(new Object());
     
     Document doc = new Document();
     mapper.toDocument(i, doc);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionFieldMapperJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionFieldMapperJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionFieldMapperJUnitTest.java
index 273b57f..c187022 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionFieldMapperJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionFieldMapperJUnitTest.java
@@ -18,7 +18,7 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal.repository.serializer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import org.apache.lucene.document.Document;
 import org.junit.Test;
@@ -35,7 +35,7 @@ public class ReflectionFieldMapperJUnitTest {
 
   @Test
   public void testAllFields() {
-    
+
     String[] allFields = new String[] {"s", "i", "l", "d", "f", "s2"};
     ReflectionLuceneSerializer mapper1 = new ReflectionLuceneSerializer(Type1.class, allFields);
     ReflectionLuceneSerializer mapper2 = new ReflectionLuceneSerializer(Type2.class, allFields);
@@ -67,7 +67,7 @@ public class ReflectionFieldMapperJUnitTest {
   
   @Test
   public void testIgnoreInvalid() {
-    
+
     String[] fields = new String[] {"s", "o", "s2"};
     ReflectionLuceneSerializer mapper = new ReflectionLuceneSerializer(Type2.class, fields);
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorJUnitTest.java
index 021dc3d..ea98f5c 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorJUnitTest.java
@@ -19,7 +19,8 @@
 package com.gemstone.gemfire.cache.lucene.internal.xml;
 
 import static org.junit.Assert.*;
-import static org.mockito.Matchers.*;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.*;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -28,10 +29,8 @@ import java.util.Set;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
 
 import com.gemstone.gemfire.cache.lucene.LuceneIndex;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
@@ -44,25 +43,25 @@ public class LuceneIndexXmlGeneratorJUnitTest {
    * Test of generating and reading cache configuration back in.
    */
   @Test
-  public void generateWithFields() throws SAXException {
-    LuceneIndex index = Mockito.mock(LuceneIndex.class);
-    Mockito.when(index.getName()).thenReturn("index");
+  public void generateWithFields() throws Exception {
+    LuceneIndex index = mock(LuceneIndex.class);
+    when(index.getName()).thenReturn("index");
     String[] fields = new String[] {"field1", "field2"};
-    Mockito.when(index.getFieldNames()).thenReturn(fields);
+    when(index.getFieldNames()).thenReturn(fields);
     
     LuceneIndexXmlGenerator generator = new LuceneIndexXmlGenerator(index);
-    CacheXmlGenerator cacheXmlGenerator = Mockito.mock(CacheXmlGenerator.class);
-    ContentHandler handler = Mockito.mock(ContentHandler.class);
-    Mockito.when(cacheXmlGenerator.getContentHandler()).thenReturn(handler);
+    CacheXmlGenerator cacheXmlGenerator = mock(CacheXmlGenerator.class);
+    ContentHandler handler = mock(ContentHandler.class);
+    when(cacheXmlGenerator.getContentHandler()).thenReturn(handler);
     generator.generate(cacheXmlGenerator);
     
     ArgumentCaptor<Attributes> captor = ArgumentCaptor.forClass(Attributes.class);
-    Mockito.verify(handler).startElement(eq(""), eq("index"), eq("lucene:index"), captor.capture());
+    verify(handler).startElement(eq(""), eq("index"), eq("lucene:index"), captor.capture());
     Attributes value = captor.getValue();
     assertEquals("index", value.getValue(LuceneXmlConstants.NAME));
     
     captor = ArgumentCaptor.forClass(Attributes.class);
-    Mockito.verify(handler, Mockito.times(2)).startElement(eq(""), eq("field"), eq("lucene:field"), captor.capture());
+    verify(handler, times(2)).startElement(eq(""), eq("field"), eq("lucene:field"), captor.capture());
     Set<String> foundFields = new HashSet<String>();
     for(Attributes fieldAttr : captor.getAllValues()) {
       foundFields.add(fieldAttr.getValue(LuceneXmlConstants.NAME));
@@ -71,8 +70,8 @@ public class LuceneIndexXmlGeneratorJUnitTest {
     HashSet<String> expected = new HashSet<String>(Arrays.asList(fields));
     assertEquals(expected, foundFields);
     
-    Mockito.verify(handler, Mockito.times(2)).endElement(eq(""), eq("field"), eq("lucene:field"));
-    Mockito.verify(handler).endElement(eq(""), eq("index"), eq("lucene:index"));
+    verify(handler, times(2)).endElement(eq(""), eq("field"), eq("lucene:field"));
+    verify(handler).endElement(eq(""), eq("index"), eq("lucene:index"));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlParserJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlParserJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlParserJUnitTest.java
index 64fe22e..aa78714 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlParserJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlParserJUnitTest.java
@@ -24,7 +24,6 @@ import java.util.Stack;
 
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
@@ -36,7 +35,7 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 public class LuceneIndexXmlParserJUnitTest {
   
   @Test
-  public void generateWithFields() throws SAXException {
+  public void generateWithFields() throws Exception {
     LuceneXmlParser parser = new LuceneXmlParser();
     AttributesImpl attrs = new AttributesImpl();
     CacheCreation cache = new CacheCreation();
@@ -67,5 +66,4 @@ public class LuceneIndexXmlParserJUnitTest {
     assertArrayEquals(new String[] {"field1", "field2"}, index.getFieldNames());
   }
   
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java
index 26b4185..7234161 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java
@@ -73,7 +73,7 @@ public class ShellCommandsControllerJUnitTest {
     controller = null;
   }
 
-  protected List<String> getCliCommands() {
+  private List<String> getCliCommands() {
     try {
       Set<Class<?>> commandClasses = ClasspathScanLoadHelper.loadAndGet(
         "com.gemstone.gemfire.management.internal.cli.commands", CommandMarker.class, true);
@@ -100,7 +100,7 @@ public class ShellCommandsControllerJUnitTest {
     }
   }
 
-  protected List<String> getControllerWebServiceEndpoints() {
+  private List<String> getControllerWebServiceEndpoints() {
     RequestAttributes requestAttrs = RequestContextHolder.getRequestAttributes();
     HttpServletRequest servletRequest = ((ServletRequestAttributes) requestAttrs).getRequest();
     String scheme = servletRequest.getScheme();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
index 08791c0..6e12af7 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/support/EnvironmentVariablesHandlerInterceptorJUnitTest.java
@@ -66,11 +66,11 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
     mockContext = null;
   }
 
-  protected String createEnvironmentVariable(final String name) {
+  private String createEnvironmentVariable(final String name) {
     return (EnvironmentVariablesHandlerInterceptor.ENVIRONMENT_VARIABLE_REQUEST_PARAMETER_PREFIX + name);
   }
 
-  protected <T> Enumeration<T> enumeration(final Iterator<T> iterator) {
+  private <T> Enumeration<T> enumeration(final Iterator<T> iterator) {
     return new Enumeration<T>() {
       public boolean hasMoreElements() {
         return iterator.hasNext();
@@ -126,7 +126,7 @@ public class EnvironmentVariablesHandlerInterceptorJUnitTest {
     TestFramework.runOnce(new HandlerInterceptorThreadSafetyMultiThreadedTestCase());
   }
 
-  protected final class HandlerInterceptorThreadSafetyMultiThreadedTestCase extends MultithreadedTestCase {
+  private final class HandlerInterceptorThreadSafetyMultiThreadedTestCase extends MultithreadedTestCase {
 
     private EnvironmentVariablesHandlerInterceptor handlerInterceptor;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/http/ClientHttpRequestJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/http/ClientHttpRequestJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/http/ClientHttpRequestJUnitTest.java
index 346879e..0e2cd0c 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/http/ClientHttpRequestJUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/http/ClientHttpRequestJUnitTest.java
@@ -494,12 +494,12 @@ public class ClientHttpRequestJUnitTest extends AbstractWebTestCase {
   }
 
   @SuppressWarnings("unused")
-  protected static interface Library {
+  private static interface Library {
     public String getName();
   }
 
   @SuppressWarnings("unused")
-  protected static interface Book {
+  private static interface Book {
     public String getAuthor();
     public String getIsbn();
     public String getTitle();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/RestHttpOperationInvokerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/RestHttpOperationInvokerJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/RestHttpOperationInvokerJUnitTest.java
index 34e9f17..bcc3cef 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/RestHttpOperationInvokerJUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/RestHttpOperationInvokerJUnitTest.java
@@ -107,28 +107,28 @@ public class RestHttpOperationInvokerJUnitTest extends AbstractWebTestCase {
     operationInvoker = null;
   }
 
-  protected CommandRequest createCommandRequest(final String command, final Map<String, String> options) {
+  private CommandRequest createCommandRequest(final String command, final Map<String, String> options) {
     return new TestCommandRequest(command, options, Collections.<String, String>emptyMap(), null);
   }
 
-  protected CommandRequest createCommandRequest(final String command, final Map<String, String> options, final Map<String, String> environment) {
+  private CommandRequest createCommandRequest(final String command, final Map<String, String> options, final Map<String, String> environment) {
     return new TestCommandRequest(command, options, environment, null);
   }
 
-  protected CommandRequest createCommandRequest(final String command, final Map<String, String> options, final byte[][] fileData) {
+  private CommandRequest createCommandRequest(final String command, final Map<String, String> options, final byte[][] fileData) {
     return new TestCommandRequest(command, options, Collections.<String, String>emptyMap(), fileData);
   }
 
-  protected CommandRequest createCommandRequest(final String command, final Map<String, String> options, final Map<String, String> environment, final byte[][] fileData) {
+  private CommandRequest createCommandRequest(final String command, final Map<String, String> options, final Map<String, String> environment, final byte[][] fileData) {
     return new TestCommandRequest(command, options, environment, fileData);
   }
 
-  protected LinkIndex getLinkIndex() {
+  private LinkIndex getLinkIndex() {
     assertTrue("The LinkIndex was not property initialized!", linkIndex != null);
     return linkIndex;
   }
 
-  protected RestHttpOperationInvoker getOperationInvoker() {
+  private RestHttpOperationInvoker getOperationInvoker() {
     assertTrue("The RestHttpOperationInvoker was not properly initialized!", operationInvoker != null);
     return operationInvoker;
   }
@@ -412,7 +412,7 @@ public class RestHttpOperationInvokerJUnitTest extends AbstractWebTestCase {
     }
   }
 
-  protected static final class TestCommandRequest extends CommandRequest {
+  private static final class TestCommandRequest extends CommandRequest {
 
     private final Map<String, String> commandParameters = new TreeMap<String, String>();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/SimpleHttpOperationInvokerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/SimpleHttpOperationInvokerJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/SimpleHttpOperationInvokerJUnitTest.java
index 2e8d118..74ed09e 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/SimpleHttpOperationInvokerJUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/shell/SimpleHttpOperationInvokerJUnitTest.java
@@ -64,16 +64,16 @@ public class SimpleHttpOperationInvokerJUnitTest extends AbstractWebTestCase {
     operationInvoker = null;
   }
 
-  protected CommandRequest createCommandRequest(final String command) {
+  private CommandRequest createCommandRequest(final String command) {
     return new TestCommandRequest(command);
   }
 
-  protected String getExpectedHttpRequestUrl(final CommandRequest command) {
+  private String getExpectedHttpRequestUrl(final CommandRequest command) {
     return SimpleHttpOperationInvoker.REST_API_URL.concat(SimpleHttpOperationInvoker.REST_API_MANAGEMENT_COMMANDS_URI)
       .concat("?").concat(SimpleHttpOperationInvoker.CMD_QUERY_PARAMETER).concat("=").concat(command.getInput());
   }
 
-  protected SimpleHttpOperationInvoker getOperationInvoker() {
+  private SimpleHttpOperationInvoker getOperationInvoker() {
     return operationInvoker;
   }
 
@@ -179,7 +179,7 @@ public class SimpleHttpOperationInvokerJUnitTest extends AbstractWebTestCase {
     }
   }
 
-  protected static final class TestCommandRequest extends CommandRequest {
+  private static final class TestCommandRequest extends CommandRequest {
 
     private final String command;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e4f513ef/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/util/ConvertUtilsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/util/ConvertUtilsJUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/util/ConvertUtilsJUnitTest.java
index 08314f8..180641c 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/util/ConvertUtilsJUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/web/util/ConvertUtilsJUnitTest.java
@@ -45,7 +45,7 @@ import org.springframework.web.multipart.MultipartFile;
 @Category(UnitTest.class)
 public class ConvertUtilsJUnitTest {
 
-  protected MultipartFile createMultipartFile(final String filename, final byte[] content) {
+  private MultipartFile createMultipartFile(final String filename, final byte[] content) {
     return new MultipartFileAdapter() {
       @Override public byte[] getBytes() throws IOException {
         return content;
@@ -65,7 +65,7 @@ public class ConvertUtilsJUnitTest {
     };
   }
 
-  protected Resource createResource(final String filename, final byte[] content) {
+  private Resource createResource(final String filename, final byte[] content) {
     return new ByteArrayResource(content, String.format("Content of file (%1$s).", filename)) {
       @Override public String getFilename() {
         return filename;


Mime
View raw message