geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [15/18] incubator-geode git commit: GEODE-1276: Change UnitTests file system to IntegrationTest category GEODE-1307: Rename HeterogenousLuceneSerializer to HeterogeneousLuceneSerializer GEODE-1279: Tests for old TRAC bugs should be renamed to useful name
Date Fri, 06 May 2016 23:55:14 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexStatisticsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexStatisticsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexStatisticsJUnitTest.java
index 58d966e..8275af7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexStatisticsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexStatisticsJUnitTest.java
@@ -728,7 +728,7 @@ public class IndexStatisticsJUnitTest {
     region.put(1, obj1);
     assertEquals(1, stats.getNumberOfValues());
     assertEquals(1, stats.getNumberOfKeys());
-    // assertEquals(1, stats.getNumberOfValues(20f));
+    // assertIndexDetailsEquals(1, stats.getNumberOfValues(20f));
     assertEquals(1, stats.getNumUpdates());
 
     // add a second object with the same index key
@@ -737,21 +737,21 @@ public class IndexStatisticsJUnitTest {
     region.put(2, obj2);
     assertEquals(2, stats.getNumberOfValues());
     assertEquals(1, stats.getNumberOfKeys());
-    // assertEquals(2, stats.getNumberOfValues(20f));
+    // assertIndexDetailsEquals(2, stats.getNumberOfValues(20f));
     assertEquals(2, stats.getNumUpdates());
 
     // remove the second object and check that keys are 1
     region.remove(2);
     assertEquals(1, stats.getNumberOfValues());
     assertEquals(1, stats.getNumberOfKeys());
-    // assertEquals(1, stats.getNumberOfValues(20f));
+    // assertIndexDetailsEquals(1, stats.getNumberOfValues(20f));
     assertEquals(3, stats.getNumUpdates());
 
     // remove the first object and check that keys are 0
     region.remove(1);
     assertEquals(0, stats.getNumberOfValues());
     assertEquals(0, stats.getNumberOfKeys());
-    // assertEquals(0, stats.getNumberOfValues(20f));
+    // assertIndexDetailsEquals(0, stats.getNumberOfValues(20f));
     assertEquals(4, stats.getNumUpdates());
 
     // add object with a different key and check results
@@ -759,7 +759,7 @@ public class IndexStatisticsJUnitTest {
     region.put(3, obj2);
     assertEquals(1, stats.getNumberOfValues());
     assertEquals(1, stats.getNumberOfKeys());
-    // assertEquals(0, stats.getNumberOfValues(20f));
+    // assertIndexDetailsEquals(0, stats.getNumberOfValues(20f));
     assertEquals(5, stats.getNumUpdates());
 
     // add object with original key and check that num keys are 2
@@ -767,7 +767,7 @@ public class IndexStatisticsJUnitTest {
     region.put(1, obj1);
     assertEquals(2, stats.getNumberOfValues());
     assertEquals(2, stats.getNumberOfKeys());
-    // assertEquals(1, stats.getNumberOfValues(20f));
+    // assertIndexDetailsEquals(1, stats.getNumberOfValues(20f));
     assertEquals(6, stats.getNumUpdates());
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
index 0a4a13e..88324d1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
@@ -16,13 +16,9 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
 
 import java.util.HashSet;
 import java.util.Iterator;
@@ -45,352 +41,350 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class MemoryIndexStoreJUnitTest {
 
-	Region region;
-	GemFireCacheImpl cache;
-	InternalIndexStatistics mockStats;
-	MemoryIndexStore store;
-	RegionEntry[] mockEntries;
-	int numMockEntries = 10;
+  Region region;
+  GemFireCacheImpl cache;
+  InternalIndexStatistics mockStats;
+  MemoryIndexStore store;
+  RegionEntry[] mockEntries;
+  int numMockEntries = 10;
   GemFireCacheImpl actualInstance;
   
-	public void subclassPreSetup() {
-		
-	}
-	
-	protected Region createRegion() {
-		return mock(LocalRegion.class);
-	}
-	
-	@Before
-	public void setup() {
-		subclassPreSetup();
-		region = createRegion();
-		cache = mock(GemFireCacheImpl.class);
-		actualInstance = GemFireCacheImpl.setInstanceForTests(cache);
-		mockStats = mock(AbstractIndex.InternalIndexStatistics.class);
-		
-		store = new MemoryIndexStore(region, mockStats);
-		store.setIndexOnValues(true);
-		mockEntries = new RegionEntry[numMockEntries];
-		IntStream.range(0, numMockEntries).forEach(i-> {
-			mockEntries[i] = createRegionEntry(i, new Object());
-		});
-	}
-	
-	@After
-	public void teardown() {
-	  GemFireCacheImpl.setInstanceForTests(actualInstance);
-	}
-	
-	@Test
-	public void testSizeOfStoreReturnsNumberOfKeysAndNotActualNumberOfValues() {
-		IntStream.range(0, 150).forEach(i -> {
-			try {
-				store.addMapping(i % 3, createRegionEntry(i, new Object()));
-			}
-			catch (Exception e) {
-				fail();
-			}
-		});
-		assertEquals(150, numObjectsInStore(store));
-	}
-	
-	@Test
-	public void testAddEnoughEntriesToCreateAConcurrentHashSet() {
-		IntStream.range(0, 150).forEach(i -> {
-			try {
-				store.addMapping(1, createRegionEntry(i, new Object()));
-			}
-			catch (Exception e) {
-				fail();
-			}
-		});
-		assertEquals(150, numObjectsInStore(store));
-	}
-	
-	@Test
-	public void testUpdateAgainstAConcurrentHashSet() throws Exception{
-		IntStream.range(0, 150).forEach(i -> {
-			try {
-				store.addMapping(1, createRegionEntry(1, new Object()));
-			}
-			catch (Exception e) {
-				fail();
-			}
-		});
-		RegionEntry entry = createRegionEntry(1, new Object());	
-		store.addMapping(1, entry);
-		store.updateMapping(2, 1, entry, entry.getValue(null));
-		assertEquals(151, numObjectsInStore(store));
-	}
-	
-	@Test
-	public void testCanAddObjectWithUndefinedKey() throws Exception {
-		store.addMapping(QueryService.UNDEFINED, mockEntries[0]);
-		assertEquals(1, numObjectsIterated(store.get(QueryService.UNDEFINED)));
-		assertEquals(0, numObjectsInStore(store));
-	}
-	
-	@Test
-	public void testCanAddManyObjectsWithUndefinedKey() throws Exception {
-		for (int i = 0; i < mockEntries.length; i++) {
-			store.addMapping(QueryService.UNDEFINED, mockEntries[i]);
-		}
-		assertEquals(mockEntries.length, numObjectsIterated(store.get(QueryService.UNDEFINED)));
-		//Undefined will not return without an explicit get for UNDEFINED);
-		assertEquals(0, numObjectsInStore(store));
-	}
-	
-	@Test
-	public void testIteratorWithStartInclusiveAndNoKeysToRemoveReturnsCorrectNumberOfResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(2, numObjectsIterated(store.iterator(numMockEntries - 2, true, null)));
-	}
-	
-	@Test
-	public void testIteratorWithStartExclusiveAndNoKeysToRemoveReturnsCorrectNumberOfResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(1, numObjectsIterated(store.iterator(numMockEntries - 2, false, null)));
-	}
-	
-	
-	@Test
-	public void testIteratorWithStartInclusiveAndKeyToRemoveReturnsCorrectNumberOfResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		Set keysToRemove = new HashSet();
-		keysToRemove.add("1");
-		assertEquals(9, numObjectsIterated(store.iterator(1, true, keysToRemove)));
-	}
-	
-	@Test
-	public void testIteratorWithStartExclusiveAndKeyToRemoveReturnsCorrectNumberOfResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		Set keysToRemove = new HashSet();
-		keysToRemove.add("1");
-		assertEquals(8, numObjectsIterated(store.iterator(1, false, keysToRemove)));
-	}
-	
-	@Test
-	public void testStartAndEndInclusiveReturnsCorrectResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(6, numObjectsIterated(store.iterator(1, true, 6, true, null)));
-	}
-	
-	@Test
-	public void testStartInclusiveAndEndExclusiveReturnsCorrectResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(5, numObjectsIterated(store.iterator(1, true, 6, false, null)));
-	}
-	
-	@Test
-	public void testStartExclusiveAndEndExclusiveReturnsCorrectResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(4, numObjectsIterated(store.iterator(1, false, 6, false, null)));
-	}
-	
-	@Test
-	public void testStartExclusiveAndEndInclusiveReturnsCorrectResults() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(5, numObjectsIterated(store.iterator(1, false, 6, true, null)));
-	}
-	
-	@Test
-	public void testStartIsNull() throws Exception {
-		addMockedEntries(numMockEntries);
-		assertEquals(6, numObjectsIterated(store.iterator(null, false, 6, false, null)));
-	}
-	
-	@Test
-	public void testDescendingIteratorReturnsExpectedOrderOfEntries() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		Iterator iteratorFirst = store.descendingIterator(null);
-		assertEquals(2, numObjectsIterated(iteratorFirst));
-		
-		Iterator iterator = store.descendingIterator(null);
-		iterator.hasNext();
-		assertEquals(mockEntry2, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
-		iterator.hasNext();
-		assertEquals(mockEntry1, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
-	}
-	
-	@Test
-	public void testDescendingIteratorWithRemovedKeysReturnsExpectedOrderOfEntries() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		RegionEntry mockEntry3 = mockEntries[2];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		store.addMapping("3", mockEntry3);
-		Set keysToRemove = new HashSet();
-		keysToRemove.add("2");
-		Iterator iteratorFirst = store.descendingIterator(keysToRemove);
-		assertEquals(2, numObjectsIterated(iteratorFirst));
-		
-		//keysToRemove has been modified by the store, we need to readd the key to remove
-		keysToRemove.add("2");
-		Iterator iterator = store.descendingIterator(keysToRemove);
-		iterator.hasNext();
-		assertEquals(mockEntry3, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
-		iterator.hasNext();
-		assertEquals(mockEntry1, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
-		assertFalse(iterator.hasNext());
-	}
-	
-	@Test
-	public void testDescendingIteratorWithMultipleRemovedKeysReturnsExpectedOrderOfEntries() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		RegionEntry mockEntry3 = mockEntries[2];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		store.addMapping("3", mockEntry3);
-		Set keysToRemove = new HashSet();
-		keysToRemove.add("2");
-		keysToRemove.add("1");
-		Iterator iteratorFirst = store.descendingIterator(keysToRemove);
-		assertEquals(1, numObjectsIterated(iteratorFirst));
-		
-		//keysToRemove has been modified by the store, we need to readd the key to remove
-		keysToRemove.add("2");
-		keysToRemove.add("1");
-		Iterator iterator = store.descendingIterator(keysToRemove);
-		iterator.hasNext();
-		assertEquals(mockEntry3, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
-		assertFalse(iterator.hasNext());
-	}
-	
-	@Test
-	public void testSizeWithKeyArgumentReturnsCorrectSize() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		assertEquals(1, store.size("1"));
-	}
-	
-	 @Test
-	  public void testGetReturnsExpectedIteratorValue() throws Exception {
-	    RegionEntry mockEntry1 = mockEntries[0];
-	    RegionEntry mockEntry2 = mockEntries[1];
-	    store.addMapping("1", mockEntry1);
-	    store.addMapping("2", mockEntry2);
-	    assertEquals(1, numObjectsIterated(store.get("1")));
-	  }
-	
-	@Test
-	public void testGetReturnsExpectedIteratorWithMultipleValues() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		RegionEntry mockEntry3 = mockEntries[2];
-		RegionEntry mockEntry4 = mockEntries[3];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("1", mockEntry2);
-		store.addMapping("1", mockEntry3);
-		store.addMapping("2", mockEntry4);
-		assertEquals(3, numObjectsIterated(store.get("1")));
-		assertEquals(4, numObjectsInStore(store));
-	}
-	
-	@Test
-	public void testGetWithIndexOnKeysReturnsExpectedIteratorValues() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.setIndexOnValues(false);
-		store.setIndexOnRegionKeys(true);
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		assertEquals(1, numObjectsIterated(store.get("1")));
-	}
-
-	@Test
-	public void testCorrectlyRemovesEntryProvidedTheWrongKey() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		store.removeMapping("1", mockEntry2);
-		assertEquals(1, numObjectsInStore(store));
-		assertTrue(objectContainedIn(store, mockEntry1));
-	}
-
-	@Test
-	public void testRemoveMappingRemovesFromBackingMap() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		store.removeMapping("1", mockEntry1);
-		assertEquals(1, numObjectsInStore(store));
-		assertTrue(objectContainedIn(store, mockEntry2));
-	}
-
-	@Test
-	public void testAddMappingAddsToBackingMap() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("2", mockEntry2);
-		assertEquals(2, numObjectsInStore(store));
-		assertTrue(objectContainedIn(store, mockEntry1));
-		assertTrue(objectContainedIn(store, mockEntry2));
-	}
-	
-	@Test
-	public void testClear() throws Exception {
-		RegionEntry mockEntry1 = mockEntries[0];
-		RegionEntry mockEntry2 = mockEntries[1];
-		store.addMapping("1", mockEntry1);
-		store.addMapping("1", mockEntry2);
-		store.clear();
-		assertEquals(0, numObjectsInStore(store));
-	}
-
-	private int numObjectsInStore(MemoryIndexStore store) {
-		Iterator iterator = store.iterator(null);
-		return numObjectsIterated(iterator);
-	}
-
-	private int numObjectsIterated(Iterator iterator) {
-		int count = 0;
-		while (iterator.hasNext()) {
-			iterator.next();
-			count++;
-		}
-		return count;
-	}
-
-	private boolean objectContainedIn(MemoryIndexStore store, Object o) {
-		Iterator iterator = store.valueToEntriesMap.values().iterator();
-		return objectContainedIn(iterator, o);
-	}
-	
-	private boolean objectContainedIn(Iterator iterator, Object o) {
-		while (iterator.hasNext()) {
-			if (iterator.next().equals(o)) {
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	private void addMockedEntries(int numEntriesToAdd) {
-		IntStream.range(0, numEntriesToAdd).forEach(i -> {
-			try {
-				store.addMapping(mockEntries[i].getKey(), mockEntries[i]);
-			}
-			catch (Exception e) {
-				fail();
-			}
-		});
-	}
-	
-	private RegionEntry createRegionEntry(Object key, Object value) {
-		RegionEntry mockEntry = mock(RegionEntry.class);
-		when(mockEntry.getValue(any())).thenReturn(value);
-		when(mockEntry.getKey()).thenReturn(key);
-		return mockEntry;
-	}
+  protected void subclassPreSetup() {
+  }
+
+  protected Region createRegion() {
+    return mock(LocalRegion.class);
+  }
+
+  @Before
+  public void setup() {
+    subclassPreSetup();
+    region = createRegion();
+    cache = mock(GemFireCacheImpl.class);
+    actualInstance = GemFireCacheImpl.setInstanceForTests(cache);
+    mockStats = mock(AbstractIndex.InternalIndexStatistics.class);
+
+    store = new MemoryIndexStore(region, mockStats);
+    store.setIndexOnValues(true);
+    mockEntries = new RegionEntry[numMockEntries];
+    IntStream.range(0, numMockEntries).forEach(i-> {
+      mockEntries[i] = createRegionEntry(i, new Object());
+    });
+  }
+
+  @After
+  public void teardown() {
+    GemFireCacheImpl.setInstanceForTests(actualInstance);
+  }
+
+  @Test
+  public void testSizeOfStoreReturnsNumberOfKeysAndNotActualNumberOfValues() {
+    IntStream.range(0, 150).forEach(i -> {
+      try {
+        store.addMapping(i % 3, createRegionEntry(i, new Object()));
+      }
+      catch (Exception e) {
+        throw new AssertionError(e);
+      }
+    });
+    assertEquals(150, numObjectsInStore(store));
+  }
+
+  @Test
+  public void testAddEnoughEntriesToCreateAConcurrentHashSet() {
+    IntStream.range(0, 150).forEach(i -> {
+      try {
+        store.addMapping(1, createRegionEntry(i, new Object()));
+      }
+      catch (Exception e) {
+        throw new AssertionError(e);
+      }
+    });
+    assertEquals(150, numObjectsInStore(store));
+  }
+
+  @Test
+  public void testUpdateAgainstAConcurrentHashSet() throws Exception{
+    IntStream.range(0, 150).forEach(i -> {
+      try {
+        store.addMapping(1, createRegionEntry(1, new Object()));
+      }
+      catch (Exception e) {
+        throw new AssertionError(e);
+      }
+    });
+    RegionEntry entry = createRegionEntry(1, new Object());
+    store.addMapping(1, entry);
+    store.updateMapping(2, 1, entry, entry.getValue(null));
+    assertEquals(151, numObjectsInStore(store));
+  }
+
+  @Test
+  public void testCanAddObjectWithUndefinedKey() throws Exception {
+    store.addMapping(QueryService.UNDEFINED, mockEntries[0]);
+    assertEquals(1, numObjectsIterated(store.get(QueryService.UNDEFINED)));
+    assertEquals(0, numObjectsInStore(store));
+  }
+
+  @Test
+  public void testCanAddManyObjectsWithUndefinedKey() throws Exception {
+    for (int i = 0; i < mockEntries.length; i++) {
+      store.addMapping(QueryService.UNDEFINED, mockEntries[i]);
+    }
+    assertEquals(mockEntries.length, numObjectsIterated(store.get(QueryService.UNDEFINED)));
+    //Undefined will not return without an explicit get for UNDEFINED);
+    assertEquals(0, numObjectsInStore(store));
+  }
+
+  @Test
+  public void testIteratorWithStartInclusiveAndNoKeysToRemoveReturnsCorrectNumberOfResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(2, numObjectsIterated(store.iterator(numMockEntries - 2, true, null)));
+  }
+
+  @Test
+  public void testIteratorWithStartExclusiveAndNoKeysToRemoveReturnsCorrectNumberOfResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(1, numObjectsIterated(store.iterator(numMockEntries - 2, false, null)));
+  }
+
+  @Test
+  public void testIteratorWithStartInclusiveAndKeyToRemoveReturnsCorrectNumberOfResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    Set keysToRemove = new HashSet();
+    keysToRemove.add("1");
+    assertEquals(9, numObjectsIterated(store.iterator(1, true, keysToRemove)));
+  }
+
+  @Test
+  public void testIteratorWithStartExclusiveAndKeyToRemoveReturnsCorrectNumberOfResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    Set keysToRemove = new HashSet();
+    keysToRemove.add("1");
+    assertEquals(8, numObjectsIterated(store.iterator(1, false, keysToRemove)));
+  }
+
+  @Test
+  public void testStartAndEndInclusiveReturnsCorrectResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(6, numObjectsIterated(store.iterator(1, true, 6, true, null)));
+  }
+
+  @Test
+  public void testStartInclusiveAndEndExclusiveReturnsCorrectResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(5, numObjectsIterated(store.iterator(1, true, 6, false, null)));
+  }
+
+  @Test
+  public void testStartExclusiveAndEndExclusiveReturnsCorrectResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(4, numObjectsIterated(store.iterator(1, false, 6, false, null)));
+  }
+
+  @Test
+  public void testStartExclusiveAndEndInclusiveReturnsCorrectResults() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(5, numObjectsIterated(store.iterator(1, false, 6, true, null)));
+  }
+
+  @Test
+  public void testStartIsNull() throws Exception {
+    addMockedEntries(numMockEntries);
+    assertEquals(6, numObjectsIterated(store.iterator(null, false, 6, false, null)));
+  }
+
+  @Test
+  public void testDescendingIteratorReturnsExpectedOrderOfEntries() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    Iterator iteratorFirst = store.descendingIterator(null);
+    assertEquals(2, numObjectsIterated(iteratorFirst));
+
+    Iterator iterator = store.descendingIterator(null);
+    iterator.hasNext();
+    assertEquals(mockEntry2, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
+    iterator.hasNext();
+    assertEquals(mockEntry1, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
+  }
+
+  @Test
+  public void testDescendingIteratorWithRemovedKeysReturnsExpectedOrderOfEntries() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    RegionEntry mockEntry3 = mockEntries[2];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    store.addMapping("3", mockEntry3);
+    Set keysToRemove = new HashSet();
+    keysToRemove.add("2");
+    Iterator iteratorFirst = store.descendingIterator(keysToRemove);
+    assertEquals(2, numObjectsIterated(iteratorFirst));
+
+    //keysToRemove has been modified by the store, we need to readd the key to remove
+    keysToRemove.add("2");
+    Iterator iterator = store.descendingIterator(keysToRemove);
+    iterator.hasNext();
+    assertEquals(mockEntry3, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
+    iterator.hasNext();
+    assertEquals(mockEntry1, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
+    assertFalse(iterator.hasNext());
+  }
+
+  @Test
+  public void testDescendingIteratorWithMultipleRemovedKeysReturnsExpectedOrderOfEntries() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    RegionEntry mockEntry3 = mockEntries[2];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    store.addMapping("3", mockEntry3);
+    Set keysToRemove = new HashSet();
+    keysToRemove.add("2");
+    keysToRemove.add("1");
+    Iterator iteratorFirst = store.descendingIterator(keysToRemove);
+    assertEquals(1, numObjectsIterated(iteratorFirst));
+
+    //keysToRemove has been modified by the store, we need to readd the key to remove
+    keysToRemove.add("2");
+    keysToRemove.add("1");
+    Iterator iterator = store.descendingIterator(keysToRemove);
+    iterator.hasNext();
+    assertEquals(mockEntry3, ((MemoryIndexStore.MemoryIndexStoreEntry)iterator.next()).getRegionEntry());
+    assertFalse(iterator.hasNext());
+  }
+
+  @Test
+  public void testSizeWithKeyArgumentReturnsCorrectSize() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    assertEquals(1, store.size("1"));
+  }
+
+  @Test
+  public void testGetReturnsExpectedIteratorValue() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    assertEquals(1, numObjectsIterated(store.get("1")));
+  }
+
+  @Test
+  public void testGetReturnsExpectedIteratorWithMultipleValues() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    RegionEntry mockEntry3 = mockEntries[2];
+    RegionEntry mockEntry4 = mockEntries[3];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("1", mockEntry2);
+    store.addMapping("1", mockEntry3);
+    store.addMapping("2", mockEntry4);
+    assertEquals(3, numObjectsIterated(store.get("1")));
+    assertEquals(4, numObjectsInStore(store));
+  }
+
+  @Test
+  public void testGetWithIndexOnKeysReturnsExpectedIteratorValues() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.setIndexOnValues(false);
+    store.setIndexOnRegionKeys(true);
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    assertEquals(1, numObjectsIterated(store.get("1")));
+  }
+
+  @Test
+  public void testCorrectlyRemovesEntryProvidedTheWrongKey() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    store.removeMapping("1", mockEntry2);
+    assertEquals(1, numObjectsInStore(store));
+    assertTrue(objectContainedIn(store, mockEntry1));
+  }
+
+  @Test
+  public void testRemoveMappingRemovesFromBackingMap() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    store.removeMapping("1", mockEntry1);
+    assertEquals(1, numObjectsInStore(store));
+    assertTrue(objectContainedIn(store, mockEntry2));
+  }
+
+  @Test
+  public void testAddMappingAddsToBackingMap() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("2", mockEntry2);
+    assertEquals(2, numObjectsInStore(store));
+    assertTrue(objectContainedIn(store, mockEntry1));
+    assertTrue(objectContainedIn(store, mockEntry2));
+  }
+
+  @Test
+  public void testClear() throws Exception {
+    RegionEntry mockEntry1 = mockEntries[0];
+    RegionEntry mockEntry2 = mockEntries[1];
+    store.addMapping("1", mockEntry1);
+    store.addMapping("1", mockEntry2);
+    store.clear();
+    assertEquals(0, numObjectsInStore(store));
+  }
+
+  private int numObjectsInStore(MemoryIndexStore store) {
+    Iterator iterator = store.iterator(null);
+    return numObjectsIterated(iterator);
+  }
+
+  private int numObjectsIterated(Iterator iterator) {
+    int count = 0;
+    while (iterator.hasNext()) {
+      iterator.next();
+      count++;
+    }
+    return count;
+  }
+
+  private boolean objectContainedIn(MemoryIndexStore store, Object o) {
+    Iterator iterator = store.valueToEntriesMap.values().iterator();
+    return objectContainedIn(iterator, o);
+  }
+
+  private boolean objectContainedIn(Iterator iterator, Object o) {
+    while (iterator.hasNext()) {
+      if (iterator.next().equals(o)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private void addMockedEntries(int numEntriesToAdd) {
+    IntStream.range(0, numEntriesToAdd).forEach(i -> {
+      try {
+        store.addMapping(mockEntries[i].getKey(), mockEntries[i]);
+      }
+      catch (Exception e) {
+        throw new AssertionError(e);
+      }
+    });
+  }
+
+  private RegionEntry createRegionEntry(Object key, Object value) {
+    RegionEntry mockEntry = mock(RegionEntry.class);
+    when(mockEntry.getValue(any())).thenReturn(value);
+    when(mockEntry.getKey()).thenReturn(key);
+    return mockEntry;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreWithInplaceModificationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreWithInplaceModificationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreWithInplaceModificationJUnitTest.java
index 79f8616..82505de 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreWithInplaceModificationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MemoryIndexStoreWithInplaceModificationJUnitTest.java
@@ -16,9 +16,7 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
-import static org.mockito.Mockito.mock;
-
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
 
 import org.junit.After;
 import org.junit.experimental.categories.Category;
@@ -30,25 +28,24 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
 public class MemoryIndexStoreWithInplaceModificationJUnitTest extends MemoryIndexStoreJUnitTest {
-	
-	public void subclassPreSetup() {
-		IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = true;
-	}
-	
-	protected Region createRegion() {
-		Region region = mock(LocalRegion.class);
-		RegionAttributes ra = mock(RegionAttributes.class);
-		when(region.getAttributes()).thenReturn(ra);
-		when(ra.getInitialCapacity()).thenReturn(16);
-		when(ra.getLoadFactor()).thenReturn(.75f);
-		when(ra.getConcurrencyLevel()).thenReturn(16);
-		return region;
-	}
-	
-	@After
-	public void resetInplaceModification() {
-		IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = false;
-	}
-	
-	
+
+  public void subclassPreSetup() {
+    IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = true;
+  }
+
+  protected Region createRegion() {
+    Region region = mock(LocalRegion.class);
+    RegionAttributes ra = mock(RegionAttributes.class);
+    when(region.getAttributes()).thenReturn(ra);
+    when(ra.getInitialCapacity()).thenReturn(16);
+    when(ra.getLoadFactor()).thenReturn(.75f);
+    when(ra.getConcurrencyLevel()).thenReturn(16);
+    return region;
+  }
+
+  @After
+  public void resetInPlaceModification() {
+    IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = false;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java
index 2cf8c3c..bc901f4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java
@@ -18,7 +18,6 @@ package com.gemstone.gemfire.cache.query.partitioned;
 
 import static com.gemstone.gemfire.cache.query.Utils.*;
 
-
 import java.util.Collection;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -39,18 +38,7 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
-/**
- * 
- */
-public class PRBasicIndexCreationDUnitTest extends
-    PartitionedRegionDUnitTestCase
-
-{
-  /**
-   * constructor
-   * 
-   * @param name
-   */
+public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCase {
 
   public PRBasicIndexCreationDUnitTest(String name) {
     super(name);
@@ -400,6 +388,7 @@ public class PRBasicIndexCreationDUnitTest extends
         cnt, cntDest));
     vm1.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(name,
         "PrIndexOnStatus", "status",null, ""));
+
     vm0.invoke(PRQHelp.getCacheSerializableRunnableForIndexCreationCheck(name));
     vm1.invoke(PRQHelp.getCacheSerializableRunnableForIndexCreationCheck(name));
     vm3.invoke(PRQHelp.getCacheSerializableRunnableForIndexCreationCheck(name));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java
index 7b93734..fcc5c49 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java
@@ -34,25 +34,18 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-
-public class PRBasicMultiIndexCreationDUnitTest extends
-    PartitionedRegionDUnitTestCase
-
-{
-  /**
-   * constructor
-   * 
-   * @param name
-   */
+public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTestCase {
 
   public PRBasicMultiIndexCreationDUnitTest(String name) {
     super(name);
   }
+
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
       vm.invoke(() -> PRQueryDUnitHelper.setCache(getCache()));
     }
   }
+
   PRQueryDUnitHelper PRQHelp = new PRQueryDUnitHelper();
 
   final String name = "PartionedPortfolios";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitHelper.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitHelper.java
index 84ef866..241aeb6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitHelper.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitHelper.java
@@ -18,10 +18,7 @@ package com.gemstone.gemfire.cache.query.partitioned;
 
 import static org.junit.Assert.*;
 
-import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -32,6 +29,8 @@ import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 
+import util.TestException;
+
 import com.gemstone.gemfire.CancelException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -85,8 +84,6 @@ import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import util.TestException;
-
 /**
  * This is a helper class for the various Partitioned Query DUnit Test Cases
  * 
@@ -1040,6 +1037,9 @@ public class PRQueryDUnitHelper implements Serializable
                 if(srr.size() > l*l) {
                   fail("The resultset size exceeds limit size. Limit size="+ l*l+", result size ="+ srr.asList().size());
                 }
+                //assertIndexDetailsEquals("The resultset size is not same as limit size.", l*l, srr.asList().size());
+
+//                getCache().getLogger().info("Finished executing PR query: " + qStr);
               }
             }
             StructSetOrResultsSet ssORrs = new  StructSetOrResultsSet();
@@ -1232,6 +1232,41 @@ public class PRQueryDUnitHelper implements Serializable
           Iterator it = indexes.iterator();
           while(it.hasNext()) {
             PartitionedIndex ind = (PartitionedIndex)it.next();
+            /*List bucketIndex = ind.getBucketIndexes();
+            int k = 0;
+            logger.info("Total number of bucket index : "+bucketIndex.size());
+            while ( k < bucketIndex.size() ){
+              Index bukInd = (Index)bucketIndex.get(k);
+              logger.info("Buket Index "+bukInd+"  usage : "+bukInd.getStatistics().getTotalUses());
+              // if number of quries on pr change in getCacheSerializableRunnableForPRQueryAndCompareResults
+              // literal 6  should change.
+              //Asif :  With the optmization of Range Queries a where clause
+              // containing something like ID > 4 AND ID < 9 will be evaluated 
+              //using a single index lookup, so accordingly modifying the 
+              //assert value from 7 to 6
+              // Anil : With aquiringReadLock during Index.getSizeEstimate(), the
+              // Index usage in case of "ID = 0 OR ID = 1" is increased by 3.
+              int indexUsageWithSizeEstimation = 3;
+              int expectedUse = 6;
+              long indexUse = bukInd.getStatistics().getTotalUses();
+              // Anil : With chnages to use single index for PR query evaluation, once the index
+              // is identified the same index is used on other PR buckets, the sieEstimation is
+              // done only once, which adds additional index use for only one bucket index.
+              if (!(indexUse == expectedUse || indexUse == (expectedUse + indexUsageWithSizeEstimation))){
+                fail ("Index usage is not as expected, expected it to be either " + 
+                    expectedUse + " or " + (expectedUse + indexUsageWithSizeEstimation) + 
+                    " it is: " + indexUse);
+                //assertIndexDetailsEquals(6 + indexUsageWithSizeEstimation, bukInd.getStatistics().getTotalUses());
+              }
+              k++;
+            }*/
+            //Shobhit: Now we dont need to check stats per bucket index,
+            //stats are accumulated in single pr index stats.
+            
+            // Anil : With aquiringReadLock during Index.getSizeEstimate(), the
+            // Index usage in case of "ID = 0 OR ID = 1" is increased by 3.
+            int indexUsageWithSizeEstimation = 3;
+            
             logger.info("index uses for "+ind.getNumberOfIndexedBuckets()+" index "+ind.getName()+": "+ind.getStatistics().getTotalUses());
             assertEquals(6, ind.getStatistics().getTotalUses());
           }
@@ -1614,6 +1649,13 @@ public class PRQueryDUnitHelper implements Serializable
                   + " and remote buckets indexed : "
                   + ((PartitionedIndex)parIndex).getNumRemoteBucketsIndexed());
           }
+          /*
+           * assertIndexDetailsEquals("Max num of buckets in the partiotion regions and
+           * the " + "buckets indexed should be equal",
+           * ((PartitionedRegion)region).getTotalNumberOfBuckets(),
+           * (((PartionedIndex)parIndex).getNumberOfIndexedBucket()+((PartionedIndex)parIndex).getNumRemtoeBucketsIndexed()));
+           * should put all the assetion in a seperate function.
+           */
         }
         catch (Exception ex) {
           Assert.fail("Creating Index in this vm failed : ", ex);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitTest.java
index 548d998..c5ec4b7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryDUnitTest.java
@@ -714,7 +714,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
           assertTrue(false);
         } catch (QueryException expected) {
         }
-//        assertEquals(1, results.size());
+//        assertIndexDetailsEquals(1, results.size());
 //        getLogWriter().info("Select results are: " + results);
         return Boolean.TRUE;
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/server/internal/ConnectionCountProbeJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/server/internal/ConnectionCountProbeJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/server/internal/ConnectionCountProbeJUnitTest.java
index 5522ae5..91e82f3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/server/internal/ConnectionCountProbeJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/server/internal/ConnectionCountProbeJUnitTest.java
@@ -16,35 +16,33 @@
  */
 package com.gemstone.gemfire.cache.server.internal;
 
-import org.junit.experimental.categories.Category;
+import static org.junit.Assert.*;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.server.ServerLoad;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
-/**
- *
- */
 @Category(UnitTest.class)
-public class ConnectionCountProbeJUnitTest extends TestCase {
+public class ConnectionCountProbeJUnitTest {
   
+  @Test
   public void test() {
     ConnectionCountProbe probe = new ConnectionCountProbe();
     ServerMetricsImpl metrics = new ServerMetricsImpl(800);
     ServerLoad load = probe.getLoad(metrics);
-    Assert.assertEquals(0f, load.getConnectionLoad(), .0001f);
-    Assert.assertEquals(0f, load.getSubscriptionConnectionLoad(), .0001f);
-    Assert.assertEquals(1/800f, load.getLoadPerConnection(), .0001f);
-    Assert.assertEquals(1f, load.getLoadPerSubscriptionConnection(), .0001f);
+    assertEquals(0f, load.getConnectionLoad(), .0001f);
+    assertEquals(0f, load.getSubscriptionConnectionLoad(), .0001f);
+    assertEquals(1/800f, load.getLoadPerConnection(), .0001f);
+    assertEquals(1f, load.getLoadPerSubscriptionConnection(), .0001f);
 
     for(int i = 0; i < 100; i++) {
       metrics.incConnectionCount();
     }
     
     load = probe.getLoad(metrics);
-    Assert.assertEquals(0.125, load.getConnectionLoad(), .0001f);
+    assertEquals(0.125, load.getConnectionLoad(), .0001f);
   }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache/util/PasswordUtilJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/util/PasswordUtilJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/util/PasswordUtilJUnitTest.java
index 883f733..2b631cd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/util/PasswordUtilJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/util/PasswordUtilJUnitTest.java
@@ -16,16 +16,19 @@
  */
 package com.gemstone.gemfire.cache.util;
 
+import static org.junit.Assert.*;
+
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.internal.util.PasswordUtil;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
+@Category({ UnitTest.class, SecurityTest.class })
+public class PasswordUtilJUnitTest {
 
-@Category(UnitTest.class)
-public class PasswordUtilJUnitTest extends TestCase {
+  @Test
   public void testPasswordUtil() {
     String x = "password";
     String z = null;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLoaderTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLoaderTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLoaderTestCase.java
index bb8bc5e..21e7a7e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLoaderTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLoaderTestCase.java
@@ -119,15 +119,15 @@ public abstract class CacheLoaderTestCase
 //        public Object load2(LoaderHelper helper)
 //          throws CacheLoaderException {
 //
-//          assertEquals(key, helper.getKey());
-//          assertEquals(name, helper.getRegion().getName());
+//          assertIndexDetailsEquals(key, helper.getKey());
+//          assertIndexDetailsEquals(name, helper.getRegion().getName());
 //
 //          try {
 //            RegionAttributes attrs =
 //              helper.getRegion().getAttributes();
 //            if (attrs.getScope().isDistributed()) {
 //              Object result = helper.netSearch(false);
-//              assertEquals(value, result);
+//              assertIndexDetailsEquals(value, result);
 //              return result;
 //            }
 //
@@ -158,8 +158,8 @@ public abstract class CacheLoaderTestCase
 ////            public Object load2(LoaderHelper helper)
 ////              throws CacheLoaderException {
 ////
-////              assertEquals(key, helper.getKey());
-////              assertEquals(name, helper.getRegion().getName());
+////              assertIndexDetailsEquals(key, helper.getKey());
+////              assertIndexDetailsEquals(name, helper.getRegion().getName());
 ////              return value;
 ////            }
 ////          };
@@ -174,9 +174,9 @@ public abstract class CacheLoaderTestCase
 //    });
 //
 //
-//    assertEquals(value, region.get(key));
+//    assertIndexDetailsEquals(value, region.get(key));
 //    assertTrue(loader.wasInvoked());
-//    assertEquals(value, region.getEntry(key).getValue());
+//    assertIndexDetailsEquals(value, region.getEntry(key).getValue());
 //  }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
index 0be86e2..56f0261 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
@@ -288,7 +288,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             
             //test containsValue
             boolean flag = region.containsValue(new String("first"));
-            //assertEquals(true, flag);
+            //assertIndexDetailsEquals(true, flag);
             
             //test remove
             region.put(""+i[2], "second");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheStatisticsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheStatisticsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheStatisticsDUnitTest.java
index ff635b0..18bb79f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheStatisticsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheStatisticsDUnitTest.java
@@ -48,7 +48,7 @@ public class CacheStatisticsDUnitTest extends CacheTestCase {
    * Asserts that two <code>long</code>s are equal concerning a
    * delta.
    */
-//   public static void assertEquals(long expected, long actual,
+//   public static void assertIndexDetailsEquals(long expected, long actual,
 //                                   long delta) {
 //     long difference = Math.abs(expected - actual);
 //     assertTrue("Expected: " + expected
@@ -472,7 +472,7 @@ public class CacheStatisticsDUnitTest extends CacheTestCase {
           // lastAccessed var contains stat from an Entry, which may be
           // up to 100 ms off from stat in Region because Entry has
           // less precision
-          //assertEquals(lastAccessed, stats.getLastAccessedTime(), 100);
+          //assertIndexDetailsEquals(lastAccessed, stats.getLastAccessedTime(), 100);
           assertEquals(0, stats.getHitCount());
           assertEquals(0, stats.getMissCount());
         }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
index 4835691..ad851ad 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
@@ -523,12 +523,12 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   //  Region r = getRootRegion().getSubregion(name);
   //  
   //  HeapLRUCapacityController hlcc = (HeapLRUCapacityController) r.getAttributes().getCapacityController();
-  //  assertEquals(hlcc.getEvictionAction(), LRUAlgorithm.OVERFLOW_TO_DISK);
+  //  assertIndexDetailsEquals(hlcc.getEvictionAction(), LRUAlgorithm.OVERFLOW_TO_DISK);
   //  
   //  Properties p = hlcc.getProperties();
-  //  assertEquals(42, Integer.parseInt(p.getProperty(HeapLRUCapacityController.HEAP_PERCENTAGE)));
-  //  assertEquals(32, Long.parseLong(p.getProperty(HeapLRUCapacityController.EVICTOR_INTERVAL)));
-  //  assertEquals(LRUAlgorithm.OVERFLOW_TO_DISK, p.getProperty(HeapLRUCapacityController.EVICTION_ACTION));
+  //  assertIndexDetailsEquals(42, Integer.parseInt(p.getProperty(HeapLRUCapacityController.HEAP_PERCENTAGE)));
+  //  assertIndexDetailsEquals(32, Long.parseLong(p.getProperty(HeapLRUCapacityController.EVICTOR_INTERVAL)));
+  //  assertIndexDetailsEquals(LRUAlgorithm.OVERFLOW_TO_DISK, p.getProperty(HeapLRUCapacityController.EVICTION_ACTION));
   //}
   /**
    * Test Publisher region attribute
@@ -542,7 +542,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
 //    attrs.setPublisher(true);
 //    cache.createRegion("root", attrs);
 //    testXml(cache);
-//    assertEquals(true, cache.getRegion("root").getAttributes().getPublisher());
+//    assertIndexDetailsEquals(true, cache.getRegion("root").getAttributes().getPublisher());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
index 6b37acc..5cda16b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
@@ -234,7 +234,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertEquals(12351, cp.getStatisticInterval());
     assertEquals("mygroup", cp.getServerGroup());
       // commented this out until queues are implemented
-    //    assertEquals(true, cp.getQueueEnabled());
+    //    assertIndexDetailsEquals(true, cp.getQueueEnabled());
     assertEquals(12345, cp.getSubscriptionRedundancy());
     assertEquals(12345, cp.getSubscriptionMessageTrackingTimeout());
     assertEquals(333, cp.getSubscriptionAckInterval());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml58DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml58DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml58DUnitTest.java
index c56b6ed..d5123e7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml58DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml58DUnitTest.java
@@ -304,7 +304,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     assertEquals(regionAttrs.getEntryTimeToLive().getTimeout(), expiration.getTimeout());    
 //  TODO mthomas 01/20/09 Move test back to using LRUHeap when config issues have settled
 //    if (getGemFireVersion().equals(CacheXml.GEMFIRE_6_0)) {
-//      assertEquals(ea.getAlgorithm(),EvictionAlgorithm.LRU_HEAP);
+//      assertIndexDetailsEquals(ea.getAlgorithm(),EvictionAlgorithm.LRU_HEAP);
 //    } else {
     assertEquals(ea.getAlgorithm(),EvictionAlgorithm.LRU_MEMORY);
 //    }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml65DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml65DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml65DUnitTest.java
index c50d6d6..56376e0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml65DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml65DUnitTest.java
@@ -275,7 +275,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(12351, cp.getStatisticInterval());
     assertEquals("mygroup", cp.getServerGroup());
     // commented this out until queues are implemented
-    // assertEquals(true, cp.getQueueEnabled());
+    // assertIndexDetailsEquals(true, cp.getQueueEnabled());
     assertEquals(12345, cp.getSubscriptionRedundancy());
     assertEquals(12345, cp.getSubscriptionMessageTrackingTimeout());
     assertEquals(333, cp.getSubscriptionAckInterval());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
index 4652e74..8530c0f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
@@ -1539,7 +1539,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
       totalClientCounts += clientCounts[i];
     }
     // this assertion fails because the count is 4
-    //assertEquals(1, totalClientCounts);
+    //assertIndexDetailsEquals(1, totalClientCounts);
   }
 
   protected static int testGetNotifiedClients_port;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
index d7e1255..aa327f8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
@@ -1481,7 +1481,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
 //         for (int i = 0; i < NB1_NUM_ENTRIES; i++) {
 //           rgn.put(new Integer(i), values[i]);
 //         }
-//         assertEquals(NB1_NUM_ENTRIES, rgn.keys().size());
+//         assertIndexDetailsEquals(NB1_NUM_ENTRIES, rgn.keys().size());
 //         //close and create to ensure that all data will go to htree 
 //         //TODO: Mitul : remove this later to fine tune test to also take oplogs recovery into account
 //         rgn.close();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
index 20051f7..8555a07 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
@@ -583,7 +583,7 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
             
             //test args for containsKey method
             boolean val2 = region.containsValue(new String("second"));
-            //assertEquals(true, val2);
+            //assertIndexDetailsEquals(true, val2);
             
             //test args for remove method
             try{

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
index 6050e3d..0acd2aa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
@@ -172,10 +172,10 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
 //
 //    VersionTag tag0 = getVersionTag(vm0, key);
 //    VersionTag tag1 = getVersionTag(vm1, key);
-//    assertEquals(3, tag0.getRegionVersion());
-//    assertEquals(3, tag0.getEntryVersion());
-//    assertEquals(3, tag1.getRegionVersion());
-//    assertEquals(3, tag1.getEntryVersion());
+//    assertIndexDetailsEquals(3, tag0.getRegionVersion());
+//    assertIndexDetailsEquals(3, tag0.getEntryVersion());
+//    assertIndexDetailsEquals(3, tag1.getRegionVersion());
+//    assertIndexDetailsEquals(3, tag1.getEntryVersion());
 //
 //    // shutdown and recover
 //    vm0.invoke(disconnect);
@@ -185,10 +185,10 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
 //
 //    tag0 = getVersionTag(vm0, key);
 //    tag1 = getVersionTag(vm1, key);
-//    assertEquals(3, tag0.getRegionVersion());
-//    assertEquals(3, tag0.getEntryVersion());
-//    assertEquals(3, tag1.getRegionVersion());
-//    assertEquals(3, tag1.getEntryVersion());
+//    assertIndexDetailsEquals(3, tag0.getRegionVersion());
+//    assertIndexDetailsEquals(3, tag0.getEntryVersion());
+//    assertIndexDetailsEquals(3, tag1.getRegionVersion());
+//    assertIndexDetailsEquals(3, tag1.getEntryVersion());
 //
 //    vm0.invoke(new SerializableRunnable("put with version 1, value vm1") {
 //      public void run() {
@@ -202,20 +202,20 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
 //          DistributedRegion.LOCALCLEAR_TESTHOOK = false;
 //        }
 //        CCRegion.put(key, "vm0");
-//        Assert.assertEquals("vm0", CCRegion.get(key));
+//        Assert.assertIndexDetailsEquals("vm0", CCRegion.get(key));
 //      }
 //    });
 //    vm1.invoke(new SerializableRunnable("verify that value has not been updated") {
 //      public void run() {
-//        Assert.assertEquals("dummy", CCRegion.get(key));
+//        Assert.assertIndexDetailsEquals("dummy", CCRegion.get(key));
 //      }
 //    });
 //
 //    tag0 = getVersionTag(vm0, key);
 //    tag1 = getVersionTag(vm1, key);
-//    assertEquals(4, tag0.getRegionVersion());
-//    assertEquals(1, tag0.getEntryVersion());
-//    assertEquals(3, tag1.getRegionVersion());
-//    assertEquals(3, tag1.getEntryVersion());
+//    assertIndexDetailsEquals(4, tag0.getRegionVersion());
+//    assertIndexDetailsEquals(1, tag0.getEntryVersion());
+//    assertIndexDetailsEquals(3, tag1.getRegionVersion());
+//    assertIndexDetailsEquals(3, tag1.getEntryVersion());
 //  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/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 04662ca..9ad102d 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
@@ -1729,8 +1729,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //            public Object load2(LoaderHelper helper)
 //              throws CacheLoaderException {
 //
-//              assertEquals(key, helper.getKey());
-//              assertEquals(name, helper.getRegion().getName());
+//              assertIndexDetailsEquals(key, helper.getKey());
+//              assertIndexDetailsEquals(name, helper.getRegion().getName());
 //              return value;
 //            }
 //          };
@@ -2844,15 +2844,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //           // longer optimize updates based on size.
 //           Region.Entry entry1 = region.getEntry(key1);
 //           assertNotNull(entry1);
-//           assertEquals(value1, entry1.getValue());
+//           assertIndexDetailsEquals(value1, entry1.getValue());
 
 //           Region.Entry entry2 = region.getEntry(key2);
 //           assertNotNull(entry2);
-//           assertEquals(value2, entry2.getValue());
+//           assertIndexDetailsEquals(value2, entry2.getValue());
 
 //           Region.Entry entry3 = region.getEntry(key3);
 //           assertNotNull(entry3);
-//           assertEquals(value3, entry3.getValue());
+//           assertIndexDetailsEquals(value3, entry3.getValue());
 //         }
 //       });
 //   }
@@ -4395,7 +4395,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //               if (getRegionAttributes().getScope().isDistributedAck()) {
 //                 // do a nonblocking netSearch
 //                 region.localInvalidate(key);
-//                 assertEquals(value, region.get(key));
+//                 assertIndexDetailsEquals(value, region.get(key));
 //               }
               break;
             case 3: // INVALIDATE
@@ -4720,7 +4720,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //               if (getRegionAttributes().getScope().isDistributedAck()) {
 //                 // do a nonblocking netSearch
 //                 region.localInvalidate(key);
-//                 assertEquals(value, region.get(key));
+//                 assertIndexDetailsEquals(value, region.get(key));
 //               }
               break;
             case 3: // INVALIDATE
@@ -5037,7 +5037,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //               if (getRegionAttributes().getScope().isDistributedAck()) {
 //                 // do a nonblocking netSearch
 //                 region.localInvalidate(key);
-//                 assertEquals(value, region.get(key));
+//                 assertIndexDetailsEquals(value, region.get(key));
 //               }
               break;
             case 3: // INVALIDATE
@@ -5333,7 +5333,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //               if (getRegionAttributes().getScope().isDistributedAck()) {
 //                 // do a nonblocking netSearch
 //                 region.localInvalidate(key);
-//                 assertEquals(value, region.get(key));
+//                 assertIndexDetailsEquals(value, region.get(key));
 //               }
               break;
             case 3: // INVALIDATE
@@ -6716,7 +6716,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
           ev = (EntryEvent)it.next();
           assertSame(rgn1, ev.getRegion());
-          //assertEquals(tl.expectedTxId, ev.getTransactionId());
+          //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
           assertEquals("key", ev.getKey());
           assertEquals("value1", ev.getNewValue());
           assertEquals(null, ev.getOldValue());
@@ -6732,7 +6732,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
           ev = (EntryEvent)it.next();
           assertSame(rgn3, ev.getRegion());
-          //assertEquals(tl.expectedTxId, ev.getTransactionId());
+          //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
           assertEquals("key", ev.getKey());
           assertEquals("value3", ev.getNewValue());
           assertEquals(null, ev.getOldValue());
@@ -6791,7 +6791,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
           ev = (EntryEvent)it.next();
           assertSame(rgn2, ev.getRegion());
-          //assertEquals(tl.expectedTxId, ev.getTransactionId());
+          //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
           assertEquals("key", ev.getKey());
           assertEquals("value2", ev.getNewValue());
           assertEquals(null, ev.getOldValue());
@@ -6807,7 +6807,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
           ev = (EntryEvent)it.next();
           assertSame(rgn3, ev.getRegion());
-          //assertEquals(tl.expectedTxId, ev.getTransactionId());
+          //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
           assertEquals("key", ev.getKey());
           assertEquals("value3", ev.getNewValue());
           assertEquals(null, ev.getOldValue());
@@ -6847,7 +6847,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
             }
             assertEquals(1, events.size());
             EntryEvent ev = (EntryEvent)events.iterator().next();
-            //assertEquals(tl.expectedTxId, ev.getTransactionId());
+            //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
             assertTrue(ev.getRegion() == rgn);
             assertEquals("key", ev.getKey());
             assertEquals("value1", ev.getNewValue());
@@ -6887,7 +6887,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
             }
             assertEquals(1, events.size());
             EntryEvent ev = (EntryEvent)events.iterator().next();
-            //assertEquals(tl.expectedTxId, ev.getTransactionId());
+            //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
             assertTrue(ev.getRegion() == rgn);
             assertEquals("key", ev.getKey());
             assertEquals("value2", ev.getNewValue());
@@ -6927,7 +6927,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
             }
             assertEquals(1, events.size());
             EntryEvent ev = (EntryEvent)events.iterator().next();
-            //assertEquals(tl.expectedTxId, ev.getTransactionId());
+            //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
             assertTrue(ev.getRegion() == rgn);
             assertEquals("key", ev.getKey());
             assertEquals("value3", ev.getNewValue());
@@ -7379,7 +7379,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           Collection events = tl.lastEvent.getCreateEvents();
           assertEquals(1, events.size());
           EntryEvent ev = (EntryEvent)events.iterator().next();
-          //assertEquals(tl.expectedTxId, ev.getTransactionId());
+          //assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
           assertTrue(ev.getRegion() == rgn);
           assertEquals("key", ev.getKey());
           assertEquals("value", ev.getNewValue());
@@ -7530,7 +7530,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
               }
               assertEquals(1, events.size());
               EntryEvent ev = (EntryEvent)events.iterator().next();
-              // assertEquals(tl.expectedTxId, ev.getTransactionId());
+              // assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
               assertTrue(ev.getRegion() == rgn1);
               assertEquals("key", ev.getKey());
               assertEquals("value2", ev.getNewValue());
@@ -7608,7 +7608,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
               }
               assertEquals(1, events.size());
               EntryEvent ev = (EntryEvent)events.iterator().next();
-              // assertEquals(tl.expectedTxId, ev.getTransactionId());
+              // assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
               assertTrue(ev.getRegion() == rgn1);
               assertEquals("key", ev.getKey());
               assertNull(ev.getNewValue());
@@ -7753,7 +7753,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
               Collection events = tl.lastEvent.getDestroyEvents();
               assertEquals(1, events.size());
               EntryEvent ev = (EntryEvent)events.iterator().next();
-              // assertEquals(tl.expectedTxId, ev.getTransactionId());
+              // assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
               assertTrue(ev.getRegion() == rgn1);
               assertNull(ev.getKey());
               assertNull(ev.getNewValue());
@@ -7817,7 +7817,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
               }
               assertEquals(1, events.size());
               EntryEvent ev = (EntryEvent)events.iterator().next();
-              // assertEquals(tl.expectedTxId, ev.getTransactionId());
+              // assertIndexDetailsEquals(tl.expectedTxId, ev.getTransactionId());
               assertTrue(ev.getRegion() == rgn1);
               assertEquals("key", ev.getKey());
               assertEquals("value1", ev.getNewValue());
@@ -8404,13 +8404,13 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       // that they originate that maybe should have been elided.  For this reason we can't
       // guarantee their consistency and don't check for it here.
 //      if (r1Contents.containsKey(key)) {
-//        assertEquals("region contents are not consistent", r1Contents.get(key), r2Contents.get(key));
+//        assertIndexDetailsEquals("region contents are not consistent", r1Contents.get(key), r2Contents.get(key));
 //      }
       assertEquals("region contents are not consistent for " + key, r2Contents.get(key), r3Contents.get(key));
       for (int subi=1; subi<3; subi++) {
         String subkey = key + "-" + subi;
         if (r2Contents.containsKey(subkey)) {
-//          assertEquals("region contents are not consistent for " + subkey, r1Contents.get(subkey), r2Contents.get(subkey));
+//          assertIndexDetailsEquals("region contents are not consistent for " + subkey, r1Contents.get(subkey), r2Contents.get(subkey));
           assertEquals("region contents are not consistent for " + subkey, r2Contents.get(subkey), r3Contents.get(subkey));
         } else {
           // can't assert this because a clear() op will cause non-replicated to start rejecting
@@ -8628,8 +8628,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 //            fail("sleep was interrupted");
 //          }
 //          count = CCRegion.getTombstoneCount();
-//          assertEquals("expected zero tombstones", 0, count);
-//          assertEquals(numEntries, CCRegion.size());
+//          assertIndexDetailsEquals("expected zero tombstones", 0, count);
+//          assertIndexDetailsEquals(numEntries, CCRegion.size());
         }
       });
 
@@ -8921,7 +8921,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       assertEquals("region contents are not consistent", r1Contents.get(key), r2Contents.get(key));
       assertEquals("region contents are not consistent", r2Contents.get(key), r3Contents.get(key));
 //      if (r0Contents.containsKey(key)) {
-//        assertEquals("region contents are not consistent", r1Contents.get(key), r0Contents.get(key));
+//        assertIndexDetailsEquals("region contents are not consistent", r1Contents.get(key), r0Contents.get(key));
 //      }
       for (int subi=1; subi<3; subi++) {
         String subkey = key + "-" + subi;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
index 2baeb52..cee7263 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
@@ -174,7 +174,7 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
         
         vm0.invoke(new CacheSerializableRunnable("testSimplePutAll2"){
             public void run2() throws CacheException {
-                //assertEquals(0, region.size());
+                //assertIndexDetailsEquals(0, region.size());
                 createMirroredRegion();
                 cacheTxnMgr = cache.getCacheTransactionManager();
                 int cntr = 0;
@@ -276,7 +276,7 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
         
         vm0.invoke(new CacheSerializableRunnable("testPutAllExceptions2"){
             public void run2() throws CacheException {
-                //assertEquals(0, region.size());
+                //assertIndexDetailsEquals(0, region.size());
                 createMirroredRegion();
                 
                 for(int i=1; i<6; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
index ae0c3f2..76c1b03 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
@@ -135,7 +135,7 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase {
         public void run2() throws CacheException {
           Region r = getRootRegion();
           assertEquals(null, r.getEntry("createKey"));
-          //assertEquals("putValue", r.getEntry("createKey").getValue());
+          //assertIndexDetailsEquals("putValue", r.getEntry("createKey").getValue());
           {
             int evIdx = 0;
             TestCacheListener cl = (TestCacheListener)r.getAttributes().getCacheListener();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
index 1a8d126..2f6b7a5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
@@ -194,7 +194,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
     // test new methods added for #43098
     if (expectedId != null) {
       Cache cache = (Cache)this.r.getRegionService();
-      //assertEquals(l, new ArrayList(cache.getMembers()));
+      //assertIndexDetailsEquals(l, new ArrayList(cache.getMembers()));
       assertEquals(l, new ArrayList(cache.getMembers(this.r)));
       assertEquals(l, new ArrayList(cache.getMembers(this.sr)));
     }
@@ -219,7 +219,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
       assertEquals(this.r, e.getRegion());
       // the test now uses a hook to get the member's DistributionAdvisor profile in the callback argument
       assertTrue(e.getCallbackArgument() instanceof Profile);
-//      assertEquals(null, e.getCallbackArgument());
+//      assertIndexDetailsEquals(null, e.getCallbackArgument());
     }
     assertTrue(this.mySRListener.lastOpWasCreate());
     {
@@ -231,7 +231,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
       assertEquals(this.sr, e.getRegion());
       // the test now uses a hook to get the member's DistributionAdvisor profile in the callback argument
       assertTrue(e.getCallbackArgument() instanceof Profile);
-//      assertEquals(null, e.getCallbackArgument());
+//      assertIndexDetailsEquals(null, e.getCallbackArgument());
     }
   }
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index e2e270c..45cb8a5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@ -421,7 +421,7 @@ public abstract class RegionTestCase extends CacheTestCase {
     Region subregion = region.createSubregion(name, attrs);
     assertTrue(attrs != subregion.getAttributes());
     /* @todo compare each individual attribute for equality?
-    assertEquals(attrs, subregion.getAttributes());
+    assertIndexDetailsEquals(attrs, subregion.getAttributes());
      */
     
     Set subregions = region.subregions(false);
@@ -1607,7 +1607,7 @@ public abstract class RegionTestCase extends CacheTestCase {
       // assert that if this is a disk region, the disk dirs are empty
       // to make sure we start with a clean slate
       getCache().getLogger().info("list="+Arrays.toString(diskDir.list()));
-//       assertEquals("list="+Arrays.toString(diskDir.list()),
+//       assertIndexDetailsEquals("list="+Arrays.toString(diskDir.list()),
 //                    0, diskDir.list().length);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
index 3b6034a..2441256 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
@@ -194,7 +194,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
               };
               Wait.waitForCriterion(ev, 50 * 1000, 200, true);
 //              assertNotNull(re);
-//              assertEquals(null, value);
+//              assertIndexDetailsEquals(null, value);
             }
           } else {
             {
@@ -1451,7 +1451,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
               continue;
             }
             assertEquals(new Integer(expectedArgs[i]), arg);
-            //assertEquals(CALLBACK_UPDATE_INTEGER, type);
+            //assertIndexDetailsEquals(CALLBACK_UPDATE_INTEGER, type);
             i++;
           }
         }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bf258f62/geode-core/src/test/java/com/gemstone/gemfire/distributed/AbstractLauncherServiceStatusTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/AbstractLauncherServiceStatusTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/AbstractLauncherServiceStatusTest.java
index c741def..940802f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/AbstractLauncherServiceStatusTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/AbstractLauncherServiceStatusTest.java
@@ -22,17 +22,15 @@ import java.io.File;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.net.InetAddress;
-import java.net.UnknownHostException;
 import java.util.Arrays;
 import java.util.List;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.distributed.AbstractLauncherServiceStatusTest.TestLauncher.TestState;
 import com.gemstone.gemfire.internal.GemFireVersion;
-import com.gemstone.gemfire.internal.process.PidUnavailableException;
 import com.gemstone.gemfire.internal.process.ProcessUtils;
 import com.gemstone.gemfire.management.internal.cli.json.GfJsonArray;
 import com.gemstone.gemfire.management.internal.cli.json.GfJsonException;
@@ -47,34 +45,58 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 @Category(UnitTest.class)
 public class AbstractLauncherServiceStatusTest {
 
-  private static final String SERVICE_NAME = "Test";
-  private static final InetAddress HOST = getLocalHost();
-  private static final int PORT = 12345;
-  private static final String NAME = AbstractLauncherServiceStatusTest.class.getSimpleName();
-  private static final int PID = identifyPid();
-  private static final long UPTIME = 123456789;
-  private static final String WORKING_DIRECTORY = identifyWorkingDirectory();
-  private static final List<String> JVM_ARGUMENTS = ManagementFactory.getRuntimeMXBean().getInputArguments();
-  private static final String CLASSPATH = ManagementFactory.getRuntimeMXBean().getClassPath();
-  private static final String GEMFIRE_VERSION = GemFireVersion.getGemFireVersion();
-  private static final String JAVA_VERSION = System.getProperty("java.version");
+  private static String serviceName;
+  private static InetAddress host;
+  private static int port;
+  private static String name;
+  private static int pid;
+  private static long uptime;
+  private static String workingDirectory;
+  private static List<String> jvmArguments;
+  private static String classpath;
+  private static String gemfireVersion;
+  private static String javaVersion;
 
   private TestLauncher launcher;
 
   @Before
-  public void setUp() {
-    this.launcher = new TestLauncher(HOST, PORT, NAME);
+  public void setUp() throws Exception {
+    serviceName = "Test";
+    port = 12345;
+    host = InetAddress.getLocalHost();
+    pid = ProcessUtils.identifyPid();
+    uptime = 123456789;
+    name = AbstractLauncherServiceStatusTest.class.getSimpleName();
+    workingDirectory = new File(System.getProperty("user.dir")).getAbsolutePath();
+    jvmArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
+    classpath = ManagementFactory.getRuntimeMXBean().getClassPath();
+    gemfireVersion = GemFireVersion.getGemFireVersion();
+    javaVersion = System.getProperty("java.version");
+
+    this.launcher = new TestLauncher(host, port, name);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    serviceName = null;
+    host = null;
+    name = null;
+    workingDirectory = null;
+    jvmArguments = null;
+    classpath = null;
+    gemfireVersion = null;
+    javaVersion = null;
   }
 
   @Test
   public void testMarshallingTestStatusToAndFromJson() {
-    final TestState status = this.launcher.status();
+    final TestLauncher.TestState status = this.launcher.status();
     final String json = status.toJson();
     validateJson(status, json);
-    validateStatus(status, TestState.fromJson(json));
+    validateStatus(status, TestLauncher.TestState.fromJson(json));
   }
 
-  private void validateStatus(final TestState expected, final TestState actual) {
+  private void validateStatus(final TestLauncher.TestState expected, final TestLauncher.TestState actual) {
     assertEquals(expected.getClasspath(), actual.getClasspath());
     assertEquals(expected.getGemFireVersion(), actual.getGemFireVersion());
     assertEquals(expected.getJavaVersion(), actual.getJavaVersion());
@@ -89,39 +111,12 @@ public class AbstractLauncherServiceStatusTest {
     assertEquals(expected.getMemberName(), actual.getMemberName());
   }
 
-  private void validateJson(final TestState expected, final String json) {
-    final TestState actual = TestState.fromJson(json);
+  private void validateJson(final TestLauncher.TestState expected, final String json) {
+    final TestLauncher.TestState actual = TestLauncher.TestState.fromJson(json);
     validateStatus(expected, actual);
   }
 
-  private static int identifyPid() {
-    try {
-      return ProcessUtils.identifyPid();
-    }
-    catch (PidUnavailableException e) {
-      return 0;
-    }
-  }
-
-  private static String identifyWorkingDirectory() {
-    try {
-      return new File(System.getProperty("user.dir")).getCanonicalPath();
-    }
-    catch (IOException e) {
-      return new File(System.getProperty("user.dir")).getAbsolutePath();
-    }
-  }
-
-  private static InetAddress getLocalHost() {
-    try {
-      return InetAddress.getLocalHost();
-    }
-    catch (UnknownHostException e) {
-      return null;
-    }
-  }
-  
-  static class TestLauncher extends AbstractLauncher<String> {
+  private static class TestLauncher extends AbstractLauncher<String> {
 
     private final InetAddress bindAddress;
     private final int port;
@@ -142,17 +137,17 @@ public class AbstractLauncherServiceStatusTest {
         null,
         System.currentTimeMillis(),
         getId(),
-        PID,
-        UPTIME,
-        WORKING_DIRECTORY,
-        JVM_ARGUMENTS,
-        CLASSPATH,
-        GEMFIRE_VERSION,
-        JAVA_VERSION,
+              pid,
+              uptime,
+              workingDirectory,
+              jvmArguments,
+              classpath,
+              gemfireVersion,
+              javaVersion,
         getLogFileName(),
         getBindAddressAsString(),
         getPortAsString(),
-        NAME);
+              name);
     }
 
     @Override
@@ -185,7 +180,7 @@ public class AbstractLauncherServiceStatusTest {
 
     @Override
     public String getServiceName() {
-      return SERVICE_NAME;
+      return serviceName;
     }
 
     InetAddress getBindAddress() {
@@ -204,7 +199,7 @@ public class AbstractLauncherServiceStatusTest {
       return String.valueOf(getPort());
     }
 
-    public static class TestState extends ServiceState<String> {
+    private static class TestState extends ServiceState<String> {
 
       protected static TestState fromJson(final String json) {
         try {
@@ -256,7 +251,7 @@ public class AbstractLauncherServiceStatusTest {
 
       @Override
       protected String getServiceName() {
-        return SERVICE_NAME;
+        return serviceName;
       }
     }
   }



Mime
View raw message