geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [28/29] incubator-geode git commit: Fixing compile errors due to the automatic conversion to junit 4
Date Tue, 24 May 2016 00:31:53 GMT
Fixing compile errors due to the automatic conversion to junit 4


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

Branch: refs/heads/feature/GEODE-837
Commit: 3de62aec65815d868eb802523237b82d984960f1
Parents: f83cc54
Author: Kirk Lund <klund@apache.org>
Authored: Mon May 23 17:09:00 2016 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Mon May 23 17:09:00 2016 -0700

----------------------------------------------------------------------
 .../ClientServerRegisterInterestsDUnitTest.java |   4 -
 .../cache/query/dunit/GroupByDUnitImpl.java     |  32 +-
 .../dunit/GroupByPartitionedQueryDUnitTest.java |   5 -
 .../query/dunit/GroupByQueryDUnitTest.java      |   5 -
 .../NonDistinctOrderByPartitionedDUnitTest.java |   1 -
 ...itionedRegionCompactRangeIndexDUnitTest.java |   2 -
 ...ndexOperationsOnOverflowRegionDUnitTest.java |   9 +-
 ...ConcurrentIndexUpdateWithoutWLDUnitTest.java |   9 +-
 .../internal/index/EquiJoinIntegrationTest.java | 437 ++++++++++++++++++
 .../query/internal/index/EquijoinDUnitTest.java | 454 -------------------
 ...artitionedRegionEquiJoinIntegrationTest.java | 130 ++++++
 .../PartitionedRegionEquijoinDUnitTest.java     | 141 ------
 .../index/PutAllWithIndexPerfDUnitTest.java     |   6 +-
 .../gemfire/cache30/CacheXml30DUnitTest.java    |  42 +-
 .../gemfire/cache30/CacheXml40DUnitTest.java    |  10 -
 .../gemfire/cache30/CacheXml81DUnitTest.java    |   1 -
 .../gemfire/cache30/CacheXmlTestCase.java       |   9 +-
 ...istributedAckOverflowRegionCCEDUnitTest.java |   2 -
 .../gemfire/cache30/MultiVMRegionTestCase.java  |  12 +-
 .../cache30/PreloadedRegionTestCase.java        |  15 +-
 .../gemfire/cache30/SlowRecDUnitTest.java       |  10 +-
 .../DistributedLockServiceDUnitTest.java        |   1 -
 .../TcpServerBackwardCompatDUnitTest.java       |   7 -
 ...wardCompatibilitySerializationDUnitTest.java |   5 -
 .../gemfire/internal/JarDeployerDUnitTest.java  |  12 -
 .../gemfire/internal/cache/BackupDUnitTest.java |   9 -
 .../internal/cache/Bug37377DUnitTest.java       |   9 +-
 .../internal/cache/Bug39079DUnitTest.java       |  10 +-
 .../cache/DeltaPropagationStatsDUnitTest.java   |  16 +-
 .../cache/DiskRegByteArrayDUnitTest.java        |  39 +-
 .../internal/cache/EvictionDUnitTest.java       |   1 -
 .../cache/FixedPRSinglehopDUnitTest.java        |  24 +-
 .../PartitionedRegionEvictionDUnitTest.java     |   3 -
 .../PartitionedRegionInvalidateDUnitTest.java   |   3 +-
 ...rtitionedRegionOffHeapEvictionDUnitTest.java |   4 -
 .../PartitionedRegionSingleHopDUnitTest.java    |  40 +-
 ...RegionSingleHopWithServerGroupDUnitTest.java |  30 +-
 .../cache/RemoteTransactionCCEDUnitTest.java    |   7 -
 .../cache/RemoteTransactionDUnitTest.java       |  97 +++-
 .../internal/cache/SingleHopStatsDUnitTest.java |  14 +-
 .../internal/cache/SystemFailureDUnitTest.java  | 124 +++--
 .../gemfire/internal/cache/TestDelta.java       | 112 ++---
 ...egionFunctionExecutionFailoverDUnitTest.java |  26 +-
 .../internal/cache/ha/HAGIIBugDUnitTest.java    |   5 -
 .../internal/cache/ha/HARegionDUnitTest.java    |   4 +-
 .../internal/cache/ha/StatsBugDUnitTest.java    |   7 -
 .../partitioned/PersistPRKRFDUnitTest.java      |   4 -
 .../PersistentPartitionedRegionTestBase.java    |  20 +-
 .../PersistentRecoveryOrderDUnitTest.java       |   3 -
 .../PersistentReplicatedTestBase.java           |   9 +-
 ...mpatibilityHigherVersionClientDUnitTest.java |   8 +-
 .../DurableClientQueueSizeDUnitTest.java        |  13 +-
 .../sockets/InterestListRecoveryDUnitTest.java  |   6 +-
 .../sockets/InterestResultPolicyDUnitTest.java  |  16 +-
 .../cache/wan/AsyncEventQueueTestBase.java      |  14 +-
 .../asyncqueue/AsyncEventListenerDUnitTest.java |   2 +-
 .../gemfire/management/ManagementTestBase.java  |   5 -
 .../internal/pulse/TestClientIdsDUnitTest.java  |   2 +-
 .../pulse/TestSubscriptionsDUnitTest.java       |   2 +-
 59 files changed, 962 insertions(+), 1087 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
index 3830c84..f26bd8c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
@@ -69,10 +69,6 @@ public class ClientServerRegisterInterestsDUnitTest extends JUnit4DistributedTes
 
   private VM gemfireServerVm;
 
