geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject [2/3] geode git commit: GEODE-2522: Flattened heirarchy of Lucene DUnit tests
Date Wed, 22 Feb 2017 20:12:01 GMT
GEODE-2522: Flattened heirarchy of Lucene DUnit tests


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

Branch: refs/heads/develop
Commit: a63b8302a07475c1726c891152daa9f8947091a6
Parents: 0d2397b
Author: Jason Huynh <huynhja@gmail.com>
Authored: Wed Feb 22 08:53:26 2017 -0800
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Wed Feb 22 11:33:59 2017 -0800

----------------------------------------------------------------------
 .../geode/cache/lucene/LuceneDUnitTest.java     | 130 +++++++++-
 .../lucene/LuceneIndexCreationDUnitTest.java    | 158 +++++++------
 .../LuceneIndexCreationOnFixedPRDUnitTest.java  |  14 +-
 .../cache/lucene/LuceneQueriesAccessorBase.java | 212 +++++++++++++++++
 .../geode/cache/lucene/LuceneQueriesBase.java   | 233 ------------------
 .../lucene/LuceneQueriesClientDUnitTest.java    |  19 +-
 .../cache/lucene/LuceneQueriesDUnitTest.java    | 143 +++++++++++
 .../geode/cache/lucene/LuceneQueriesPRBase.java | 236 -------------------
 .../LuceneQueriesPeerFixedPRDUnitTest.java      |  39 ---
 .../lucene/LuceneQueriesPeerPRDUnitTest.java    |  41 ----
 .../LuceneQueriesPeerPROverflowDUnitTest.java   |  46 ----
 .../LuceneQueriesPeerPRPersistentDUnitTest.java |  41 ----
 .../LuceneQueriesPeerPRRedundancyDUnitTest.java | 186 ---------------
 .../geode/cache/lucene/RebalanceDUnitTest.java  | 200 ++++++++++++++++
 .../RebalanceWithRedundancyDUnitTest.java       | 181 ++++++++++++++
 .../cache/lucene/test/LuceneTestUtilities.java  |   7 +-
 16 files changed, 974 insertions(+), 912 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneDUnitTest.java
index 9318b0e..31ffced 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneDUnitTest.java
@@ -1,7 +1,7 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
  * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License. You may obtain a
  * copy of the License at
  *