-  public ClientServerRegisterInterestsDUnitTest(final String testName) {
-    super(testName);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByDUnitImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByDUnitImpl.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByDUnitImpl.java
index 06636e9..c25cae5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByDUnitImpl.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByDUnitImpl.java
@@ -16,6 +16,10 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static org.junit.Assert.fail;
+
+import org.junit.Test;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.query.Index;
 import com.gemstone.gemfire.cache.query.IndexExistsException;
@@ -29,21 +33,19 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
 /**
  * 
  *
  */
-public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByTestInterface{
-
+public abstract class GroupByDUnitImpl extends JUnit4CacheTestCase implements GroupByTestInterface{
 
-  public GroupByDUnitImpl(String name) {
-    super(name);
-  }
 
   protected abstract GroupByTestInterface createTestInstance();
 
   @Override
+  @Test
   public void testAggregateFuncAvg() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -57,6 +59,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncAvgDistinct() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -70,6 +73,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncCountDistinctStar_1()
       throws Exception {
     Host host = Host.getHost(0);
@@ -84,6 +88,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncCountDistinctStar_2()
       throws Exception {
     Host host = Host.getHost(0);
@@ -98,6 +103,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncCountStar()
       throws Exception {
     Host host = Host.getHost(0);
@@ -112,6 +118,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncMax()
       throws Exception {
     Host host = Host.getHost(0);
@@ -126,6 +133,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncMin() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -139,6 +147,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncNoGroupBy() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -152,6 +161,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncSum() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -165,6 +175,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testAggregateFuncSumDistinct() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -178,6 +189,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testConvertibleGroupByQuery_1() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -191,6 +203,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testConvertibleGroupByQuery_refer_column() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -204,6 +217,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testConvertibleGroupByQuery_refer_column_alias_Bug520141() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -217,6 +231,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testSumWithMultiColumnGroupBy() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -230,6 +245,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testComplexValueAggregateFuncAvgDistinct() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -243,6 +259,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testAggregateFuncWithOrderBy() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -256,6 +273,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
   
   @Override
+  @Test
   public void testCompactRangeIndex() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -269,6 +287,7 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
   }
 
   @Override
+  @Test
   public void testDistinctCountWithoutGroupBy() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -280,7 +299,8 @@ public abstract class GroupByDUnitImpl extends CacheTestCase implements GroupByT
     test.testDistinctCountWithoutGroupBy();
     this.closeCache(vm0, vm1, vm2, vm3);
   }
-  
+
+  @Test
   public void testLimitWithGroupBy() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByPartitionedQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByPartitionedQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByPartitionedQueryDUnitTest.java
index c213558..cf261ac 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByPartitionedQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByPartitionedQueryDUnitTest.java
@@ -48,13 +48,8 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  *
  */
 @Category(DistributedTest.class)
-@Category(DistributedTest.class)
 public class GroupByPartitionedQueryDUnitTest extends GroupByDUnitImpl {
 
-  public GroupByPartitionedQueryDUnitTest() {
-    super();
-  }
-
   @Override
   protected GroupByTestImpl createTestInstance() {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByQueryDUnitTest.java
index ac8c5da..3dae466 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/GroupByQueryDUnitTest.java
@@ -56,13 +56,8 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  *
  */
 @Category(DistributedTest.class)
-@Category(DistributedTest.class)
 public class GroupByQueryDUnitTest extends JUnit4CacheTestCase {
 
-  public GroupByQueryDUnitTest() {
-    super();
-  }
-
   @Test
   public void testConvertibleGroupByNoIndex() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByPartitionedDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByPartitionedDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByPartitionedDUnitTest.java
index 9a80caf..f448db6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByPartitionedDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByPartitionedDUnitTest.java
@@ -49,7 +49,6 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  *
  */
 @Category(DistributedTest.class)
-@Category(DistributedTest.class)
 public class NonDistinctOrderByPartitionedDUnitTest extends
     NonDistinctOrderByDUnitImpl {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
index db1c7e3..9a791d9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
@@ -51,7 +51,6 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
 @Category(DistributedTest.class)
-@Category(DistributedTest.class)
 public class PartitionedRegionCompactRangeIndexDUnitTest extends JUnit4DistributedTestCase {
 
   public PartitionedRegionCompactRangeIndexDUnitTest() {
@@ -81,7 +80,6 @@ public class PartitionedRegionCompactRangeIndexDUnitTest extends JUnit4Distribut
   }
   
   @Test
-  @Test
   public void testGIIUpdateWithIndexDoesNotDuplicateEntryInIndexWhenAlreadyRecoveredFromPersistence() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
index f537d8b..535840b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
@@ -67,20 +67,13 @@ import com.gemstone.gemfire.test.dunit.Wait;
  */
 @Category(DistributedTest.class)
 public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
-    CacheTestCase {
+    JUnit4CacheTestCase {
 
   String name;
 
   public static volatile boolean hooked = false;
 
   /**
-   * @param name
-   */
-  public ConcurrentIndexOperationsOnOverflowRegionDUnitTest() {
-    super();
-  }
-
-  /**
    *
    */
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
index 1006234..80affdf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
@@ -72,7 +72,7 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
  */
 @Category(DistributedTest.class)
 public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
-    DistributedTestCase {
+    JUnit4DistributedTestCase {
   
   PRQueryDUnitHelper helper = new PRQueryDUnitHelper();
   private static String regionName = "Portfolios";
@@ -92,13 +92,6 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
   int stepSize = 10;
   private int totalDataSize = 50;
 
-  /**
-   * @param name
-   */
-  public ConcurrentIndexUpdateWithoutWLDUnitTest() {
-    super();
-  }
-
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
       vm.invoke(() -> getAvailableCacheElseCreateCache());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquiJoinIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquiJoinIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquiJoinIntegrationTest.java
new file mode 100644
index 0000000..622777e
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquiJoinIntegrationTest.java
@@ -0,0 +1,437 @@
+/*
+ * 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 com.gemstone.gemfire.cache.query.internal.index;
+
+import static org.junit.Assert.*;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.query.CacheUtils;
+import com.gemstone.gemfire.cache.query.FunctionDomainException;
+import com.gemstone.gemfire.cache.query.Index;
+import com.gemstone.gemfire.cache.query.IndexExistsException;
+import com.gemstone.gemfire.cache.query.IndexNameConflictException;
+import com.gemstone.gemfire.cache.query.NameResolutionException;
+import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.RegionNotFoundException;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.TypeMismatchException;
+import com.gemstone.gemfire.cache.query.functional.StructSetOrResultsSet;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+@Category(IntegrationTest.class)
+public class EquiJoinIntegrationTest {
+  QueryService qs;
+  Region region1, region2, region3, region4;
+  
+  @Before
+  public void setUp() throws java.lang.Exception {
+    CacheUtils.startCache();
+    qs = CacheUtils.getQueryService();
+  }
+  
+  @After
+  public void tearDown() {
+    region2.destroyRegion();
+    region1.destroyRegion();
+  }
+  
+  protected void createRegions() throws Exception {
+    region1 = createReplicatedRegion("region1");
+    region2 = createReplicatedRegion("region2");
+  }
+  
+  protected void createAdditionalRegions() throws Exception {
+    region3 = createReplicatedRegion("region3");
+    region4 = createReplicatedRegion("region4");
+  }
+  
+  protected void destroyAdditionalRegions() throws Exception {
+    if (region3 != null) {
+      region3.destroyRegion();
+    }
+    if (region4 != null) {
+      region4.destroyRegion();
+    }
+  }
+
+  @Test
+  public void testSingleFilterWithSingleEquijoinOneToOneMapping() throws Exception {
+    createRegions();
+
+    String[] queries = new String[]{
+        "<trace>select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid",
+        "<trace>select * from /region1 c, /region2 s where c.pkid=1 and s.pkid = c.pkid",
+        "<trace>select * from /region1 c, /region2 s where c.pkid = s.pkid and c.pkid=1",
+        "<trace>select * from /region1 c, /region2 s where s.pkid = c.pkid and c.pkid=1",
+    };
+    
+    for (int i = 0; i < 1000; i++) {
+      region1.put( i, new Customer(i, i));
+      region2.put( i, new Customer(i, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries);
+  }
+  
+  @Test
+  public void testSingleFilterWithSingleEquijoinOneToOneMappingWithAdditionalJoins() throws Exception {
+    createRegions();
+    try {
+      createAdditionalRegions();
+      
+      String[] queries = new String[]{
+          "<trace>select * from /region1 c, /region2 s, /region3 d where c.pkid=1 and c.pkid = s.pkid and d.pkid = s.pkid",  //this should derive d after deriving s from c
+          "<trace>select * from /region1 c, /region2 s, /region3 d, /region4 f where c.pkid=1 and c.pkid = s.pkid and d.pkid = s.pkid and f.pkid = d.pkid",  //this should f from d from s from c
+          "<trace>select * from /region1 c, /region2 s, /region3 d where c.pkid=1 and c.pkid = s.pkid and d.pkid = c.pkid",  //this should derive d and s from c 
+          "<trace>select * from /region1 c, /region2 s, /region3 d where c.pkid=1 and c.pkid = s.pkid and s.pkid = d.pkid",  //this should derive d after deriving s from c (order is just switched in the query)
+      };
+      
+      for (int i = 0; i < 30; i++) {
+        region1.put( i, new Customer(i, i));
+        region2.put( i, new Customer(i, i));
+        region3.put( i, new Customer(i, i));
+        region4.put( i, new Customer(i, i));
+      }
+      
+      executeQueriesWithIndexCombinations(queries);
+    }
+    finally {
+      destroyAdditionalRegions();
+    }
+  }
+
+  
+  /**
+   * We do not want to test this with Primary Key on the many side or else only 1 result will be returned
+   */
+  @Test
+  public void testSingleFilterWithSingleEquijoinOneToManyMapping() throws Exception {
+    createRegions();
+
+    String[] queries = new String[]{
+        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid",
+        "select * from /region1 c, /region2 s where c.pkid=1 and s.pkid = c.pkid",
+        "select * from /region1 c, /region2 s where c.pkid = s.pkid and c.pkid=1",
+        "select * from /region1 c, /region2 s where s.pkid = c.pkid and c.pkid=1",
+    };
+    
+    for (int i = 0; i < 1000; i++) {
+      region1.put( i, new Customer(i, i));
+      region2.put( i, new Customer(i % 100, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
+      protected String[] createIndexTypesForRegion2() {
+        return new String[] { "Compact", "Hash"};
+      }
+    }, false);
+  }
+
+  @Test
+  public void testSingleFilterWithSingleEquijoinMultipleFiltersOnSameRegionOnSameIteratorMapping() throws Exception {
+    createRegions();
+
+    String[] queries = new String[]{
+        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid and c.id = 1",
+        "select * from /region1 c, /region2 s where c.id = 1 and c.pkid=1 and s.pkid = c.pkid",
+        
+    };
+    
+    for (int i = 0; i < 1000; i++) {
+      region1.put( i, new Customer(i, i % 10));
+      region2.put( i, new Customer(i, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
+      Index secondaryIndex;
+      
+      @Override
+      public void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+        secondaryIndex = qs.createIndex("region1 id", "p.id", "/region1 p");
+        super.createIndexForRegion1(indexTypeId);
+      }
+
+      @Override
+      public void destroyIndexForRegion1(int indexTypeId) {
+        qs.removeIndex(secondaryIndex);
+        super.destroyIndexForRegion1(indexTypeId);
+      }
+      
+    }, false /*want to compare actual results and not size only*/);
+  }
+
+  @Test
+  public void testSingleFilterWithSingleEquijoinWithRangeFilters() throws Exception {
+    createRegions();
+
+    String[] queries = new String[]{
+        "<trace>select * from /region1 c, /region2 s where c.pkid = 1 and c.id > 1 and c.id < 10 and c.pkid = s.pkid",
+        "<trace>select * from /region1 c, /region2 s where c.pkid >= 0 and c.pkid < 10 and c.id < 10 and c.pkid = s.pkid"
+    };
+    
+    //just need enough so that there are 1-10 ids per pkid
+    for (int i = 0; i < 1000; i++) {
+      region1.put(i, new Customer(i % 5, i % 10));
+      region2.put(i, new Customer(i, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
+      protected String[] createIndexTypesForRegion1() {
+        return new String[] { "Compact", "Hash"};
+      }
+    }, false /*want to compare actual results and not size only*/);
+  }
+
+  @Test
+  public void testSingleFilterWithSingleEquijoinLimit() throws Exception {
+    //In this test we are hoping the index being used will properly use the limit while taking into consideration the filters of c.id and c.pkid
+    //This test is set up so that if the pkid index is used and limit applied, if id is not taken into consideration until later stages, it will lead to incorrect results (0)
+    createRegions();
+
+    String[] queries = new String[]{
+        "select * from /region1 c, /region2 s where c.id = 3 and c.pkid > 2  and c.pkid = s.pkid limit 1",
+    };
+    
+    for (int i = 0; i < 1000; i++) {
+      region1.put( i, new Customer(i, i % 10));
+      region2.put( i, new Customer(i, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
+      Index secondaryIndex;
+      
+      @Override
+      public void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+        secondaryIndex = qs.createIndex("region1 id", "p.id", "/region1 p");
+        super.createIndexForRegion1(indexTypeId);
+      }
+
+      @Override
+      public void destroyIndexForRegion1(int indexTypeId) {
+        qs.removeIndex(secondaryIndex);
+        super.destroyIndexForRegion1(indexTypeId);
+      }
+      
+    }, true);
+  }
+
+  @Test
+  public void testSingleFilterWithSingleEquijoinNestedQuery() throws Exception {
+    createRegions();
+
+    String[] queries = new String[]{
+        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid and c.pkid in (select t.pkid from /region1 t,/region2 s where s.pkid=t.pkid and s.pkid = 1)",
+        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid or c.pkid in set (1,2,3,4)",
+    };
+    
+    for (int i = 0; i < 1000; i++) {
+      region1.put( i, new Customer(i, i));
+      region2.put( i, new Customer(i, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries);
+  }
+
+  public static class Customer implements Serializable {
+    public int pkid;
+    public int id;
+    public String name;
+    public Map<String, Customer> nested = new HashMap<String, Customer>();
+
+    public Customer(int pkid, int id) {
+      this.pkid = pkid;
+      this.id = id;
+      this.name = "name" + pkid;
+    }
+
+    public String toString() {
+      return "Customer pkid = " + pkid + ", id: " + id + " name:" + name;
+    }
+  }
+
+  private Region createReplicatedRegion(String regionName) throws ParseException {
+    Cache cache = CacheUtils.getCache();
+    AttributesFactory attributesFactory = new AttributesFactory();
+    attributesFactory.setDataPolicy(DataPolicy.REPLICATE);
+    RegionAttributes regionAttributes = attributesFactory.create();
+    return cache.createRegion(regionName, regionAttributes);
+  }
+
+  protected void executeQueriesWithIndexCombinations(String[] queries) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException, QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException {
+    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs), false);
+  }
+  
+  protected void executeQueriesWithIndexCombinations(String[] queries, IndexCreatorCallback indexCreator, boolean sizeOnly) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException, QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException {
+    Object[] nonIndexedResults = executeQueries(queries);
+    
+    for (int r1Index = 0; r1Index < indexCreator.getNumIndexTypesForRegion1(); r1Index++) {
+      indexCreator.createIndexForRegion1(r1Index);
+      for (int r2Index = 0; r2Index < indexCreator.getNumIndexTypesForRegion2(); r2Index++) {
+        indexCreator.createIndexForRegion2(r2Index);
+        Object[] indexedResults = executeQueries(queries);
+        compareResults(nonIndexedResults, indexedResults, queries, sizeOnly);
+        indexCreator.destroyIndexForRegion2(r2Index);
+      }
+      indexCreator.destroyIndexForRegion1(r1Index);
+    }
+  }
+  
+  protected Object[] executeQueries(String[] queries) throws QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException {
+    Object[] results = new SelectResults[queries.length];
+    for (int i = 0; i < queries.length; i++) {
+      results[i] = qs.newQuery(queries[i]).execute();
+    }
+    return results;
+  }
+  
+  interface IndexCreatorCallback {
+    int getNumIndexTypesForRegion1();
+    int getNumIndexTypesForRegion2();
+    void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException;
+    void createIndexForRegion2(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException;
+    void destroyIndexForRegion1(int indexTypeId) ;
+    void destroyIndexForRegion2(int indexTypeId) ;
+  }
+  
+  static class DefaultIndexCreatorCallback implements IndexCreatorCallback {
+    protected String[] indexTypesForRegion1 = createIndexTypesForRegion1();
+    protected String[] indexTypesForRegion2 = createIndexTypesForRegion2();
+    protected Index indexOnR1, indexOnR2;
+    protected QueryService qs;
+    
+    DefaultIndexCreatorCallback(QueryService qs) {
+      this.qs = qs;
+    }
+    protected String[] createIndexTypesForRegion1() {
+      return new String[] { "Compact", "Hash", "PrimaryKey"};
+    }
+    
+    protected String[] createIndexTypesForRegion2() {
+      return new String[] { "Compact", "Hash", "PrimaryKey"};
+    }
+    
+    public int getNumIndexTypesForRegion1() {
+      return indexTypesForRegion1.length; 
+    }
+    
+    public int getNumIndexTypesForRegion2() {
+      return indexTypesForRegion2.length;
+    }
+    
+    public void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      indexOnR1 = createIndex(indexTypesForRegion1[indexTypeId], "region1", "pkid");
+
+    }
+    
+    public void createIndexForRegion2(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      indexOnR2 = createIndex(indexTypesForRegion2[indexTypeId], "region2", "pkid");
+    }
+
+    //Type id is not used here but at some future time we could store a map of indexes or find a use for this id?
+    public void destroyIndexForRegion1(int indexTypeId) {
+      qs.removeIndex(indexOnR1);
+    }
+    
+    public void destroyIndexForRegion2(int indexTypeId) {
+      qs.removeIndex(indexOnR2);
+    }
+    
+    
+    private Index createIndex(String type, String regionName, String field) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      Index index = null;
+      switch (type) {
+      case "Compact":
+        index = createCompactRangeIndex(regionName, field);
+        break;
+      case "Range":
+        index = createRangeIndexOnFirstIterator(regionName, field);
+        break;
+      case "Hash":
+        index = createHashIndex(regionName, field);
+        break;
+      case "PrimaryKey":
+        index = createPrimaryKeyIndex(regionName, field);
+        break;
+      }
+      return index;
+    }
+    
+    private Index createCompactRangeIndex(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      String fromClause = "/" + regionName + " r";
+      String indexedExpression = "r." + fieldName;
+      return qs.createIndex("Compact " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
+    }
+    
+    private Index createHashIndex(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      String fromClause = "/" + regionName + " r";
+      String indexedExpression = "r." + fieldName;
+      return qs.createHashIndex("Hash " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
+    }
+    
+    private Index createPrimaryKeyIndex(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      String fromClause = "/" + regionName + " r";
+      String indexedExpression = "r." + fieldName;
+      return qs.createKeyIndex("PrimaryKey " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
+    }
+    
+    private Index createRangeIndexOnFirstIterator(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      String fromClause = "/" + regionName + " r, r.nested.values v";
+      String indexedExpression = "r." + fieldName;
+      return qs.createIndex("Range " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
+    }
+    
+    private Index createRangeIndexOnSecondIterator(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
+      String fromClause = "/" + regionName + " r, r.nested.values v";
+      String indexedExpression = "v." + fieldName;
+      return qs.createIndex("Range " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
+    }
+  }
+  
+  private void compareResults(Object[] nonIndexedResults, Object[] indexedResults, String[] queries, boolean sizeOnly) {
+    if (sizeOnly) {
+      for (int i = 0; i < queries.length; i++) {
+        assertTrue(((SelectResults)nonIndexedResults[i]).size() == ((SelectResults)indexedResults[i]).size());
+        assertTrue(((SelectResults)nonIndexedResults[i]).size() > 0);
+      }
+    }
+    else {
+      StructSetOrResultsSet util = new StructSetOrResultsSet();
+      for (int i = 0; i < queries.length; i++) {
+        Object[][] resultsToCompare = new Object[1][2];
+        resultsToCompare[0][0] = nonIndexedResults[i];
+        resultsToCompare[0][1] = indexedResults[i];
+        util.CompareQueryResultsWithoutAndWithIndexes(resultsToCompare, 1, new String[]{queries[i]});
+        assertTrue(((SelectResults)nonIndexedResults[i]).size() > 0);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquijoinDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquijoinDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquijoinDUnitTest.java
deleted file mode 100644
index 3595019..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquijoinDUnitTest.java
+++ /dev/null
@@ -1,454 +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 com.gemstone.gemfire.cache.query.internal.index;
-
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
-import java.io.Serializable;
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.query.CacheUtils;
-import com.gemstone.gemfire.cache.query.FunctionDomainException;
-import com.gemstone.gemfire.cache.query.Index;
-import com.gemstone.gemfire.cache.query.IndexExistsException;
-import com.gemstone.gemfire.cache.query.IndexNameConflictException;
-import com.gemstone.gemfire.cache.query.NameResolutionException;
-import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
-import com.gemstone.gemfire.cache.query.QueryService;
-import com.gemstone.gemfire.cache.query.RegionNotFoundException;
-import com.gemstone.gemfire.cache.query.SelectResults;
-import com.gemstone.gemfire.cache.query.TypeMismatchException;
-import com.gemstone.gemfire.cache.query.functional.StructSetOrResultsSet;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-
-@Category(IntegrationTest.class)
-@Category(DistributedTest.class)
-public class EquijoinDUnitTest extends TestCase {
-  QueryService qs;
-  Region region1, region2, region3, region4;
-  
-  @Before
-  public void setUp() throws java.lang.Exception {
-    CacheUtils.startCache();
-    qs = CacheUtils.getQueryService();
-  }
-  
-  @After
-  public void tearDown() {
-    region2.destroyRegion();
-    region1.destroyRegion();
-  }
-  
-  protected void createRegions() throws Exception {
-    region1 = createReplicatedRegion("region1");
-    region2 = createReplicatedRegion("region2");
-  }
-  
-  protected void createAdditionalRegions() throws Exception {
-    region3 = createReplicatedRegion("region3");
-    region4 = createReplicatedRegion("region4");
-  }
-  
-  protected void destroyAdditionalRegions() throws Exception {
-    if (region3 != null) {
-      region3.destroyRegion();
-    }
-    if (region4 != null) {
-      region4.destroyRegion();
-    }
-  }
-
-  @Test
-  @Test
-  public void testSingleFilterWithSingleEquijoinOneToOneMapping() throws Exception {
-    createRegions();
-
-    String[] queries = new String[]{
-        "<trace>select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid",
-        "<trace>select * from /region1 c, /region2 s where c.pkid=1 and s.pkid = c.pkid",
-        "<trace>select * from /region1 c, /region2 s where c.pkid = s.pkid and c.pkid=1",
-        "<trace>select * from /region1 c, /region2 s where s.pkid = c.pkid and c.pkid=1",
-    };
-    
-    for (int i = 0; i < 1000; i++) {
-      region1.put( i, new Customer(i, i));
-      region2.put( i, new Customer(i, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries);
-  }
-  
-  @Test
-  @Test
-  public void testSingleFilterWithSingleEquijoinOneToOneMappingWithAdditionalJoins() throws Exception {
-    createRegions();
-    try {
-      createAdditionalRegions();
-      
-      String[] queries = new String[]{
-          "<trace>select * from /region1 c, /region2 s, /region3 d where c.pkid=1 and c.pkid = s.pkid and d.pkid = s.pkid",  //this should derive d after deriving s from c
-          "<trace>select * from /region1 c, /region2 s, /region3 d, /region4 f where c.pkid=1 and c.pkid = s.pkid and d.pkid = s.pkid and f.pkid = d.pkid",  //this should f from d from s from c
-          "<trace>select * from /region1 c, /region2 s, /region3 d where c.pkid=1 and c.pkid = s.pkid and d.pkid = c.pkid",  //this should derive d and s from c 
-          "<trace>select * from /region1 c, /region2 s, /region3 d where c.pkid=1 and c.pkid = s.pkid and s.pkid = d.pkid",  //this should derive d after deriving s from c (order is just switched in the query)
-      };
-      
-      for (int i = 0; i < 30; i++) {
-        region1.put( i, new Customer(i, i));
-        region2.put( i, new Customer(i, i));
-        region3.put( i, new Customer(i, i));
-        region4.put( i, new Customer(i, i));
-      }
-      
-      executeQueriesWithIndexCombinations(queries);
-    }
-    finally {
-      destroyAdditionalRegions();
-    }
-  }
-
-  
-  /**
-   * We do not want to test this with Primary Key on the many side or else only 1 result will be returned
-   */
-  @Test
-  @Test
-  public void testSingleFilterWithSingleEquijoinOneToManyMapping() throws Exception {
-    createRegions();
-
-    String[] queries = new String[]{
-        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid",
-        "select * from /region1 c, /region2 s where c.pkid=1 and s.pkid = c.pkid",
-        "select * from /region1 c, /region2 s where c.pkid = s.pkid and c.pkid=1",
-        "select * from /region1 c, /region2 s where s.pkid = c.pkid and c.pkid=1",
-    };
-    
-    for (int i = 0; i < 1000; i++) {
-      region1.put( i, new Customer(i, i));
-      region2.put( i, new Customer(i % 100, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
-      protected String[] createIndexTypesForRegion2() {
-        return new String[] { "Compact", "Hash"};
-      }
-    }, false);
-  }
-
-  @Test
-  @Test
-  public void testSingleFilterWithSingleEquijoinMultipleFiltersOnSameRegionOnSameIteratorMapping() throws Exception {
-    createRegions();
-
-    String[] queries = new String[]{
-        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid and c.id = 1",
-        "select * from /region1 c, /region2 s where c.id = 1 and c.pkid=1 and s.pkid = c.pkid",
-        
-    };
-    
-    for (int i = 0; i < 1000; i++) {
-      region1.put( i, new Customer(i, i % 10));
-      region2.put( i, new Customer(i, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
-      Index secondaryIndex;
-      
-      @Override
-      public void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-        secondaryIndex = qs.createIndex("region1 id", "p.id", "/region1 p");
-        super.createIndexForRegion1(indexTypeId);
-      }
-
-      @Override
-      public void destroyIndexForRegion1(int indexTypeId) {
-        qs.removeIndex(secondaryIndex);
-        super.destroyIndexForRegion1(indexTypeId);
-      }
-      
-    }, false /*want to compare actual results and not size only*/);
-  }
-
-  @Test  
-  @Test
-  public void testSingleFilterWithSingleEquijoinWithRangeFilters() throws Exception {
-    createRegions();
-
-    String[] queries = new String[]{
-        "<trace>select * from /region1 c, /region2 s where c.pkid = 1 and c.id > 1 and c.id < 10 and c.pkid = s.pkid",
-        "<trace>select * from /region1 c, /region2 s where c.pkid >= 0 and c.pkid < 10 and c.id < 10 and c.pkid = s.pkid"
-    };
-    
-    //just need enough so that there are 1-10 ids per pkid
-    for (int i = 0; i < 1000; i++) {
-      region1.put(i, new Customer(i % 5, i % 10));
-      region2.put(i, new Customer(i, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
-      protected String[] createIndexTypesForRegion1() {
-        return new String[] { "Compact", "Hash"};
-      }
-    }, false /*want to compare actual results and not size only*/);
-  }
-
-  @Test 
-  @Test
-  public void testSingleFilterWithSingleEquijoinLimit() throws Exception {
-    //In this test we are hoping the index being used will properly use the limit while taking into consideration the filters of c.id and c.pkid
-    //This test is set up so that if the pkid index is used and limit applied, if id is not taken into consideration until later stages, it will lead to incorrect results (0)
-    createRegions();
-
-    String[] queries = new String[]{
-        "select * from /region1 c, /region2 s where c.id = 3 and c.pkid > 2  and c.pkid = s.pkid limit 1",
-    };
-    
-    for (int i = 0; i < 1000; i++) {
-      region1.put( i, new Customer(i, i % 10));
-      region2.put( i, new Customer(i, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs) {
-      Index secondaryIndex;
-      
-      @Override
-      public void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-        secondaryIndex = qs.createIndex("region1 id", "p.id", "/region1 p");
-        super.createIndexForRegion1(indexTypeId);
-      }
-
-      @Override
-      public void destroyIndexForRegion1(int indexTypeId) {
-        qs.removeIndex(secondaryIndex);
-        super.destroyIndexForRegion1(indexTypeId);
-      }
-      
-    }, true);
-  }
-
-  @Test
-  @Test
-  public void testSingleFilterWithSingleEquijoinNestedQuery() throws Exception {
-    createRegions();
-
-    String[] queries = new String[]{
-        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid and c.pkid in (select t.pkid from /region1 t,/region2 s where s.pkid=t.pkid and s.pkid = 1)",
-        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid or c.pkid in set (1,2,3,4)",
-    };
-    
-    for (int i = 0; i < 1000; i++) {
-      region1.put( i, new Customer(i, i));
-      region2.put( i, new Customer(i, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries);
-  }
-
-  public static class Customer implements Serializable {
-    public int pkid;
-    public int id;
-    public String name;
-    public Map<String, Customer> nested = new HashMap<String, Customer>();
-
-    public Customer(int pkid, int id) {
-      this.pkid = pkid;
-      this.id = id;
-      this.name = "name" + pkid;
-    }
-
-    public String toString() {
-      return "Customer pkid = " + pkid + ", id: " + id + " name:" + name;
-    }
-  }
-
-  private Region createReplicatedRegion(String regionName) throws ParseException {
-    Cache cache = CacheUtils.getCache();
-    AttributesFactory attributesFactory = new AttributesFactory();
-    attributesFactory.setDataPolicy(DataPolicy.REPLICATE);
-    RegionAttributes regionAttributes = attributesFactory.create();
-    return cache.createRegion(regionName, regionAttributes);
-  }
-
-  protected void executeQueriesWithIndexCombinations(String[] queries) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException, QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException {
-    executeQueriesWithIndexCombinations(queries, new DefaultIndexCreatorCallback(qs), false);
-  }
-  
-  protected void executeQueriesWithIndexCombinations(String[] queries, IndexCreatorCallback indexCreator, boolean sizeOnly) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException, QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException {
-    Object[] nonIndexedResults = executeQueries(queries);
-    
-    for (int r1Index = 0; r1Index < indexCreator.getNumIndexTypesForRegion1(); r1Index++) {
-      indexCreator.createIndexForRegion1(r1Index);
-      for (int r2Index = 0; r2Index < indexCreator.getNumIndexTypesForRegion2(); r2Index++) {
-        indexCreator.createIndexForRegion2(r2Index);
-        Object[] indexedResults = executeQueries(queries);
-        compareResults(nonIndexedResults, indexedResults, queries, sizeOnly);
-        indexCreator.destroyIndexForRegion2(r2Index);
-      }
-      indexCreator.destroyIndexForRegion1(r1Index);
-    }
-  }
-  
-  protected Object[] executeQueries(String[] queries) throws QueryInvocationTargetException, NameResolutionException, TypeMismatchException, FunctionDomainException {
-    Object[] results = new SelectResults[queries.length];
-    for (int i = 0; i < queries.length; i++) {
-      results[i] = qs.newQuery(queries[i]).execute();
-    }
-    return results;
-  }
-  
-  interface IndexCreatorCallback {
-    int getNumIndexTypesForRegion1();
-    int getNumIndexTypesForRegion2();
-    void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException;
-    void createIndexForRegion2(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException;
-    void destroyIndexForRegion1(int indexTypeId) ;
-    void destroyIndexForRegion2(int indexTypeId) ;
-  }
-  
-  static class DefaultIndexCreatorCallback implements IndexCreatorCallback {
-    protected String[] indexTypesForRegion1 = createIndexTypesForRegion1();
-    protected String[] indexTypesForRegion2 = createIndexTypesForRegion2();
-    protected Index indexOnR1, indexOnR2;
-    protected QueryService qs;
-    
-    DefaultIndexCreatorCallback(QueryService qs) {
-      this.qs = qs;
-    }
-    protected String[] createIndexTypesForRegion1() {
-      return new String[] { "Compact", "Hash", "PrimaryKey"};
-    }
-    
-    protected String[] createIndexTypesForRegion2() {
-      return new String[] { "Compact", "Hash", "PrimaryKey"};
-    }
-    
-    public int getNumIndexTypesForRegion1() {
-      return indexTypesForRegion1.length; 
-    }
-    
-    public int getNumIndexTypesForRegion2() {
-      return indexTypesForRegion2.length;
-    }
-    
-    public void createIndexForRegion1(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      indexOnR1 = createIndex(indexTypesForRegion1[indexTypeId], "region1", "pkid");
-
-    }
-    
-    public void createIndexForRegion2(int indexTypeId) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      indexOnR2 = createIndex(indexTypesForRegion2[indexTypeId], "region2", "pkid");
-    }
-
-    //Type id is not used here but at some future time we could store a map of indexes or find a use for this id?
-    public void destroyIndexForRegion1(int indexTypeId) {
-      qs.removeIndex(indexOnR1);
-    }
-    
-    public void destroyIndexForRegion2(int indexTypeId) {
-      qs.removeIndex(indexOnR2);
-    }
-    
-    
-    private Index createIndex(String type, String regionName, String field) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      Index index = null;
-      switch (type) {
-      case "Compact":
-        index = createCompactRangeIndex(regionName, field);
-        break;
-      case "Range":
-        index = createRangeIndexOnFirstIterator(regionName, field);
-        break;
-      case "Hash":
-        index = createHashIndex(regionName, field);
-        break;
-      case "PrimaryKey":
-        index = createPrimaryKeyIndex(regionName, field);
-        break;
-      }
-      return index;
-    }
-    
-    private Index createCompactRangeIndex(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      String fromClause = "/" + regionName + " r";
-      String indexedExpression = "r." + fieldName;
-      return qs.createIndex("Compact " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
-    }
-    
-    private Index createHashIndex(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      String fromClause = "/" + regionName + " r";
-      String indexedExpression = "r." + fieldName;
-      return qs.createHashIndex("Hash " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
-    }
-    
-    private Index createPrimaryKeyIndex(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      String fromClause = "/" + regionName + " r";
-      String indexedExpression = "r." + fieldName;
-      return qs.createKeyIndex("PrimaryKey " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
-    }
-    
-    private Index createRangeIndexOnFirstIterator(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      String fromClause = "/" + regionName + " r, r.nested.values v";
-      String indexedExpression = "r." + fieldName;
-      return qs.createIndex("Range " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
-    }
-    
-    private Index createRangeIndexOnSecondIterator(String regionName, String fieldName) throws RegionNotFoundException, IndexExistsException, IndexNameConflictException {
-      String fromClause = "/" + regionName + " r, r.nested.values v";
-      String indexedExpression = "v." + fieldName;
-      return qs.createIndex("Range " + fromClause + ":" + indexedExpression, indexedExpression, fromClause);
-    }
-  }
-  
-  private void compareResults(Object[] nonIndexedResults, Object[] indexedResults, String[] queries, boolean sizeOnly) {
-    if (sizeOnly) {
-      for (int i = 0; i < queries.length; i++) {
-        assertTrue(((SelectResults)nonIndexedResults[i]).size() == ((SelectResults)indexedResults[i]).size());
-        assertTrue(((SelectResults)nonIndexedResults[i]).size() > 0);
-      }
-    }
-    else {
-      StructSetOrResultsSet util = new StructSetOrResultsSet();
-      for (int i = 0; i < queries.length; i++) {
-        Object[][] resultsToCompare = new Object[1][2];
-        resultsToCompare[0][0] = nonIndexedResults[i];
-        resultsToCompare[0][1] = indexedResults[i];
-        util.CompareQueryResultsWithoutAndWithIndexes(resultsToCompare, 1, new String[]{queries[i]});
-        assertTrue(((SelectResults)nonIndexedResults[i]).size() > 0);
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquiJoinIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquiJoinIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquiJoinIntegrationTest.java
new file mode 100644
index 0000000..01b245a
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquiJoinIntegrationTest.java
@@ -0,0 +1,130 @@
+/*
+ * 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 com.gemstone.gemfire.cache.query.internal.index;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
+import com.gemstone.gemfire.cache.query.CacheUtils;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+@Category(IntegrationTest.class)
+public class PartitionedRegionEquiJoinIntegrationTest extends EquiJoinIntegrationTest {
+ 
+  @Override
+  protected void createRegions() {
+    region1 = createPartitionRegion("region1");
+    region2 = createColocatedPartitionRegion("region2", "region1");
+    FunctionService.registerFunction(equijoinTestFunction);
+  }
+  
+  @Override
+  protected void createAdditionalRegions() throws Exception {
+    region3 = createColocatedPartitionRegion("region3", "region1");
+    region4 = createColocatedPartitionRegion("region4", "region1");
+  }
+ 
+  @Test
+  public void testSingleFilterWithSingleEquijoinNestedQuery() throws Exception {
+    createRegions();
+
+    String[] queries = new String[]{
+        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid or c.pkid in set (1,2,3,4)",
+    };
+    
+    for (int i = 0; i < 1000; i++) {
+      region1.put( i, new Customer(i, i));
+      region2.put( i, new Customer(i, i));
+    }
+    
+    executeQueriesWithIndexCombinations(queries);
+  }
+
+  public Region createPartitionRegion(String regionName) {
+    PartitionAttributesFactory paf = new PartitionAttributesFactory();
+    RegionFactory factory = CacheUtils.getCache().createRegionFactory(RegionShortcut.PARTITION)
+        .setPartitionAttributes(paf.create());
+    return factory.create(regionName);
+  }
+ 
+  public Region createColocatedPartitionRegion(String regionName, final String colocatedRegion) {
+     PartitionAttributesFactory paf = new PartitionAttributesFactory();
+        paf.setColocatedWith(colocatedRegion);
+    RegionFactory factory = CacheUtils.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create());
+    return factory.create(regionName);
+  }
+  
+
+  @Override
+  protected Object[] executeQueries(String[] queries) {
+    ResultCollector collector = FunctionService.onRegion(region1).withArgs(queries).execute(equijoinTestFunction.getId());
+    Object result = collector.getResult();
+    return (Object[])((ArrayList)result).get(0);
+  }
+  
+  Function equijoinTestFunction = new Function(){
+    @Override
+    public boolean hasResult() {
+      return true;
+    }
+
+    @Override
+    public void execute(FunctionContext context) {
+      try {
+        String[] queries = (String[]) context.getArguments();
+        QueryService qs = CacheUtils.getCache().getQueryService();
+        
+        Object[] results = new SelectResults[queries.length];
+        for (int i = 0; i < queries.length; i++) {
+          results[i] = qs.newQuery(queries[i]).execute((RegionFunctionContext)context);
+        }
+        context.getResultSender().lastResult(results);
+      }
+      catch (Exception e) {
+        e.printStackTrace();
+      }
+    }
+
+    @Override
+    public String getId() {
+      return "Equijoin Query";
+    }
+
+    @Override
+    public boolean optimizeForWrite() {
+      return false;
+    }
+
+    @Override
+    public boolean isHA() {
+      return false;
+    }
+  };
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquijoinDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquijoinDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquijoinDUnitTest.java
deleted file mode 100644
index 951da21..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquijoinDUnitTest.java
+++ /dev/null
@@ -1,141 +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 com.gemstone.gemfire.cache.query.internal.index;
-
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
-import java.util.ArrayList;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.cache.PartitionAttributesFactory;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionFactory;
-import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache.execute.Function;
-import com.gemstone.gemfire.cache.execute.FunctionContext;
-import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
-import com.gemstone.gemfire.cache.execute.ResultCollector;
-import com.gemstone.gemfire.cache.query.CacheUtils;
-import com.gemstone.gemfire.cache.query.QueryService;
-import com.gemstone.gemfire.cache.query.SelectResults;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-
-@Category(IntegrationTest.class)
-@Category(DistributedTest.class)
-public class PartitionedRegionEquijoinDUnitTest extends EquijoinDUnitTest {
- 
-  @Override
-  protected void createRegions() {
-    region1 = createPartitionRegion("region1");
-    region2 = createColocatedPartitionRegion("region2", "region1");
-    FunctionService.registerFunction(equijoinTestFunction);
-  }
-  
-  @Override
-  protected void createAdditionalRegions() throws Exception {
-    region3 = createColocatedPartitionRegion("region3", "region1");
-    region4 = createColocatedPartitionRegion("region4", "region1");
-  }
- 
-  @Test
-  @Test
-  public void testSingleFilterWithSingleEquijoinNestedQuery() throws Exception {
-    createRegions();
-
-    String[] queries = new String[]{
-        "select * from /region1 c, /region2 s where c.pkid=1 and c.pkid = s.pkid or c.pkid in set (1,2,3,4)",
-    };
-    
-    for (int i = 0; i < 1000; i++) {
-      region1.put( i, new Customer(i, i));
-      region2.put( i, new Customer(i, i));
-    }
-    
-    executeQueriesWithIndexCombinations(queries);
-  }
-
-  public Region createPartitionRegion(String regionName) {
-    PartitionAttributesFactory paf = new PartitionAttributesFactory();
-    RegionFactory factory = CacheUtils.getCache().createRegionFactory(RegionShortcut.PARTITION)
-        .setPartitionAttributes(paf.create());
-    return factory.create(regionName);
-  }
- 
-  public Region createColocatedPartitionRegion(String regionName, final String colocatedRegion) {
-     PartitionAttributesFactory paf = new PartitionAttributesFactory();
-        paf.setColocatedWith(colocatedRegion);
-    RegionFactory factory = CacheUtils.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create());
-    return factory.create(regionName);
-  }
-  
-
-  @Override
-  protected Object[] executeQueries(String[] queries) {
-    ResultCollector collector = FunctionService.onRegion(region1).withArgs(queries).execute(equijoinTestFunction.getId());
-    Object result = collector.getResult();
-    return (Object[])((ArrayList)result).get(0);
-  }
-  
-  Function equijoinTestFunction = new Function(){
-    @Override
-    public boolean hasResult() {
-      return true;
-    }
-
-    @Override
-    public void execute(FunctionContext context) {
-      try {
-        String[] queries = (String[]) context.getArguments();
-        QueryService qs = CacheUtils.getCache().getQueryService();
-        
-        Object[] results = new SelectResults[queries.length];
-        for (int i = 0; i < queries.length; i++) {
-          results[i] = qs.newQuery(queries[i]).execute((RegionFunctionContext)context);
-        }
-        context.getResultSender().lastResult(results);
-      }
-      catch (Exception e) {
-        e.printStackTrace();
-      }
-    }
-
-    @Override
-    public String getId() {
-      return "Equijoin Query";
-    }
-
-    @Override
-    public boolean optimizeForWrite() {
-      return false;
-    }
-
-    @Override
-    public boolean isHA() {
-      return false;
-    }
-  };
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
index c896cec..0e8c5e6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
@@ -55,11 +55,6 @@ import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-@Category(DistributedTest.class)
-@Ignore("Test was disabled by renaming to DisabledTest")
 @Category(DistributedTest.class)
 public class PutAllWithIndexPerfDUnitTest extends JUnit4CacheTestCase {
 
@@ -82,6 +77,7 @@ public class PutAllWithIndexPerfDUnitTest extends JUnit4CacheTestCase {
     disconnectAllFromDS();
   }
 
+  @Ignore("TODO")
   @Test
   public void testPutAllWithIndexes() {
     final String name = "testRegion";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml30DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml30DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml30DUnitTest.java
index 5f50688..feafcef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml30DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml30DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileWriter;
@@ -79,15 +88,13 @@ import com.gemstone.gemfire.util.test.TestUtil;
  *
  * @since 3.0
  */
+@Category(DistributedTest.class)
 public class CacheXml30DUnitTest extends CacheXmlTestCase {
 
-  public CacheXml30DUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Tests creating a cache with a non-existent XML file
    */
+  @Test
   public void testNonExistentFile() throws IOException {
 //    System.out.println("testNonExistentFile - start: " + System.currentTimeMillis());
     File nonExistent = new File(this.getName() + ".xml");
@@ -113,6 +120,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests creating a cache with a XML file that is a directory
    */
+  @Test
   public void testXmlFileIsDirectory() {
     File dir = new File(this.getName() + "dir");
     dir.mkdirs();
@@ -136,6 +144,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests creating a cache with the default lock-timeout, lock-lease,
    * and search-timeout.
    */
+  @Test
   public void testDefaultCache() {
     CacheCreation cache = new CacheCreation();
 
@@ -146,6 +155,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests creating a cache with non-default lock-timeout, lock-lease,
    * and search-timeout.
    */
+  @Test
   public void testNonDefaultCache() {
     CacheCreation cache = new CacheCreation();
     cache.setLockTimeout(42);
@@ -162,6 +172,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests creating a cache with entries defined in the root region
    */
+  @Test
   public void testEntriesInRootRegion() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -176,6 +187,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests creating a cache whose keys are constrained
    */
+  @Test
   public void testConstrainedKeys() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -189,6 +201,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests creating a cache with a various {@link
    * ExpirationAttributes}.
    */
+  @Test
   public void testExpirationAttriubutes() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -226,6 +239,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests a cache loader an interesting combination of declarables
    */
+  @Test
   public void testCacheLoaderWithDeclarables() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -242,6 +256,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests a cache writer with no parameters
    */
+  @Test
   public void testCacheWriter() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -257,6 +272,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests a cache listener with no parameters
    */
+  @Test
   public void testCacheListener() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -272,6 +288,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests a region with non-default region attributes
    */
+  @Test
   public void testNonDefaultRegionAttributes() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -290,6 +307,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests parsing a malformed XML file
    */
+  @Test
   public void testMalformed() {
     setXmlFile(findFile("malformed.xml"));
 
@@ -308,6 +326,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests parsing an XML file with a bad integer
    */
+  @Test
   public void testBadInt() {
     setXmlFile(findFile("badInt.xml"));
 
@@ -330,6 +349,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests parsing an XML file with a bad float
    */
+  @Test
   public void testBadFloat() {
     setXmlFile(findFile("badFloat.xml"));
 
@@ -349,6 +369,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests parsing an XML file with a bad scope.  This error should be
    * caught by the XML parser.
    */
+  @Test
   public void testBadScope() {
     setXmlFile(findFile("badScope.xml"));
 
@@ -368,6 +389,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests parsing an XML file with a non-existent key constraint
    * class.
    */
+  @Test
   public void testBadKeyConstraintClass() {
     setXmlFile(findFile("badKeyConstraintClass.xml"));
 
@@ -387,6 +409,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests parsing an XML file that specifies a cache listener that is
    * not {@link Declarable}.
    */
+  @Test
   public void testCallbackNotDeclarable() {
     setXmlFile(findFile("callbackNotDeclarable.xml"));
 
@@ -409,6 +432,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests parsing an XML file that specifies a cache listener whose
    * constructor throws an {@linkplain AssertionError exception}.
    */
+  @Test
   public void testCallbackWithException() {
     setXmlFile(findFile("callbackWithException.xml"));
 
@@ -431,6 +455,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests parsing an XML file that specifies a cache listener that is
    * not a <code>CacheLoader</code>.
    */
+  @Test
   public void testLoaderNotLoader() {
     setXmlFile(findFile("loaderNotLoader.xml"));
 
@@ -450,6 +475,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests nested regions
    */
+  @Test
   public void testNestedRegions() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -494,6 +520,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests whether or not XML attributes can appear in any order.  See
    * bug 30050.
    */
+  @Test
   public void testAttributesUnordered() {
     setXmlFile(findFile("attributesUnordered.xml"));
     getCache();
@@ -502,6 +529,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests disk directories
    */
+  @Test
   public void testDiskDirs() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -526,6 +554,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    * Tests the <code>overflowThreshold</code> and
    * <code>persistBackup</code> related attributes
    */
+  @Test
   public void testOverflowAndBackup() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -541,6 +570,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests <code>DiskWriteAttributes</code>
    */
+  @Test
   public void testDiskWriteAttributes() throws CacheException {
     CacheCreation cache = new CacheCreation();
 //  Set properties for Asynch writes
@@ -577,6 +607,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    *
    * @since 3.2.1
    */
+  @Test
   public void testExampleCacheXmlFile() throws Exception {
     // Check for old example files
     String dirName = "examples_" + this.getGemFireVersion();
@@ -617,6 +648,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
     }
   }
   
+  @Test
   public void testEvictionLRUEntryAttributes() throws Exception {
     final String rName = getUniqueName();
     CacheCreation cache = new CacheCreation();
@@ -658,6 +690,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
       return true;
     }
   }
+  @Test
   public void testEvictionLRUMemoryAttributes() throws Exception {
     final String rName = getUniqueName();
     CacheCreation cache = new CacheCreation();
@@ -667,6 +700,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
     testXml(cache);
   }
 
+  @Test
   public void testEvictionLRUHeapAttributes() throws Exception {
     final String rName = getUniqueName();
     CacheCreation cache = new CacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml40DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml40DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml40DUnitTest.java
index fcd37b1..9b3ea63 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml40DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml40DUnitTest.java
@@ -43,20 +43,10 @@ import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 @Category(DistributedTest.class)
 public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
 
-  ////////  Constructors
-
-  public CacheXml40DUnitTest() {
-    super();
-  }
-
-  ////////  Helper methods
-
   protected String getGemFireVersion() {
     return CacheXml.VERSION_4_0;
   }
 
-  ////////  Test methods
-
   /**
    * Tests the cache server attribute
    *

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
index 013863a..12e1716 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
@@ -144,7 +144,6 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
    * @since 8.2
    */
   @Test
-  @Test
   public void testLocatorInException() {
     final String regionName = "testRegionExtension";
     final CacheCreation cache = new CacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
index 8c9776e..47a016a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -30,9 +32,10 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
 import com.gemstone.gemfire.internal.cache.xmlcache.ClientCacheCreation;
 import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-public class CacheXmlTestCase extends CacheTestCase {
+public class CacheXmlTestCase extends JUnit4CacheTestCase {
 
   /** The file used by this test (method) to initialize the cache */
   private File xmlFile;
@@ -40,10 +43,6 @@ public class CacheXmlTestCase extends CacheTestCase {
   /** set this to false if a test needs a non-loner distributed system */
   static boolean lonerDistributedSystem = true;
 
-  public CacheXmlTestCase(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
index 16c38f7..d678ac0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
@@ -71,7 +71,6 @@ public class DistributedAckOverflowRegionCCEDUnitTest extends
   }
 
   @Override
-  @Test
   @Ignore
   @Test
   public void testClearWithConcurrentEvents() throws Exception {
@@ -81,7 +80,6 @@ public class DistributedAckOverflowRegionCCEDUnitTest extends
   }
 
   @Override
-  @Test
   @Ignore
   @Test
   public void testClearWithConcurrentEventsAsync() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
index a8c2f0e..7f0c136 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
@@ -437,7 +437,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * DISABLED 4-16-04 - the current implementation assumes events
    * are processed synchronously, which is no longer true.
    */
-  public void _ttestOrderedUpdates() throws Throwable {
+  @Ignore("DISABLED 4-16-04 - the current implementation assumes events are processed synchronously, which is no longer true")
+  @Test
+  public void testOrderedUpdates() throws Throwable {
     if (getRegionAttributes().getScope() ==
         Scope.DISTRIBUTED_NO_ACK) {
       return;
@@ -4960,9 +4962,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
   }
 
-
   @Ignore("Disabled for 51542")
-  public void DISABLED_testNBRegionInvalidationDuringGetInitialImage() throws Throwable {
+  @Test
+  public void testNBRegionInvalidationDuringGetInitialImage() throws Throwable {
     DistributedTestCase.disconnectAllFromDS();
     if (!supportsReplication()) {
       return;
@@ -7509,7 +7511,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
   }
 
-  public void todo_testTXAlgebra() throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testTXAlgebra() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
     if (getRegionAttributes().getScope().isGlobal()
         || getRegionAttributes().getDataPolicy().withPersistence()) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3de62aec/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
index 38be728..b9cf639 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -33,10 +42,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since 3.0
  */
+@Category(DistributedTest.class)
 public class PreloadedRegionTestCase extends MultiVMRegionTestCase {
 
-  public PreloadedRegionTestCase(String name) {
-    super(name);
+  public PreloadedRegionTestCase() {
+    super();
   }
 
   /**
@@ -52,6 +62,7 @@ public class PreloadedRegionTestCase extends MultiVMRegionTestCase {
   /**
    * Tests that created entries are not propagated to other caches
    */
+  @Test
   public void testDistributedCreate() throws Exception {
     final String rgnName = getUniqueName();
 



Mime
View raw message