@@ -14,15 +14,31 @@
  */
 package org.apache.geode.cache.lucene;
 
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.EvictionAction;
+import org.apache.geode.cache.EvictionAttributes;
+import org.apache.geode.cache.PartitionAttributes;
+import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.dunit.VM;
+
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 
+import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
+
+
+
 public abstract class LuceneDUnitTest extends JUnit4CacheTestCase {
   protected VM dataStore1;
   protected VM dataStore2;
 
+  protected static int NUM_BUCKETS = 10;
+
+
   @Override
   public void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -30,5 +46,115 @@ public abstract class LuceneDUnitTest extends JUnit4CacheTestCase {
     dataStore2 = host.getVM(1);
   }
 
-  protected abstract void initDataStore(SerializableRunnableIF createIndex) throws Exception;
+  protected void initDataStore(SerializableRunnableIF createIndex,
+      RegionTestableType regionTestType) throws Exception {
+    createIndex.run();
+    regionTestType.createRegion(getCache(), REGION_NAME);
+  }
+
+  // Needed to seperate due to client/server tests...
+  protected void initAccessor(SerializableRunnableIF createIndex, RegionTestableType regionTestType)
+      throws Exception {
+    initDataStore(createIndex, regionTestType);
+  }
+
+  protected RegionTestableType[] getListOfServerRegionTestTypes() {
+    return new RegionTestableType[] {RegionTestableType.PARTITION,
+        RegionTestableType.PARTITION_PERSISTENT, RegionTestableType.PARTITION_REDUNDANT,
+        RegionTestableType.PARTITION_OVERFLOW_TO_DISK, RegionTestableType.PARTITION_REDUNDANT};
+  }
+
+
+  protected Object[] getListOfClientServerTypes() {
+    return new Object[] {
+        new RegionTestableType[] {RegionTestableType.PARTITION_PROXY, RegionTestableType.PARTITION},
+        new RegionTestableType[] {RegionTestableType.PARTITION, RegionTestableType.PARTITION},
+        new RegionTestableType[] {RegionTestableType.PARTITION_PROXY_REDUNDANT,
+            RegionTestableType.PARTITION_REDUNDANT},
+        new RegionTestableType[] {RegionTestableType.PARTITION_PROXY_WITH_OVERFLOW,
+            RegionTestableType.PARTITION_OVERFLOW_TO_DISK},
+        new RegionTestableType[] {RegionTestableType.PARTITION_REDUNDANT,
+            RegionTestableType.PARTITION_REDUNDANT},
+        new RegionTestableType[] {RegionTestableType.PARTITION_OVERFLOW_TO_DISK,
+            RegionTestableType.PARTITION_OVERFLOW_TO_DISK},
+        new RegionTestableType[] {RegionTestableType.FIXED_PARTITION_ACCESSOR,
+            RegionTestableType.FIXED_PARTITION}};
+  }
+
+  protected final Object[] parameterCombiner(Object[] aValues, Object[] bValues) {
+    Object[] parameters = new Object[aValues.length * bValues.length];
+    for (int i = 0; i < aValues.length; i++) {
+      for (int j = 0; j < bValues.length; j++) {
+        parameters[i * bValues.length + j] = new Object[] {aValues[i], bValues[j]};
+      }
+    }
+    return parameters;
+  }
+
+  public enum RegionTestableType {
+    PARTITION(RegionShortcut.PARTITION, false),
+    PARTITION_PROXY(RegionShortcut.PARTITION_PROXY, true),
+    PARTITION_PERSISTENT(RegionShortcut.PARTITION_PERSISTENT, false),
+    PARTITION_REDUNDANT(RegionShortcut.PARTITION_REDUNDANT, false),
+    PARTITION_OVERFLOW_TO_DISK(RegionShortcut.PARTITION_OVERFLOW, false,
+        EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)),
+    PARTITION_PROXY_WITH_OVERFLOW(RegionShortcut.PARTITION_PROXY, true,
+        EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)),
+    FIXED_PARTITION(RegionShortcut.PARTITION, false),
+    FIXED_PARTITION_ACCESSOR(RegionShortcut.PARTITION, true),
+
+    PARTITION_PROXY_REDUNDANT(RegionShortcut.PARTITION_PROXY_REDUNDANT, true),
+    CLIENT_PARTITION(RegionShortcut.PARTITION, false),
+    CLIENT_PARTITION_PERSISTENT(RegionShortcut.PARTITION_PERSISTENT, false),
+    ACCESSOR_PARTITION_PERSISTENT(RegionShortcut.PARTITION_PERSISTENT, true);
+
+
+    EvictionAttributes evictionAttributes = null;
+    private RegionShortcut shortcut;
+    private boolean isAccessor;
+
+    RegionTestableType(RegionShortcut shortcut, boolean isAccessor) {
+      this(shortcut, isAccessor, null);
+    }
+
+    RegionTestableType(RegionShortcut shortcut, boolean isAccessor,
+        EvictionAttributes evictionAttributes) {
+      this.shortcut = shortcut;
+      this.isAccessor = isAccessor;
+      this.evictionAttributes = evictionAttributes;
+    }
+
+    public Region createRegion(Cache cache, String regionName) {
+      if (this.equals(CLIENT_PARTITION)) {
+        return null;
+      } else if (this.equals(FIXED_PARTITION_ACCESSOR)) {
+        return LuceneTestUtilities.createFixedPartitionedRegion(cache, regionName, null, 0);
+      } else if (this.equals(FIXED_PARTITION)) {
+        try {
+          return LuceneTestUtilities.initDataStoreForFixedPR(cache);
+        } catch (Exception e) {
+          e.printStackTrace();
+          return null;
+        }
+      }
+      if (evictionAttributes == null) {
+        return cache.createRegionFactory(shortcut)
+            .setPartitionAttributes(getPartitionAttributes(isAccessor)).create(regionName);
+      } else {
+        return cache.createRegionFactory(shortcut)
+            .setPartitionAttributes(getPartitionAttributes(isAccessor))
+            .setEvictionAttributes(evictionAttributes).create(regionName);
+      }
+    }
+  }
+
+  protected static PartitionAttributes getPartitionAttributes(final boolean isAccessor) {
+    PartitionAttributesFactory factory = new PartitionAttributesFactory();
+    if (!isAccessor) {
+      factory.setLocalMaxMemory(100);
+    }
+    factory.setTotalNumBuckets(NUM_BUCKETS);
+    return factory.create();
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
index 6a02a25..71c111d 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java
@@ -14,7 +14,6 @@
  */
 package org.apache.geode.cache.lucene;
 
-import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.junit.categories.DistributedTest;
@@ -42,32 +41,41 @@ import static org.junit.Assert.*;
 @RunWith(JUnitParamsRunner.class)
 public class LuceneIndexCreationDUnitTest extends LuceneDUnitTest {
 
-  @Override
-  protected void initDataStore(SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION).create(REGION_NAME);
+  private final Object[] parametersForMultipleIndexCreates() {
+    Integer[] numIndexes = {1, 2, 10};
+    RegionTestableType[] regionTestTypes = getListOfServerRegionTestTypes();
+    return parameterCombiner(numIndexes, regionTestTypes);
   }
 
+  protected final Object[] parametersForIndexAndRegions() {
+    Object[] indexCreations = new Object[] {getFieldsIndexWithOneField(),
+        getFieldsIndexWithTwoFields(), get2FieldsIndexes(), getAnalyzersIndexWithOneField(),
+        getAnalyzersIndexWithTwoFields(), getAnalyzersIndexWithNullField1()};
+    RegionTestableType[] regionTestTypes = getListOfServerRegionTestTypes();
+    return parameterCombiner(indexCreations, regionTestTypes);
+  }
 
   @Test
-  @Parameters({"1", "2", "10"})
-  public void verifyThatIndexObjectsAreListedWhenPresentInTheSystem(int numberOfIndexes) {
+  @Parameters(method = "parametersForMultipleIndexCreates")
+  public void verifyThatIndexObjectsAreListedWhenPresentInTheSystem(int numberOfIndexes,
+      RegionTestableType regionType) {
     SerializableRunnableIF createIndex = getMultipleIndexes(numberOfIndexes);
-    dataStore1.invoke(() -> initDataStore(createIndex));
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
     dataStore1.invoke(() -> verifyIndexList(numberOfIndexes));
 
-    dataStore2.invoke(() -> initDataStore(createIndex));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
     dataStore2.invoke(() -> verifyIndexList(numberOfIndexes));
   }
 
   @Test
-  @Parameters({"1", "2", "10"})
-  public void verifyThatIndexObjectIsRetrievedWhenPresentInTheSystem(int numberOfIndexes) {
+  @Parameters(method = "parametersForMultipleIndexCreates")
+  public void verifyThatIndexObjectIsRetrievedWhenPresentInTheSystem(int numberOfIndexes,
+      RegionTestableType regionType) {
     SerializableRunnableIF createIndex = getMultipleIndexes(numberOfIndexes);
-    dataStore1.invoke(() -> initDataStore(createIndex));
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
     dataStore1.invoke(() -> verifyIndexes(numberOfIndexes));
 
-    dataStore2.invoke(() -> initDataStore(createIndex));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
     dataStore2.invoke(() -> verifyIndexes(numberOfIndexes));
   }
 
@@ -108,132 +116,136 @@ public class LuceneIndexCreationDUnitTest extends LuceneDUnitTest {
 
 
   @Test
-  public void verifyDifferentFieldsFails() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentFieldsFails(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getFieldsIndexWithOneField();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getFieldsIndexWithTwoFields();
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS));
+    dataStore2.invoke(
+        () -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS));
   }
 
   @Test
-  public void verifyDifferentFieldAnalyzerSizesFails1() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentFieldAnalyzerSizesFails1(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithTwoFields();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithOneField();
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS_2));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
+        CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS_2));
   }
 
   @Test
-  public void verifyDifferentFieldAnalyzerSizesFails2() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentFieldAnalyzerSizesFails2(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithOneField();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithTwoFields();
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS));
+    dataStore2.invoke(
+        () -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_FIELDS));
   }
 
   @Test
-  public void verifyDifferentFieldAnalyzersFails1() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentFieldAnalyzersFails1(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithOneField(StandardAnalyzer.class);
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithOneField(KeywordAnalyzer.class);
-    dataStore2.invoke(
-        () -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_ANALYZERS_2));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
+        CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_ANALYZERS_2));
   }
 
   @Test
-  public void verifyDifferentFieldAnalyzersFails2() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentFieldAnalyzersFails2(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithNullField1();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithNullField2();
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_ANALYZERS));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
+        CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_ANALYZERS));
   }
 
   @Test
-  public void verifyDifferentFieldAnalyzersFails3() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentFieldAnalyzersFails3(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithNullField2();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithNullField1();
-    dataStore2.invoke(() -> initDataStore(createIndex2,
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
         LuceneTestUtilities.CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_ANALYZERS_3));
   }
 
   @Test
-  public void verifyDifferentIndexNamesFails() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentIndexNamesFails(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = () -> {
       LuceneService luceneService = LuceneServiceProvider.get(getCache());
       luceneService.createIndex(INDEX_NAME + "1", REGION_NAME, "field1");
     };
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = () -> {
       LuceneService luceneService = LuceneServiceProvider.get(getCache());
       luceneService.createIndex(INDEX_NAME + "2", REGION_NAME, "field1");
     };
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_NAMES));
+    dataStore2.invoke(
+        () -> initDataStore(createIndex2, regionType, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_NAMES));
   }
 
   @Test
-  public void verifyDifferentIndexesFails1() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentIndexesFails1(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getFieldsIndexWithOneField();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = () -> {
       /* Do nothing */};
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_1));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
+        CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_1));
   }
 
 
   @Test
-  public void verifyDifferentIndexesFails2() {
+  @Parameters({"PARTITION"})
+  public void verifyDifferentIndexesFails2(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getFieldsIndexWithOneField();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = () -> {
       LuceneService luceneService = LuceneServiceProvider.get(getCache());
       luceneService.createIndex(INDEX_NAME, REGION_NAME, "field1");
       luceneService.createIndex(INDEX_NAME + "2", REGION_NAME, "field2");
     };
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_2));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
+        CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_2));
   }
 
   @Test
-  public void verifyMemberWithoutIndexCreatedFirstFails() {
+  @Parameters({"PARTITION"})
+  public void verifyMemberWithoutIndexCreatedFirstFails(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = () -> {
       /* Do nothing */};
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getFieldsIndexWithOneField();
-    dataStore2
-        .invoke(() -> initDataStore(createIndex2, CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_3));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType,
+        CANNOT_CREATE_LUCENE_INDEX_DIFFERENT_INDEXES_3));
   }
 
   @Test
-  @Parameters(method = "getIndexes")
-  public void verifySameIndexesSucceeds(SerializableRunnableIF createIndex) {
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    dataStore2.invoke(() -> initDataStore(createIndex));
+  @Parameters(method = "parametersForIndexAndRegions")
+  public void verifySameIndexesSucceeds(SerializableRunnableIF createIndex,
+      RegionTestableType regionType) {
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
   }
 
-  protected final Object[] getIndexes() {
-    return $(new Object[] {getFieldsIndexWithOneField()},
-        new Object[] {getFieldsIndexWithTwoFields()}, new Object[] {get2FieldsIndexes()},
-        new Object[] {getAnalyzersIndexWithOneField()},
-        new Object[] {getAnalyzersIndexWithTwoFields()},
-        new Object[] {getAnalyzersIndexWithNullField1()});
-  }
 
   @Test
   @Parameters(method = "getXmlAndExceptionMessages")
@@ -295,21 +307,23 @@ public class LuceneIndexCreationDUnitTest extends LuceneDUnitTest {
   }
 
   @Test
-  public void verifyStandardAnalyzerAndNullOnSameFieldPasses() {
+  @Parameters("PARTITION")
+  public void verifyStandardAnalyzerAndNullOnSameFieldPasses(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithNullField1();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithTwoFields2();
-    dataStore2.invoke(() -> initDataStore(createIndex2));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType));
   }
 
   @Test
-  public void verifyStandardAnalyzerAndNullOnSameFieldPasses2() {
+  @Parameters("PARTITION")
+  public void verifyStandardAnalyzerAndNullOnSameFieldPasses2(RegionTestableType regionType) {
     SerializableRunnableIF createIndex1 = getAnalyzersIndexWithTwoFields2();
-    dataStore1.invoke(() -> initDataStore(createIndex1));
+    dataStore1.invoke(() -> initDataStore(createIndex1, regionType));
 
     SerializableRunnableIF createIndex2 = getAnalyzersIndexWithNullField1();
-    dataStore2.invoke(() -> initDataStore(createIndex2));
+    dataStore2.invoke(() -> initDataStore(createIndex2, regionType));
   }
 
   protected String getXmlFileForTest(String testName) {
@@ -321,11 +335,11 @@ public class LuceneIndexCreationDUnitTest extends LuceneDUnitTest {
     return getClass().getSimpleName();
   }
 
-  protected void initDataStore(SerializableRunnableIF createIndex, String message)
-      throws Exception {
+  protected void initDataStore(SerializableRunnableIF createIndex, RegionTestableType regionType,
+      String message) throws Exception {
     createIndex.run();
     try {
-      getCache().createRegionFactory(RegionShortcut.PARTITION).create(REGION_NAME);
+      regionType.createRegion(getCache(), REGION_NAME);
       fail("Should not have been able to create index");
     } catch (IllegalStateException e) {
       assertEquals(message, e.getMessage());

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationOnFixedPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationOnFixedPRDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationOnFixedPRDUnitTest.java
index 7de12e3..e623d7d 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationOnFixedPRDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationOnFixedPRDUnitTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.cache.lucene;
 
+import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.junit.categories.DistributedTest;
@@ -27,16 +28,17 @@ import junitparams.JUnitParamsRunner;
 @Category(DistributedTest.class)
 @RunWith(JUnitParamsRunner.class)
 public class LuceneIndexCreationOnFixedPRDUnitTest extends LuceneIndexCreationDUnitTest {
+
   @Override
-  protected void initDataStore(SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    LuceneTestUtilities.initDataStoreForFixedPR(getCache());
+  protected RegionTestableType[] getListOfServerRegionTestTypes() {
+    return new RegionTestableType[] {RegionTestableType.FIXED_PARTITION};
   }
 
-  protected void initDataStore(SerializableRunnableIF createIndex, String message)
-      throws Exception {
+  @Override
+  protected void initDataStore(SerializableRunnableIF createIndex, RegionTestableType regionType,
+      String message) throws Exception {
     try {
-      initDataStore(createIndex);
+      initDataStore(createIndex, regionType);
       fail("Should not have been able to create index");
     } catch (IllegalStateException e) {
       assertEquals(message, e.getMessage());

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
new file mode 100644
index 0000000..00bb842
--- /dev/null
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.cache.lucene;
+
+
+import static org.apache.geode.cache.lucene.test.IndexRepositorySpy.doOnce;
+import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.DEFAULT_FIELD;
+import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.INDEX_NAME;
+import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_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 org.apache.geode.cache.Region;
+import org.apache.geode.cache.control.RebalanceOperation;
+import org.apache.geode.cache.control.RebalanceResults;
+import org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy;
+import org.apache.geode.cache.lucene.internal.LuceneIndexImpl;
+import org.apache.geode.cache.lucene.test.IndexRepositorySpy;
+import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.cache.InitialImageOperation;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage;
+import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse;
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.VM;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public class LuceneQueriesAccessorBase extends LuceneDUnitTest {
+
+  protected VM accessor;
+
+  @Override
+  public void postSetUp() throws Exception {
+    super.postSetUp();
+    accessor = Host.getHost(0).getVM(3);
+  }
+
+  protected boolean waitForFlushBeforeExecuteTextSearch(VM vm, int ms) {
+    return vm.invoke(() -> {
+      Cache cache = getCache();
+
+      LuceneService service = LuceneServiceProvider.get(cache);
+      LuceneIndexImpl index = (LuceneIndexImpl) service.getIndex(INDEX_NAME, REGION_NAME);
+
+      return service.waitUntilFlushed(INDEX_NAME, REGION_NAME, ms, TimeUnit.MILLISECONDS);
+    });
+  }
+
+  protected void executeTextSearch(VM vm) {
+    vm.invoke(() -> {
+      Cache cache = getCache();
+      Region<Object, Object> region = cache.getRegion(REGION_NAME);
+
+      LuceneService service = LuceneServiceProvider.get(cache);
+      LuceneQuery<Integer, TestObject> query;
+      query = service.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, "text:world",
+          DEFAULT_FIELD);
+      PageableLuceneQueryResults<Integer, TestObject> results = query.findPages();
+      assertEquals(3, results.size());
+      List<LuceneResultStruct<Integer, TestObject>> page = results.next();
+
+      Map<Integer, TestObject> data = new HashMap<Integer, TestObject>();
+      for (LuceneResultStruct<Integer, TestObject> row : page) {
+        data.put(row.getKey(), row.getValue());
+      }
+
+      assertEquals(new HashMap(region), data);
+      return null;
+    });
+  }
+
+  protected void executeTextSearch(VM vm, String queryString, String defaultField,
+      int expectedResultsSize) {
+    vm.invoke(() -> {
+      Cache cache = getCache();
+
+      LuceneService service = LuceneServiceProvider.get(cache);
+      LuceneQuery<Integer, TestObject> query;
+      query = service.createLuceneQueryFactory().setResultLimit(1000).setPageSize(1000)
+          .create(INDEX_NAME, REGION_NAME, queryString, defaultField);
+      Collection<?> results = query.findKeys();
+      System.out.println("JASON Lucene Query returned:" + results.size());
+
+      assertEquals(expectedResultsSize, results.size());
+    });
+  }
+
+  protected void addCallbackToTriggerRebalance(VM vm) {
+    vm.invoke(() -> {
+      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
+
+      spy.beforeWriteIndexRepository(doOnce(key -> rebalanceRegion(vm)));
+    });
+  }
+
+  protected void addCallbackToMoveBucket(VM vm, final DistributedMember destination) {
+    vm.invoke(() -> {
+      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
+
+      spy.beforeWriteIndexRepository(doOnce(key -> moveBucket(destination, key)));
+    });
+  }
+
+  protected void addCallbackToMovePrimary(VM vm, final DistributedMember destination) {
+    vm.invoke(() -> {
+      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
+
+      spy.beforeWriteIndexRepository(doOnce(key -> movePrimary(destination, key)));
+    });
+  }
+
+  protected void addCallbackToMovePrimaryOnQuery(VM vm, final DistributedMember destination) {
+    vm.invoke(() -> {
+      LuceneIndexFactorySpy factorySpy = LuceneIndexFactorySpy.injectSpy();
+
+      factorySpy.setGetRespositoryConsumer(doOnce(key -> moveBucket(destination, key)));
+    });
+  }
+
+  private void moveBucket(final DistributedMember destination, final Object key) {
+    Region<Object, Object> region = getCache().getRegion(REGION_NAME);
+    DistributedMember source = getCache().getDistributedSystem().getDistributedMember();
+    PartitionRegionHelper.moveBucketByKey(region, source, destination, key);
+  }
+
+  private void movePrimary(final DistributedMember destination, final Object key) {
+    PartitionedRegion region = (PartitionedRegion) getCache().getRegion(REGION_NAME);
+
+    BecomePrimaryBucketResponse response =
+        BecomePrimaryBucketMessage.send((InternalDistributedMember) destination, region,
+            region.getKeyInfo(key).getBucketId(), true);
+    assertNotNull(response);
+    assertTrue(response.waitForResponse());
+  }
+
+  protected void removeCallback(VM vm) {
+    vm.invoke(() -> {
+      IndexRepositorySpy.remove();
+      InitialImageOperation.resetAllGIITestHooks();
+      LuceneIndexFactorySpy.remove();
+    });
+  }
+
+  protected void rebalanceRegion(VM vm) {
+    // Do a rebalance
+    vm.invoke(() -> {
+      RebalanceOperation op = getCache().getResourceManager().createRebalanceFactory().start();
+      RebalanceResults results = op.getResults();
+    });
+  }
+
+  protected static class TestObject implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private String text;
+
+    public TestObject(String text) {
+      this.text = text;
+    }
+
+    @Override
+    public int hashCode() {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((text == null) ? 0 : text.hashCode());
+      return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+      if (this == obj)
+        return true;
+      if (obj == null)
+        return false;
+      if (getClass() != obj.getClass())
+        return false;
+      TestObject other = (TestObject) obj;
+      if (text == null) {
+        if (other.text != null)
+          return false;
+      } else if (!text.equals(other.text))
+        return false;
+      return true;
+    }
+
+    @Override
+    public String toString() {
+      return "TestObject[" + text + "]";
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesBase.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesBase.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesBase.java
deleted file mode 100644
index 1b1167c..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesBase.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
-import static org.junit.Assert.*;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.lucene.internal.LuceneIndexImpl;
-import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.dunit.VM;
-
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.TermQuery;
-import org.junit.Test;
-
-/**
- * This test class is intended to contain basic integration tests of the lucene query class that
- * should be executed against a number of different regions types and topologies.
- *
- */
-public abstract class LuceneQueriesBase extends LuceneDUnitTest {
-
-  private static final long serialVersionUID = 1L;
-  protected VM accessor;
-
-  @Override
-  public void postSetUp() throws Exception {
-    super.postSetUp();
-    accessor = Host.getHost(0).getVM(3);
-  }
-
-  protected abstract void initAccessor(SerializableRunnableIF createIndex) throws Exception;
-
-  @Test
-  public void returnCorrectResultsFromStringQueryWithDefaultAnalyzer() {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-
-    putDataInRegion(accessor);
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
-    executeTextSearch(accessor);
-  }
-
-  @Test
-  public void defaultFieldShouldPropogateCorrectlyThroughFunction() {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    putDataInRegion(accessor);
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
-    executeTextSearch(accessor, "world", "text", 3);
-    executeTextSearch(accessor, "world", "noEntriesMapped", 0);
-  }
-
-  @Test
-  public void canQueryWithCustomLuceneQueryObject() {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    putDataInRegion(accessor);
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
-
-    // Execute a query with a custom lucene query object
-    accessor.invoke(() -> {
-      Cache cache = getCache();
-      LuceneService service = LuceneServiceProvider.get(cache);
-      LuceneQuery query =
-          service.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, index -> {
-            return new TermQuery(new Term("text", "world"));
-          });
-      final PageableLuceneQueryResults results = query.findPages();
-      assertEquals(3, results.size());
-    });
-  }
-
-  @Test
-  public void verifyWaitForFlushedFunctionOnAccessor() throws InterruptedException {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-    dataStore2.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-    putDataInRegion(accessor);
-    assertFalse(waitForFlushBeforeExecuteTextSearch(accessor, 200));
-    dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-    dataStore2.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
-    executeTextSearch(accessor, "world", "text", 3);
-    executeTextSearch(accessor, "world", "noEntriesMapped", 0);
-  }
-
-  protected boolean waitForFlushBeforeExecuteTextSearch(VM vm, int ms) {
-    return vm.invoke(() -> {
-      Cache cache = getCache();
-
-      LuceneService service = LuceneServiceProvider.get(cache);
-      LuceneIndexImpl index = (LuceneIndexImpl) service.getIndex(INDEX_NAME, REGION_NAME);
-
-      return service.waitUntilFlushed(INDEX_NAME, REGION_NAME, ms, TimeUnit.MILLISECONDS);
-    });
-  }
-
-  protected void executeTextSearch(VM vm) {
-    vm.invoke(() -> {
-      Cache cache = getCache();
-      Region<Object, Object> region = cache.getRegion(REGION_NAME);
-
-      LuceneService service = LuceneServiceProvider.get(cache);
-      LuceneQuery<Integer, TestObject> query;
-      query = service.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, "text:world",
-          DEFAULT_FIELD);
-      PageableLuceneQueryResults<Integer, TestObject> results = query.findPages();
-      assertEquals(3, results.size());
-      List<LuceneResultStruct<Integer, TestObject>> page = results.next();
-
-      Map<Integer, TestObject> data = new HashMap<Integer, TestObject>();
-      for (LuceneResultStruct<Integer, TestObject> row : page) {
-        data.put(row.getKey(), row.getValue());
-      }
-
-      assertEquals(new HashMap(region), data);
-      return null;
-    });
-  }
-
-  protected void executeTextSearch(VM vm, String queryString, String defaultField,
-      int expectedResultsSize) {
-    vm.invoke(() -> {
-      Cache cache = getCache();
-
-      LuceneService service = LuceneServiceProvider.get(cache);
-      LuceneQuery<Integer, TestObject> query;
-      query = service.createLuceneQueryFactory().setResultLimit(1000).setPageSize(1000)
-          .create(INDEX_NAME, REGION_NAME, queryString, defaultField);
-      Collection<?> results = query.findKeys();
-
-      assertEquals(expectedResultsSize, results.size());
-    });
-  }
-
-  protected void putDataInRegion(VM vm) {
-    vm.invoke(() -> {
-      final Cache cache = getCache();
-      Region<Object, Object> region = cache.getRegion(REGION_NAME);
-      region.put(1, new TestObject("hello world"));
-      region.put(113, new TestObject("hi world"));
-      region.put(2, new TestObject("goodbye world"));
-    });
-  }
-
-  protected static class TestObject implements Serializable {
-    private static final long serialVersionUID = 1L;
-    private String text;
-
-    public TestObject(String text) {
-      this.text = text;
-    }
-
-    @Override
-    public int hashCode() {
-      final int prime = 31;
-      int result = 1;
-      result = prime * result + ((text == null) ? 0 : text.hashCode());
-      return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-      if (this == obj)
-        return true;
-      if (obj == null)
-        return false;
-      if (getClass() != obj.getClass())
-        return false;
-      TestObject other = (TestObject) obj;
-      if (text == null) {
-        if (other.text != null)
-          return false;
-      } else if (!text.equals(other.text))
-        return false;
-      return true;
-    }
-
-    @Override
-    public String toString() {
-      return "TestObject[" + text + "]";
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesClientDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesClientDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesClientDUnitTest.java
index 36ede16..0753adf 100755
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesClientDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesClientDUnitTest.java
@@ -27,9 +27,13 @@ import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.test.dunit.SerializableCallableIF;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.runner.RunWith;
+
+import junitparams.JUnitParamsRunner;
 
 @Category(DistributedTest.class)
-public class LuceneQueriesClientDUnitTest extends LuceneQueriesBase {
+@RunWith(JUnitParamsRunner.class)
+public class LuceneQueriesClientDUnitTest extends LuceneQueriesDUnitTest {
 
   @Override
   public void postSetUp() throws Exception {
@@ -53,13 +57,14 @@ public class LuceneQueriesClientDUnitTest extends LuceneQueriesBase {
     });
   }
 
-  @Override
-  protected void initAccessor(SerializableRunnableIF createIndex) throws Exception {}
+  protected void initAccessor(SerializableRunnableIF createIndex, RegionTestableType regionTestType)
+      throws Exception {}
 
-  @Override
-  protected void initDataStore(SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION).create(REGION_NAME);
+  protected Object[] getListOfClientServerTypes() {
+    return new Object[] {new RegionTestableType[] {RegionTestableType.CLIENT_PARTITION,
+        RegionTestableType.PARTITION}};
   }
 
+
+
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesDUnitTest.java
new file mode 100644
index 0000000..f32bc84
--- /dev/null
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesDUnitTest.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.cache.lucene;
+
+import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
+import static org.junit.Assert.*;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
+import org.apache.geode.test.dunit.SerializableRunnableIF;
+import org.apache.geode.test.dunit.VM;
+
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.TermQuery;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+
+/**
+ * This test class is intended to contain basic integration tests of the lucene query class that
+ * should be executed against a number of different regions types and topologies.
+ *
+ */
+@Category(DistributedTest.class)
+@RunWith(JUnitParamsRunner.class)
+public class LuceneQueriesDUnitTest extends LuceneQueriesAccessorBase {
+
+  private static final long serialVersionUID = 1L;
+
+  @Test
+  @Parameters(method = "getListOfClientServerTypes")
+  public void returnCorrectResultsFromStringQueryWithDefaultAnalyzer(RegionTestableType clientType,
+      RegionTestableType regionType) {
+    SerializableRunnableIF createIndex = () -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
+    };
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
+    accessor.invoke(() -> initAccessor(createIndex, clientType));
+
+    putDataInRegion(accessor);
+    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
+    executeTextSearch(accessor);
+  }
+
+  @Test
+  @Parameters(method = "getListOfClientServerTypes")
+  public void defaultFieldShouldPropogateCorrectlyThroughFunction(RegionTestableType clientType,
+      RegionTestableType regionType) {
+    SerializableRunnableIF createIndex = () -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
+    };
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
+    accessor.invoke(() -> initAccessor(createIndex, clientType));
+    putDataInRegion(accessor);
+    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
+    executeTextSearch(accessor, "world", "text", 3);
+    executeTextSearch(accessor, "world", "noEntriesMapped", 0);
+  }
+
+  @Test
+  @Parameters(method = "getListOfClientServerTypes")
+  public void canQueryWithCustomLuceneQueryObject(RegionTestableType clientType,
+      RegionTestableType regionType) {
+    SerializableRunnableIF createIndex = () -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
+    };
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
+    accessor.invoke(() -> initAccessor(createIndex, clientType));
+    putDataInRegion(accessor);
+    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
+
+    // Execute a query with a custom lucene query object
+    accessor.invoke(() -> {
+      Cache cache = getCache();
+      LuceneService service = LuceneServiceProvider.get(cache);
+      LuceneQuery query =
+          service.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, index -> {
+            return new TermQuery(new Term("text", "world"));
+          });
+      final PageableLuceneQueryResults results = query.findPages();
+      assertEquals(3, results.size());
+    });
+  }
+
+  @Test
+  @Parameters(method = "getListOfClientServerTypes")
+  public void verifyWaitForFlushedFunctionOnAccessor(RegionTestableType clientType,
+      RegionTestableType regionType) throws InterruptedException {
+    SerializableRunnableIF createIndex = () -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
+    };
+    dataStore1.invoke(() -> initDataStore(createIndex, regionType));
+    dataStore2.invoke(() -> initDataStore(createIndex, regionType));
+    accessor.invoke(() -> initAccessor(createIndex, clientType));
+    dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
+    dataStore2.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
+    putDataInRegion(accessor);
+    assertFalse(waitForFlushBeforeExecuteTextSearch(accessor, 200));
+    dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
+    dataStore2.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    executeTextSearch(accessor, "world", "text", 3);
+    executeTextSearch(accessor, "world", "noEntriesMapped", 0);
+  }
+
+  protected void putDataInRegion(VM vm) {
+    vm.invoke(() -> {
+      final Cache cache = getCache();
+      Region<Object, Object> region = cache.getRegion(REGION_NAME);
+      region.put(1, new TestObject("hello world"));
+      region.put(113, new TestObject("hi world"));
+      region.put(2, new TestObject("goodbye world"));
+    });
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java
deleted file mode 100644
index 9c2f6ed..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.IndexRepositorySpy.doOnce;
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.any;
-
-import java.util.stream.IntStream;
-
-import org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.PartitionedRegion;
-import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage;
-import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.DistributionMessage;
-import org.apache.geode.distributed.internal.DistributionMessageObserver;
-import org.apache.geode.internal.cache.InitialImageOperation;
-import org.apache.geode.internal.cache.InitialImageOperation.GIITestHook;
-import org.apache.geode.internal.cache.InitialImageOperation.GIITestHookType;
-import org.apache.geode.internal.cache.InitialImageOperation.RequestImageMessage;
-import org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.PartitionedRegion;
-import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage;
-import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse;
-import org.junit.After;
-import org.junit.Test;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.PartitionAttributes;
-import org.apache.geode.cache.PartitionAttributesFactory;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.control.RebalanceOperation;
-import org.apache.geode.cache.control.RebalanceResults;
-import org.apache.geode.cache.lucene.test.IndexRepositorySpy;
-import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
-import org.apache.geode.cache.partition.PartitionRegionHelper;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.dunit.VM;
-
-/**
- * This test class adds more basic tests of lucene functionality for partitioned regions. These
- * tests should work across all types of PRs and topologies.
- *
- */
-public abstract class LuceneQueriesPRBase extends LuceneQueriesBase {
-  protected static final int NUM_BUCKETS = 10;
-
-  @After
-  public void cleanupRebalanceCallback() {
-    removeCallback(dataStore1);
-    removeCallback(dataStore2);
-  }
-
-  @Test
-  public void returnCorrectResultsWhenRebalanceHappensOnIndexUpdate() throws InterruptedException {
-    addCallbackToTriggerRebalance(dataStore1);
-
-    putEntriesAndValidateQueryResults();
-  }
-
-  @Test
-  public void returnCorrectResultsWhenMoveBucketHappensOnIndexUpdate() throws InterruptedException {
-    final DistributedMember member2 =
-        dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
-    addCallbackToMoveBucket(dataStore1, member2);
-
-    putEntriesAndValidateQueryResults();
-  }
-
-  @Test
-  public void returnCorrectResultsWhenMoveBucketHappensOnQuery() throws InterruptedException {
-    final DistributedMember member2 =
-        dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
-    addCallbackToMovePrimaryOnQuery(dataStore1, member2);
-
-    putEntriesAndValidateQueryResults();
-  }
-
-  @Test
-  public void returnCorrectResultsWhenBucketIsMovedAndMovedBackOnIndexUpdate()
-      throws InterruptedException {
-    final DistributedMember member1 =
-        dataStore1.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
-    final DistributedMember member2 =
-        dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
-    addCallbackToMoveBucket(dataStore1, member2);
-    addCallbackToMoveBucket(dataStore2, member1);
-
-    putEntriesAndValidateQueryResults();
-  }
-
-  @Test
-  public void returnCorrectResultsWhenRebalanceHappensAfterUpdates() throws InterruptedException {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-
-    putEntryInEachBucket();
-
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
-
-    rebalanceRegion(dataStore2);
-
-    executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
-  }
-
-  @Test
-  public void returnCorrectResultsWhenRebalanceHappensWhileSenderIsPaused()
-      throws InterruptedException {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-
-    putEntryInEachBucket();
-
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    rebalanceRegion(dataStore2);
-    dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
-
-    executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
-  }
-
-  protected PartitionAttributes getPartitionAttributes(final boolean isAccessor) {
-    PartitionAttributesFactory factory = new PartitionAttributesFactory();
-    if (!isAccessor) {
-      factory.setLocalMaxMemory(100);
-    }
-    factory.setTotalNumBuckets(NUM_BUCKETS);
-    return factory.create();
-  }
-
-  protected void putEntriesAndValidateQueryResults() {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-
-    putEntryInEachBucket();
-
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
-
-    executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
-  }
-
-  protected void putEntryInEachBucket() {
-    accessor.invoke(() -> {
-      final Cache cache = getCache();
-      Region<Object, Object> region = cache.getRegion(REGION_NAME);
-      IntStream.range(0, NUM_BUCKETS).forEach(i -> region.put(i, new TestObject("hello world")));
-    });
-  }
-
-  private void addCallbackToTriggerRebalance(VM vm) {
-    vm.invoke(() -> {
-      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
-
-      spy.beforeWriteIndexRepository(doOnce(key -> rebalanceRegion(vm)));
-    });
-  }
-
-  protected void addCallbackToMoveBucket(VM vm, final DistributedMember destination) {
-    vm.invoke(() -> {
-      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
-
-      spy.beforeWriteIndexRepository(doOnce(key -> moveBucket(destination, key)));
-    });
-  }
-
-  protected void addCallbackToMovePrimaryOnQuery(VM vm, final DistributedMember destination) {
-    vm.invoke(() -> {
-      LuceneIndexFactorySpy factorySpy = LuceneIndexFactorySpy.injectSpy();
-
-      factorySpy.setGetRespositoryConsumer(doOnce(key -> moveBucket(destination, key)));
-    });
-  }
-
-  private void moveBucket(final DistributedMember destination, final Object key) {
-    Region<Object, Object> region = getCache().getRegion(REGION_NAME);
-    DistributedMember source = getCache().getDistributedSystem().getDistributedMember();
-    System.out.println("WHAT");
-    PartitionRegionHelper.moveBucketByKey(region, source, destination, key);
-  }
-
-  private void removeCallback(VM vm) {
-    vm.invoke(() -> {
-      IndexRepositorySpy.remove();
-      InitialImageOperation.resetAllGIITestHooks();
-      LuceneIndexFactorySpy.remove();
-    });
-  }
-
-  private void rebalanceRegion(VM vm) {
-    // Do a rebalance
-    vm.invoke(() -> {
-      RebalanceOperation op = getCache().getResourceManager().createRebalanceFactory().start();
-      RebalanceResults results = op.getResults();
-    });
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerFixedPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerFixedPRDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerFixedPRDUnitTest.java
deleted file mode 100644
index 2622063..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerFixedPRDUnitTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME;
-
-import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.junit.categories.DistributedTest;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
-public class LuceneQueriesPeerFixedPRDUnitTest extends LuceneQueriesPeerPRRedundancyDUnitTest {
-
-  @Override
-  protected void initAccessor(SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache();
-    LuceneTestUtilities.createFixedPartitionedRegion(getCache(), REGION_NAME, null, 0);
-  }
-
-  @Override
-  protected void initDataStore(SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    LuceneTestUtilities.initDataStoreForFixedPR(getCache());
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
deleted file mode 100644
index f65777f..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME;
-
-import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
-public class LuceneQueriesPeerPRDUnitTest extends LuceneQueriesPRBase {
-
-  @Override
-  protected void initDataStore(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION)
-        .setPartitionAttributes(getPartitionAttributes(false)).create(REGION_NAME);
-  }
-
-  @Override
-  protected void initAccessor(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION_PROXY)
-        .setPartitionAttributes(getPartitionAttributes(true)).create(REGION_NAME);
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPROverflowDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPROverflowDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPROverflowDUnitTest.java
deleted file mode 100644
index 86ce713..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPROverflowDUnitTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
-
-import org.apache.geode.cache.EvictionAction;
-import org.apache.geode.cache.EvictionAttributes;
-import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
-public class LuceneQueriesPeerPROverflowDUnitTest extends LuceneQueriesPRBase {
-
-  @Override
-  protected void initDataStore(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    EvictionAttributes evicAttr =
-        EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK);
-    getCache().createRegionFactory(RegionShortcut.PARTITION_OVERFLOW)
-        .setPartitionAttributes(getPartitionAttributes(false)).setEvictionAttributes(evicAttr)
-        .create(REGION_NAME);
-  }
-
-  @Override
-  protected void initAccessor(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION_PROXY)
-        .setPartitionAttributes(getPartitionAttributes(true)).create(REGION_NAME);
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRPersistentDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRPersistentDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRPersistentDUnitTest.java
deleted file mode 100644
index 4e809ce..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRPersistentDUnitTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME;
-
-import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
-public class LuceneQueriesPeerPRPersistentDUnitTest extends LuceneQueriesPRBase {
-
-  @Override
-  protected void initDataStore(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION_PERSISTENT)
-        .setPartitionAttributes(getPartitionAttributes(false)).create(REGION_NAME);
-  }
-
-  @Override
-  protected void initAccessor(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    getCache().createRegionFactory(RegionShortcut.PARTITION_PROXY)
-        .setPartitionAttributes(getPartitionAttributes(true)).create(REGION_NAME);
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/a63b8302/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
deleted file mode 100644
index 1b4303a..0000000
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.cache.lucene;
-
-import static org.apache.geode.cache.lucene.test.IndexRepositorySpy.*;
-import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
-import static org.junit.Assert.*;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.geode.cache.CacheClosedException;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.cache.lucene.test.IndexRegionSpy;
-import org.apache.geode.cache.lucene.test.IndexRepositorySpy;
-import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.InitialImageOperation;
-import org.apache.geode.internal.cache.InitialImageOperation.GIITestHook;
-import org.apache.geode.internal.cache.InitialImageOperation.GIITestHookType;
-import org.apache.geode.internal.cache.PartitionedRegion;
-import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage;
-import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse;
-import org.apache.geode.test.dunit.SerializableRunnableIF;
-import org.apache.geode.test.dunit.VM;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import org.awaitility.Awaitility;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Category(DistributedTest.class)
-public class LuceneQueriesPeerPRRedundancyDUnitTest extends LuceneQueriesPRBase {
-
-  @Override
-  protected void initDataStore(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    Region region = getCache().createRegionFactory(RegionShortcut.PARTITION_REDUNDANT)
-        .setPartitionAttributes(getPartitionAttributes(false)).create(REGION_NAME);
-  }
-
-  @Override
-  protected void initAccessor(final SerializableRunnableIF createIndex) throws Exception {
-    createIndex.run();
-    Region region = getCache().createRegionFactory(RegionShortcut.PARTITION_PROXY_REDUNDANT)
-        .setPartitionAttributes(getPartitionAttributes(true)).create(REGION_NAME);
-  }
-
-  @Test
-  public void returnCorrectResultsWhenMovePrimaryHappensOnIndexUpdate()
-      throws InterruptedException {
-    final DistributedMember member2 =
-        dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
-    addCallbackToMovePrimary(dataStore1, member2);
-
-    putEntriesAndValidateResultsWithRedundancy();
-  }
-
-  @Test
-  public void returnCorrectResultsWhenCloseCacheHappensOnIndexUpdate() throws InterruptedException {
-    dataStore1.invoke(() -> {
-      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
-
-      spy.beforeWriteIndexRepository(doAfterN(key -> getCache().close(), 2));
-    });
-
-    final String expectedExceptions = CacheClosedException.class.getName();
-    dataStore1.invoke(addExceptionTag1(expectedExceptions));
-
-    putEntriesAndValidateResultsWithRedundancy();
-
-    // Wait until the cache is closed in datastore1
-    dataStore1.invoke(
-        () -> Awaitility.await().atMost(60, TimeUnit.SECONDS).until(basicGetCache()::isClosed));
-  }
-
-  @Test
-  public void returnCorrectResultsWhenCloseCacheHappensOnPartialIndexWrite()
-      throws InterruptedException {
-    final DistributedMember member2 =
-        dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
-    dataStore1.invoke(() -> {
-      IndexRegionSpy.beforeWrite(getCache(), doAfterN(key -> getCache().close(), 100));
-    });
-
-    putEntriesAndValidateResultsWithRedundancy();
-
-    // Wait until the cache is closed in datastore1
-    dataStore1.invoke(
-        () -> Awaitility.await().atMost(60, TimeUnit.SECONDS).until(basicGetCache()::isClosed));
-  }
-
-  @Test
-  public void returnCorrectResultsWhenIndexUpdateHappensIntheMiddleofGII()
-      throws InterruptedException {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-    putEntryInEachBucket();
-
-    dataStore2.invoke(() -> {
-      InitialImageOperation.setGIITestHook(
-          new GIITestHook(GIITestHookType.AfterSentRequestImage, "Do puts during request") {
-            @Override
-            public void reset() {
-
-          }
-
-            @Override
-            public String getRegionName() {
-              return "_B__index#__region.files_0";
-            }
-
-            @Override
-            public void run() {
-              dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-              waitForFlushBeforeExecuteTextSearch(dataStore1, 30000);
-            }
-          });
-    });
-
-    dataStore2.invoke(() -> initDataStore(createIndex));
-
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 30000));
-    executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
-  }
-
-  private void putEntriesAndValidateResultsWithRedundancy() {
-    SerializableRunnableIF createIndex = () -> {
-      LuceneService luceneService = LuceneServiceProvider.get(getCache());
-      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
-    };
-    dataStore1.invoke(() -> initDataStore(createIndex));
-    dataStore2.invoke(() -> initDataStore(createIndex));
-    accessor.invoke(() -> initAccessor(createIndex));
-    dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-    dataStore2.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-    accessor.invoke(() -> LuceneTestUtilities.pauseSender(getCache()));
-
-    putEntryInEachBucket();
-
-    dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-    dataStore2.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-    accessor.invoke(() -> LuceneTestUtilities.resumeSender(getCache()));
-
-    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore2, 60000));
-
-    executeTextSearch(accessor, "world", "text", NUM_BUCKETS);
-  }
-
-  protected void addCallbackToMovePrimary(VM vm, final DistributedMember destination) {
-    vm.invoke(() -> {
-      IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
-
-      spy.beforeWriteIndexRepository(doOnce(key -> moveBucket(destination, key)));
-    });
-  }
-
-  private void moveBucket(final DistributedMember destination, final Object key) {
-    PartitionedRegion region = (PartitionedRegion) getCache().getRegion(REGION_NAME);
-
-    BecomePrimaryBucketResponse response =
-        BecomePrimaryBucketMessage.send((InternalDistributedMember) destination, region,
-            region.getKeyInfo(key).getBucketId(), true);
-    assertNotNull(response);
-    assertTrue(response.waitForResponse());
-  }
-}


Mime
View raw message