You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/06/09 17:05:18 UTC

[01/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 7fb8a39b9 -> b914df230


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
index 5c2f723..a806516 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
@@ -16,7 +16,33 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheEvent;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheWriter;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EntryNotFoundException;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
+import com.gemstone.gemfire.cache.TransactionEvent;
+import com.gemstone.gemfire.cache.TransactionListener;
+import com.gemstone.gemfire.cache.TransactionWriter;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
@@ -30,7 +56,6 @@ import com.gemstone.gemfire.cache.query.CqListener;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.execute.CustomerIDPartitionResolver;
@@ -38,32 +63,37 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.Customer;
 import com.gemstone.gemfire.internal.cache.execute.data.Order;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
+@Category(DistributedTest.class)
+public class RemoteCQTransactionDUnitTest extends JUnit4CacheTestCase {
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- *
- */
-public class RemoteCQTransactionDUnitTest extends CacheTestCase {
   final protected String CUSTOMER = "custRegion";
   final protected String ORDER = "orderRegion";
   final protected String D_REFERENCE = "distrReference";
-  
+
+  final CustId expectedCustId = new CustId(6);
+  final Customer expectedCustomer = new Customer("customer6", "address6");
+
   private final SerializableCallable getNumberOfTXInProgress = new SerializableCallable() {
+    @Override
     public Object call() throws Exception {
       TXManagerImpl mgr = getGemfireCache().getTxManager();
       return mgr.hostedTransactionsInProgressForTest();
     }
   };
+
   private final SerializableCallable verifyNoTxState = new SerializableCallable() {
+    @Override
     public Object call() throws Exception {
-      //TXManagerImpl mgr = getGemfireCache().getTxManager();
-      //assertIndexDetailsEquals(0, mgr.hostedTransactionsInProgressForTest());
       final TXManagerImpl mgr = getGemfireCache().getTxManager();
       Wait.waitForCriterion(new WaitCriterion() {
         @Override
@@ -79,12 +109,6 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       return null;
     }
   };
-  /**
-   * @param name
-   */
-  public RemoteCQTransactionDUnitTest(String name) {
-    super(name);
-  }
 
   protected enum OP {
     PUT, GET, DESTROY, INVALIDATE, KEYS, VALUES, ENTRIES, PUTALL, GETALL, REMOVEALL
@@ -92,7 +116,6 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
   
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
-//    try { Thread.sleep(5000); } catch (InterruptedException e) { } // FOR MANUAL TESTING OF STATS - DON"T KEEP THIS
     try {
       Invoke.invokeInEveryVM(verifyNoTxState);
     } finally {
@@ -144,6 +167,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
 
   protected void initAccessorAndDataStore(VM accessor, VM datastore, final int redundantCopies) {
     accessor.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         createRegion(true/*accessor*/, redundantCopies, null);
         return null;
@@ -151,6 +175,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     });
 
     datastore.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         createRegion(false/*accessor*/, redundantCopies, null);
         populateData();
@@ -161,6 +186,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
 
   protected void initAccessorAndDataStore(VM accessor, VM datastore1, VM datastore2, final int redundantCopies) {
     datastore2.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         createRegion(false/*accessor*/, redundantCopies, null);
         return null;
@@ -172,6 +198,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
 
   private void initAccessorAndDataStoreWithInterestPolicy(VM accessor, VM datastore1, VM datastore2, final int redundantCopies) {
     datastore2.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         createRegion(false/*accessor*/, redundantCopies, InterestPolicy.ALL);
         return null;
@@ -204,8 +231,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       rContainsVO = rContainsVO && orderRegion.containsValueForKey(o);
     }
     boolean rContainsVR = refRegion.containsValueForKey(custId);
-    
-    
+
     assertEquals(containsKey,rContainsKC);
     assertEquals(containsKey,rContainsKO);
     assertEquals(containsKey,rContainsKR);
@@ -213,7 +239,6 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     assertEquals(containsValue,rContainsVC);
     assertEquals(containsValue,rContainsVO);
     
-    
     if(containsKey) {
       Region.Entry eC =  custRegion.getEntry(custId);
       for (OrderId o : ordersSet) {
@@ -222,14 +247,8 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       Region.Entry eR = refRegion.getEntry(custId);
       assertNotNull(eC);
       assertNotNull(eR);
-//      assertIndexDetailsEquals(1,custRegion.size());
-  //    assertIndexDetailsEquals(1,orderRegion.size());
-    //  assertIndexDetailsEquals(1,refRegion.size());
-      
+
     } else {
-      //assertIndexDetailsEquals(0,custRegion.size());
-      //assertIndexDetailsEquals(0,orderRegion.size());
-      //assertIndexDetailsEquals(0,refRegion.size());
       try {
         Region.Entry eC =  custRegion.getEntry(custId);
         assertNull("should have had an EntryNotFoundException:"+eC,eC);
@@ -251,12 +270,9 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       } catch(EntryNotFoundException enfe) {
         // this is what we expect
       }
-      
     }
-    
   }
 
-
   void verifyAfterCommit(OP op) {
     Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
     Region<CustId, Customer> refRegion = getCache().getRegion(D_REFERENCE);
@@ -279,22 +295,10 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       expectedRef = expectedCust;
       assertNotNull(custRegion.getEntry(custId));
       assertEquals(expectedCust, custRegion.getEntry(custId).getValue());
-      /*
-      assertNotNull(orderRegion.getEntry(orderId));
-      assertIndexDetailsEquals(expectedOrder, orderRegion.getEntry(orderId).getValue());
-      
-      assertNotNull(orderRegion.getEntry(orderId2));
-      assertIndexDetailsEquals(expectedOrder2, orderRegion.getEntry(orderId2).getValue());
-      
-      assertNotNull(orderRegion.getEntry(orderId3));
-      assertIndexDetailsEquals(expectedOrder3, orderRegion.getEntry(orderId3).getValue());
-      */
+
       assertNotNull(refRegion.getEntry(custId));
       assertEquals(expectedRef, refRegion.getEntry(custId).getValue());
       
-      //Set<OrderId> ordersSet = new HashSet<OrderId>();
-      //ordersSet.add(orderId);ordersSet.add(orderId2);ordersSet.add(orderId3);
-      //validateContains(custId, ordersSet, true);
       break;
     case GET:
       expectedCust = custRegion.get(custId);
@@ -324,8 +328,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       throw new IllegalStateException();
     }
   }
-  
-  
+
   void verifyAfterRollback(OP op) {
     Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
     Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -383,14 +386,12 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       throw new IllegalStateException();
     }
   }
-  
-  
-  
 
+  static abstract class CacheCallback {
 
-  abstract class CacheCallback {
     protected boolean isAccessor;
     protected Exception ex = null;
+
     protected void verifyOrigin(EntryEvent event) {
       try {
         assertEquals(!isAccessor, event.isOriginRemote());
@@ -398,6 +399,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
         ex = e;
       }
     }
+
     protected void verifyPutAll(EntryEvent event) {
       CustId knownCustId = new CustId(1);
       OrderId knownOrderId = new OrderId(2, knownCustId);
@@ -410,37 +412,46 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
         }
       }
     }
-
   }
   
-  class TestCacheListener extends CacheCallback implements CacheListener {
+  static class TestCacheListener extends CacheCallback implements CacheListener {
     TestCacheListener(boolean isAccessor) {
       this.isAccessor = isAccessor;
     }
+    @Override
     public void afterCreate(EntryEvent event) {
       verifyOrigin(event);
       verifyPutAll(event);
     }
+    @Override
     public void afterUpdate(EntryEvent event) {
       verifyOrigin(event);
       verifyPutAll(event);
     }
+    @Override
     public void afterDestroy(EntryEvent event) {
       verifyOrigin(event);
     }
+    @Override
     public void afterInvalidate(EntryEvent event) {
       verifyOrigin(event);
     }
+    @Override
     public void afterRegionClear(RegionEvent event) {
     }
+    @Override
     public void afterRegionCreate(RegionEvent event) {
     }
+    @Override
     public void afterRegionDestroy(RegionEvent event) {
     }
+    @Override
     public void afterRegionInvalidate(RegionEvent event) {
     }
+    @Override
     public void afterRegionLive(RegionEvent event) {
     }
+    @Override
     public void close() {
     }
   }
@@ -452,6 +463,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     TestCacheWriter(boolean isAccessor) {
       this.isAccessor = isAccessor;
     }
+    @Override
     public void beforeCreate(EntryEvent event) throws CacheWriterException {
       getGemfireCache().getLogger().info("SWAP:beforeCreate:"+event+" op:"+event.getOperation());
       verifyOrigin(event);
@@ -461,37 +473,45 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     public void setFired(EntryEvent event) {
       wasFired = true;
     }
+    @Override
     public void beforeUpdate(EntryEvent event) throws CacheWriterException {
       getGemfireCache().getLogger().info("SWAP:beforeCreate:"+event+" op:"+event.getOperation());
       verifyOrigin(event);
       verifyPutAll(event);
       setFired(event);
     }
+    @Override
     public void beforeDestroy(EntryEvent event) throws CacheWriterException {
       verifyOrigin(event);
       setFired(event);
     }
+    @Override
     public void beforeRegionClear(RegionEvent event)
         throws CacheWriterException {
       setFired(null);
     }
+    @Override
     public void beforeRegionDestroy(RegionEvent event)
         throws CacheWriterException {
       setFired(null);
     }
+    @Override
     public void close() {
     }
   }
 
-  abstract class txCallback {
+  static abstract class txCallback {
+
     protected boolean isAccessor;
     protected Exception ex = null;
+
     protected void verify(TransactionEvent txEvent) {
       for (CacheEvent e : txEvent.getEvents()) {
         verifyOrigin(e);
         verifyPutAll(e);
       }
     }
+
     private void verifyOrigin(CacheEvent event) {
       try {
         assertEquals(true, event.isOriginRemote()); //change to !isAccessor after fixing #41498
@@ -499,6 +519,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
         ex = e;
       }
     }
+
     private void verifyPutAll(CacheEvent p_event) {
       if (!(p_event instanceof EntryEvent)) {
         return;
@@ -517,18 +538,23 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     }
   }
   
-  class TestTxListener extends txCallback implements TransactionListener {
+  static class TestTxListener extends txCallback implements TransactionListener {
+
     private boolean listenerInvoked;
+
     TestTxListener(boolean isAccessor) {
       this.isAccessor = isAccessor;
     }
+    @Override
     public void afterCommit(TransactionEvent event) {
       listenerInvoked = true;
       verify(event);
     }
+    @Override
     public void afterFailedCommit(TransactionEvent event) {
       verify(event);
     }
+    @Override
     public void afterRollback(TransactionEvent event) {
       listenerInvoked = true;
       verify(event);
@@ -536,27 +562,29 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     public boolean isListenerInvoked() {
       return this.listenerInvoked;
     }
+    @Override
     public void close() {
     }
   }
 
-  class TestTxWriter extends txCallback implements TransactionWriter {
+  static class TestTxWriter extends txCallback implements TransactionWriter {
     public TestTxWriter(boolean isAccessor) {
       this.isAccessor = isAccessor;
     }
+    @Override
     public void beforeCommit(TransactionEvent event) {
       verify(event);
     }
+    @Override
     public void close() {
     }
   }
 
-
-  
-  final CustId expectedCustId = new CustId(6);
-  final Customer expectedCustomer = new Customer("customer6", "address6");
   class TXFunction implements Function {
+
     static final String id = "TXFunction";
+
+    @Override
     public void execute(FunctionContext context) {
       Region r = null;
       r = getGemfireCache().getRegion(CUSTOMER);
@@ -565,15 +593,19 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       GemFireCacheImpl.getInstance().getLogger().warning(" XXX DOIN A PUT ",new Exception());
       context.getResultSender().lastResult(Boolean.TRUE);
     }
+    @Override
     public String getId() {
       return id;
     }
+    @Override
     public boolean hasResult() {
       return true;
     }
+    @Override
     public boolean optimizeForWrite() {
       return true;
     }
+    @Override
     public boolean isHA() {
       return false;
     }
@@ -617,8 +649,8 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     return expectedSet;
   }
 
+  static class OneUpdateCacheListener extends CacheListenerAdapter {
 
-  class OneUpdateCacheListener extends CacheListenerAdapter {
     boolean success = false;
     
     public boolean getSuccess() {
@@ -648,7 +680,8 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     }
   }
   
-  class OneDestroyAndThenOneCreateCacheWriter extends CacheWriterAdapter {
+  static class OneDestroyAndThenOneCreateCacheWriter extends CacheWriterAdapter {
+
     private boolean oneDestroy;
     private boolean oneCreate;
     
@@ -693,6 +726,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
 
   protected Integer startServer(VM vm) {
     return (Integer) vm.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
         CacheServer s = getCache().addCacheServer();
@@ -702,8 +736,10 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       }
     });
   }
+
   protected void createClientRegion(VM vm, final int port, final boolean isEmpty, final boolean ri, final boolean CQ) {
     vm.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         ClientCacheFactory ccf = new ClientCacheFactory();
         ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port);
@@ -734,28 +770,26 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
     });
   }
 
-  protected class ClientCQListener implements CqListener {
+  protected static class ClientCQListener implements CqListener {
 
     boolean invoked = false;
+
+    @Override
     public void onError(CqEvent aCqEvent) {
-      // TODO Auto-generated method stub
-      
     }
 
+    @Override
     public void onEvent(CqEvent aCqEvent) {
-      // TODO Auto-generated method stub
       invoked =true;
-      
     }
 
+    @Override
     public void close() {
-      // TODO Auto-generated method stub
-      
     }
-    
   }
   
-protected static class ClientListener extends CacheListenerAdapter {
+  protected static class ClientListener extends CacheListenerAdapter {
+
     boolean invoked = false;
     int invokeCount = 0;
     int invalidateCount = 0;
@@ -776,6 +810,7 @@ protected static class ClientListener extends CacheListenerAdapter {
       putAllOp = event.getOperation().isPutAll();
       isOriginRemote = event.isOriginRemote();
     }
+
     @Override
     public void afterUpdate(EntryEvent event) {
     	event.getRegion().getCache().getLogger().warning("ZZZ AFTER UPDATE:"+event.getKey()+" isPutAll:"+event.getOperation().isPutAll()+" op:"+event.getOperation());
@@ -808,9 +843,11 @@ protected static class ClientListener extends CacheListenerAdapter {
   }
   
   protected static class ServerListener extends CacheListenerAdapter {
+
     boolean invoked = false;
     int creates;
     int updates;
+
     @Override
     public void afterCreate(EntryEvent event) {
       invoked = true;
@@ -831,8 +868,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     }
   }
   
-  private static final String EMPTY_REGION = "emptyRegionName";
-  
+  @Test
   public void testTXWithCQCommitInDatastoreCQ() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -844,6 +880,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     createClientRegion(client, port, false, true, true);
     datastore.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -861,6 +898,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     Thread.sleep(10000);
     client.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -874,7 +912,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
   
-  
+  @Test
   public void testTXWithCQCommitInDatastoreConnectedToAccessorCQ() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -886,6 +924,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     createClientRegion(client, port, false, true, true);
     datastore.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -894,8 +933,6 @@ protected static class ClientListener extends CacheListenerAdapter {
         OrderId orderId = new OrderId(1, custId);
         getCache().getCacheTransactionManager().begin();
         custRegion.put(custId, new Customer("foo", "bar"));
-//        orderRegion.put(orderId, new Order("fooOrder"));
-//        refRegion.put(custId, new Customer("foo", "bar"));
         getCache().getCacheTransactionManager().commit();
         return null;
       }
@@ -903,6 +940,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     Thread.sleep(10000);
     client.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -914,8 +952,8 @@ protected static class ClientListener extends CacheListenerAdapter {
       }
     });
   }
-  
-  
+
+  @Test
   public void testTXWithCQCommitInDatastoreConnectedToDatastoreCQ() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -927,6 +965,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     createClientRegion(client, port, false, true, true);
     datastore.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -935,8 +974,6 @@ protected static class ClientListener extends CacheListenerAdapter {
         OrderId orderId = new OrderId(1, custId);
         getCache().getCacheTransactionManager().begin();
         custRegion.put(custId, new Customer("foo", "bar"));
-//        orderRegion.put(orderId, new Order("fooOrder"));
-//        refRegion.put(custId, new Customer("foo", "bar"));
         getCache().getCacheTransactionManager().commit();
         return null;
       }
@@ -944,6 +981,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     Thread.sleep(10000);
     client.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -956,6 +994,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
   
+  @Test
   public void testTXWithCQCommitInAccessorConnectedToDatastoreCQ() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -967,6 +1006,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     createClientRegion(client, port, false, true, true);
     accessor.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -975,8 +1015,6 @@ protected static class ClientListener extends CacheListenerAdapter {
         OrderId orderId = new OrderId(1, custId);
         getCache().getCacheTransactionManager().begin();
         custRegion.put(custId, new Customer("foo", "bar"));
-//        orderRegion.put(orderId, new Order("fooOrder"));
-//        refRegion.put(custId, new Customer("foo", "bar"));
         getCache().getCacheTransactionManager().commit();
         return null;
       }
@@ -984,6 +1022,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     Thread.sleep(10000);
     client.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -996,6 +1035,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
   
+  @Test
   public void testTXWithCQCommitInAccessorConnectedToAccessorCQ() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -1007,6 +1047,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     createClientRegion(client, port, false, true, true);
     accessor.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -1015,8 +1056,6 @@ protected static class ClientListener extends CacheListenerAdapter {
         OrderId orderId = new OrderId(1, custId);
         getCache().getCacheTransactionManager().begin();
         custRegion.put(custId, new Customer("foo", "bar"));
-//        orderRegion.put(orderId, new Order("fooOrder"));
-//        refRegion.put(custId, new Customer("foo", "bar"));
         getCache().getCacheTransactionManager().commit();
         return null;
       }
@@ -1024,6 +1063,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     Thread.sleep(10000);
     client.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -1035,8 +1075,8 @@ protected static class ClientListener extends CacheListenerAdapter {
       }
     });
   }
-  
-  
+
+  @Test
   public void testCQCommitInDatastoreConnectedToAccessorCQ() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -1048,6 +1088,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     createClientRegion(client, port, false, true, true);
     datastore.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -1056,8 +1097,6 @@ protected static class ClientListener extends CacheListenerAdapter {
         OrderId orderId = new OrderId(1, custId);
         getCache().getCacheTransactionManager().begin();
         custRegion.put(custId, new Customer("foo", "bar"));
-//        orderRegion.put(orderId, new Order("fooOrder"));
-//        refRegion.put(custId, new Customer("foo", "bar"));
         getCache().getCacheTransactionManager().commit();
         return null;
       }
@@ -1065,6 +1104,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
     Thread.sleep(10000);
     client.invoke(new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
         Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
@@ -1077,5 +1117,4 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
 
-
 }


[43/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRColocatedEquiJoinDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRColocatedEquiJoinDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRColocatedEquiJoinDUnitTest.java
index f86b94e..b50b650 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRColocatedEquiJoinDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRColocatedEquiJoinDUnitTest.java
@@ -19,6 +19,15 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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 static com.gemstone.gemfire.cache.query.Utils.*;
 
 import java.util.ArrayList;
@@ -64,6 +73,7 @@ import com.gemstone.gemfire.test.dunit.Wait;
 /**
  *
  */
+@Category(DistributedTest.class)
 public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase {
 
   int totalNumBuckets = 100;
@@ -87,8 +97,8 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
   /**
    * @param name
    */
-  public PRColocatedEquiJoinDUnitTest(String name) {
-    super(name);
+  public PRColocatedEquiJoinDUnitTest() {
+    super();
   }
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
@@ -102,6 +112,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRLocalQuerying() throws Exception
   {
     Host host = Host.getHost(0);
@@ -180,6 +191,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
   }
 
+  @Test
   public void testNonColocatedPRLocalQuerying() throws Exception
   {
     IgnoredException.addIgnoredException("UnsupportedOperationException");
@@ -385,6 +397,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRLocalQueryingWithIndexes() throws Exception {
 
     Host host = Host.getHost(0);
@@ -474,6 +487,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRLocalQueryingWithIndexOnOneRegion() throws Exception {
 
     Host host = Host.getHost(0);
@@ -561,6 +575,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRRRLocalQuerying() throws Exception
   {
     Host host = Host.getHost(0);
@@ -645,6 +660,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRRRLocalQueryingWithIndexes() throws Exception {
 
     Host host = Host.getHost(0);
@@ -734,6 +750,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRRRLocalQueryingWithIndexOnOnePRRegion() throws Exception {
 
     Host host = Host.getHost(0);
@@ -820,6 +837,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testRRPRLocalQuerying() throws Exception
   {
     Host host = Host.getHost(0);
@@ -904,6 +922,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testRRPRLocalQueryingWithIndexes() throws Exception {
 
     Host host = Host.getHost(0);
@@ -991,6 +1010,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testRRPRLocalQueryingWithIndexOnOnePRRegion() throws Exception {
 
     Host host = Host.getHost(0);
@@ -1077,6 +1097,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRNonLocalQueryException() throws Exception {
     
     Host host = Host.getHost(0);
@@ -1235,6 +1256,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
   }
 
+  @Test
   public void testPRRRLocalQueryingWithHetroIndexes() throws Exception {
 
     Host host = Host.getHost(0);
@@ -1318,6 +1340,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
   }
 
 
+  @Test
   public void testRRPRLocalQueryingWithHetroIndexes() throws Exception {
 
     Host host = Host.getHost(0);
@@ -1400,6 +1423,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
   }
 
+  @Test
   public void testPRRRCompactRangeAndNestedRangeIndexQuerying() throws Exception {
 
     Host host = Host.getHost(0);
@@ -1482,6 +1506,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
   }
 
+  @Test
   public void testPRRRIndexQueryWithSameTypeIndexQueryResults() throws Exception {
 
     Host host = Host.getHost(0);
@@ -1577,6 +1602,7 @@ public class PRColocatedEquiJoinDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a LOCAL query on one data store VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRRRNonLocalQueryingWithNoRROnOneNode() throws Exception
   {
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRInvalidQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRInvalidQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRInvalidQueryDUnitTest.java
index 4fa2b5a..ed98c3e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRInvalidQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRInvalidQueryDUnitTest.java
@@ -17,6 +17,15 @@
 
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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;
+
 /**
  * This tests creates partition regions across VM's executes Queries on PR's so
  * that they generate various Exceptions
@@ -30,6 +39,7 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class PRInvalidQueryDUnitTest extends PartitionedRegionDUnitTestCase
 
 {
@@ -39,9 +49,9 @@ public class PRInvalidQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @param name
    */
 
-  public PRInvalidQueryDUnitTest(String name) {
+  public PRInvalidQueryDUnitTest() {
 
-    super(name);
+    super();
   }
 
   public void setCacheInVMs(VM... vms) {
@@ -70,6 +80,7 @@ public class PRInvalidQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @throws Exception
    */
 
+  @Test
   public void testPRDAckCreationAndQueryingWithInvalidQuery() throws Exception
   {
     LogWriterUtils.getLogWriter()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryCacheCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryCacheCloseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryCacheCloseDUnitTest.java
index 97021f5..f76529f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryCacheCloseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryCacheCloseDUnitTest.java
@@ -17,6 +17,15 @@
 
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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;
+
 /**
  * This test tests the PR query behaviour with respect to cache closure
  * happening on one of the data stores. PR is configured with redundantCopies =
@@ -44,6 +53,7 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
+@Category(DistributedTest.class)
 public class PRQueryCacheCloseDUnitTest extends PartitionedRegionDUnitTestCase
 {
 
@@ -53,9 +63,9 @@ public class PRQueryCacheCloseDUnitTest extends PartitionedRegionDUnitTestCase
    * @param name
    */
 
-  public PRQueryCacheCloseDUnitTest(String name) {
+  public PRQueryCacheCloseDUnitTest() {
 
-    super(name);
+    super();
   }
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
@@ -89,6 +99,7 @@ public class PRQueryCacheCloseDUnitTest extends PartitionedRegionDUnitTestCase
    * 6. then recreates the PR on the same VM <br>
    * 7. Verfies the size , type , contents of both the resultSets Obtained <br>
    */
+  @Test
   public void testPRWithCacheCloseInOneDatastoreWithDelay() throws Exception
   {
 
@@ -222,6 +233,7 @@ public class PRQueryCacheCloseDUnitTest extends PartitionedRegionDUnitTestCase
    * 6. then recreates the PR on the same VM <br>
    * 7. Verfies the size , type , contents of both the resultSets Obtained <br>
    */
+  @Test
   public void testPRWithCacheCloseInOneDatastoreWithoutDelay() throws Exception
   {
     LogWriterUtils.getLogWriter()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 241aeb6..6b6623e 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
@@ -86,25 +86,15 @@ import com.gemstone.gemfire.util.test.TestUtil;
 
 /**
  * This is a helper class for the various Partitioned Query DUnit Test Cases
- * 
  */
+public class PRQueryDUnitHelper implements Serializable {
 
-public class PRQueryDUnitHelper implements Serializable
-{
-  /**
-   * constructor *
-   * 
-   * @param name
-   */
   static Cache cache = null;
+
   public static void setCache(Cache cache) {
     PRQueryDUnitHelper.cache = cache;
   }
 
-  public PRQueryDUnitHelper() {
-
-  }
-
   public static Cache getCache() {
     return cache;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 c5ec4b7..1135939 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
@@ -17,6 +17,15 @@
 
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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;
+
 /**
  * This tests creates partition regions across VM's and a local Region across
  * one of the VM executes Queries both on Local Region & PR's & compare
@@ -53,6 +62,7 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
 
 {
@@ -62,8 +72,8 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @param name
    */
 
-  public PRQueryDUnitTest(String name) {
-    super(name);
+  public PRQueryDUnitTest() {
+    super();
   }
 
   public void setCacheInVMs(VM... vms) {
@@ -100,6 +110,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @throws Exception
    */
 
+  @Test
   public void testPRDAckCreationAndQuerying() throws Exception
   {
     LogWriterUtils.getLogWriter()
@@ -184,6 +195,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
     * @throws Exception
     */
 
+  @Test
   public void testPRDAckCreationAndQueryingFull() throws Exception
   {
     LogWriterUtils.getLogWriter()
@@ -270,6 +282,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @throws Exception
    */
 
+  @Test
   public void testPRDAckCreationAndQueryingWithConstants() throws Exception
   {
     LogWriterUtils.getLogWriter()
@@ -353,6 +366,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * the query loop
    * @throws Exception
    */
+  @Test
   public void testDataLossDuringQueryProcessor() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -431,6 +445,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
     }
   }
 
+  @Test
   public void testQueryResultsFromMembers() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -536,6 +551,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
     }
   }
 
+  @Test
   public void testQueryResultsFromMembersWithAccessor() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -650,6 +666,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * the query loop
    * @throws Exception
    */
+  @Test
   public void testSimulatedDataLossBeforeQueryProcessor() throws Exception
   {
     final String rName = getUniqueName();
@@ -733,6 +750,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @throws Exception
    */
 
+  @Test
   public void testPRAccessorCreationAndQuerying() throws Exception
   {
     LogWriterUtils.getLogWriter()
@@ -824,7 +842,8 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @throws Exception
    */
 
- public void testPRDAckCreationAndQueryingWithOrderBy() throws Exception
+  @Test
+  public void testPRDAckCreationAndQueryingWithOrderBy() throws Exception
  {
    int dataSize = 10;
    int step = 2;
@@ -911,7 +930,8 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
   * @throws Exception
   */
 
- public void testPRDAckCreationAndQueryingWithOrderByVerifyOrder() throws Exception
+  @Test
+  public void testPRDAckCreationAndQueryingWithOrderByVerifyOrder() throws Exception
  {
    int dataSize = 10;
    int step = 2;
@@ -997,6 +1017,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    *
    * @throws Exception
    */
+  @Test
   public void testPRAccessorCreationAndQueryWithOrderBy() throws Exception
   {
     int dataSize = 10;
@@ -1081,6 +1102,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQueryDUnitTest#testPRAccessorCreationAndQuerying : Querying PR's Test ENDED*****");
   }
 
+  @Test
   public void testPRDAckCreationAndQueryingWithOrderByLimit() throws Exception
   {
     int dataSize = 10;
@@ -1169,6 +1191,7 @@ public class PRQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @throws Exception
    */
 
+  @Test
   public void testPRAccessorCreationAndQueryingWithNoData() throws Exception
   {
     LogWriterUtils.getLogWriter()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java
index c8975db..edc821a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java
@@ -17,6 +17,15 @@
 
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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;
+
 /**
  * This test creates partition regions with one Accessor node & two Datastores
  * Calls region.close() on one of the data stores while the query is being
@@ -42,6 +51,7 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.internal.cache.ForceReattemptException;
 
+@Category(DistributedTest.class)
 public class PRQueryRegionCloseDUnitTest extends PartitionedRegionDUnitTestCase
 {
 
@@ -51,8 +61,8 @@ public class PRQueryRegionCloseDUnitTest extends PartitionedRegionDUnitTestCase
    * @param name
    */
 
-  public PRQueryRegionCloseDUnitTest(String name) {
-    super(name);
+  public PRQueryRegionCloseDUnitTest() {
+    super();
   }
 
   public void setCacheInVMs(VM... vms) {
@@ -88,6 +98,7 @@ public class PRQueryRegionCloseDUnitTest extends PartitionedRegionDUnitTestCase
    * 6. then recreates the PR on the same VM <br>
    * 7. Verfies the size , type , contents of both the resultSets Obtained <br>
    */
+  @Test
   public void testPRWithRegionCloseInOneDatastoreWithoutDelay()
       throws Exception
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java
index 1892be9..41dcad7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java
@@ -17,6 +17,15 @@
 
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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;
+
 /**
  * This test creates partition regions with one Accessor node & two Datastores
  * Calls region.destroy() on one of the data stores while the query is being
@@ -42,6 +51,7 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.internal.cache.ForceReattemptException;
 
+@Category(DistributedTest.class)
 public class PRQueryRegionDestroyedDUnitTest extends PartitionedRegionDUnitTestCase
 {
 
@@ -51,9 +61,9 @@ public class PRQueryRegionDestroyedDUnitTest extends PartitionedRegionDUnitTestC
    * @param name
    */
 
-  public PRQueryRegionDestroyedDUnitTest(String name) {
+  public PRQueryRegionDestroyedDUnitTest() {
 
-    super(name);
+    super();
   }
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
@@ -82,6 +92,7 @@ public class PRQueryRegionDestroyedDUnitTest extends PartitionedRegionDUnitTestC
    * 6. then recreates the PR on the same VM <br>
    * 7. Verfies the size , type , contents of both the resultSets Obtained <br>
    */
+  @Test
   public void testPRWithRegionDestroyInOneDatastoreWithDelay()
       throws Exception
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRemoteNodeExceptionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRemoteNodeExceptionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRemoteNodeExceptionDUnitTest.java
index 2fc1bc5..ac108ef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRemoteNodeExceptionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRQueryRemoteNodeExceptionDUnitTest.java
@@ -19,11 +19,14 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
-import static com.gemstone.gemfire.cache.query.Utils.createPortfolioData;
+import static com.gemstone.gemfire.cache.query.Utils.*;
+import static org.junit.Assert.*;
 
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheClosedException;
@@ -31,43 +34,28 @@ import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.Query;
 import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
-import com.gemstone.gemfire.cache.query.cq.dunit.CqQueryTestListener;
 import com.gemstone.gemfire.cache.query.data.PortfolioData;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.cache.query.internal.IndexTrackingQueryObserver;
-import com.gemstone.gemfire.cache.query.internal.QueryObserver;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
-import com.gemstone.gemfire.internal.cache.BucketRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDUnitTestCase;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test verifies exception handling on coordinator node for remote as
  * well as local querying.
- *
  */
+@Category(DistributedTest.class)
 public class PRQueryRemoteNodeExceptionDUnitTest extends PartitionedRegionDUnitTestCase {
 
-  /**
-   * constructor *
-   * 
-   * @param name
-   */
-
-  public PRQueryRemoteNodeExceptionDUnitTest(String name) {
-    super(name);
-  }
-
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
       vm.invoke(() -> PRQueryDUnitHelper.setCache(getCache()));
@@ -103,6 +91,7 @@ public class PRQueryRemoteNodeExceptionDUnitTest extends PartitionedRegionDUnitT
    * 6. then re-executes the query on one of the data-store node. <br>
    * 7. Verifies the exception thrown is from local node not from remote node <br>
    */
+  @Test
   public void testPRWithLocalAndRemoteException()
       throws Exception {
 
@@ -234,6 +223,7 @@ public class PRQueryRemoteNodeExceptionDUnitTest extends PartitionedRegionDUnitT
             "PRQueryRemoteNodeExceptionDUnitTest#testPRWithLocalAndRemoteException: Querying with PR Local/Remote Exception Test ENDED");
   }
   
+  @Test
   public void testRemoteException() throws Exception {
 
     LogWriterUtils.getLogWriter()
@@ -365,6 +355,7 @@ public class PRQueryRemoteNodeExceptionDUnitTest extends PartitionedRegionDUnitT
             "PRQueryRemoteNodeExceptionDUnitTest#testPRWithLocalAndRemoteException: Querying with PR Local/Remote Exception Test ENDED");
   }
   
+  @Test
   public void testCacheCloseExceptionFromLocalAndRemote() throws Exception {
 
     LogWriterUtils.getLogWriter()
@@ -498,6 +489,7 @@ public class PRQueryRemoteNodeExceptionDUnitTest extends PartitionedRegionDUnitT
             "PRQueryRemoteNodeExceptionDUnitTest#testPRWithLocalAndRemoteException: Querying with PR Local/Remote Exception Test ENDED");
   }
   
+  @Test
   public void testCacheCloseExceptionFromLocalAndRemote2() throws Exception {
 
     LogWriterUtils.getLogWriter()
@@ -641,6 +633,7 @@ public class PRQueryRemoteNodeExceptionDUnitTest extends PartitionedRegionDUnitT
             "PRQueryRemoteNodeExceptionDUnitTest#testPRWithLocalAndRemoteException: Querying with PR Local/Remote Exception Test ENDED");
   }
   
+  @Test
   public void testForceReattemptExceptionFromLocal() throws Exception {
 
     LogWriterUtils.getLogWriter()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
index 5b123f2..0e2b4cd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.snapshot;
 
+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.FilenameFilter;
 import java.io.IOException;
@@ -35,7 +44,8 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class ParallelSnapshotDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ParallelSnapshotDUnitTest extends JUnit4CacheTestCase {
   static byte[] ffff = new byte[] { 0xf, 0xf, 0xf, 0xf };
   static byte[] eeee = new byte[] { 0xe, 0xe, 0xe, 0xe };
   
@@ -61,15 +71,17 @@ public class ParallelSnapshotDUnitTest extends CacheTestCase {
     }
   }
   
-  public ParallelSnapshotDUnitTest(String name) {
-    super(name);
+  public ParallelSnapshotDUnitTest() {
+    super();
   }
   
+  @Test
   public void testExportImport() throws Exception {
     doExport(false);
     doImport(false);
   }
   
+  @Test
   public void testExportImportErrors() throws Exception {
     try {
       doExport(true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
index eae745a..4a75094 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.snapshot;
 
+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 com.examples.snapshot.MyPdxSerializer;
@@ -31,13 +40,15 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 
-public class SnapshotByteArrayDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class SnapshotByteArrayDUnitTest extends JUnit4CacheTestCase {
   private final File snap = new File("snapshot-ops");
   
-  public SnapshotByteArrayDUnitTest(String name) {
-    super(name);
+  public SnapshotByteArrayDUnitTest() {
+    super();
   }
 
+  @Test
   public void testImportByteArray() throws Exception {
     SerializableCallable load = new SerializableCallable() {
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
index 06bfecc..d9b041a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.snapshot;
 
+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.FilenameFilter;
 import java.util.HashMap;
@@ -39,11 +48,13 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 
-public class SnapshotDUnitTest extends CacheTestCase {
-  public SnapshotDUnitTest(String name) {
-    super(name);
+@Category(DistributedTest.class)
+public class SnapshotDUnitTest extends JUnit4CacheTestCase {
+  public SnapshotDUnitTest() {
+    super();
   }
 
+  @Test
   public void testExportAndImport() throws Exception {
     File dir = new File(getDiskDirs()[0], "snap");
     dir.mkdir();
@@ -108,6 +119,7 @@ public class SnapshotDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testCacheExportFilterException() throws Exception {
     SnapshotFilter<Object, Object> oops = new SnapshotFilter<Object, Object>() {
       @Override
@@ -132,6 +144,7 @@ public class SnapshotDUnitTest extends CacheTestCase {
     assertTrue(caughtException);
   }
   
+  @Test
   public void testCacheImportFilterException() throws Exception {
     SnapshotFilter<Object, Object> oops = new SnapshotFilter<Object, Object>() {
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
index c5b0e55..ec75ba1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.snapshot;
 
+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.FilenameFilter;
 import java.util.HashMap;
@@ -34,11 +43,13 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 
-public class SnapshotPerformanceDUnitTest extends CacheTestCase {
-  public SnapshotPerformanceDUnitTest(String name) {
-    super(name);
+@Category(DistributedTest.class)
+public class SnapshotPerformanceDUnitTest extends JUnit4CacheTestCase {
+  public SnapshotPerformanceDUnitTest() {
+    super();
   }
 
+  @Test
   public void testPerformance() throws Exception {
     int iterations = 5;
     int dataCount = 10000;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34387DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34387DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34387DUnitTest.java
index e8fac48..f1ee791 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34387DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34387DUnitTest.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.CacheListener;
@@ -37,7 +46,8 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 5.0
  */
-public class Bug34387DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug34387DUnitTest extends JUnit4CacheTestCase {
 
 //  private transient Region r;
 //  private transient DistributedMember otherId;
@@ -45,8 +55,8 @@ public class Bug34387DUnitTest extends CacheTestCase {
   
   static volatile boolean callbackFailure;
   
-  public Bug34387DUnitTest(String name) {
-    super(name);
+  public Bug34387DUnitTest() {
+    super();
   }
 
   protected static void callbackAssertEquals(String message, Object expected, 
@@ -115,6 +125,7 @@ public class Bug34387DUnitTest extends CacheTestCase {
   /**
    * test create followed by localDestroy
    */
+  @Test
   public void testCreateAndLD() throws CacheException {
     initOtherId();
     AttributesFactory af = new AttributesFactory();
@@ -144,6 +155,7 @@ public class Bug34387DUnitTest extends CacheTestCase {
   /**
    * test create followed by localInvalidate
    */
+  @Test
   public void testCreateAndLI() throws CacheException {
     initOtherId();
     AttributesFactory af = new AttributesFactory();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34948DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34948DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34948DUnitTest.java
index 2d1dcf4..3fc35af 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34948DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug34948DUnitTest.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.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -41,10 +50,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 5.0
  */
-public class Bug34948DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug34948DUnitTest extends JUnit4CacheTestCase {
 
-  public Bug34948DUnitTest(String name) {
-    super(name);
+  public Bug34948DUnitTest() {
+    super();
   }
 
   //////////////////////  Test Methods  //////////////////////
@@ -98,6 +108,7 @@ public class Bug34948DUnitTest extends CacheTestCase {
    * Make sure that value is only deserialized in cache whose application
    * asks for the value.
    */
+  @Test
   public void testBug34948() throws CacheException {
     final AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug35214DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug35214DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug35214DUnitTest.java
index 9714bdd..02f065d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug35214DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug35214DUnitTest.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.SystemFailure;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
@@ -43,7 +52,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  *
  * @since GemFire 5.0
  */
-public class Bug35214DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug35214DUnitTest extends JUnit4CacheTestCase {
 
   protected volatile int expirationCount = 0;
 
@@ -51,8 +61,8 @@ public class Bug35214DUnitTest extends CacheTestCase {
 
   protected static volatile boolean callbackFailure;
   
-  public Bug35214DUnitTest(String name) {
-    super(name);
+  public Bug35214DUnitTest() {
+    super();
   }
 
   private VM getOtherVm() {
@@ -148,6 +158,7 @@ public class Bug35214DUnitTest extends CacheTestCase {
   /**
    * make sure entries do not expire during a GII
    */
+  @Test
   public void testNoEntryExpireDuringGII() throws Exception {
     initOtherVm();
     AsyncInvocation updater = null;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38013DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38013DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38013DUnitTest.java
index 2c76556..da33c71 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38013DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38013DUnitTest.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.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -40,10 +49,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 5.0
  */
-public class Bug38013DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug38013DUnitTest extends JUnit4CacheTestCase {
 
-  public Bug38013DUnitTest(String name) {
-    super(name);
+  public Bug38013DUnitTest() {
+    super();
   }
 
   //////////////////////  Test Methods  //////////////////////
@@ -100,6 +110,7 @@ public class Bug38013DUnitTest extends CacheTestCase {
    * Make sure that value is only deserialized in cache whose application
    * asks for the value.
    */
+  @Test
   public void testBug38013() throws CacheException {
     final AttributesFactory factory = new AttributesFactory();
     PartitionAttributesFactory paf = new PartitionAttributesFactory();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38741DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38741DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38741DUnitTest.java
index 49a6ce6..830eead 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38741DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/Bug38741DUnitTest.java
@@ -16,36 +16,58 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.CopyHelper;
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.NanoTimer;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.BucketRegion;
 import com.gemstone.gemfire.internal.cache.BucketRegion.RawValue;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.internal.cache.CachedDeserializable;
+import com.gemstone.gemfire.internal.cache.EnumListenerEvent;
+import com.gemstone.gemfire.internal.cache.EventID;
+import com.gemstone.gemfire.internal.cache.KeyInfo;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessageImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
  * @since GemFire bugfix5.7
  */
+@Category(DistributedTest.class)
 public class Bug38741DUnitTest extends ClientServerTestCase {
-  private static final long serialVersionUID = 1L;
 
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
@@ -53,16 +75,13 @@ public class Bug38741DUnitTest extends ClientServerTestCase {
     return factory.create();
   }
 
-  public Bug38741DUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Test that CopyOnRead doesn't cause {@link HARegionQueue#peek()} to create a copy,
    * assuming that creating copies performs a serialize and de-serialize operation.
    * @throws Exception when there is a failure
    * @since GemFire bugfix5.7
    */
+  @Test
   public void testCopyOnReadWithBridgeServer() throws Exception {
     final Host h = Host.getHost(0);
     final VM client = h.getVM(2);
@@ -245,6 +264,7 @@ public class Bug38741DUnitTest extends ClientServerTestCase {
    * expected number of copies when copy-on-read is set to true
    * @throws Exception
    */
+  @Test
   public void testPartitionedRegionAndCopyOnRead() throws Exception {
     final Host h = Host.getHost(0);
     final VM accessor = h.getVM(2);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheCloseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheCloseDUnitTest.java
index 798fc1b..338a842 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheCloseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheCloseDUnitTest.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.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -32,10 +41,11 @@ import com.gemstone.gemfire.cache.RegionAttributes;
  *
  * @since GemFire 3.0
  */
-public class CacheCloseDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CacheCloseDUnitTest extends JUnit4CacheTestCase {
 
-  public CacheCloseDUnitTest(String name) {
-    super(name);
+  public CacheCloseDUnitTest() {
+    super();
   }
 
   private RegionAttributes createAtts(List callbacks) {
@@ -72,6 +82,7 @@ public class CacheCloseDUnitTest extends CacheTestCase {
   
   //////////////////////  Test Methods  //////////////////////
 
+  @Test
   public void testCallbacksClosed() throws CacheException {
     {
       List callbacks = new ArrayList();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheListenerTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheListenerTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheListenerTestCase.java
index ac028db..1980848 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheListenerTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheListenerTestCase.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.CacheListener;
@@ -39,8 +48,8 @@ import com.gemstone.gemfire.test.dunit.Wait;
 public abstract class CacheListenerTestCase
   extends CacheLoaderTestCase {
 
-  public CacheListenerTestCase(String name) {
-    super(name);
+  public CacheListenerTestCase() {
+    super();
   }
 
   ///////////////////////  Test Methods  ///////////////////////
@@ -49,6 +58,7 @@ public abstract class CacheListenerTestCase
    * Tests that the <code>CacheListener</code> is called after an entry
    * is {@linkplain CacheListener#afterCreate created}.
    */
+  @Test
   public void testCacheListenerAfterCreate() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -102,6 +112,7 @@ public abstract class CacheListenerTestCase
    * Tests that the <code>CacheListener</code> is called after an entry
    * is {@linkplain CacheListener#afterUpdate updated}.
    */
+  @Test
   public void testCacheListenerAfterUpdate() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -168,6 +179,7 @@ public abstract class CacheListenerTestCase
    * Tests that the <code>CacheListener</code> is called after an
    * entry is {@linkplain CacheListener#afterDestroy destroyed}.
    */
+  @Test
   public void testCacheListenerAfterDestroy() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -212,6 +224,7 @@ public abstract class CacheListenerTestCase
    * Tests that the <code>CacheListener</code> is called after an
    * entry is {@linkplain CacheListener#afterInvalidate invalidated}.
    */
+  @Test
   public void testCacheListenerAfterInvalidate() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -258,6 +271,7 @@ public abstract class CacheListenerTestCase
     assertFalse(listener.wasInvoked());
   }
   
+  @Test
   public void testCacheListenerAfterInvalidateWithForce() throws CacheException {
     AbstractRegionMap.FORCE_INVALIDATE_EVENT = true;
     try {
@@ -321,6 +335,7 @@ public abstract class CacheListenerTestCase
    * @see CacheListener#afterRegionDestroy
    * @see CacheListener#close
    */
+  @Test
   public void testCacheListenerAfterRegionDestroy()
     throws CacheException,InterruptedException {
 
@@ -381,6 +396,7 @@ public abstract class CacheListenerTestCase
    * @see CacheListener#afterRegionInvalidate
    * @see CacheListener#close
    */
+  @Test
   public void testCacheListenerAfterRegionInvalidate()
     throws CacheException, InterruptedException  {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 265e086..3f08137 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
@@ -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.CacheLoader;
@@ -40,12 +49,13 @@ import com.gemstone.gemfire.test.dunit.Wait;
 public abstract class CacheLoaderTestCase
   extends CacheWriterTestCase {
 
-  public CacheLoaderTestCase(String name) {
-    super(name);
+  public CacheLoaderTestCase() {
+    super();
   }
 
   ///////////////////////  Test Methods  ///////////////////////
 
+  @Test
   public void testCacheLoader() throws CacheException {
     final String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -183,6 +193,7 @@ public abstract class CacheLoaderTestCase
    * Tests what happens when a {@link CacheLoader} returns
    * <code>null</code> from its {@link CacheLoader#load load} method.
    */
+  @Test
   public void testCacheLoaderNull() throws CacheException {
     TestCacheLoader loader = new TestCacheLoader() {
         public Object load2(LoaderHelper helper)
@@ -208,6 +219,7 @@ public abstract class CacheLoaderTestCase
    * Tests that a <code>CacheWriter</code> gets invoked on a
    * <code>load</code>.
    */
+  @Test
   public void testCacheWriterOnLoad() throws CacheException {
     final String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -269,6 +281,7 @@ public abstract class CacheLoaderTestCase
    * Tests that a <code>CacheListener</code> gets invoked on a
    * <code>load</code>.
    */
+  @Test
   public void testCacheListenerOnLoad()
     throws CacheException, InterruptedException {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLogRollDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLogRollDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLogRollDUnitTest.java
index 212c5a8..8802328 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLogRollDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheLogRollDUnitTest.java
@@ -16,30 +16,35 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.logging.InternalLogWriter;
-import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;
 import java.util.Properties;
 import java.util.regex.Pattern;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.logging.InternalLogWriter;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 /**
  * Test to make sure cache close is working.
  *
  * @since GemFire 6.5
  */
-public class CacheLogRollDUnitTest extends CacheTestCase {
-
-  public CacheLogRollDUnitTest(String name) {
-    super(name);
-  }
-
-  //////////////////////  Test Methods  //////////////////////
+@Category(DistributedTest.class)
+public class CacheLogRollDUnitTest extends JUnit4CacheTestCase {
 
   private void logAndRollAndVerify(String baseLogName,
       DistributedSystem ds,String mainId) throws FileNotFoundException, IOException {
@@ -215,6 +220,7 @@ public class CacheLogRollDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testDiskSpace() throws Exception {
     Properties props = new Properties();
     String baseLogName = "diskarito";
@@ -226,14 +232,15 @@ public class CacheLogRollDUnitTest extends CacheTestCase {
     for(int i=0;i<10;i++) {
      ds = this.getSystem(props);
      ds.disconnect();
-     }
+    }
 
-     /*
-      * This was throwing NPEs until my fix...
-      */
+   /*
+    * This was throwing NPEs until my fix...
+    */
   }
 
   @Category(FlakyTest.class) // GEODE-674: possible disk pollution, file size sensitive
+  @Test
   public void testSimpleStartRestartWithRolling() throws Exception {
     Properties props = new Properties();
     String baseLogName = "restarto";
@@ -290,10 +297,10 @@ public class CacheLogRollDUnitTest extends CacheTestCase {
         assertTrue("We are hoping that:"+lfl+" exists",f1l.exists());
         ds.disconnect();
     }
-
   }
 
   @Category(FlakyTest.class) // GEODE-677: possible disk pollution, file size sensitive
+  @Test
   public void testStartWithRollingThenRestartWithRolling() throws Exception {
     Properties props = new Properties();
     String baseLogName = "biscuits";
@@ -370,74 +377,75 @@ public class CacheLogRollDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-676: possible disk pollution, file size sensitive
+  @Test
   public void testLogFileLayoutAndRolling() throws Exception {
     String baseLogName = "tacos";
-      Properties props = new Properties();
-      
-      String logfile = baseLogName+".log";
+    Properties props = new Properties();
+
+    String logfile = baseLogName+".log";
     props.put(LOG_FILE, logfile);
     props.put(LOG_FILE_SIZE_LIMIT, "1");
     props.put(LOG_LEVEL, "config");
       
-      DistributedSystem ds = getSystem(props);
-      InternalDistributedSystem ids = (InternalDistributedSystem) ds;
-      assertEquals(InternalLogWriter.INFO_LEVEL, ((InternalLogWriter)ids.getLogWriter()).getLogWriterLevel());
+    DistributedSystem ds = getSystem(props);
+    InternalDistributedSystem ids = (InternalDistributedSystem) ds;
+    assertEquals(InternalLogWriter.INFO_LEVEL, ((InternalLogWriter)ids.getLogWriter()).getLogWriterLevel());
 
-      // Lets figure out the mainId we start with
-      String mainId;
-      {
-        final Pattern mainIdPattern = Pattern.compile("meta-" + baseLogName + "-\\d+.log");
-        File[] metaLogs = new File(".").listFiles(new FilenameFilter() {
-            public boolean accept(File d, String name) {
-              return mainIdPattern.matcher(name).matches();
-            }
-          });
-        assertEquals(1, metaLogs.length);
-        String f = metaLogs[0].getName();
-        int idx = f.lastIndexOf("-");
-        int idx2 = f.lastIndexOf(".");
-        mainId = f.substring(idx+1, idx2);
-      }
-      ds.getProperties();
-      logAndRollAndVerify(baseLogName, ds, mainId);
-      
+    // Lets figure out the mainId we start with
+    String mainId;
+    {
+      final Pattern mainIdPattern = Pattern.compile("meta-" + baseLogName + "-\\d+.log");
+      File[] metaLogs = new File(".").listFiles(new FilenameFilter() {
+          public boolean accept(File d, String name) {
+            return mainIdPattern.matcher(name).matches();
+          }
+        });
+      assertEquals(1, metaLogs.length);
+      String f = metaLogs[0].getName();
+      int idx = f.lastIndexOf("-");
+      int idx2 = f.lastIndexOf(".");
+      mainId = f.substring(idx+1, idx2);
+    }
+    ds.getProperties();
+    logAndRollAndVerify(baseLogName, ds, mainId);
   }
 
   @Category(FlakyTest.class) // GEODE-675: possible disk pollution, file size sensitive
+  @Test
   public void testSecurityLogFileLayoutAndRolling() throws Exception {
     String baseLogName = "securitytacos";
-      Properties props = new Properties();
-      
-      String logfile = baseLogName+".log";
-      String sec_logfile = "sec_"+baseLogName+".log";
+    Properties props = new Properties();
+
+    String logfile = baseLogName+".log";
+    String sec_logfile = "sec_"+baseLogName+".log";
     props.put(LOG_FILE, logfile);
     props.put(LOG_FILE_SIZE_LIMIT, "1");
     props.put(LOG_LEVEL, "config");
     props.put(SECURITY_LOG_FILE, sec_logfile);
     props.put(SECURITY_LOG_LEVEL, "config");
       
-      DistributedSystem ds = getSystem(props);
-      InternalDistributedSystem ids = (InternalDistributedSystem) ds;
-      assertEquals(InternalLogWriter.INFO_LEVEL, ((InternalLogWriter)ids.getLogWriter()).getLogWriterLevel());
-      assertEquals(InternalLogWriter.INFO_LEVEL, ((InternalLogWriter)ids.getSecurityLogWriter()).getLogWriterLevel());
+    DistributedSystem ds = getSystem(props);
+    InternalDistributedSystem ids = (InternalDistributedSystem) ds;
+    assertEquals(InternalLogWriter.INFO_LEVEL, ((InternalLogWriter)ids.getLogWriter()).getLogWriterLevel());
+    assertEquals(InternalLogWriter.INFO_LEVEL, ((InternalLogWriter)ids.getSecurityLogWriter()).getLogWriterLevel());
 
-      // Lets figure out the mainId we start with
-      String mainId;
-      {
-        final Pattern mainIdPattern = Pattern.compile("meta-" + baseLogName + "-\\d+.log");
-        File[] metaLogs = new File(".").listFiles(new FilenameFilter() {
-            public boolean accept(File d, String name) {
-              return mainIdPattern.matcher(name).matches();
-            }
-          });
-        assertEquals(1, metaLogs.length);
-        String f = metaLogs[0].getName();
-        int idx = f.lastIndexOf("-");
-        int idx2 = f.lastIndexOf(".");
-        mainId = f.substring(idx+1, idx2);
-      }
-      ds.getProperties();
-      SecurityLogAndRollAndVerify(baseLogName, ds, mainId);
+    // Lets figure out the mainId we start with
+    String mainId;
+    {
+      final Pattern mainIdPattern = Pattern.compile("meta-" + baseLogName + "-\\d+.log");
+      File[] metaLogs = new File(".").listFiles(new FilenameFilter() {
+          public boolean accept(File d, String name) {
+            return mainIdPattern.matcher(name).matches();
+          }
+        });
+      assertEquals(1, metaLogs.length);
+      String f = metaLogs[0].getName();
+      int idx = f.lastIndexOf("-");
+      int idx2 = f.lastIndexOf(".");
+      mainId = f.substring(idx+1, idx2);
+    }
+    ds.getProperties();
+    SecurityLogAndRollAndVerify(baseLogName, ds, mainId);
   }
 
   String getLogContents(String logfile) throws FileNotFoundException,IOException {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 af604f2..b923ece 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
@@ -22,15 +22,35 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 import java.util.Set;
 
-public class CacheMapTxnDUnitTest extends DistributedTestCase{
-    
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class CacheMapTxnDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
+
     protected static Cache cache;
     protected static Properties props = new Properties();
     static DistributedSystem ds = null;
@@ -38,11 +58,6 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
     static Region mirroredRegion;
     protected static CacheTransactionManager cacheTxnMgr;
     
-    /** Creates a new instance of CacheMapTxnDUnitTest */
-    public CacheMapTxnDUnitTest(String name) {
-        super(name);
-    }
-    
     @Override
     public final void postSetUp() throws Exception {
       Host host = Host.getHost(0);
@@ -69,7 +84,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
         try{
             //            props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
             //            ds = DistributedSystem.connect(props);
-            ds = (new CacheMapTxnDUnitTest("temp")).getSystem(props);
+            ds = (new CacheMapTxnDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -78,7 +93,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             region = cache.createRegion("map", attr);
             
         } catch (Exception ex){
-            ex.printStackTrace();
+            throw new AssertionError(ex);
         }
     }
     
@@ -87,25 +102,28 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             cache.close();
             ds.disconnect();            
         } catch (Exception ex){
-            ex.printStackTrace();
+          throw new AssertionError(ex);
         }
     }
     
-    public void testCommitTxn() {
+  @Test
+  public void testCommitTxn() {
         //this is to test single VM region transactions
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         vm0.invoke(() -> CacheMapTxnDUnitTest.commitTxn());
     }//end of testCommitTxn
     
-    public void testRollbackTxn() {
+  @Test
+  public void testRollbackTxn() {
         //this is to test single VM region transactions
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         vm0.invoke(() -> CacheMapTxnDUnitTest.rollbackTxn());
     }//end of testRollbackTxn
     
-    public void testRollbackTxnClear() {
+  @Test
+  public void testRollbackTxnClear() {
         //this is to test single VM region transactions
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
@@ -130,7 +148,8 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
         }
     }//end of testRollbackTxnClear
     
-    public void testMiscMethods() throws Throwable{
+  @Test
+  public void testMiscMethods() throws Throwable{
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -245,8 +264,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             
         }
         catch(Exception ex){
-            ex.printStackTrace();
-            fail("failed in commitTxn");
+          throw new AssertionError(ex);
         }
         finally{
             if(cacheTxnMgr.exists()){
@@ -350,8 +368,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             
         }
         catch(Exception ex){
-            ex.printStackTrace();
-            fail("failed in rollbackTxn");
+          throw new AssertionError(ex);
         }
         finally{
             if(cacheTxnMgr.exists()){
@@ -395,8 +412,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
         }
         catch(Exception ex){
             cacheTxnMgr = null;
-            ex.printStackTrace();
-            fail("failed in rollbackTxnClear");
+          throw new AssertionError(ex);
         }
         
     }//end of rollbackTxnClear
@@ -447,8 +463,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             
         }
         catch(Exception ex){
-            ex.printStackTrace();
-            fail("failed in miscMethodsOwner");
+          throw new AssertionError(ex);
         }
         finally{
             if(cacheTxnMgr.exists()){
@@ -488,8 +503,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
             
         }
         catch(Exception ex){
-            ex.printStackTrace();
-            fail("failed in miscMethodsNotOwner");
+          throw new AssertionError(ex);
         }
     }//end of miscMethodsNotOwner
     
@@ -504,8 +518,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
                 obj = region.put(ob, str);
             }
         }catch(Exception ex){
-            ex.printStackTrace();
-            fail("Failed while region.put");
+          throw new AssertionError(ex);
         }
         return obj;
     }
@@ -515,7 +528,7 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
         try{
             obj = region.get(ob);
         } catch(Exception ex){
-            fail("Failed while region.get");
+          throw new AssertionError(ex);
         }
         return obj;
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheRegionsReliablityStatsCheckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheRegionsReliablityStatsCheckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheRegionsReliablityStatsCheckDUnitTest.java
index c133d5c..3e9fffb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheRegionsReliablityStatsCheckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheRegionsReliablityStatsCheckDUnitTest.java
@@ -16,28 +16,38 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.cache.CachePerfStats;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class CacheRegionsReliablityStatsCheckDUnitTest extends CacheTestCase {
-  public CacheRegionsReliablityStatsCheckDUnitTest(String name) {
-    super(name);
-  }
+public class CacheRegionsReliablityStatsCheckDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * The tests check to see if all the reliablity stats are working
    * fine and asserts their values to constants.
    */
-  public void testRegionsReliablityStats() throws Exception, RegionExistsException {
+	@Test
+  public void testRegionsReliablityStats() throws Exception {
     final String rr1 = "roleA";
     final String regionNoAccess = "regionNoAccess";
     final String regionLimitedAccess = "regionLimitedAccess";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheSerializableRunnable.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheSerializableRunnable.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheSerializableRunnable.java
index 4e01601..b43e6de 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheSerializableRunnable.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheSerializableRunnable.java
@@ -22,21 +22,15 @@ import com.gemstone.gemfire.cache.CacheRuntimeException;
 import com.gemstone.gemfire.test.dunit.RepeatableRunnable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
-import junit.framework.AssertionFailedError;
-
 /**
  * A helper class that provides the {@link SerializableRunnable}
  * class, but uses a {@link #run2} method instead that throws {@link
  * CacheException}.  This way, we don't need to have a lot of
  * try/catch code in the tests.
  *
- *
  * @since GemFire 3.0
  */
-public abstract class CacheSerializableRunnable
-  extends SerializableRunnable 
-  implements RepeatableRunnable 
-{
+public abstract class CacheSerializableRunnable extends SerializableRunnable implements RepeatableRunnable {
 
   /**
    * Creates a new <code>CacheSerializableRunnable</code> with the
@@ -50,7 +44,7 @@ public abstract class CacheSerializableRunnable
    * Creates a new <code>CacheSerializableRunnable</code> with the
    * given name
    */
-  public CacheSerializableRunnable(String name,Object[] args) {
+  public CacheSerializableRunnable(String name, Object[] args) {
     super(name);
     this.args = args;
   }
@@ -74,21 +68,21 @@ public abstract class CacheSerializableRunnable
   }
   
   /**
-   * Invokes the {@link #run} method.  If AssertionFailedError is thrown,
+   * Invokes the {@link #run} method.  If AssertionError is thrown,
    * and repeatTimeoutMs is >0, then repeat the {@link #run} method until
    * it either succeeds or repeatTimeoutMs milliseconds have passed.  The
-   * AssertionFailedError is only thrown to the caller if the last run
+   * AssertionError is only thrown to the caller if the last run
    * still throws it.
    */
   public final void runRepeatingIfNecessary(long repeatTimeoutMs) {
     long start = System.currentTimeMillis();
-    AssertionFailedError lastErr = null;
+    AssertionError lastErr = null;
     do {
       try {
         lastErr = null;
         this.run();
         CacheFactory.getAnyInstance().getLogger().fine("Completed " + this);
-      } catch (AssertionFailedError err) {
+      } catch (AssertionError err) {
         CacheFactory.getAnyInstance().getLogger().fine("Repeating " + this);
         lastErr = err;
         try {
@@ -109,19 +103,13 @@ public abstract class CacheSerializableRunnable
 
   public void run3() throws CacheException{}
 
-  /////////////////////////  Inner Classes  /////////////////////////
-
   /**
    * An exception that wraps a {@link CacheException}
    */
-  public static class CacheSerializableRunnableException 
-    extends CacheRuntimeException {
+  public static class CacheSerializableRunnableException extends CacheRuntimeException {
 
-    public CacheSerializableRunnableException(String message,
-                                              Throwable cause) {
+    public CacheSerializableRunnableException(String message, Throwable cause) {
       super(message, cause);
     }
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 8fd89ef..5621a3f 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
@@ -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.CacheStatistics;
@@ -36,10 +45,11 @@ import com.gemstone.gemfire.test.dunit.Wait;
  *
  * @since GemFire 3.0
  */
-public class CacheStatisticsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CacheStatisticsDUnitTest extends JUnit4CacheTestCase {
 
-  public CacheStatisticsDUnitTest(String name) {
-    super(name);
+  public CacheStatisticsDUnitTest() {
+    super();
   }
 
   ////////  Helper Methods
@@ -71,6 +81,7 @@ public class CacheStatisticsDUnitTest extends CacheTestCase {
    * {@link CacheStatistics#getMissCount miss count} are updated
    * properly for a local region and its entries.
    */
+  @Test
   public void testHitMissCount() throws CacheException {
     String name = this.getUniqueName();
     Object key = "KEY"; // value exists
@@ -182,6 +193,7 @@ public class CacheStatisticsDUnitTest extends CacheTestCase {
    * and its entries.  It also validates that the last modification
    * and last access times are propagated to parent regions.
    */
+  @Test
   public void testTimeStats() throws CacheException, InterruptedException
   {
     final long ESTAT_RES = 100; // the resolution, in ms, of entry stats
@@ -325,6 +337,7 @@ public class CacheStatisticsDUnitTest extends CacheTestCase {
    * time}.  It also validates that distributed operations do not
    * affect the hit and miss counts in remote caches.
    */
+  @Test
   public void testDistributedStats() {
     final String name = this.getUniqueName();
     final Object key = "KEY";
@@ -483,6 +496,7 @@ public class CacheStatisticsDUnitTest extends CacheTestCase {
    * Tests that an attempt to get statistics when they are disabled
    * results in a {@link StatisticsDisabledException}.
    */
+  @Test
   public void testDisabledStatistics() throws CacheException {
     String name = this.getUniqueName();
     Object key = "KEY";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheWriterTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheWriterTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheWriterTestCase.java
index 1ad1caa..88a8fda 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheWriterTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheWriterTestCase.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.*;
 //import com.gemstone.gemfire.cache.util.*;
 //import java.util.*;
@@ -32,8 +41,8 @@ import com.gemstone.gemfire.cache.*;
 public abstract class CacheWriterTestCase
   extends RegionAttributesTestCase {
 
-  public CacheWriterTestCase(String name) {
-    super(name);
+  public CacheWriterTestCase() {
+    super();
   }
 
   ///////////////////////  Test Methods  ///////////////////////
@@ -42,6 +51,7 @@ public abstract class CacheWriterTestCase
    * Tests that the <code>CacheWriter</code> is called before an entry
    * is {@linkplain CacheWriter#beforeCreate created}.
    */
+  @Test
   public void testCacheWriterBeforeCreate() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -130,6 +140,7 @@ public abstract class CacheWriterTestCase
    * Tests that the <code>CacheWriter</code> is called before an entry
    * is {@linkplain CacheWriter#beforeUpdate updated}.
    */
+  @Test
   public void testCacheWriterBeforeUpdate() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -238,6 +249,7 @@ public abstract class CacheWriterTestCase
    * Tests that the <code>CacheWriter</code> is called before an entry
    * is {@linkplain CacheWriter#beforeDestroy destroyed}.
    */
+  @Test
   public void testCacheWriterBeforeDestroy() throws CacheException {
     String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -311,6 +323,7 @@ public abstract class CacheWriterTestCase
    * @see CacheWriter#beforeRegionDestroy
    * @see CacheWriter#close
    */
+  @Test
   public void testCacheWriterBeforeRegionDestroy()
     throws CacheException {
 
@@ -392,6 +405,7 @@ public abstract class CacheWriterTestCase
    * Tests that a <code>CacheWriter</code> is <I>not</I> invoked on a
    * {@linkplain Region#localDestroyRegion local destroy}.
    */
+  @Test
   public void testCacheWriterLocalDestroy() throws CacheException {
     final String name = this.getUniqueName();
 
@@ -410,6 +424,7 @@ public abstract class CacheWriterTestCase
    * Tests that a {@link CacheWriter} throwing a {@link
    * CacheWriterException} aborts the operation.
    */
+  @Test
   public void testCacheWriterExceptionAborts() throws CacheException {
     final String name = this.getUniqueName();
     final String exception = "EXCEPTION";


[07/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
index 0800dde..d249fb9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
@@ -16,15 +16,33 @@
  */
 package com.gemstone.gemfire.pdx;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Properties;
+
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.gemstone.gemfire.cache.*;
+import org.json.JSONException;
+import org.json.JSONObject;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.Assert;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
@@ -33,26 +51,13 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-/**
- *
- */
-public class JSONPdxClientServerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class JSONPdxClientServerDUnitTest extends JUnit4CacheTestCase {
 
-  public JSONPdxClientServerDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownCacheTestCase() {
     // this test creates client caches in some VMs and so
@@ -61,6 +66,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
     disconnectAllFromDS();
   }
 
+  @Test
   public void testSimplePut() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -90,6 +96,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
   }
   
   //this is for unquote fielnames in json string
+  @Test
   public void testSimplePut2() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -112,6 +119,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
      
   }
   
+  @Test
   public void testPdxInstanceAndJSONConversion() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -153,43 +161,43 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
         
         //Testcase-1: Validate json string against the pdxInstance.
         //validation for primitive types
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Int type values are not matched",
+        assertEquals("VerifyPdxInstanceToJson: Int type values are not matched",
             testObject.getP_int(), jsonObject.getInt(testObject.getP_intFN()));
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: long type values are not matched",
+        assertEquals("VerifyPdxInstanceToJson: long type values are not matched",
             testObject.getP_long(), jsonObject.getLong(testObject.getP_longFN()));
         
         //validation for wrapper types
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Boolean type values are not matched",
+        assertEquals("VerifyPdxInstanceToJson: Boolean type values are not matched",
             testObject.getW_bool().booleanValue(), jsonObject.getBoolean(testObject.getW_boolFN()));
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Float type values are not matched",
-            testObject.getW_double().doubleValue(), jsonObject.getDouble(testObject.getW_doubleFN()));
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: bigDec type values are not matched",
+        assertEquals("VerifyPdxInstanceToJson: Float type values are not matched",
+            testObject.getW_double().doubleValue(), jsonObject.getDouble(testObject.getW_doubleFN()), 0);
+        assertEquals("VerifyPdxInstanceToJson: bigDec type values are not matched",
             testObject.getW_bigDec().longValue(), jsonObject.getLong(testObject.getW_bigDecFN()));
         
         //vlidation for array types
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Byte[] type values are not matched",
+        assertEquals("VerifyPdxInstanceToJson: Byte[] type values are not matched",
             (int)testObject.getW_byteArray()[1], jsonObject.getJSONArray(testObject.getW_byteArrayFN()).getInt(1));
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Double[] type values are not matched",
-            testObject.getW_doubleArray()[0], jsonObject.getJSONArray(testObject.getW_doubleArrayFN()).getDouble(0));
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: String[] type values are not matched",
+        assertEquals("VerifyPdxInstanceToJson: Double[] type values are not matched",
+            testObject.getW_doubleArray()[0], jsonObject.getJSONArray(testObject.getW_doubleArrayFN()).getDouble(0), 0);
+        assertEquals("VerifyPdxInstanceToJson: String[] type values are not matched",
             testObject.getW_strArray()[2], jsonObject.getJSONArray(testObject.getW_strArrayFN()).getString(2));
         
         //validation for collection types
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: list type values are not matched", 
+        assertEquals("VerifyPdxInstanceToJson: list type values are not matched", 
             testObject.getC_list().get(0), 
             jsonObject.getJSONArray(testObject.getC_listFN()).getString(0));
         
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: stack type values are not matched", 
+        assertEquals("VerifyPdxInstanceToJson: stack type values are not matched", 
             testObject.getC_stack().get(2), 
             jsonObject.getJSONArray(testObject.getC_stackFN()).getString(2));
         
         //validation for Map
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Map type values are not matched", 
+        assertEquals("VerifyPdxInstanceToJson: Map type values are not matched", 
             testObject.getM_empByCity().get("Ahmedabad").get(0).getFname(), 
             jsonObject.getJSONObject(testObject.getM_empByCityFN()).getJSONArray("Ahmedabad").getJSONObject(0).getString("fname"));
         
         //validation Enum
-        junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Enum type values are not matched", 
+        assertEquals("VerifyPdxInstanceToJson: Enum type values are not matched", 
             testObject.getDay().toString(), 
             jsonObject.getString(testObject.getDayFN()));       
       } catch (JSONException e) {
@@ -323,11 +331,11 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
     
     String o1 = jsonParse(jd.getJsonString());
     String o2 = jsonParse(getJsonString);
-    junit.framework.Assert.assertEquals("Json Strings are not equal " + jd.getFileName() + " " +  Boolean.getBoolean("pdxToJson.unqouteFieldNames"), o1, o2);
+    assertEquals("Json Strings are not equal " + jd.getFileName() + " " +  Boolean.getBoolean("pdxToJson.unqouteFieldNames"), o1, o2);
   
     PdxInstance pdx2 = JSONFormatter.fromJSON(getJsonString);
     
-    junit.framework.Assert.assertEquals("Pdx are not equal; json filename " + jd.getFileName(), pdx, pdx2);    
+    assertEquals("Pdx are not equal; json filename " + jd.getFileName(), pdx, pdx2);    
   }  
   
   protected final static int INT_TAB = '\t';
@@ -367,13 +375,12 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
     byte[] o1 = jsonParse(jd.getJsonByteArray());
     byte[] o2 = jsonParse(jsonByteArray);
     
-   // junit.framework.Assert.assertIndexDetailsEquals("Pdx byte aray are not equal after fetching from cache " + jd.getFileName(), o1, o2);
    compareByteArray(o1, o2);
     
     PdxInstance pdx2 = JSONFormatter.fromJSON(jsonByteArray);
     boolean pdxequals = pdx.equals(pdx2);
     
-    junit.framework.Assert.assertEquals("Pdx are not equal for byte array ; json filename " + jd.getFileName(), pdx, pdx2 );    
+    assertEquals("Pdx are not equal for byte array ; json filename " + jd.getFileName(), pdx, pdx2 );    
   }  
   public void compareByteArray(byte[] b1, byte[] b2) {
     if(b1.length != b2.length) 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PDXAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PDXAsyncEventQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PDXAsyncEventQueueDUnitTest.java
index a4b81cb..6854361 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PDXAsyncEventQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PDXAsyncEventQueueDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.pdx;
 
+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.List;
 import java.util.Properties;
 
@@ -37,10 +46,11 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class PDXAsyncEventQueueDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PDXAsyncEventQueueDUnitTest extends JUnit4CacheTestCase {
 
-  public PDXAsyncEventQueueDUnitTest(String name) {
-    super(name);
+  public PDXAsyncEventQueueDUnitTest() {
+    super();
   }
   
   /**
@@ -48,6 +58,7 @@ public class PDXAsyncEventQueueDUnitTest extends CacheTestCase {
    * type registry.
    */
   
+  @Test
   public void testNonPersistentPDXCreateQueueFirst() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -61,6 +72,7 @@ public class PDXAsyncEventQueueDUnitTest extends CacheTestCase {
    * Test that an async queue doesn't require a persistent PDX
    * type registry.
    */
+  @Test
   public void testNonPersistentPDXCreatePDXFirst() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
index d029557..309cbdc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
@@ -16,35 +16,53 @@
  */
 package com.gemstone.gemfire.pdx;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.HeapDataOutputStream;
 import com.gemstone.gemfire.internal.PdxSerializerObject;
 import com.gemstone.gemfire.internal.Version;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- *
- */
-public class PdxClientServerDUnitTest extends CacheTestCase {
-
-  public PdxClientServerDUnitTest(String name) {
-    super(name);
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class PdxClientServerDUnitTest extends JUnit4CacheTestCase {
+
+  public PdxClientServerDUnitTest() {
+    super();
   }
 
+  @Test
   public void testSimplePut() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -83,6 +101,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
    * registry if the server is restarted and PDX serialization
    * for a class has changed.  This was reported in Pivotal bug #47338
    */
+  @Test
   public void testNonPersistentServerRestart() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -168,6 +187,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
    * Test of bug 47338 - what happens to the client type
    * registry if the server is restarted.
    */
+  @Test
   public void testNonPersistentServerRestartAutoSerializer() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -255,6 +275,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
    * Test that we through an exception if one of the servers has persistent
    * regions but not a persistent registry.
    */
+  @Test
   public void testServersWithPersistence() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -292,6 +313,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testPutThreadLocalConnections() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -326,6 +348,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
 
   }
   
+  @Test
   public void testSimplePdxInstancePut() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -377,6 +400,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
    * in multiple distributed systems.
    * @throws Exception 
    */
+  @Test
   public void testMultipleServerDSes() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -444,6 +468,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
     assertEquals(new SimpleClass(57, (byte) 3), r.get(1));
   }
   
+  @Test
   public void testUserSerializesObject() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -485,6 +510,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
    * Test that we still use the client
    * type registry, even if pool is created late.
    */
+  @Test
   public void testLatePoolCreation() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -537,6 +563,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
    * tries to create a pool after we were forced to use a peer
    * type registry.
    */
+  @Test
   public void testExceptionWithPoolAfterTypeRegistryCreation() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
index fde1a27..380dfe0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.pdx;
 
+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.IOException;
 
 import com.gemstone.gemfire.SerializationException;
@@ -54,16 +63,18 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  *
  */
-public class PdxDeserializationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PdxDeserializationDUnitTest extends JUnit4CacheTestCase {
 
-  public PdxDeserializationDUnitTest(String name) {
-    super(name);
+  public PdxDeserializationDUnitTest() {
+    super();
   }
   
   /**
    * Test that we don't deserialize objects on a remote peer
    * when performing operations. 
    */
+  @Test
   public void testP2P() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -77,6 +88,7 @@ public class PdxDeserializationDUnitTest extends CacheTestCase {
    * Test to make sure we don't deserialize
    * objects on a server that is a datastore 
    */
+  @Test
   public void testClientToDataStore() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(1);
@@ -89,6 +101,7 @@ public class PdxDeserializationDUnitTest extends CacheTestCase {
    * Test to make sure we don't deserialize
    * objects on a server that is an accessor.
    */
+  @Test
   public void testClientToAccessor() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(1);
@@ -101,6 +114,7 @@ public class PdxDeserializationDUnitTest extends CacheTestCase {
    * Test to make sure we don't deserialize
    * objects on a client that has registered interest.
    */
+  @Test
   public void testAccessorToClient() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
index 3621016..ca407b7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.pdx;
 
+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.List;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -39,12 +48,14 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class PdxSerializableDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PdxSerializableDUnitTest extends JUnit4CacheTestCase {
 
-  public PdxSerializableDUnitTest(String name) {
-    super(name);
+  public PdxSerializableDUnitTest() {
+    super();
   }
   
+  @Test
   public void testSimplePut() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -93,6 +104,7 @@ public class PdxSerializableDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTransactionCallbacksNotInvoked() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -135,6 +147,7 @@ public class PdxSerializableDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testPersistenceDefaultDiskStore() throws Throwable {
     
     SerializableCallable createRegion = new SerializableCallable() {
@@ -154,6 +167,7 @@ public class PdxSerializableDUnitTest extends CacheTestCase {
     persistenceTest(createRegion);
   }
   
+  @Test
   public void testPersistenceExplicitDiskStore() throws Throwable {
     SerializableCallable createRegion = new SerializableCallable() {
       public Object call() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableJUnitTest.java
index 418a819..f38a2eb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableJUnitTest.java
@@ -16,37 +16,60 @@
  */
 package com.gemstone.gemfire.pdx;
 
-import com.gemstone.gemfire.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+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.CopyHelper;
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.DeltaTestImpl;
+import com.gemstone.gemfire.ToDataException;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.DiskStoreFactory;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
-import com.gemstone.gemfire.internal.*;
+import com.gemstone.gemfire.internal.DSCODE;
+import com.gemstone.gemfire.internal.FileUtil;
+import com.gemstone.gemfire.internal.HeapDataOutputStream;
+import com.gemstone.gemfire.internal.PdxSerializerObject;
+import com.gemstone.gemfire.internal.SystemAdmin;
+import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.tcp.ByteBufferInputStream.ByteSourceFactory;
 import com.gemstone.gemfire.internal.util.ArrayUtils;
-import com.gemstone.gemfire.pdx.internal.*;
+import com.gemstone.gemfire.pdx.internal.DataSize;
+import com.gemstone.gemfire.pdx.internal.PdxReaderImpl;
+import com.gemstone.gemfire.pdx.internal.PdxType;
+import com.gemstone.gemfire.pdx.internal.PdxWriterImpl;
+import com.gemstone.gemfire.pdx.internal.TypeRegistry;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.*;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
 
 @Category(IntegrationTest.class)
 public class PdxSerializableJUnitTest {
   
-  public PdxSerializableJUnitTest() {
-    super();
-  }
-
   private GemFireCacheImpl c;
 
   @Before

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxStringJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxStringJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxStringJUnitTest.java
index f8b3806..a2d3204 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxStringJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxStringJUnitTest.java
@@ -16,28 +16,29 @@
  */
 package com.gemstone.gemfire.pdx;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.pdx.internal.PdxInstanceFactoryImpl;
-import com.gemstone.gemfire.pdx.internal.PdxInstanceImpl;
-import com.gemstone.gemfire.pdx.internal.PdxString;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
 import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.pdx.internal.PdxInstanceFactoryImpl;
+import com.gemstone.gemfire.pdx.internal.PdxInstanceImpl;
+import com.gemstone.gemfire.pdx.internal.PdxString;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
 public class PdxStringJUnitTest {
+
   private GemFireCacheImpl c;
 
   @Before

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
index 58f2128..48a6511 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.pdx;
 
+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.Collection;
 
 import com.examples.snapshot.MyObjectPdx;
@@ -39,12 +48,14 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 
-public class PdxTypeExportDUnitTest extends CacheTestCase {
-  public PdxTypeExportDUnitTest(String name) {
-    super(name);
+@Category(DistributedTest.class)
+public class PdxTypeExportDUnitTest extends JUnit4CacheTestCase {
+  public PdxTypeExportDUnitTest() {
+    super();
   }
 
   
+  @Test
   public void testPeer() throws Exception {
     Region r = getCache().getRegion("pdxtest");
     r.get(1);
@@ -57,6 +68,7 @@ public class PdxTypeExportDUnitTest extends CacheTestCase {
     assertEquals(MyEnumPdx.const1.name(), enums.iterator().next().getEnum().name());
   }
   
+  @Test
   public void testClient() throws Exception {
     SerializableCallable test = new SerializableCallable() {
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/VersionClassLoader.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/VersionClassLoader.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/VersionClassLoader.java
deleted file mode 100644
index f2e6b5a..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/VersionClassLoader.java
+++ /dev/null
@@ -1,98 +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.
- */
-
-/** Class containing pdx tests.
- * 
- */
-package com.gemstone.gemfire.pdx;
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-
-public class VersionClassLoader {
-
-  /** If PdxPrms.initClassLoader is true, then randomly choose a versioned
-   *  class path and create and install a class loader for it on this thread.
-   *  
-   * @return The installed class loader (which includes a versioned class path)
-   *         or null if this call did not install a new class loader.
-   */
-  public static ClassLoader initClassLoader(long classVersion) throws Exception {
-    ClassLoader cl = Thread.currentThread().getContextClassLoader();
-    cl = ClassLoader.getSystemClassLoader();
-    
-    String alternateVersionClassPath =  System.getProperty("JTESTS") +
-    File.separator + ".." + File.separator + ".." + File.separator +
-    "classes" + File.separator + "version" + classVersion;
-    LogWriterUtils.getLogWriter().info("Initializing the class loader :" + alternateVersionClassPath);
-    ClassLoader versionCL = null;
-    try {
-      versionCL = new URLClassLoader(new URL[]{new File(alternateVersionClassPath).toURI().toURL()}, cl);
-      Thread.currentThread().setContextClassLoader(versionCL); 
-    } catch (Exception e) {
-      LogWriterUtils.getLogWriter().info("error", e);
-      throw new Exception("Failed to initialize the class loader. " + e.getMessage());
-    }
-    LogWriterUtils.getLogWriter().info("Setting/adding class loader with " + alternateVersionClassPath);
-    return versionCL;
-  }
-
-
-  /** Use reflection to create a new instance of a versioned class whose
-   *  name is specified by className.
-   *  
-   *  Since versioned classes are compled outside outside the <checkoutDir>/tests 
-   *  directory, code within <checkoutDir>/tests cannot directly reference
-   *  versioned classes, however the versioned class should be available at 
-   *  runtime if the test has installed the correct class loader.
-   *
-   * @param className The name of the versioned class to create. 
-   * @return A new instance of className.
-   */
-  public static Object getVersionedInstance(String className, Object[] args) throws Exception {
-    Object newObj = null;
-    try {
-      Class aClass = Class.forName(className, true, Thread.currentThread().getContextClassLoader());
-      if (args != null && args.length > 0) {
-        if (className.endsWith("PdxTestObject")){
-          Constructor constructor = aClass.getConstructor(int.class, String.class);
-          newObj = constructor.newInstance(((Integer)args[0]).intValue(), args[1]);          
-        } else if (className.endsWith("PortfolioPdxVersion1")) {
-          Constructor constructor = aClass.getConstructor(int.class, int.class);
-          newObj = constructor.newInstance(((Integer)args[0]).intValue(), ((Integer)args[1]).intValue());
-        } else if (className.endsWith("PdxVersionedNewPortfolio")) {
-          Constructor constructor = aClass.getConstructor(String.class, int.class);
-          newObj = constructor.newInstance(((String)args[0]), ((Integer)args[1]).intValue());
-        } else if (className.endsWith("PdxVersionedFieldType")) {
-          Constructor constructor = aClass.getConstructor( int.class);
-          newObj = constructor.newInstance(((Integer)args[0]).intValue());
-        } 
-      } else {
-        Constructor constructor = aClass.getConstructor();
-        newObj = constructor.newInstance();
-      }
-    } catch (Exception e) {
-      LogWriterUtils.getLogWriter().info("error", e);
-      throw new Exception("Failed to get the class instance. ClassName: " + className + "  error: ", e);
-    }
-    return newObj;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
index f4a7308..a55b687 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
@@ -16,20 +16,32 @@
  */
 package com.gemstone.gemfire.redis;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Random;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import redis.clients.jedis.Jedis;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystemConfigProperties;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-import redis.clients.jedis.Jedis;
 
-import java.util.Random;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class RedisDistDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class RedisDistDUnitTest extends JUnit4DistributedTestCase {
 
   public static final String TEST_KEY = "key";
   public static int pushes = 200;
@@ -43,26 +55,25 @@ public class RedisDistDUnitTest extends DistributedTestCase {
   private int server1Port;
   private int server2Port;
   
-  private String localHost = SocketCreator.getLocalHost().getHostName();
+  private String localHost;
   
   private static final int JEDIS_TIMEOUT = 20 * 1000;
 
   private abstract class ClientTestBase extends SerializableCallable {
 
     int port;
+
     protected ClientTestBase (int port) {
       this.port = port;
     }
-
-  }
-
-  public RedisDistDUnitTest() throws Throwable {
-    super("RedisDistTest");  
   }
 
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
+
+    localHost = SocketCreator.getLocalHost().getHostName();
+
     host = Host.getHost(0);
     server1 = host.getVM(0);
     server2 = host.getVM(1);
@@ -72,8 +83,6 @@ public class RedisDistDUnitTest extends DistributedTestCase {
     final int locatorPort = DistributedTestUtils.getDUnitLocatorPort();
     final SerializableCallable<Object> startRedisAdapter = new SerializableCallable<Object>() {
 
-      private static final long serialVersionUID = 1978017907725504294L;
-
       @Override
       public Object call() throws Exception {
         int port = ports[VM.getCurrentVMNum()];
@@ -90,11 +99,7 @@ public class RedisDistDUnitTest extends DistributedTestCase {
     };
     AsyncInvocation i = server1.invokeAsync(startRedisAdapter);
     server2Port = (Integer) server2.invoke(startRedisAdapter);
-    try {
-      server1Port = (Integer) i.getResult();
-    } catch (Throwable e) {
-      throw new Exception(e);
-    }
+    server1Port = (Integer) i.getResult();
   }
 
   @Override
@@ -103,7 +108,8 @@ public class RedisDistDUnitTest extends DistributedTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-1092: random ports, failure stack involves TCPTransport ConnectionHandler (are we eating BindExceptions somewhere?), uses Random, async actions
-  public void testConcListOps() throws Throwable {
+  @Test
+  public void testConcListOps() throws Exception {
     final Jedis jedis1 = new Jedis(localHost, server1Port, JEDIS_TIMEOUT);
     final Jedis jedis2 = new Jedis(localHost, server2Port, JEDIS_TIMEOUT);
     final int pushes = 20;
@@ -138,7 +144,8 @@ public class RedisDistDUnitTest extends DistributedTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-717: random ports, BindException in failure stack, async actions
-  public void testConcCreateDestroy() throws Throwable {
+  @Test
+  public void testConcCreateDestroy() throws Exception {
     IgnoredException.addIgnoredException("RegionDestroyedException");
     IgnoredException.addIgnoredException("IndexInvalidException");
     final int ops = 40;
@@ -196,9 +203,9 @@ public class RedisDistDUnitTest extends DistributedTestCase {
 
   /**
    * Just make sure there are no unexpected server crashes
-   * @throws Throwable 
    */
-  public void testConcOps() throws Throwable {
+  @Test
+  public void testConcOps() throws Exception {
 
     final int ops = 100;
     final String hKey = TEST_KEY+"hash";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
index 56dbd14..b5a088b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
@@ -18,12 +18,44 @@
  */
 package com.gemstone.gemfire.security;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.internal.AvailablePort.*;
+import static com.gemstone.gemfire.security.SecurityTestUtils.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.Host.*;
+import static com.gemstone.gemfire.test.dunit.Wait.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.Callable;
+
+import com.gemstone.gemfire.cache.DynamicRegionFactory;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
-import com.gemstone.gemfire.cache.query.*;
-import com.gemstone.gemfire.internal.AvailablePort.Keeper;
+import com.gemstone.gemfire.cache.query.CqAttributes;
+import com.gemstone.gemfire.cache.query.CqAttributesFactory;
+import com.gemstone.gemfire.cache.query.CqEvent;
+import com.gemstone.gemfire.cache.query.CqException;
+import com.gemstone.gemfire.cache.query.CqListener;
+import com.gemstone.gemfire.cache.query.CqQuery;
+import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.Struct;
+import com.gemstone.gemfire.internal.AvailablePort.*;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.AbstractRegionEntry;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
@@ -36,17 +68,6 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 
-import java.util.*;
-import java.util.concurrent.Callable;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static com.gemstone.gemfire.internal.AvailablePort.SOCKET;
-import static com.gemstone.gemfire.internal.AvailablePort.getRandomAvailablePort;
-import static com.gemstone.gemfire.security.SecurityTestUtils.*;
-import static com.gemstone.gemfire.test.dunit.Assert.*;
-import static com.gemstone.gemfire.test.dunit.Host.getHost;
-import static com.gemstone.gemfire.test.dunit.Wait.waitForCriterion;
-
 /**
  * Base class for tests for authorization from client to server. It contains
  * utility functions for the authorization tests from client to server.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
index fd572ba..ff8d23d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
@@ -18,7 +18,6 @@
  */
 package com.gemstone.gemfire.security;
 
-import static com.gemstone.gemfire.internal.AvailablePort.*;
 import static com.gemstone.gemfire.security.SecurityTestUtils.*;
 import static com.gemstone.gemfire.test.dunit.Assert.*;
 import static com.gemstone.gemfire.test.dunit.IgnoredException.*;
@@ -30,12 +29,12 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
-import com.gemstone.gemfire.internal.AvailablePortHelper;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.DeltaTestImpl;
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionLocalMaxMemoryDUnitTest;
 import com.gemstone.gemfire.security.generator.AuthzCredentialGenerator;
 import com.gemstone.gemfire.security.generator.CredentialGenerator;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtils.java b/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtils.java
index 71a0e55..c5bfa4c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtils.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtils.java
@@ -18,8 +18,54 @@
  */
 package com.gemstone.gemfire.security;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.*;
+import static com.gemstone.gemfire.cache30.ClientServerTestCase.*;
+import static com.gemstone.gemfire.distributed.internal.DistributionConfig.*;
+import static com.gemstone.gemfire.internal.AvailablePort.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.*;
+import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
+import static com.gemstone.gemfire.test.dunit.NetworkUtils.*;
+import static com.gemstone.gemfire.test.dunit.Wait.*;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import javax.net.ServerSocketFactory;
+import javax.net.SocketFactory;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLContextSpi;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DynamicRegionFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.NoAvailableServersException;
+import com.gemstone.gemfire.cache.client.Pool;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache.client.ServerConnectivityException;
+import com.gemstone.gemfire.cache.client.ServerOperationException;
+import com.gemstone.gemfire.cache.client.ServerRefusedConnectionException;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.ProxyCache;
 import com.gemstone.gemfire.cache.execute.Execution;
@@ -36,32 +82,9 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.pdx.PdxReader;
 import com.gemstone.gemfire.pdx.PdxSerializable;
 import com.gemstone.gemfire.pdx.PdxWriter;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 
-import javax.net.ServerSocketFactory;
-import javax.net.SocketFactory;
-import javax.net.ssl.*;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.*;
-import java.util.concurrent.Callable;
-
-import static com.gemstone.gemfire.cache30.ClientServerTestCase.configureConnectionPoolWithNameAndFactory;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static com.gemstone.gemfire.internal.AvailablePort.SOCKET;
-import static com.gemstone.gemfire.internal.AvailablePort.getRandomAvailablePort;
-import static com.gemstone.gemfire.test.dunit.Assert.*;
-import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.getDUnitLocatorPort;
-import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter;
-import static com.gemstone.gemfire.test.dunit.NetworkUtils.getIPLiteral;
-import static com.gemstone.gemfire.test.dunit.Wait.waitForCriterion;
-
 /**
  * Contains utility methods for setting up servers/clients for authentication
  * and authorization tests.
@@ -70,7 +93,7 @@ import static com.gemstone.gemfire.test.dunit.Wait.waitForCriterion;
  */
 public final class SecurityTestUtils {
 
-  private final JUnit4DistributedTestCase distributedTestCase = new JUnit4DistributedTestCase() {}; // TODO: delete
+  private final JUnit4DistributedTestCase distributedTestCase = new JUnit4DistributedTestCase() {};
 
   protected static final int NO_EXCEPTION = 0;
   protected static final int AUTHREQ_EXCEPTION = 1;
@@ -818,7 +841,7 @@ public final class SecurityTestUtils {
       cache = null;
     }
 
-    DistributedTestCase.disconnectFromDS();
+    disconnectFromDS();
   }
 
   protected static void closeCache(final Boolean keepAlive) {
@@ -831,7 +854,7 @@ public final class SecurityTestUtils {
       cache = null;
     }
 
-    DistributedTestCase.disconnectFromDS();
+    disconnectFromDS();
   }
 
   // ------------------------- private static methods -------------------------

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
index b7d33b0..466b379 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
@@ -18,7 +18,7 @@ package com.gemstone.gemfire.test.dunit;
 
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
@@ -26,12 +26,5 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  */
 @Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public abstract class DistributedTestCase extends JUnit3DistributedTestCase {
-  
-  /**
-   * Creates a new {@code DistributedTestCase} test with the given name.
-   */
-  public DistributedTestCase(final String name) {
-    super(name);
-  }
+public abstract class DistributedTestCase extends JUnit4DistributedTestCase {
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/VM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/VM.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/VM.java
index 8391ffa..7abfc4f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/VM.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/VM.java
@@ -322,9 +322,9 @@ public class VM implements Serializable {
   
   /**
    * Invokes the {@code run} method of a {@link Runnable} in this {@code VM}.
-   * If the invocation throws AssertionFailedError, and repeatTimeoutMs
+   * If the invocation throws AssertionError, and repeatTimeoutMs
    * is >0, the {@code run} method is invoked repeatedly until it
-   * either succeeds, or repeatTimeoutMs has passed.  The AssertionFailedError
+   * either succeeds, or repeatTimeoutMs has passed.  The AssertionError
    * is thrown back to the sender of this method if {@code run} has not
    * completed successfully before repeatTimeoutMs has passed.
    * 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
index ce32320..868d59f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
@@ -39,7 +39,7 @@ import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
  */
 public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase implements CacheTestFixture {
 
-  private final JUnit4CacheTestCase delegate = new JUnit4CacheTestCase(this);
+  private final JUnit4CacheTestCase delegate = new JUnit4CacheTestCase(this){};
 
   public JUnit3CacheTestCase(final String name) {
     super(name);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
index bc74ec1..db5be9c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -16,7 +16,27 @@
  */
 package com.gemstone.gemfire.test.dunit.cache.internal;
 
-import com.gemstone.gemfire.cache.*;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.logging.log4j.Logger;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionExistsException;
+import com.gemstone.gemfire.cache.TimeoutException;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -30,17 +50,14 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
 import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Properties;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
@@ -50,7 +67,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * TODO: make this class abstract when JUnit3CacheTestCase is deleted
  */
-public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements CacheTestFixture {
+public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements CacheTestFixture {
 
   private static final Logger logger = LogService.getLogger();
 
@@ -66,7 +83,7 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements Ca
   private final CacheTestFixture cacheTestFixture;
 
   public JUnit4CacheTestCase() {
-    this((CacheTestFixture)null);
+    this(null);
   }
 
   JUnit4CacheTestCase(final CacheTestFixture cacheTestFixture) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
index 705fa4e..cdabd42 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
@@ -324,6 +324,7 @@ public abstract class JUnit4DistributedTestCase implements DistributedTestFixtur
    * name of the class as well as the name of the method.
    */
   public final String getUniqueName() {
+    assertNotNull(getName());
     return getTestClass().getSimpleName() + "_" + getName();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
index a5663e5..f858d8e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
@@ -16,22 +16,23 @@
  */
 package com.gemstone.gemfire.test.dunit.tests;
 
-import static com.gemstone.gemfire.test.dunit.Assert.*;
 import static com.gemstone.gemfire.test.dunit.Invoke.*;
 import static com.googlecode.catchexception.CatchException.*;
 import static com.googlecode.catchexception.throwable.CatchThrowable.*;
 import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.dunit.DUnitEnv;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
@@ -39,7 +40,8 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  * test framework.
  */
 @SuppressWarnings("unused")
-public class BasicDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class BasicDUnitTest extends JUnit4DistributedTestCase {
 
   private static final String MESSAGE_FOR_remoteThrowException = "Test exception.  Please ignore.";
 
@@ -48,8 +50,8 @@ public class BasicDUnitTest extends DistributedTestCase {
   private VM vm0;
   private VM vm1;
 
-  public BasicDUnitTest(String name) {
-    super(name);
+  public BasicDUnitTest() {
+    super();
   }
 
   @Override
@@ -66,41 +68,51 @@ public class BasicDUnitTest extends DistributedTestCase {
     invokeInEveryVM(() -> bindings = null);
   }
 
+  @Test
   public void testPreconditions() throws Exception {
     invokeInEveryVM(() -> assertThat("getUniqueName() must not return null", getUniqueName(), notNullValue()));
     invokeInEveryVM(() -> assertThat("bindings must not be null", bindings, notNullValue()));
   }
 
+  @Test
   public void testInvokeOnClassTargetWithEmptyArgs() throws Exception {
     assertThat(this.vm0.invoke(BasicDUnitTest.class, "booleanValue", new Object[] {}), is(true));
   }
+  @Test
   public void testInvokeOnObjectTargetWithEmptyArgs() throws Exception {
-    assertThat(this.vm0.invoke(new BasicDUnitTest(""), "booleanValue", new Object[] {}), is(true));
+    assertThat(this.vm0.invoke(new BasicDUnitTest(), "booleanValue", new Object[] {}), is(true));
   }
+  @Test
   public void testInvokeAsyncOnClassTargetWithEmptyArgs() throws Exception {
     AsyncInvocation<?> async = this.vm0.invokeAsync(BasicDUnitTest.class, "booleanValue", new Object[] {}).join();
     assertThat(async.getResult(), is(true));
   }
+  @Test
   public void testInvokeAsyncOnObjectTargetWithEmptyArgs() throws Exception {
-    AsyncInvocation<?> async = this.vm0.invokeAsync(new BasicDUnitTest(""), "booleanValue", new Object[] {}).join();
+    AsyncInvocation<?> async = this.vm0.invokeAsync(new BasicDUnitTest(), "booleanValue", new Object[] {}).join();
     assertThat(async.getResult(), is(true));
   }
 
+  @Test
   public void testInvokeOnClassTargetWithNullArgs() throws Exception {
     assertThat(this.vm0.invoke(BasicDUnitTest.class, "booleanValue", null), is(true));
   }
+  @Test
   public void testInvokeOnObjectTargetWithNullArgs() throws Exception {
-    assertThat(this.vm0.invoke(new BasicDUnitTest(""), "booleanValue", null), is(true));
+    assertThat(this.vm0.invoke(new BasicDUnitTest(), "booleanValue", null), is(true));
   }
+  @Test
   public void testInvokeAsyncOnClassTargetWithNullArgs() throws Exception {
     AsyncInvocation<?> async = this.vm0.invokeAsync(BasicDUnitTest.class, "booleanValue", null).join();
     assertThat(async.getResult(), is(true));
   }
+  @Test
   public void testInvokeAsyncOnObjectTargetWithNullArgs() throws Exception {
-    AsyncInvocation<?> async = this.vm0.invokeAsync(new BasicDUnitTest(""), "booleanValue", null).join();
+    AsyncInvocation<?> async = this.vm0.invokeAsync(new BasicDUnitTest(), "booleanValue", null).join();
     assertThat(async.getResult(), is(true));
   }
 
+  @Test
   public void testRemoteInvocationWithException() throws Exception {
     catchException(this.vm0).invoke(() -> remoteThrowException());
 
@@ -110,24 +122,29 @@ public class BasicDUnitTest extends DistributedTestCase {
     assertThat(caughtException().getCause().getMessage(), is(MESSAGE_FOR_remoteThrowException));
   }
 
+  @Test
   public void testInvokeWithLambda() throws Exception {
     assertThat(this.vm0.invoke(() -> DUnitEnv.get().getVMID()), is(0));
     assertThat(this.vm1.invoke(() -> DUnitEnv.get().getVMID()), is(1));
   }
 
+  @Test
   public void testInvokeLambdaAsync() throws Throwable {
     assertThat(this.vm0.invokeAsync(() -> DUnitEnv.get().getVMID()).getResult(), is(0));
   }
 
+  @Test
   public void testInvokeWithNamedLambda() {
     assertThat(this.vm0.invoke("getVMID", () -> DUnitEnv.get().getVMID()), is(0));
     assertThat(this.vm1.invoke("getVMID", () -> DUnitEnv.get().getVMID()), is(1));
   }
 
+  @Test
   public void testInvokeNamedLambdaAsync() throws Throwable {
     assertThat(this.vm0.invokeAsync("getVMID", () -> DUnitEnv.get().getVMID()).getResult(), is(0));
   }
 
+  @Test
   public void testRemoteInvokeAsync() throws Exception {
     String name = getUniqueName();
     String value = "Hello";
@@ -136,6 +153,7 @@ public class BasicDUnitTest extends DistributedTestCase {
     this.vm0.invokeAsync(() -> remoteValidateBind(name, value )).join().checkException();
   }
 
+  @Test
   public void testRemoteInvokeAsyncWithException() throws Exception {
     AsyncInvocation<?> async = this.vm0.invokeAsync(() -> remoteThrowException()).join();
 
@@ -150,6 +168,7 @@ public class BasicDUnitTest extends DistributedTestCase {
     assertThat(caughtThrowable().getCause().getMessage(), is(MESSAGE_FOR_remoteThrowException));
   }
 
+  @Test
   public void testInvokeNamedRunnableLambdaAsync() throws Exception {
     catchThrowable(this.vm0.invokeAsync("throwSomething", () -> throwException()).join()).checkException();
 
@@ -158,6 +177,7 @@ public class BasicDUnitTest extends DistributedTestCase {
     assertThat(caughtThrowable().getCause(), instanceOf(BasicDUnitException.class));
   }
 
+  @Test
   public void testInvokeNamedRunnableLambda() throws Exception {
     catchException(this.vm0).invoke("throwSomething", () -> throwException());
 
@@ -188,7 +208,7 @@ public class BasicDUnitTest extends DistributedTestCase {
     assertNotNull("value must not be null", value);
     assertNotNull("bindings must not be null", bindings);
 
-    new BasicDUnitTest("").getSystem(); // forces connection
+    new BasicDUnitTest().getSystem(); // forces connection
     bindings.setProperty(name, value);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
index c4f6160..d0ced0a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
@@ -18,30 +18,31 @@ package com.gemstone.gemfire.test.dunit.tests;
 
 import static org.assertj.core.api.Assertions.*;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class GetDefaultDiskStoreNameDUnitTest extends DistributedTestCase {
-
-  public GetDefaultDiskStoreNameDUnitTest(final String name) {
-    super(name);
-  }
+public class GetDefaultDiskStoreNameDUnitTest extends JUnit4DistributedTestCase {
 
+  @Test
   public void testGetTestMethodName() {
     String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodName");
     assertGetDefaultDiskStoreName(expected);
   }
 
+  @Test
   public void testGetTestMethodNameChanges() {
     String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameChanges");
     assertGetDefaultDiskStoreName(expected);
   }
 
+  @Test
   public void testGetTestMethodNameInAllVMs() {
     String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameInAllVMs");
     assertGetDefaultDiskStoreName(expected);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
index 2e9b1fd..22fe213 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
@@ -18,27 +18,28 @@ package com.gemstone.gemfire.test.dunit.tests;
 
 import static org.assertj.core.api.Assertions.*;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class GetTestMethodNameDUnitTest extends DistributedTestCase {
-
-  public GetTestMethodNameDUnitTest(final String name) {
-    super(name);
-  }
+public class GetTestMethodNameDUnitTest extends JUnit4DistributedTestCase {
 
+  @Test
   public void testGetTestMethodName() {
     assertGetTestMethodName("testGetTestMethodName");
   }
 
+  @Test
   public void testGetTestMethodNameChanges() {
     assertGetTestMethodName("testGetTestMethodNameChanges");
   }
 
+  @Test
   public void testGetTestMethodNameInAllVMs() {
     assertGetTestMethodName("testGetTestMethodNameInAllVMs");
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
index 2bd1f75..0a4b5d7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
@@ -16,22 +16,24 @@
  */
 package com.gemstone.gemfire.test.dunit.tests;
 
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static com.gemstone.gemfire.test.dunit.Invoke.invokeInEveryVM;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Verifies that overriding {@code getDistributedSystemProperties} results
  * in {@code disconnectAllFromDS} during tear down.
  */
-public class OverridingGetPropertiesDisconnectsAllDUnitTest extends DistributedTestCase {
-
-  public OverridingGetPropertiesDisconnectsAllDUnitTest(final String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class OverridingGetPropertiesDisconnectsAllDUnitTest extends JUnit4DistributedTestCase {
 
   @Override
   public final void preTearDownAssertions() throws Exception {
@@ -50,6 +52,7 @@ public class OverridingGetPropertiesDisconnectsAllDUnitTest extends DistributedT
     return props;
   }
 
+  @Test
   public void testDisconnects() throws Exception {
     invokeInEveryVM(() -> assertFalse(getDistributedSystemProperties().isEmpty()));
     invokeInEveryVM(() -> assertNotNull(getSystem()));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
index c0275d2..50f2877 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
@@ -16,20 +16,27 @@
  */
 package com.gemstone.gemfire.test.dunit.tests;
 
+import static org.junit.Assert.*;
+
 import java.io.Serializable;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the functionality of the {@link VM} class.
  */
-public class VMDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class VMDUnitTest extends JUnit4DistributedTestCase {
 
   private static final AtomicInteger COUNTER = new AtomicInteger();
   private static final boolean BOOLEAN_VALUE = true;
@@ -37,34 +44,39 @@ public class VMDUnitTest extends DistributedTestCase {
   private static final long LONG_VALUE = 42L;
   private static final String STRING_VALUE = "BLAH BLAH BLAH";
 
-  public VMDUnitTest(String name) {
-    super(name);
+  public VMDUnitTest() {
+    super();
   }
 
+  @Test
   public void testInvokeStaticBoolean() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
     assertEquals(BOOLEAN_VALUE, (boolean) vm.invoke(() -> remoteBooleanMethod()));
   }
 
+  @Test
   public void testInvokeStaticByte() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
     assertEquals(BYTE_VALUE, (byte) vm.invoke(() -> remoteByteMethod()));
   }
 
+  @Test
   public void testInvokeStaticLong() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
     assertEquals(LONG_VALUE, (long) vm.invoke(() -> remoteLongMethod()));
   }
 
+  @Test
   public void testInvokeInstance() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
     assertEquals(STRING_VALUE, vm.invoke(new ClassWithString(), "getString"));
   }
 
+  @Test
   public void testInvokeRunnableWithException() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
@@ -76,6 +88,7 @@ public class VMDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testReturnValue() throws Exception {
     final Host host = Host.getHost(0);
     final VM vm = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromEndOfOutputJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromEndOfOutputJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromEndOfOutputJUnitTest.java
index f645213..1fb3ff5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromEndOfOutputJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromEndOfOutputJUnitTest.java
@@ -27,7 +27,6 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 /**
  * Verifies that test output missing an expected line (at the end of
  * the golden file) will fail with that line as the failure message.
- * 
  */
 @Category(IntegrationTest.class)
 public class FailWithLineMissingFromEndOfOutputJUnitTest extends FailOutputTestCase {
@@ -63,7 +62,7 @@ public class FailWithLineMissingFromEndOfOutputJUnitTest extends FailOutputTestC
       assertOutputMatchesGoldenFile(process.getOutput(), goldenString);
       fail("assertOutputMatchesGoldenFile should have failed due to " + problem());
     } catch (AssertionError expected) {
-      assertTrue("AssertionFailedError message should contain \"" + problem() + "\"", 
+      assertTrue("AssertionError message should contain \"" + problem() + "\"",
           expected.getMessage().contains(problem()));
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromMiddleOfOutputJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromMiddleOfOutputJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromMiddleOfOutputJUnitTest.java
index 4b7897f..b92e6ec 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromMiddleOfOutputJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/golden/FailWithLineMissingFromMiddleOfOutputJUnitTest.java
@@ -27,7 +27,6 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 /**
  * Verifies that test output missing an expected line (at the middle 
  * of the golden file) will fail with that line as the failure message.
- * 
  */
 @Category(IntegrationTest.class)
 public class FailWithLineMissingFromMiddleOfOutputJUnitTest extends FailOutputTestCase {
@@ -62,7 +61,7 @@ public class FailWithLineMissingFromMiddleOfOutputJUnitTest extends FailOutputTe
       assertOutputMatchesGoldenFile(process.getOutput(), goldenString);
       fail("assertOutputMatchesGoldenFile should have failed due to " + problem());
     } catch (AssertionError expected) {
-      assertTrue("AssertionFailedError message should contain \"" + problem() + "\"", 
+      assertTrue("AssertionError message should contain \"" + problem() + "\"",
           expected.getMessage().contains(problem()));
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/util/JSR166TestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/util/JSR166TestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/util/JSR166TestCase.java
index a4d8c1a..8098e9a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/util/JSR166TestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/util/JSR166TestCase.java
@@ -23,13 +23,16 @@
  */
 package com.gemstone.gemfire.util;
 
+import static org.junit.Assert.*;
+
 import java.security.CodeSource;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
 import java.security.ProtectionDomain;
 
-import junit.framework.TestCase;
+import org.junit.After;
+import org.junit.Before;
 
 /**
  * Base class for JSR166 Junit TCK tests.  Defines some constants,
@@ -49,7 +52,7 @@ import junit.framework.TestCase;
  * Only the most typically used JUnit assertion methods are defined
  * this way, but enough to live with.</li>
  *
- * <li> If you override {@link junit.framework.TestCase#setUp} or {@link junit.framework.TestCase#tearDown}, make sure
+ * <li> If you override {@link #setUp} or {@link #tearDown}, make sure
  * to invoke <tt>super.setUp</tt> and <tt>super.tearDown</tt> within
  * them. These methods are used to clear and check for thread
  * assertion failures.</li>
@@ -107,19 +110,15 @@ import junit.framework.TestCase;
  *
  * @version Based on JSR166 TCK version 1.8
  */
-public class JSR166TestCase extends TestCase {
+public class JSR166TestCase { // TODO: reformat
+
     public static long SHORT_DELAY_MS;
     public static long SMALL_DELAY_MS;
     public static long MEDIUM_DELAY_MS;
     public static long LONG_DELAY_MS;
 
-    public static Class<?> MAP_CLASS =
-        com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap.class;
+    public static Class<?> MAP_CLASS = com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap.class;
 
-    public JSR166TestCase(String name) {
-      super(name);
-    } 
-    
     /**
      * Return the shortest timed delay. This could
      * be reimplmented to use for example a Property.
@@ -147,7 +146,8 @@ public class JSR166TestCase extends TestCase {
     /**
      * Initialize test to indicate that no thread assertions have failed
      */
-    protected void setUp() throws Exception { 
+    @Before
+    public void setUp() throws Exception {
         setDelays();
         threadFailed = false;  
     }
@@ -155,7 +155,8 @@ public class JSR166TestCase extends TestCase {
     /**
      * Trigger test case failure if any thread assertions have failed
      */
-    protected void tearDown() throws Exception { 
+    @After
+    public void tearDown() throws Exception {
         assertFalse(threadFailed);  
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/CQJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/CQJUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/CQJUnitTest.java
index ce67542..0cb1c14 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/CQJUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/CQJUnitTest.java
@@ -16,6 +16,16 @@
  */
 package com.gemstone.gemfire.cache.query.cq;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
@@ -26,27 +36,15 @@ import com.gemstone.gemfire.cache.query.QueryInvalidException;
 import com.gemstone.gemfire.cache.query.QueryService;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.TestCase;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 @Category(IntegrationTest.class)
-public class CQJUnitTest extends TestCase {
+public class CQJUnitTest {
+
   private DistributedSystem ds;
   private Cache cache;
   private QueryService qs;
   
-  /////////////////////////////////////
-  // Methods for setUp and tearDown
-  /////////////////////////////////////
-  
-  public CQJUnitTest(String name) {
-    super(name);
-  }
-  
+  @Before
   public void setUp() throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
@@ -55,22 +53,19 @@ public class CQJUnitTest extends TestCase {
     this.cache = CacheFactory.create(ds);
     this.qs = cache.getQueryService();
   }
-  
+
+  @After
   public void tearDown() throws Exception {
     this.cache.close();
     this.ds.disconnect();
   }
 
-  /////////////////////////////////////
-  // Test Methods
-  /////////////////////////////////////
-  
-  
   /**
    * Test to make sure CQs that have invalid syntax
    * throw QueryInvalidException, and CQs that have unsupported
    * CQ features throw UnsupportedOperationException
    */
+  @Test
   public void testValidateCQ() throws Exception {
    
     AttributesFactory attributesFactory = new AttributesFactory();
@@ -132,18 +127,4 @@ public class CQJUnitTest extends TestCase {
     }
   }
   
-  /* would need to make the constructServerSideQuery method package
-   * accessible and move this to the internal package in order
-   * to test that method
-   * 
-  public void testConstructServerSideQuery() throws Exception {
-    // default attributes
-    CqAttributes attrs = new CqAttributesFactory().create();
-    
-    // valid CQ
-    CqQuery cq = this.qs.newCq("SELECT * FROM /region WHERE status = 'active'",
-                              attrs);
-    Query serverSideQuery = ((CqQueryImpl)cq).constructServerSideQuery();
-  }
-  */
 }


[11/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
index 1ede356..84d1978 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
@@ -16,6 +16,25 @@
  */
 package com.gemstone.gemfire.internal.jta;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -23,19 +42,9 @@ import com.gemstone.gemfire.internal.datasource.GemFireBasicDataSource;
 import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import junit.framework.TestCase;
-import org.junit.experimental.categories.Category;
-
-import javax.naming.Context;
-import javax.transaction.*;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 @Category(IntegrationTest.class)
-public class GlobalTransactionJUnitTest extends TestCase {
+public class GlobalTransactionJUnitTest {
 
   private static Properties props = null;
   private static DistributedSystem ds1 = null;
@@ -43,8 +52,8 @@ public class GlobalTransactionJUnitTest extends TestCase {
   private static UserTransaction utx = null;
   private static TransactionManager tm = null;
 
-  @Override
-  protected void setUp() throws Exception {
+  @Before
+  public void setUp() throws Exception {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     String path = TestUtil.getResourcePath(GlobalTransactionJUnitTest.class, "/jta/cachejta.xml");
@@ -55,48 +64,35 @@ public class GlobalTransactionJUnitTest extends TestCase {
     tm = TransactionManagerImpl.getTransactionManager();
   }
 
-  @Override
-  protected void tearDown() throws Exception {
+  @After
+  public void tearDown() throws Exception {
     ds1.disconnect();
   }
 
-  public GlobalTransactionJUnitTest(String name) {
-    super(name);
-  }
-
+  @Test
   public void testGetSimpleDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
-          .lookup("java:/SimpleDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetSimpleDataSource due to " + e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
+        .lookup("java:/SimpleDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
   }
 
-  public void testSetRollbackOnly() {
-    try {
-      utx.begin();
-      utx.setRollbackOnly();
-      Transaction txn = tm.getTransaction();
-      if (txn.getStatus() != Status.STATUS_MARKED_ROLLBACK) {
-        utx.rollback();
-        fail("testSetRollbackonly failed");
-      }
+  @Test
+  public void testSetRollbackOnly() throws Exception {
+    utx.begin();
+    utx.setRollbackOnly();
+    Transaction txn = tm.getTransaction();
+    if (txn.getStatus() != Status.STATUS_MARKED_ROLLBACK) {
       utx.rollback();
+      fail("testSetRollbackonly failed");
     }
-    catch (Exception e) {
-      fail("exception in testSetRollbackonly due to " + e);
-      e.printStackTrace();
-    }
+    utx.rollback();
   }
 
-  public void testEnlistResource() {
+  @Test
+  public void testEnlistResource() throws Exception {
     try {
       boolean exceptionoccured = false;
       utx.begin();
@@ -125,7 +121,8 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
-  public void testRegisterSynchronization() {
+  @Test
+  public void testRegisterSynchronization() throws Exception {
     try {
       boolean exceptionoccured = false;
       utx.begin();
@@ -153,7 +150,8 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
-  public void testEnlistResourceAfterRollBack() {
+  @Test
+  public void testEnlistResourceAfterRollBack() throws Exception {
     try {
       boolean exceptionoccured = false;
       utx.begin();
@@ -183,7 +181,8 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
-  public void testRegisterSynchronizationAfterRollBack() {
+  @Test
+  public void testRegisterSynchronizationAfterRollBack() throws Exception {
     try {
       boolean exceptionoccured = false;
       utx.begin();
@@ -213,34 +212,23 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
-  public void testSuspend() {
-    try {
-      utx.begin();
-//      Transaction txn = tm.getTransaction();
-      tm.suspend();
-      Transaction txn1 = tm.getTransaction();
-      if (txn1 != null)
-        fail("suspend failed to suspend the transaction");
-    }
-    catch (Exception e) {
-      fail("exception in testSuspend due to " + e);
-      e.printStackTrace();
-    }
+  @Test
+  public void testSuspend() throws Exception {
+    utx.begin();
+    tm.suspend();
+    Transaction txn1 = tm.getTransaction();
+    if (txn1 != null)
+      fail("suspend failed to suspend the transaction");
   }
 
-  public void testResume() {
-    try {
-      utx.begin();
-      Transaction txn = tm.getTransaction();
-      Transaction txn1 = tm.suspend();
-      tm.resume(txn1);
-      if (txn != tm.getTransaction())
-        fail("resume failed ");
-      utx.commit();
-    }
-    catch (Exception e) {
-      fail("exception in testSuspend due to " + e);
-      e.printStackTrace();
-    }
+  @Test
+  public void testResume() throws Exception {
+    utx.begin();
+    Transaction txn = tm.getTransaction();
+    Transaction txn1 = tm.suspend();
+    tm.resume(txn1);
+    if (txn != tm.getTransaction())
+      fail("resume failed ");
+    utx.commit();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
index 548b9b1..727e1ea 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
@@ -16,296 +16,263 @@
  */
 package com.gemstone.gemfire.internal.jta;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import com.gemstone.gemfire.util.test.TestUtil;
-import junit.framework.TestCase;
-import org.junit.FixMethodOrder;
-import org.junit.experimental.categories.Category;
-import org.junit.runners.MethodSorters;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import javax.naming.Context;
-import javax.sql.DataSource;
-import javax.transaction.UserTransaction;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.Statement;
 import java.util.Properties;
 import java.util.Random;
+import javax.naming.Context;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.FixMethodOrder;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+import org.junit.runners.MethodSorters;
 
-//import java.sql.SQLException;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+/**
+ * TODO: this test has no assertions or validations of any sort
+ */
 @Category(IntegrationTest.class)
-public class TransactionTimeOutJUnitTest extends TestCase {
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TransactionTimeOutJUnitTest {
 
-  private static Properties props = null;
   private static DistributedSystem ds1 = null;
   private static Cache cache = null;
 
-  protected void setUp() throws Exception {
-    super.setUp();
-    props = new Properties();
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void setUp() throws Exception {
+    Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
+
     int pid = new Random().nextInt();
+
     File tmpFile = File.createTempFile("dunit-cachejta_", ".xml");
     tmpFile.deleteOnExit();
+
     String path = tmpFile.getAbsolutePath();
     String file_as_str = readFile(TestUtil.getResourcePath(TransactionTimeOutJUnitTest.class, "/jta/cachejta.xml"));
     String modified_file_str= file_as_str.replaceAll("newDB", "newDB_" + pid);
+
     FileOutputStream fos = new FileOutputStream(path);
     BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(fos));
     wr.write(modified_file_str);
     wr.flush();
     wr.close();
+
     props.setProperty(CACHE_XML_FILE, path);
-    // props.setProperty(cacheXmlFile,"D:\\projects\\JTA\\cachejta.xml");
+
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
-    cache.getLogger().fine("SWAP:running test:"+getName());
+    cache.getLogger().fine("SWAP:running test:" + testName.getMethodName());
   }
 
-  protected void tearDown() throws Exception {
-    super.tearDown();
+  @After
+  public void tearDown() throws Exception {
     ds1.disconnect();
+    // TODO: null out the statics!
   }
 
-  public TransactionTimeOutJUnitTest(String arg0) {
-    super(arg0);
+  @Test
+  public void test1One() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.begin();
+    Thread.sleep(2000);
+    utx.setTransactionTimeout(2);
+    utx.setTransactionTimeout(200);
+    utx.setTransactionTimeout(3);
+    Thread.sleep(5000);
+    //utx.commit();
   }
 
-  public void test1One() {
-    try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.begin();
-      Thread.sleep(2000);
-      utx.setTransactionTimeout(2);
-      utx.setTransactionTimeout(200);
-      utx.setTransactionTimeout(3);
-      Thread.sleep(5000);
-      //utx.commit();
-    } catch (Exception e) {
-      fail("Exception in TestSetTransactionTimeOut due to " + e);
-    }
+  @Test
+  public void test2SetTransactionTimeOut() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.begin();
+    utx.setTransactionTimeout(2);
+    System.out.println("Going to sleep");
+    Thread.sleep(6000);
+    utx.begin();
+    utx.commit();
   }
 
-  public void test2SetTransactionTimeOut() {
+  @Test
+  public void test3ExceptionOnCommitAfterTimeOut() throws Exception {
+    UserTransaction utx;
+    utx = new UserTransactionImpl();
+    utx.setTransactionTimeout(2);
+    utx.begin();
+    Thread.sleep(4000);
     try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.begin();
-      utx.setTransactionTimeout(2);
-      System.out.println("Going to sleep");
-      Thread.sleep(6000);
-      utx.begin();
       utx.commit();
-    } catch (Exception e) {
-      fail("Exception in TestSetTransactionTimeOut due to " + e);
+      fail("TimeOut did not rollback the transaction");
+    } catch (Exception expected) {
     }
   }
 
-  public void test3ExceptionOnCommitAfterTimeOut() {
+  @Test
+  public void test4MultipleSetTimeOuts() throws Exception {
     UserTransaction utx;
-    boolean exceptionOccured = true;
+    utx = new UserTransactionImpl();
+    utx.setTransactionTimeout(10);
+    utx.begin();
+    utx.setTransactionTimeout(8);
+    utx.setTransactionTimeout(6);
+    utx.setTransactionTimeout(2);
+    Thread.sleep(6000);
     try {
-      utx = new UserTransactionImpl();
-      utx.setTransactionTimeout(2);
-      utx.begin();
-      Thread.sleep(4000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = false;
-      }
-      if (exceptionOccured) {
-        fail("TimeOut did not rollback the transaction");
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      utx.commit();
+      fail("TimeOut did not rollback the transaction");
+    } catch (Exception expected) {
     }
   }
 
-  public void test4MultipleSetTimeOuts() {
-    UserTransaction utx;
-    boolean exceptionOccured = true;
+  @Test
+  public void test5TimeOutBeforeBegin() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.setTransactionTimeout(4);
+    utx.begin();
+    Thread.sleep(6000);
     try {
-      utx = new UserTransactionImpl();
-      utx.setTransactionTimeout(10);
-      utx.begin();
-      utx.setTransactionTimeout(8);
-      utx.setTransactionTimeout(6);
-      utx.setTransactionTimeout(2);
-      Thread.sleep(6000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = false;
-      }
-      if (exceptionOccured) {
-        fail("TimeOut did not rollback the transaction");
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      utx.commit();
+      fail("TimeOut did not rollback the transaction");
+    } catch (Exception expected) {
     }
   }
 
-  public void test5TimeOutBeforeBegin() {
-    boolean exceptionOccured = true;
-    try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.setTransactionTimeout(4);
-      utx.begin();
-      Thread.sleep(6000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = false;
-      }
-      if (exceptionOccured) {
-        fail("TimeOut did not rollback the transaction");
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
-    }
+  @Test
+  public void test6CommitBeforeTimeOut() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.begin();
+    utx.setTransactionTimeout(6);
+    Thread.sleep(2000);
+    utx.commit();
   }
 
-  public void test6CommitBeforeTimeOut() {
-//    boolean exceptionOccured = true;
-    try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.begin();
-      utx.setTransactionTimeout(6);
-      Thread.sleep(2000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        fail("Transaction failed to commit although TimeOut was not exceeded due to "
-            + e);
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+  @Test
+  public void test7Commit() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
+    ds2.getConnection();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) ctx
+        .lookup("java:/UserTransaction");
+    utx.begin();
+    Connection conn = ds.getConnection();
+    String sql = "create table newTable1 (id integer)";
+    Statement sm = conn.createStatement();
+    sm.execute(sql);
+    utx.setTransactionTimeout(30);
+    Thread.sleep(5000);
+    utx.setTransactionTimeout(20);
+    utx.setTransactionTimeout(10);
+    sql = "insert into newTable1  values (1)";
+    sm.execute(sql);
+    utx.commit();
+    sql = "select * from newTable1 where id = 1";
+    ResultSet rs = sm.executeQuery(sql);
+    if (!rs.next()) {
+      fail("Transaction not committed");
     }
+    sql = "drop table newTable1";
+    sm.execute(sql);
+    sm.close();
+    conn.close();
   }
 
-  public void test7Commit() {
+  @Test
+  public void test8CommitAfterTimeOut() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
+    ds2.getConnection();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) ctx
+        .lookup("java:/UserTransaction");
+    utx.begin();
+    Connection conn = ds.getConnection();
+    String sql = "create table newTable2 (id integer)";
+    Statement sm = conn.createStatement();
+    sm.execute(sql);
+    utx.setTransactionTimeout(30);
+    sql = "insert into newTable2  values (1)";
+    sm.execute(sql);
+    sql = "select * from newTable2 where id = 1";
+    ResultSet rs = sm.executeQuery(sql);
+    if (!rs.next()) {
+      fail("Transaction not committed");
+    }
+    sql = "drop table newTable2";
+    sm.execute(sql);
+    sm.close();
+    conn.close();
+    utx.setTransactionTimeout(1);
+    Thread.sleep(3000);
     try {
-      Context ctx = cache.getJNDIContext();
-      DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx
-          .lookup("java:/UserTransaction");
-      utx.begin();
-      Connection conn = ds.getConnection();
-      String sql = "create table newTable1 (id integer)";
-      Statement sm = conn.createStatement();
-      sm.execute(sql);
-      utx.setTransactionTimeout(30);
-      Thread.sleep(5000);
-      utx.setTransactionTimeout(20);
-      utx.setTransactionTimeout(10);
-      sql = "insert into newTable1  values (1)";
-      sm.execute(sql);
       utx.commit();
-      sql = "select * from newTable1 where id = 1";
-      ResultSet rs = sm.executeQuery(sql);
-      if (!rs.next()) fail("Transaction not committed");
-      sql = "drop table newTable1";
-      sm.execute(sql);
-      sm.close();
-      conn.close();
-    } catch (Exception e) {
-      fail("Exception occured in test Commit due to " + e);
-      e.printStackTrace();
+      fail("exception did not occur on commit although transaction timed out");
+    } catch (Exception expected) {
     }
   }
 
-  public void test8CommitAfterTimeOut() {
-    try {
-      boolean exceptionOccured = false;
-      Context ctx = cache.getJNDIContext();
-      DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx
-          .lookup("java:/UserTransaction");
-      utx.begin();
-      Connection conn = ds.getConnection();
-      String sql = "create table newTable2 (id integer)";
-      Statement sm = conn.createStatement();
-      sm.execute(sql);
-      utx.setTransactionTimeout(30);
-      sql = "insert into newTable2  values (1)";
-      sm.execute(sql);
-      sql = "select * from newTable2 where id = 1";
-      ResultSet rs = sm.executeQuery(sql);
-      if (!rs.next()) fail("Transaction not committed");
-      sql = "drop table newTable2";
-      sm.execute(sql);
-      sm.close();
-      conn.close();
-      utx.setTransactionTimeout(1);
-      Thread.sleep(3000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = true;
-      }
-      if (!exceptionOccured) {
-        fail("exception did not occur on commit although transaction timed out");
-      }
-    } catch (Exception e) {
-      fail("Exception occured in test Commit due to " + e);
-      e.printStackTrace();
+  @Test
+  public void test9RollbackAfterTimeOut() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
+    Connection conn2 = ds2.getConnection();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) ctx
+        .lookup("java:/UserTransaction");
+    utx.begin();
+    Connection conn = ds.getConnection();
+    String sql = "create table newTable3 (id integer)";
+    Statement sm = conn.createStatement();
+    sm.execute(sql);
+    utx.setTransactionTimeout(30);
+    sql = "insert into newTable3  values (1)";
+    sm.execute(sql);
+    sql = "select * from newTable3 where id = 1";
+    ResultSet rs = sm.executeQuery(sql);
+    if (!rs.next()) {
+      fail("Transaction not committed");
     }
-  }
-
-  public void test9RollbackAfterTimeOut() {
+    sql = "drop table newTable3";
+    sm.execute(sql);
+    sm.close();
+    conn.close();
+    conn2.close();
+    utx.setTransactionTimeout(1);
+    Thread.sleep(3000);
     try {
-      boolean exceptionOccured = false;
-      Context ctx = cache.getJNDIContext();
-      DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      Connection conn2 = ds2.getConnection();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx
-          .lookup("java:/UserTransaction");
-      utx.begin();
-      Connection conn = ds.getConnection();
-      String sql = "create table newTable3 (id integer)";
-      Statement sm = conn.createStatement();
-      sm.execute(sql);
-      utx.setTransactionTimeout(30);
-      sql = "insert into newTable3  values (1)";
-      sm.execute(sql);
-      sql = "select * from newTable3 where id = 1";
-      ResultSet rs = sm.executeQuery(sql);
-      if (!rs.next()) fail("Transaction not committed");
-      sql = "drop table newTable3";
-      sm.execute(sql);
-      sm.close();
-      conn.close();
-      conn2.close();
-      utx.setTransactionTimeout(1);
-      Thread.sleep(3000);
-      try {
-        utx.rollback();
-      } catch (Exception e) {
-        exceptionOccured = true;
-      }
-      if (!exceptionOccured) {
-        fail("exception did not occur on rollback although transaction timed out");
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test Commit due to " + e);
+      utx.rollback();
+      fail("exception did not occur on rollback although transaction timed out");
+    } catch (Exception expected) {
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
index 117f3e3..a7edbd4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
@@ -16,27 +16,38 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.sql.SQLException;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.jta.CacheUtils;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import javax.naming.Context;
-import javax.sql.DataSource;
-import javax.transaction.UserTransaction;
-import java.io.*;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class ExceptionsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class ExceptionsDUnitTest extends JUnit4DistributedTestCase {
 
   static DistributedSystem ds;
   static Cache cache;
@@ -59,8 +70,8 @@ public class ExceptionsDUnitTest extends DistributedTestCase {
     return sb.toString();
   }
 
-  public ExceptionsDUnitTest(String name) {
-    super(name);
+  public ExceptionsDUnitTest() {
+    super();
   }
 
   private static String modifyFile(String str) throws IOException {
@@ -131,7 +142,7 @@ public class ExceptionsDUnitTest extends DistributedTestCase {
     //		  props.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "10339");
     try {
       //			   ds = DistributedSystem.connect(props);
-      ds = (new ExceptionsDUnitTest("temp")).getSystem(props);
+      ds = (new ExceptionsDUnitTest()).getSystem(props);
       cache = CacheFactory.create(ds);
     }
     catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
index ff97dd2..2440f35 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
@@ -16,26 +16,44 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.OSProcess;
-import com.gemstone.gemfire.internal.jta.CacheUtils;
-import com.gemstone.gemfire.test.dunit.*;
-import com.gemstone.gemfire.util.test.TestUtil;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.CACHE_XML_FILE;
+import static org.junit.Assert.*;
 
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.OSProcess;
+import com.gemstone.gemfire.internal.jta.CacheUtils;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-public class IdleTimeOutDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class IdleTimeOutDUnitTest extends JUnit4DistributedTestCase {
 
   static DistributedSystem ds;
   static Cache cache;
@@ -58,8 +76,8 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
     return sb.toString();
   }
 
-  public IdleTimeOutDUnitTest(String name) {
-    super(name);
+  public IdleTimeOutDUnitTest() {
+    super();
   }
 
   private static String modifyFile(String str) throws IOException {
@@ -134,7 +152,7 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
     //	        props.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "10339");
     try {
       //	  	      ds = DistributedSystem.connect(props);
-      ds = (new IdleTimeOutDUnitTest("temp")).getSystem(props);
+      ds = (new IdleTimeOutDUnitTest()).getSystem(props);
       cache = CacheFactory.create(ds);
       if (className != null && !className.equals("")) {
         String time = new Long(System.currentTimeMillis()).toString();
@@ -248,6 +266,7 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
     vm0.invoke(() -> IdleTimeOutDUnitTest.closeCache());
   }
 
+  @Test
   public void testIdleTimeOut() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
index 5d058d1..85f265c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
@@ -16,28 +16,49 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.jta.CacheUtils;
 import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import org.apache.logging.log4j.Logger;
 
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-import java.io.*;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class LoginTimeOutDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class LoginTimeOutDUnitTest extends JUnit4DistributedTestCase {
   private static final Logger logger = LogService.getLogger();
 
   protected static volatile boolean runTest1Ready = false;
@@ -46,10 +67,6 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
   private static Cache cache;
   private static String tblName;
 
-  public LoginTimeOutDUnitTest(String name) {
-    super(name);
-  }
-
   private static String readFile(String filename) throws IOException {
     BufferedReader br = new BufferedReader(new FileReader(filename));
     String nextLine = "";
@@ -204,8 +221,8 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
     }
   }
 
-  public void disabledsetUp() throws Exception {
-    super.setUp();
+  @Override
+  public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     Object o[] = new Object[1];
@@ -213,7 +230,8 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
     vm0.invoke(LoginTimeOutDUnitTest.class, "init", o);
   }
 
-  public void disabledtearDown2() throws Exception {
+  @Override
+  public final void preTearDown() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     try {
@@ -222,18 +240,16 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
       if ( (e instanceof RMIException) || (e instanceof SQLException)) {
         // sometimes we have lock timeout problems destroying the table in
         // this test
-        vm0.invoke(() -> DistributedTestCase.disconnectFromDS());
+        vm0.invoke(() -> disconnectFromDS());
       }
     }
   }
   
-  public void testBug52206() {
-    // reenable setUp and testLoginTimeout to work on bug 52206
-  }
-  
   // this test and the setUp and teardown2 methods are disabled due to frequent
   // failures in CI runs.  See bug #52206
-  public void disabledtestLoginTimeOut() throws Exception {
+  @Ignore("TODO: test is disabled due to #52206")
+  @Test
+  public void testLoginTimeOut() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     AsyncInvocation test1 = vm0.invokeAsync(() -> LoginTimeOutDUnitTest.runTest1());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
index 544463c..c6284d6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
@@ -16,33 +16,50 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.OSProcess;
-import com.gemstone.gemfire.internal.jta.CacheUtils;
-import com.gemstone.gemfire.test.dunit.*;
-import com.gemstone.gemfire.util.test.TestUtil;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
 
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-public class MaxPoolSizeDUnitTest extends DistributedTestCase {
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.OSProcess;
+import com.gemstone.gemfire.internal.jta.CacheUtils;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.util.test.TestUtil;
+
+@Category(DistributedTest.class)
+public class MaxPoolSizeDUnitTest extends JUnit4DistributedTestCase {
 
   static DistributedSystem ds;
   static Cache cache;
   private static String tblName;
 
   private static String readFile(String filename) throws IOException {
-//    String lineSep = System.getProperty("\n");
     BufferedReader br = new BufferedReader(new FileReader(filename));
     String nextLine = "";
     StringBuffer sb = new StringBuffer();
@@ -58,10 +75,6 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
     return sb.toString();
   }
 
-  public MaxPoolSizeDUnitTest(String name) {
-    super(name);
-  }
-
   private static String modifyFile(String str) throws IOException {
     String search = "<jndi-binding type=\"XAPooledDataSource\"";
     String last_search = "</jndi-binding>";
@@ -129,20 +142,12 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
     wr.close();
     props.setProperty(CACHE_XML_FILE, path);
     String tableName = "";
-    //	        props.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "10339");
-    try {
-      //	  	      ds = DistributedSystem.connect(props);
-      ds = (new MaxPoolSizeDUnitTest("temp")).getSystem(props);
-      cache = CacheFactory.create(ds);
-      if (className != null && !className.equals("")) {
-        String time = new Long(System.currentTimeMillis()).toString();
-        tableName = className + time;
-        createTable(tableName);
-      }
-    }
-    catch (Exception e) {
-      e.printStackTrace(System.err);
-      throw new Exception("" + e);
+    ds = (new MaxPoolSizeDUnitTest()).getSystem(props);
+    cache = CacheFactory.create(ds);
+    if (className != null && !className.equals("")) {
+      String time = new Long(System.currentTimeMillis()).toString();
+      tableName = className + time;
+      createTable(tableName);
     }
     tblName = tableName;
     return tableName;
@@ -186,10 +191,6 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
       sm.execute(sql);
       conn.close();
     }
-    catch (NamingException ne) {
-      LogWriterUtils.getLogWriter().fine("destroy table naming exception: " + ne);
-      throw ne;
-    }
     catch (SQLException se) {
       if (!se.getMessage().contains("A lock could not be obtained within the time requested")) {
         LogWriterUtils.getLogWriter().fine("destroy table sql exception: " + se);
@@ -213,7 +214,7 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      e.printStackTrace();
+      fail("startCache failed", e);
     }
   }
 
@@ -224,7 +225,7 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      e.printStackTrace();
+      fail("closeCache failed", e);
     }
     try {
       ds.disconnect();
@@ -255,7 +256,8 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void testMaxPoolSize()  throws Throwable{
+  @Test
+  public void testMaxPoolSize() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     AsyncInvocation asyncObj = vm0.invokeAsync(() -> MaxPoolSizeDUnitTest.runTest1());
@@ -275,12 +277,12 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
     }
     catch (NamingException e) {
       LogWriterUtils.getLogWriter().fine("Naming Exception caught in lookup: " + e);
-      fail("failed in naming lookup: " + e);
+      fail("failed in naming lookup: ", e);
       return;
     }
     catch (Exception e) {
       LogWriterUtils.getLogWriter().fine("Exception caught during naming lookup: " + e);
-      fail("failed in naming lookup: " + e);
+      fail("failed in naming lookup: ", e);
       return;
     }
     try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
index 38745ba..0e7660f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
@@ -16,6 +16,27 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -23,33 +44,26 @@ import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
 import com.gemstone.gemfire.internal.jta.CacheUtils;
 import com.gemstone.gemfire.internal.jta.UserTransactionImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import javax.naming.Context;
-import javax.sql.DataSource;
-import javax.transaction.UserTransaction;
-import java.io.*;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.Statement;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
 /**
-*This test tests TransactionTimeOut functionality
-*/
-public class TransactionTimeOutDUnitTest extends DistributedTestCase {
+ * This test tests TransactionTimeOut functionality
+ */
+@Category(DistributedTest.class)
+public class TransactionTimeOutDUnitTest extends JUnit4DistributedTestCase {
 
   static DistributedSystem ds;
   static Cache cache = null;
   private static String tblName;
 
-  public TransactionTimeOutDUnitTest(String name) {
-    super(name);
-  }
-
   public static void init() throws Exception {
     Properties props = new Properties();
     int pid = OSProcess.getId();
@@ -63,16 +77,9 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
     wr.close();
 
     props.setProperty(CACHE_XML_FILE, path);
-    //    props.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "10321");
-    try {
-//      ds = DistributedSystem.connect(props);
-        ds = (new TransactionTimeOutDUnitTest("temp")).getSystem(props);
-      if (cache == null || cache.isClosed()) cache = CacheFactory.create(ds);
-    }
-    catch (Exception e) {
-      e.printStackTrace(System.err);
-      throw new Exception("" + e);
-    }
+
+    ds = (new TransactionTimeOutDUnitTest()).getSystem(props);
+    if (cache == null || cache.isClosed()) cache = CacheFactory.create(ds);
   }
 
   public static Cache getCache() {
@@ -86,8 +93,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("Exception in cache creation due to "+e);
-	  e.printStackTrace();
+      fail("Exception in cache creation due to ", e);
     }
   }
 
@@ -100,8 +106,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
 		   ds.disconnect();
     }
     catch (Exception e) {
-	fail("Exception in closing cache and disconnecting ds due to "+e);
-      e.printStackTrace();
+	    fail("Exception in closing cache and disconnecting ds due to ", e);
     }
   }
 
@@ -127,57 +132,65 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
     
     ThreadUtils.join(async1, 30 * 1000);
     ThreadUtils.join(async2, 30 * 1000);
-    if(async1.exceptionOccurred()){
+    if (async1.exceptionOccurred()){
       Assert.fail("async1 failed", async1.getException());
     }
-    if(async2.exceptionOccurred()){
+    if (async2.exceptionOccurred()){
       Assert.fail("async2 failed", async2.getException());
     }
   }
 
-  public static void test1() {
+  @Test
+  public void test1() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest3());
   }
 
-  public static void test2() {
+  @Test
+  public void test2() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest4());
   }
 
-  public static void test3() {
+  @Test
+  public void test3() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest5());
   }
 
-  public static void test4() {
+  @Test
+  public void test4() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest6());
   }
 
-  public static void test5() {
+  @Test
+  public void test5() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest7());
   }
 
-  public static void test6() {
+  @Test
+  public void test6() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest8());
   }
 
-  public static void test7() {
+  @Test
+  public void test7() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest9());
   }
 
-  public static void test8() {
+  @Test
+  public void test8() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     vm0.invoke(() -> TransactionTimeOutDUnitTest.runTest10());
@@ -200,12 +213,9 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
       if (!exceptionOccured)
           fail("Exception did not occur although was supposed to occur");
-      return;
     }
     catch (Exception e) {
-      LogWriterUtils.getLogWriter().fine("Exception caught " + e);
-      fail("failed in naming lookup: " + e);
-      return;
+      fail("failed in naming lookup: ", e);
     }
   }
 
@@ -225,13 +235,10 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
         exceptionOccured = true;
       }
       if (!exceptionOccured)
-          fail("Exception did not occur although was supposed to occur");
-      return;
+        fail("Exception did not occur although was supposed to occur");
     }
     catch (Exception e) {
-      LogWriterUtils.getLogWriter().fine("Exception caught " + e);
-      fail("failed in naming lookup: " + e);
-      return;
+      fail("failed in naming lookup: ", e);
     }
   }
 
@@ -247,7 +254,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       utx.commit();
     }
     catch (Exception e) {
-      fail("Exception in TestSetTransactionTimeOut due to " + e);
+      fail("Exception in TestSetTransactionTimeOut due to ", e);
     }
   }
 
@@ -272,7 +279,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      fail("Exception in testExceptionOnCommitAfterTimeOut() due to ", e);
     }
   }
 
@@ -300,7 +307,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      fail("Exception in testExceptionOnCommitAfterTimeOut() due to ", e);
     }
   }
 
@@ -324,7 +331,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      fail("Exception in testExceptionOnCommitAfterTimeOut() due to ", e);
     }
   }
 
@@ -341,12 +348,11 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
         utx.commit();
       }
       catch (Exception e) {
-        fail("Transaction failed to commit although TimeOut was not exceeded due to "
-            + e);
+        fail("Transaction failed to commit although TimeOut was not exceeded due to ", e);
       }
     }
     catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      fail("Exception in testExceptionOnCommitAfterTimeOut() due to ", e);
     }
   }
 
@@ -380,8 +386,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       conn.close();
     }
     catch (Exception e) {
-      fail("Exception occured in test Commit due to " + e);
-      e.printStackTrace();
+      fail("Exception occured in test Commit due to ", e);
     }
   }
 
@@ -423,8 +428,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("Exception occured in test Commit due to " + e);
-      e.printStackTrace();
+      fail("Exception occured in test Commit due to ", e);
     }
   }
 
@@ -466,10 +470,10 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test Commit due to " + e);
+      fail("Exception occured in test Commit due to ", e);
     }
   }
+
   private static String readFile(String filename) throws IOException {
     BufferedReader br = new BufferedReader(new FileReader(filename));
     String nextLine = "";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
index 439c961..86d4d51 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
@@ -16,6 +16,30 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import org.junit.FixMethodOrder;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runners.MethodSorters;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -23,54 +47,38 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.jta.CacheUtils;
 import com.gemstone.gemfire.internal.jta.JTAUtils;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import org.junit.FixMethodOrder;
-import org.junit.runners.MethodSorters;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-import java.io.*;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 /**
  * This test case is to test the following test scenarios: 1) Behaviour of
- * Transaction Manager in multy threaded thransactions. We will have around five
+ * Transaction Manager in multithreaded transactions. We will have around five
  * threads doing different activities. The response to those activities by
  * transaction manager is tested.
- * 
- * 
- *  
  */
+@Category(DistributedTest.class)
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
-
-  /////constructor/////
-  public TxnManagerMultiThreadDUnitTest(String name) {
-    super(name);
-  }
+public class TxnManagerMultiThreadDUnitTest extends JUnit4DistributedTestCase {
 
   public static DistributedSystem ds;
   public static Cache cache;
 
-  /////Methods for initializations/////
   private static String readFile(String filename) throws IOException {
-//    String lineSep = System.getProperty("\n");
     BufferedReader br = new BufferedReader(new FileReader(filename));
     String nextLine = "";
     StringBuffer sb = new StringBuffer();
     while ((nextLine = br.readLine()) != null) {
       sb.append(nextLine);
     }
-    //getLogWriter().fine("***********\n "+ sb);
     return sb.toString();
-  }//end of readFile
+  }
 
   private static String modifyFile(String str) throws IOException {
     String search = "<jndi-binding type=\"XAPooledDataSource\"";
@@ -118,7 +126,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     StringBuffer sbuff = new StringBuffer(str);
     String modified_str = sbuff.replace(n1, n2, new_str).toString();
     return modified_str;
-  }//end of modifyFile
+  }
 
   private static String modifyFile1(String str) throws IOException {
     String search = "<jndi-binding type=\"SimpleDataSource\"";
@@ -166,7 +174,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     StringBuffer sbuff = new StringBuffer(str);
     String modified_str = sbuff.replace(n1, n2, new_str).toString();
     return modified_str;
-  }//end of modifyFile
+  }
 
   public static String init(String className) throws Exception {
     DistributedSystem ds;
@@ -187,27 +195,20 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     wr.close();
     props.setProperty(CACHE_XML_FILE, path);
     String tableName = "";
-    //    props.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "10339");
-    try {
-      //        ds = DistributedSystem.connect(props);
-      ds = (new TxnManagerMultiThreadDUnitTest("temp")).getSystem(props);
-      CacheUtils.ds = ds;
-      cache = CacheFactory.create(ds);
-      if (className != null && !className.equals("")) {
-        String time = new Long(System.currentTimeMillis()).toString();
-        tableName = className + time;
-        createTable(tableName);
-      }
-    }
-    catch (Exception e) {
-      LogWriterUtils.getLogWriter().info("", e);
-      throw new Exception("" + e);
+
+    ds = (new TxnManagerMultiThreadDUnitTest()).getSystem(props);
+    CacheUtils.ds = ds;
+    cache = CacheFactory.create(ds);
+    if (className != null && !className.equals("")) {
+      String time = new Long(System.currentTimeMillis()).toString();
+      tableName = className + time;
+      createTable(tableName);
     }
+
     return tableName;
-  }//end of init method
+  }
 
-  public static void createTable(String tblName) throws NamingException,
-      SQLException {
+  public static void createTable(String tblName) throws NamingException, SQLException {
     String tableName = tblName;
     cache = TxnManagerMultiThreadDUnitTest.getCache();
     Context ctx = cache.getJNDIContext();
@@ -228,17 +229,16 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     }
     sm.executeBatch();
     conn.close();
-  }//end of createTable
+  }
 
-  public static void destroyTable(String tblName) throws NamingException,
-      SQLException {
+  public static void destroyTable(String tblName) throws NamingException, SQLException {
     //the sleep below is given to give the time to threads to start and perform
     // before destroyTable is called.
     try {
       Thread.sleep(10 * 1000);
     }
     catch (InterruptedException ie) {
-      fail("interrupted");
+      fail("interrupted", ie);
     }
     try {
       String tableName = tblName;
@@ -266,11 +266,11 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
       LogWriterUtils.getLogWriter().fine("Closing cache...");
       closeCache();
     }
-  }//end of destroyTable
+  }
 
   public static Cache getCache() {
     return cache;
-  }//end of getCache
+  }
 
   public static void startCache() {
     try {
@@ -281,7 +281,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     catch (Exception e) {
       LogWriterUtils.getLogWriter().warning("exception while creating cache", e);
     }
-  }//end of startCache
+  }
 
   public static void closeCache() {
     try {
@@ -300,7 +300,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     catch (Exception e) {
       LogWriterUtils.getLogWriter().fine("Error in disconnecting from Distributed System");
     }
-  }//end of closeCache
+  }
 
   @Override
   public final void postSetUp() throws java.lang.Exception {
@@ -337,9 +337,9 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
       /*int rowsDeleted = */jtaObj.deleteRows(tblName_delRows);
     }
     catch (Exception e) {
-      LogWriterUtils.getLogWriter().warning("Error: while deleting rows from database using JTAUtils", e);
+      fail("Error: while deleting rows from database using JTAUtils", e);
     }
-  }//end of delRows
+  }
 
   @Override
   public final void preTearDown() throws Exception {
@@ -352,7 +352,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     //that takes care of destroying table, closing cache, disconnecting from
     // DistributedSystem
     vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "destroyTable", o);
-  }//end of tearDown
+  }
 
   /*
    * calldestroyTable method is written to destroyTable, close cache and
@@ -371,7 +371,6 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
    * ("Closing cache..."); getLogWriter().fine("destroyTable is Successful!"); }
    * catch (Exception e) { fail (" failed during tear down of this test..." +
    * e); } finally { closeCache(); ds.disconnect(); } }//end of destroyTable
-   *  
    */
   public static void getNumberOfRows() {
     //the sleep below is given to give the time to threads to start and perform
@@ -380,7 +379,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
       Thread.sleep(7 * 1000);
     }
     catch (InterruptedException ie) {
-      fail("interrupted");
+      fail("interrupted", ie);
     }
     Region currRegion = null;
     Cache cache;
@@ -400,15 +399,17 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     }
     catch (Exception e) {
       LogWriterUtils.getLogWriter().warning("Error: while getting rows from database using JTAUtils", e);
+      fail("Error: while getting rows from database using JTAUtils", e);
     }
-  }//end of getNumberOfRows
+  }
 
-  /////test methods/////
-  /*
+  /**
    * The following method testAllCommit test the scenario in which all four
    * threads are committing the transaction
    */
-  public static void test1AllCommit() throws Throwable {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void test1AllCommit() throws Exception {
     VM vm0 = Host.getHost(0).getVM(0);
     AsyncInvocation asyncObj1 = vm0.invokeAsync(() -> TxnManagerMultiThreadDUnitTest.callCommitThreads());
     ThreadUtils.join(asyncObj1, 30 * 1000);
@@ -416,11 +417,10 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
       Assert.fail("asyncObj1 failed", asyncObj1.getException());
     }
     vm0.invoke(() -> TxnManagerMultiThreadDUnitTest.getNumberOfRows());
-  }//end of testAllCommit
+  }
 
-  /*
+  /**
    * This method gives call to CommitThread
-   *  
    */
   public static void callCommitThreads() {
     LogWriterUtils.getLogWriter().fine("This is callCommitThreads method");
@@ -432,15 +432,17 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     }
     catch (Exception e) {
       LogWriterUtils.getLogWriter().warning("Failed in Commit Threads", e);
-      fail("Failed in Commit Threads" + e);
+      fail("Failed in Commit Threads", e);
     }
-  }//end of callCommitTheads
+  }
 
-  /*
+  /**
    * The following method test3Commit2Rollback test the scenario in which 3
    * threads are committing and 2 threads are rolling back the transaction
    */
-  public static void _test3Commit2Rollback() throws Throwable {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void test3Commit2Rollback() throws Exception {
     VM vm0 = Host.getHost(0).getVM(0);
     AsyncInvocation asyncObj1 = vm0.invokeAsync(() -> TxnManagerMultiThreadDUnitTest.callCommitandRollbackThreads());
     ThreadUtils.join(asyncObj1, 30 * 1000);
@@ -448,7 +450,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
       Assert.fail("asyncObj1 failed", asyncObj1.getException());
     }
     vm0.invoke(() -> TxnManagerMultiThreadDUnitTest.getNumberOfRows());
-  }//end of test3Commit2Rollback
+  }
 
   public static void callCommitandRollbackThreads() {
     LogWriterUtils.getLogWriter().fine("This is callCommitandRollbackThreads method");
@@ -461,9 +463,11 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
     }
     catch (Exception e) {
       LogWriterUtils.getLogWriter().info("Failed in Commit and Rollback threads", e);
-      fail("Failed in Commit and Rollback Threads" + e);
+      fail("Failed in Commit and Rollback Threads", e);
     }
-  }//end of callCommitandRollbackThreads
+  }
+
+  // TODO: test3Commit2BlockingTimeOut is static and commented out
   /*
    * The following method test3Commit2BlockingTimeOut over test the scenario in
    * which 3 threads are committing and 2 threads are passing blocking time out
@@ -502,5 +506,4 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
    *  
    */
 
-   public void testFoo() {}
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
index 10afad8..a3b3b53 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
@@ -16,36 +16,49 @@
  */
 package com.gemstone.gemfire.internal.jta.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.jta.CacheUtils;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.transaction.UserTransaction;
-import java.io.*;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
 /**
-*This test sees if the TransactionTimeOut works properly
-*/
-public class TxnTimeOutDUnitTest extends DistributedTestCase {
+ * This test sees if the TransactionTimeOut works properly
+ */
+@Category(DistributedTest.class)
+public class TxnTimeOutDUnitTest extends JUnit4DistributedTestCase {
 
   static DistributedSystem ds;
   static Cache cache = null;
-  private static String tblName;
-  private boolean exceptionOccured = false;
-
-  public TxnTimeOutDUnitTest(String name) {
-    super(name);
-  }
 
   public static void init() throws Exception {
     Properties props = new Properties();
@@ -59,17 +72,9 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
     wr.flush();
     wr.close();
     props.setProperty(CACHE_XML_FILE, path);
-    //    props.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "10321");
     props.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
-    try {
-//      ds = DistributedSystem.connect(props);
-      ds = (new TxnTimeOutDUnitTest("temp")).getSystem(props);
-      if (cache == null || cache.isClosed()) cache = CacheFactory.create(ds);
-    }
-    catch (Exception e) {
-      e.printStackTrace(System.err);
-      throw new Exception("" + e);
-    }
+    ds = (new TxnTimeOutDUnitTest()).getSystem(props);
+    if (cache == null || cache.isClosed()) cache = CacheFactory.create(ds);
   }
 
   public static Cache getCache() {
@@ -83,8 +88,7 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-	fail("Exception in starting cache due to "+e);
-      e.printStackTrace();
+	    fail("Exception in starting cache due to ", e);
     }
   }
 
@@ -98,7 +102,7 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
 
     }
     catch (Exception e) {
-	fail("Exception in closing cache or ds due to "+e);
+    	fail("Exception in closing cache or ds due to "+e);
       e.printStackTrace();
     }
   }
@@ -117,7 +121,8 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
     vm0.invoke(() -> TxnTimeOutDUnitTest.closeCache());
   }
 
-  public void testMultiThreaded() throws NamingException, SQLException,Throwable {
+  @Test
+  public void testMultiThreaded() throws Exception {
     try{
 	Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -178,7 +183,9 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
   e.printStackTrace();
   }
   }
-  public static void testLoginTimeOut() throws Throwable {
+
+  @Test
+  public void testLoginTimeOut() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     AsyncInvocation asyncObj1 =  vm0.invokeAsync(() -> TxnTimeOutDUnitTest.runTest2());
@@ -252,34 +259,26 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static  void runTest3(Object o) {
-  
-	   boolean exceptionOccured = false;
-	   try 
-	   {
-			int sleeptime = ((Integer)o).intValue();
-			Context ctx = cache.getJNDIContext();
-			UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
-			utx.begin();
-			utx.setTransactionTimeout(sleeptime);
-			Thread.sleep(sleeptime * 2000);
-			try {
-				 utx.commit();
-			}
-			catch (Exception e) {
-				 exceptionOccured = true;
-			}
-			if(!exceptionOccured)
-			fail("exception did not occur although was supposed to"
-			+" occur");
-	   }
-	   catch (Exception e) {
-	   	fail("Exception in runTest3 due to "+e);
-			e.printStackTrace();
-	   }
+  public static void runTest3(Object o) throws SystemException, NotSupportedException, NamingException, InterruptedException {
+    boolean exceptionOccured = false;
+    int sleeptime = ((Integer)o).intValue();
+    Context ctx = cache.getJNDIContext();
+    UserTransaction utx = (UserTransaction) ctx.lookup("java:/UserTransaction");
+    utx.begin();
+    utx.setTransactionTimeout(sleeptime);
+    Thread.sleep(sleeptime * 2000);
+    try {
+       utx.commit();
+    }
+    catch (Exception e) {
+       exceptionOccured = true;
+    }
+    if(!exceptionOccured) {
+      fail("exception did not occur although was supposed to occur");
+    }
   }
+
   private static String readFile(String filename) throws IOException {
-//    String lineSep = System.getProperty("\n");
     BufferedReader br = new BufferedReader(new FileReader(filename));
     String nextLine = "";
     StringBuffer sb = new StringBuffer();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
index 78ee588..83cf09e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
@@ -17,6 +17,17 @@
 package com.gemstone.gemfire.internal.logging;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
@@ -26,35 +37,22 @@ import com.gemstone.gemfire.internal.logging.log4j.LogWriterLogger;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
 
 /**
  * Creates Locator and tests logging behavior at a high level.
- * 
  */
 @Category(IntegrationTest.class)
 public class LocatorLogFileJUnitTest {
-  @Rule public TestName name = new TestName();
 
   protected static final int TIMEOUT_MILLISECONDS = 180 * 1000; // 2 minutes
   protected static final int INTERVAL_MILLISECONDS = 100; // 100 milliseconds
   
   private Locator locator;
   private FileInputStream fis;
-  
-  
+
+  @Rule
+  public TestName name = new TestName();
+
   @After
   public void tearDown() throws Exception {
     if (this.locator != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterDisabledPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterDisabledPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterDisabledPerformanceTest.java
index 2d76d12..53c10f5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterDisabledPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterDisabledPerformanceTest.java
@@ -16,14 +16,16 @@
  */
 package com.gemstone.gemfire.internal.logging;
 
+import org.junit.Ignore;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 
+@Category(PerformanceTest.class)
+@Ignore("Tests have no assertions")
 public class LogWriterDisabledPerformanceTest extends LogWriterPerformanceTest {
 
-  public LogWriterDisabledPerformanceTest(String name) {
-    super(name);
-  }
-
   @Override
   protected PerformanceLogger createPerformanceLogger() {
     final LogWriter logWriter = createLogWriter();
@@ -41,24 +43,4 @@ public class LogWriterDisabledPerformanceTest extends LogWriterPerformanceTest {
     
     return perfLogger;
   }
-
-  @Override
-  public void testCountBasedLogging() throws Exception {
-    super.testCountBasedLogging();
-  }
-
-  @Override
-  public void testTimeBasedLogging() throws Exception {
-    super.testTimeBasedLogging();
-  }
-
-  @Override
-  public void testCountBasedIsEnabled() throws Exception {
-    super.testCountBasedIsEnabled();
-  }
-
-  @Override
-  public void testTimeBasedIsEnabled() throws Exception {
-    super.testTimeBasedIsEnabled();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterPerformanceTest.java
index 886c2ac..bec2bc4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LogWriterPerformanceTest.java
@@ -16,33 +16,30 @@
  */
 package com.gemstone.gemfire.internal.logging;
 
-import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
-import com.gemstone.gemfire.internal.util.IOUtils;
-import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Ignore;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
+import com.gemstone.gemfire.internal.util.IOUtils;
+import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 
 /**
  * Tests performance of logging when level is OFF.
- * 
  */
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
 public class LogWriterPerformanceTest extends LoggingPerformanceTestCase {
 
-  public LogWriterPerformanceTest(String name) {
-    super(name);
-  }
-  
   protected Properties createGemFireProperties() {
     final Properties props = new Properties();
     this.logFile = new File(this.configDirectory, DistributionConfig.GEMFIRE_PREFIX + "log");
@@ -87,7 +84,8 @@ public class LogWriterPerformanceTest extends LoggingPerformanceTestCase {
         appendToFile, isLoner, isSecurityLog, config, logConfig, fosHolder);
     return logWriter;
   }
-  
+
+  @Override
   protected PerformanceLogger createPerformanceLogger() {
     final LogWriter logWriter = createLogWriter();
     
@@ -104,24 +102,4 @@ public class LogWriterPerformanceTest extends LoggingPerformanceTestCase {
     
     return perfLogger;
   }
-  
-  @Override
-  public void testCountBasedLogging() throws Exception {
-    super.testCountBasedLogging();
-  }
-
-  @Override
-  public void testTimeBasedLogging() throws Exception {
-    super.testTimeBasedLogging();
-  }
-
-  @Override
-  public void testCountBasedIsEnabled() throws Exception {
-    super.testCountBasedIsEnabled();
-  }
-
-  @Override
-  public void testTimeBasedIsEnabled() throws Exception {
-    super.testTimeBasedIsEnabled();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LoggingPerformanceTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LoggingPerformanceTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LoggingPerformanceTestCase.java
index bc7cf39..9f0a734 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LoggingPerformanceTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LoggingPerformanceTestCase.java
@@ -16,18 +16,23 @@
  */
 package com.gemstone.gemfire.internal.logging;
 
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.util.StopWatch;
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.IOException;
 
+import org.junit.After;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.util.StopWatch;
+
 /**
  * Tests performance of logging when level is OFF.
- * 
  */
-public abstract class LoggingPerformanceTestCase extends TestCase {
+public abstract class LoggingPerformanceTestCase {
 
   protected static final boolean TIME_BASED = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "test.LoggingPerformanceTestCase.TIME_BASED");
   protected static final long TIME_TO_RUN = 1000 * 60 * 10; // ten minutes
@@ -38,23 +43,16 @@ public abstract class LoggingPerformanceTestCase extends TestCase {
   protected File configDirectory = new File(getUniqueName());//null;
   protected File logFile = new File(configDirectory, getUniqueName()+".log");
 
-  public LoggingPerformanceTestCase(String name) {
-    super(name);
-  }
-  
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-  }
-  
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
+  @Rule
+  public TestName testName = new TestName();
+
+  @After
+  public void tearDownLoggingPerformanceTestCase() throws Exception {
     this.configDirectory = null; // leave this directory in place for now
   }
 
   protected String getUniqueName() {
-    return getClass().getSimpleName() + "_" + getName();
+    return getClass().getSimpleName() + "_" + testName.getMethodName();
   }
   
   protected long performLoggingTest(final PerformanceLogger perfLogger) {
@@ -171,22 +169,26 @@ public abstract class LoggingPerformanceTestCase extends TestCase {
   }
   
   protected abstract PerformanceLogger createPerformanceLogger() throws IOException;
-  
+
+  @Test
   public void testCountBasedLogging() throws Exception {
     performCountBasedLoggingTest(createPerformanceLogger());
     assertTrue(this.logFile.exists());
   }
 
+  @Test
   public void testTimeBasedLogging() throws Exception {
     performTimeBasedLoggingTest(createPerformanceLogger());
     assertTrue(this.logFile.exists());
   }
 
+  @Test
   public void testCountBasedIsEnabled() throws Exception {
     performCountBasedIsEnabledTest(createPerformanceLogger());
     assertTrue(this.logFile.exists());
   }
 
+  @Test
   public void testTimeBasedIsEnabled() throws Exception {
     performTimeBasedIsEnabledTest(createPerformanceLogger());
     assertTrue(this.logFile.exists());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/TestLogWriterFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/TestLogWriterFactory.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/TestLogWriterFactory.java
index 9b587a6..d0f5970 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/TestLogWriterFactory.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/TestLogWriterFactory.java
@@ -16,6 +16,14 @@
  */
 package com.gemstone.gemfire.internal.logging;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.junit.Assert;
+
 import com.gemstone.gemfire.GemFireIOException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
@@ -25,13 +33,9 @@ import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.process.ProcessLauncherContext;
 import com.gemstone.gemfire.internal.util.LogFileUtils;
-import junit.framework.Assert;
-
-import java.io.*;
 
 /**
  * Creates LogWriter instances for testing.
- * 
  */
 public class TestLogWriterFactory extends Assert {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2DisabledPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2DisabledPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2DisabledPerformanceTest.java
index caedadc..90428b4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2DisabledPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2DisabledPerformanceTest.java
@@ -29,45 +29,22 @@ import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 @Ignore("Tests have no assertions")
 public class Log4J2DisabledPerformanceTest extends Log4J2PerformanceTest {
 
-  public Log4J2DisabledPerformanceTest(String name) {
-    super(name);
-  }
-
   @Override
   protected PerformanceLogger createPerformanceLogger() throws IOException {
     final Logger logger = createLogger();
-    
+
     final PerformanceLogger perfLogger = new PerformanceLogger() {
       @Override
       public void log(String message) {
         logger.debug(message);
       }
+
       @Override
       public boolean isEnabled() {
         return logger.isEnabled(Level.DEBUG);
       }
     };
-    
-    return perfLogger;
-  }
-
-  @Override
-  public void testCountBasedLogging() throws Exception {
-    super.testCountBasedLogging();
-  }
 
-  @Override
-  public void testTimeBasedLogging() throws Exception {
-    super.testTimeBasedLogging();
-  }
-
-  @Override
-  public void testCountBasedIsEnabled() throws Exception {
-    super.testCountBasedIsEnabled();
-  }
-
-  @Override
-  public void testTimeBasedIsEnabled() throws Exception {
-    super.testTimeBasedIsEnabled();
+    return perfLogger;
   }
 }



[42/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 bc50219..010b1f9 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,16 +16,7 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.ObjectSizer;
-import com.gemstone.gemfire.internal.cache.DiskWriteAttributesImpl;
-import com.gemstone.gemfire.internal.cache.xmlcache.*;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.util.test.TestUtil;
-import junit.framework.AssertionFailedError;
-import org.xml.sax.SAXException;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -33,11 +24,46 @@ import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.xml.sax.SAXException;
+
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.CacheWriter;
+import com.gemstone.gemfire.cache.CacheXmlException;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.DiskWriteAttributesFactory;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.ObjectSizer;
+import com.gemstone.gemfire.internal.cache.DiskWriteAttributesImpl;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlParser;
+import com.gemstone.gemfire.internal.cache.xmlcache.Declarable2;
+import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
+import com.gemstone.gemfire.internal.cache.xmlcache.RegionCreation;
+import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.util.test.TestUtil;
+
 /**
  * Tests the functionality of loading a declarative caching file when
  * a <code>Cache</code> is {@link CacheFactory#create created}.  The
  * fact that it is a subclass of {@link RegionTestCase} allows us to
- * take advantage of methods like {@link #getCache}.
+ * take advantage of methods like getCache().
  *
  * <P>
  *
@@ -47,15 +73,13 @@ import java.util.Properties;
  *
  * @since GemFire 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");
@@ -81,6 +105,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();
@@ -104,6 +129,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();
 
@@ -114,6 +140,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);
@@ -130,6 +157,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)
@@ -144,6 +172,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);
@@ -157,6 +186,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);
@@ -194,6 +224,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);
@@ -210,6 +241,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);
@@ -225,6 +257,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);
@@ -240,6 +273,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);
@@ -258,6 +292,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests parsing a malformed XML file
    */
+  @Test
   public void testMalformed() {
     setXmlFile(findFile("malformed.xml"));
 
@@ -276,6 +311,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests parsing an XML file with a bad integer
    */
+  @Test
   public void testBadInt() {
     setXmlFile(findFile("badInt.xml"));
 
@@ -298,6 +334,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests parsing an XML file with a bad float
    */
+  @Test
   public void testBadFloat() {
     setXmlFile(findFile("badFloat.xml"));
 
@@ -317,6 +354,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"));
 
@@ -336,6 +374,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"));
 
@@ -355,6 +394,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"));
 
@@ -375,8 +415,9 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
 
   /**
    * Tests parsing an XML file that specifies a cache listener whose
-   * constructor throws an {@linkplain TestException exception}.
+   * constructor throws an {@linkplain AssertionError exception}.
    */
+  @Test
   public void testCallbackWithException() {
     setXmlFile(findFile("callbackWithException.xml"));
 
@@ -386,7 +427,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
       fail("Should have thrown a CacheXmlException");
 
     } catch (CacheXmlException ex) {
-      if (!(ex.getCause() instanceof TestException)) {
+      if (!(ex.getCause() instanceof AssertionError)) {
         throw ex;
       }
     } finally {
@@ -399,6 +440,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"));
 
@@ -418,6 +460,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests nested regions
    */
+  @Test
   public void testNestedRegions() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -462,6 +505,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();
@@ -470,6 +514,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   /**
    * Tests disk directories
    */
+  @Test
   public void testDiskDirs() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -494,6 +539,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();
 
@@ -509,6 +555,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
@@ -545,13 +592,14 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
    *
    * @since GemFire 3.2.1
    */
+  @Test
   public void testExampleCacheXmlFile() throws Exception {
     // Check for old example files
     String dirName = "examples_" + this.getGemFireVersion();
     File dir = null;
     try {
       dir = findFile(dirName);
-    } catch(AssertionFailedError e) {
+    } catch(AssertionError e) {
       //ignore, no directory.
     }
     if (dir != null && dir.exists()) {
@@ -585,6 +633,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
     }
   }
   
+  @Test
   public void testEvictionLRUEntryAttributes() throws Exception {
     final String rName = getUniqueName();
     CacheCreation cache = new CacheCreation();
@@ -626,6 +675,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
       return true;
     }
   }
+  @Test
   public void testEvictionLRUMemoryAttributes() throws Exception {
     final String rName = getUniqueName();
     CacheCreation cache = new CacheCreation();
@@ -635,6 +685,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
     testXml(cache);
   }
 
+  @Test
   public void testEvictionLRUHeapAttributes() throws Exception {
     final String rName = getUniqueName();
     CacheCreation cache = new CacheCreation();
@@ -659,8 +710,8 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
   }
 
 
-  public static class TestException extends RuntimeException {
-    public TestException() {
+  public static class AssertionError extends RuntimeException {
+    public AssertionError() {
       super("Test Exception");
     }
   }
@@ -674,7 +725,7 @@ public class CacheXml30DUnitTest extends CacheXmlTestCase {
     extends TestCacheListener {
 
     public ExceptionalCacheListener() {
-      throw new TestException();
+      throw new AssertionError();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 134cf5f..279b563 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
@@ -16,6 +16,11 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.MirrorType;
 import com.gemstone.gemfire.cache.Scope;
@@ -24,6 +29,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheTransactionManagerCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the declarative caching functionality introduced in GemFire
@@ -31,27 +37,19 @@ import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
  *
  * @since GemFire 4.0
  */
+@Category(DistributedTest.class)
 public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
 
-  ////////  Constructors
-
-  public CacheXml40DUnitTest(String name) {
-    super(name);
-  }
-
-  ////////  Helper methods
-
   protected String getGemFireVersion() {
     return CacheXml.VERSION_4_0;
   }
 
-  ////////  Test methods
-
   /**
    * Tests the cache server attribute
    *
    * @since GemFire 4.0
    */
+  @Test
   public void testServer() {
     CacheCreation cache = new CacheCreation();
     cache.setIsServer(true);
@@ -65,6 +63,7 @@ public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
    *
    * @since GemFire 4.0
    */
+  @Test
   public void testBridgeServers() {
     CacheCreation cache = new CacheCreation();
 
@@ -90,6 +89,7 @@ public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
   /**
    * Tests the is-lock-grantor attribute in xml.
    */
+  @Test
   public void testIsLockGrantorAttribute() throws CacheException {
 
     CacheCreation cache = new CacheCreation();
@@ -110,6 +110,7 @@ public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
    *
    * @since GemFire 4.0
    */
+  @Test
   public void testTransactionListener() {
     CacheCreation cache = new CacheCreation();
     CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation();
@@ -123,6 +124,7 @@ public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
    *
    * @since GemFire 4.0
    */
+  @Test
   public void testCacheTransactionManager() {
     CacheCreation cache = new CacheCreation();
     CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation();
@@ -136,6 +138,7 @@ public class CacheXml40DUnitTest extends CacheXml30DUnitTest {
    *
    * @since GemFire 4.1
    */
+  @Test
   public void testConstrainedValues() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 617f9ca..9c7d37a 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
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -23,6 +25,8 @@ import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.xml.sax.SAXException;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -44,6 +48,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the declarative caching functionality introduced in GemFire 4.1.
@@ -51,13 +56,14 @@ import com.gemstone.gemfire.test.dunit.IgnoredException;
  * @since GemFire 4.1
  */
 
+@Category(DistributedTest.class)
 public class CacheXml41DUnitTest extends CacheXml40DUnitTest
 {
 
   // ////// Constructors
 
-  public CacheXml41DUnitTest(String name) {
-    super(name);
+  public CacheXml41DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -82,6 +88,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * Tests that named region attributes are registered when the cache is
    * created.
    */
+  @Test
   public void testRegisteringNamedRegionAttributes()
   {
     CacheCreation cache = new CacheCreation();
@@ -113,6 +120,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * Tests that a region created with a named attributes has the correct
    * attributes.
    */
+  @Test
   public void testNamedAttributes() throws CacheException
   {
     setXmlFile(findFile("namedAttributes.xml"));
@@ -158,6 +166,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * attributes refer to an unknown named region attributes throws an
    * {@link IllegalStateException}.
    */
+  @Test
   public void testUnknownNamedAttributes()
   {
     setXmlFile(findFile("unknownNamedAttributes.xml"));
@@ -179,6 +188,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * Tests to make sure that we cannot create the same region multiple times in
    * a <code>cache.xml</code> file.
    */
+  @Test
   public void testCreateSameRegionTwice() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -221,6 +231,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * Tests to make sure that we cannot create the same subregion multiple times
    * in a <code>cache.xml</code> file.
    */
+  @Test
   public void testCreateSameSubregionTwice() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -283,6 +294,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * Tests that loading cache XML effects mutable cache attributes.
    */
+  @Test
   public void testModifyCacheAttributes() throws CacheException
   {
     boolean copyOnRead1 = false;
@@ -332,6 +344,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * Tests that loading cache XML can create a region.
    */
+  @Test
   public void testAddRegionViaCacheXml() throws CacheException
   {
     CacheCreation creation = new CacheCreation();
@@ -394,6 +407,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * Tests that loading cache XML can modify a region.
    */
+  @Test
   public void testModifyRegionViaCacheXml() throws CacheException
   {
     CacheCreation creation = new CacheCreation();
@@ -467,6 +481,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * Tests that loading cache XML can add/update entries to a region.
    */
+  @Test
   public void testAddEntriesViaCacheXml() throws CacheException
   {
     String key1 = "KEY1";
@@ -535,6 +550,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * @since GemFire 4.2.3
    * @deprecated as of GemFire 6.5.
    */
+  @Test
   public void testPublisherAttribute() throws CacheException {
 
 //    CacheCreation cache = new CacheCreation();
@@ -549,6 +565,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * Test EnableBridgeConflation region attribute
    * @since GemFire 4.2
    */
+  @Test
   public void testEnableBridgeConflationAttribute() throws CacheException {
 
     CacheCreation cache = new CacheCreation();
@@ -563,6 +580,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
    * Test EnableAsyncConflation region attribute
    * @since GemFire 4.2
    */
+  @Test
   public void testEnableAsyncConflationAttribute() throws CacheException {
 
     CacheCreation cache = new CacheCreation();
@@ -575,6 +593,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * @since GemFire 4.3
    */
+  @Test
   public void testDynamicRegionFactoryDefault() throws CacheException {
     CacheCreation cache = new CacheCreation();
     cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config());
@@ -593,6 +612,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
     }
     
   }
+  @Test
   public void testDynamicRegionFactoryNonDefault() throws CacheException {
     CacheCreation cache = new CacheCreation();
     cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config((File)null, null, false, false));
@@ -615,6 +635,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * @since GemFire 4.3
    */
+  @Test
   public void testDynamicRegionFactoryDiskDir() throws CacheException {
     CacheCreation cache = new CacheCreation();
     File f = new File("diskDir");
@@ -636,6 +657,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   /**
    * Remove this override when bug #52052 is fixed.
    */
+  @Test
   public void testExampleCacheXmlFile() {
     return;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml45DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml45DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml45DUnitTest.java
index a6705ee..1662dfe 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml45DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml45DUnitTest.java
@@ -16,8 +16,40 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
 import com.company.app.DBLoader;
-import com.gemstone.gemfire.cache.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
+import com.gemstone.gemfire.cache.TransactionListener;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.internal.cache.DistributedRegion;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
@@ -26,13 +58,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the declarative caching functionality introduced in GemFire
@@ -40,30 +66,20 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
 
-  ////////  Constructors
-
-  public CacheXml45DUnitTest(String name) {
-    super(name);
-  }
-
-  ////////  Helper methods
-
   protected String getGemFireVersion() {
     return CacheXml.VERSION_5_0;
   }
 
-  ////////  Test methods
-  
-
-  
   public void setBridgeAttributes(CacheServer bridge1)
   {
     super.setBridgeAttributes(bridge1);
     bridge1.setMaxConnections(100);
   }
 
+  @Test
   public void testDataPolicy() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -125,6 +141,7 @@ public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
   /**
    * Test xml support of MembershipAttributes.
    */
+  @Test
   public void testMembershipAttributes() throws Exception {
     final String MY_ROLES = "Foo, Bip, BAM";
     final String[][] roles = new String[][] {{"Foo"}, {"Bip", "BAM"}};
@@ -184,6 +201,7 @@ public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
    * Tests multiple cache listeners on one region
    * @since GemFire 5.0
    */
+  @Test
   public void testMultipleCacheListener() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -234,6 +252,7 @@ public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
     }
   }
 
+  @Test
   public void testHeapLRUEviction() throws Exception {
     final String name = getUniqueName();
     beginCacheXml();
@@ -254,6 +273,7 @@ public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
    * Tests multiple transaction listeners
    * @since GemFire 5.0
    */
+  @Test
   public void testMultipleTXListener() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation();
@@ -303,6 +323,7 @@ public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
    * Tests that a region created with a named attributes has the correct
    * attributes.
    */
+  @Test
   public void testPartitionedRegionXML() throws CacheException
   {
     setXmlFile(findFile("partitionedRegion.xml"));
@@ -376,6 +397,7 @@ public class CacheXml45DUnitTest extends CacheXml41DUnitTest {
    * attributes.
    * 
    */
+  @Test
   public void testPartitionedRegionInstantiation() throws CacheException
   {
     CacheCreation cache = new CacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml51DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml51DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml51DUnitTest.java
index 47f3825..ea258dd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml51DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml51DUnitTest.java
@@ -16,15 +16,31 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskWriteAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.DiskWriteAttributesImpl;
-import com.gemstone.gemfire.internal.cache.xmlcache.*;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
+import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
+import com.gemstone.gemfire.internal.cache.xmlcache.RegionCreation;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the declarative caching functionality introduced in the GemFire
@@ -33,13 +49,14 @@ import com.gemstone.gemfire.test.dunit.VM;
  * @since GemFire 5.0
  */
 
+@Category(DistributedTest.class)
 public class CacheXml51DUnitTest extends CacheXml45DUnitTest
 {
 
   // ////// Constructors
 
-  public CacheXml51DUnitTest(String name) {
-    super(name);
+  public CacheXml51DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -53,6 +70,7 @@ public class CacheXml51DUnitTest extends CacheXml45DUnitTest
    * Tests that a region created with a named attributes has the correct
    * attributes.
    */
+  @Test
   public void testPartitionedRegionXML() throws CacheException
   {
     setXmlFile(findFile("partitionedRegion51.xml"));
@@ -133,7 +151,8 @@ public class CacheXml51DUnitTest extends CacheXml45DUnitTest
  *
  * @throws CacheException
  */
-public void testMessageSyncInterval() throws CacheException {
+  @Test
+  public void testMessageSyncInterval() throws CacheException {
   CacheCreation cache = new CacheCreation();
   cache.setMessageSyncInterval(123);
   RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -152,7 +171,8 @@ public void testMessageSyncInterval() throws CacheException {
  * 
  * @throws CacheException
  */
-public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException {
+  @Test
+  public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException {
   CacheCreation cache = new CacheCreation();
   cache.setMessageSyncInterval(3445);
   CacheServer bs = cache.addCacheServer();
@@ -182,6 +202,7 @@ public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException
    * the functionality for future comparisons (by hand of course). -- Mitch
    * Thomas 01/18/2006
    */
+  @Test
   public void testPartitionedRegionInstantiation() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -201,6 +222,7 @@ public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException
    * 
    * @throws CacheException
    */
+  @Test
   public void testBridgeMaxThreads()
       throws CacheException
   {
@@ -219,6 +241,7 @@ public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException
   /**
    * Tests that loading cache XML with multi-cast set will set the multi-cast
    */
+  @Test
   public void testRegionMulticastSetViaCacheXml() throws CacheException
   {
     final String rNameBase = getUniqueName();
@@ -284,6 +307,7 @@ public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException
     }
   }
 
+  @Test
   public void testRollOplogs() throws CacheException {
     CacheCreation cache = new CacheCreation();
 //  Set properties for Asynch writes
@@ -316,6 +340,7 @@ public void testBridgeAttributesRelatedToClientQueuesHA() throws CacheException
     testXml(cache);
   }
   
+  @Test
   public void testMaxOplogSize() throws CacheException {
     CacheCreation cache = new CacheCreation();
 //  Set properties for Asynch writes

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml55DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml55DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml55DUnitTest.java
index 315567f..d6387d6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml55DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml55DUnitTest.java
@@ -16,8 +16,12 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the declarative caching functionality introduced in the GemFire
@@ -26,13 +30,14 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
  * @since GemFire 5.0
  */
 
+@Category(DistributedTest.class)
 public class CacheXml55DUnitTest extends CacheXml51DUnitTest
 {
 
   // ////// Constructors
 
-  public CacheXml55DUnitTest(String name) {
-    super(name);
+  public CacheXml55DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -46,6 +51,7 @@ public class CacheXml55DUnitTest extends CacheXml51DUnitTest
    * Tests that a region created with a named attributes has the correct
    * attributes.
    */
+  @Test
   public void testEmpty() throws CacheException
   {}
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 2cb61f8..84a25cb 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
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -23,6 +25,9 @@ import java.net.UnknownHostException;
 import java.util.Arrays;
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CustomExpiry;
@@ -53,58 +58,40 @@ import com.gemstone.gemfire.internal.cache.xmlcache.Declarable2;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionCreation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
-import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import junit.framework.Assert;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 5.7 cache.xml features.
  * 
  * @since GemFire 5.7
  */
+@Category(DistributedTest.class)
+public class CacheXml57DUnitTest extends CacheXml55DUnitTest {
 
-public class CacheXml57DUnitTest extends CacheXml55DUnitTest
-{
-  //
   private final static String ALIAS1;
   private final static String ALIAS2;
 
   static {
     String tmp_alias1 = "localhost";
     String tmp_alias2 = "localhost";
-//    try {
-//      tmp_alias1 = getServerHostName(Host.getHost(0)); 
-//      InetSocketAddress addr = createINSA(tmp_alias1, 10000);
-//      tmp_alias2 = addr.getHostName();
-//    } catch (IllegalArgumentException suppress) {
-//      //The runnables dont have a Host object initialized, but they dont need 
-//      //access to the aliases so its ok to suppress this.
-//    } finally {
-      ALIAS1 = tmp_alias1;
-      ALIAS2 = tmp_alias2;
-//    }
+    ALIAS1 = tmp_alias1;
+    ALIAS2 = tmp_alias2;
   }
 
-  // ////// Constructors
-
-  public CacheXml57DUnitTest(String name) {
-    super(name);
-  }
-
-  // ////// Helper methods
-
-  protected String getGemFireVersion()
-  {
+  @Override
+  protected String getGemFireVersion() {
     return CacheXml.VERSION_5_7;
   }
 
   /**
    * Tests the groups subelement on bridge-server.
    */
+  @Test
   public void testDefaultCacheServerGroups() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheServer bs = cache.addCacheServer();
@@ -117,6 +104,8 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertNotNull(server);
     assertEquals(CacheServer.DEFAULT_GROUPS, server.getGroups());
   }
+
+  @Test
   public void testOneCacheServerGroups() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheServer bs = cache.addCacheServer();
@@ -130,6 +119,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertNotNull(server);
     assertEquals(Arrays.asList(groups), Arrays.asList(server.getGroups()));
   }
+  @Test
   public void testTwoCacheServerGroups() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheServer bs = cache.addCacheServer();
@@ -143,6 +133,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertNotNull(server);
     assertEquals(Arrays.asList(groups), Arrays.asList(server.getGroups()));
   }
+  @Test
   public void testDefaultCacheServerBindAddress() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheServer bs = cache.addCacheServer();
@@ -154,6 +145,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertNotNull(server);
     assertEquals(CacheServer.DEFAULT_BIND_ADDRESS, server.getBindAddress());
   }
+  @Test
   public void testCacheServerBindAddress() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheServer bs = cache.addCacheServer();
@@ -167,6 +159,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertNotNull(server);
     assertEquals(BA, server.getBindAddress());
   }
+  @Test
   public void testCacheServerHostnameForClients() throws CacheException {
     CacheCreation cache = new CacheCreation();
     CacheServer bs = cache.addCacheServer();
@@ -182,6 +175,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertEquals(BA, server.getBindAddress());
     assertEquals("clientHostName", server.getHostnameForClients());
   }
+  @Test
   public void testExplicitConnectionPool() throws CacheException {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -239,6 +233,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertEquals(12345, cp.getSubscriptionMessageTrackingTimeout());
     assertEquals(333, cp.getSubscriptionAckInterval());
   }
+  @Test
   public void testDefaultConnectionPool() throws CacheException {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -276,6 +271,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertEquals(PoolFactory.DEFAULT_SUBSCRIPTION_MESSAGE_TRACKING_TIMEOUT, cp.getSubscriptionMessageTrackingTimeout());
     assertEquals(PoolFactory.DEFAULT_SUBSCRIPTION_ACK_INTERVAL, cp.getSubscriptionAckInterval());
   }
+  @Test
   public void testTwoConnectionPools() throws CacheException {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -322,6 +318,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
       throw ex;
     }
   }
+  @Test
   public void testNoConnectionPools() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -336,6 +333,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
       expectedException.remove();
     }
   }
+  @Test
   public void testAlreadyExistingPool() throws CacheException {
     getSystem();
     PoolFactoryImpl f = (PoolFactoryImpl)
@@ -358,6 +356,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     }
   }
 
+  @Test
   public void testDynamicRegionFactoryConnectionPool() throws CacheException, IOException {
     IgnoredException.addIgnoredException("Connection reset");
     IgnoredException.addIgnoredException("SocketTimeoutException");
@@ -407,6 +406,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
    * @throws CacheException
    * @since GemFire 5.7
    */
+  @Test
   public void testBridgeAttributesRelatedToHAOverFlow() throws CacheException {
     CacheCreation cache = new CacheCreation();
     cache.setMessageSyncInterval(3445);
@@ -438,6 +438,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertEquals("overFlow", chaqf.getOverflowDirectory());
   }
   
+  @Test
   public void testBridgeLoadProbe() {
     CacheCreation cache = new CacheCreation();
     CacheServer server = cache.addCacheServer();
@@ -448,9 +449,10 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     
     Cache c= getCache();
     server = c.getCacheServers().get(0);
-    Assert.assertEquals(MyLoadProbe.class,server.getLoadProbe().getClass());
+    assertEquals(MyLoadProbe.class,server.getLoadProbe().getClass());
   }
   
+  @Test
   public void testLoadPollInterval() {
     CacheCreation cache = new CacheCreation();
     CacheServer server = cache.addCacheServer();
@@ -461,7 +463,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     
     Cache c = getCache();
     server = c.getCacheServers().get(0);
-    Assert.assertEquals(12345, server.getLoadPollInterval());
+    assertEquals(12345, server.getLoadPollInterval());
   }
   
   public static class MyLoadProbe extends ServerLoadProbeAdapter implements Declarable {
@@ -550,6 +552,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
   /**
    * Test both customEntryIdleTime and customEntryTimeToLife
    */
+  @Test
   public void testCustomEntryXml() {
     CacheCreation cache = new CacheCreation();
 
@@ -595,6 +598,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     testXml(cache);
   }
 
+  @Test
   public void testPreloadDataPolicy() throws CacheException {
     CacheCreation cache = new CacheCreation();
 
@@ -645,6 +649,7 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
    * Test EnableSubscriptionConflation region attribute
    * @since GemFire 5.7
    */
+  @Test
   public void testEnableSubscriptionConflationAttribute() throws CacheException {
 
     CacheCreation cache = new CacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 f61158f..aaf3251 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
@@ -16,13 +16,17 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.Map;
 import java.util.Properties;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheException;
+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.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.DiskWriteAttributesFactory;
 import com.gemstone.gemfire.cache.EvictionAction;
@@ -36,15 +40,14 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.execute.Function;
 import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.cache.util.ObjectSizerImpl;
-import com.gemstone.gemfire.internal.cache.DistributedRegion;
-import com.gemstone.gemfire.internal.cache.functions.*;
+import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.cache.lru.MemLRUCapacityController;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.FunctionServiceCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 5.8 cache.xml features.
@@ -52,13 +55,14 @@ import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
  * @since GemFire 5.8
  */
 
+@Category(DistributedTest.class)
 public class CacheXml58DUnitTest extends CacheXml57DUnitTest
 {
 
   // ////// Constructors
 
-  public CacheXml58DUnitTest(String name) {
-    super(name);
+  public CacheXml58DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -74,6 +78,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
    * for partition-resolver has the correct attributes.
    * 
    */
+  @Test
   public void testPartitionedRegionAttributesForCustomPartitioning() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -124,6 +129,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
    * has correct registered Function
    * 
    */
+  @Test
   public void testCacheCreationWithFuntionService() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -152,6 +158,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
    * for ExpirationAttributes
    * 
    */
+  @Test
   public void testPartitionedRegionAttributesForExpiration() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -218,6 +225,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
    * for ExpirationAttributes
    * 
    */
+  @Test
   public void testPartitionedRegionAttributesForEviction() throws CacheException
   {
     final int redundantCopies = 1;
@@ -311,6 +319,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     assertEquals(ea.getAction(), EvictionAction.OVERFLOW_TO_DISK);    
   }
 
+  @Test
   public void testPartitionedRegionAttributesForCoLocation(){
     closeCache();
     CacheCreation cache = new CacheCreation();
@@ -345,6 +354,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     
   }
   
+  @Test
   public void testPartitionedRegionAttributesForCoLocation2(){
     closeCache();
     setXmlFile(findFile("coLocation.xml"));    
@@ -360,6 +370,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     
   }
   
+  @Test
   public void testPartitionedRegionAttributesForMemLruWithoutMaxMem() throws CacheException
   {
     final int redundantCopies = 1;
@@ -401,6 +412,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     assertEquals(ea.getMaximum(), pa.getLocalMaxMemory());
   }
   
+  @Test
   public void testPartitionedRegionAttributesForMemLruWithMaxMem() throws CacheException
   {
     final int redundantCopies = 1;
@@ -444,6 +456,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     assertEquals(ea.getMaximum(), pa.getLocalMaxMemory());
   }
   
+  @Test
   public void testReplicatedRegionAttributesForMemLruWithoutMaxMem() throws CacheException
   {
     final int redundantCopies = 1;
@@ -472,6 +485,7 @@ public class CacheXml58DUnitTest extends CacheXml57DUnitTest
     assertEquals(ea.getMaximum(), MemLRUCapacityController.DEFAULT_MAXIMUM_MEGABYTES);
   }
   
+  @Test
   public void testReplicatedRegionAttributesForMemLruWithMaxMem() throws CacheException
   {
     final int redundantCopies = 1;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml60DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml60DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml60DUnitTest.java
index 992956a..bd30e07 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml60DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml60DUnitTest.java
@@ -16,11 +16,16 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.io.Serializable;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.Cache;
@@ -38,6 +43,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.SerializerCreation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 6.0 cache.xml features.
@@ -45,13 +51,14 @@ import com.gemstone.gemfire.test.dunit.IgnoredException;
  * @since GemFire 6.0
  */
 
+@Category(DistributedTest.class)
 public class CacheXml60DUnitTest extends CacheXml58DUnitTest
 {
 
   // ////// Constructors
 
-  public CacheXml60DUnitTest(String name) {
-    super(name);
+  public CacheXml60DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -67,6 +74,7 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
    * for recovery-delay has the correct attributes.
    * 
    */
+  @Test
   public void testRecoveryDelayAttributes() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -113,6 +121,7 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
    * for recovery-delay has the correct attributes.
    * 
    */
+  @Test
   public void testDefaultRecoveryDelayAttributes() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -156,6 +165,7 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
    * eviction-heap-percentage attributes
    * @throws Exception
    */
+  @Test
   public void testResourceManagerThresholds() throws Exception {
     CacheCreation cache = new CacheCreation();
     final float low = 90.0f;
@@ -169,8 +179,8 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
     testXml(cache);
     {
       c = getCache();
-      assertEquals(low, c.getResourceManager().getEvictionHeapPercentage());
-      assertEquals(high, c.getResourceManager().getCriticalHeapPercentage());
+      assertEquals(low, c.getResourceManager().getEvictionHeapPercentage(),0);
+      assertEquals(high, c.getResourceManager().getCriticalHeapPercentage(),0);
     }
     closeCache();
     
@@ -182,8 +192,8 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
     testXml(cache);
     {
       c = getCache();
-      assertEquals(low, c.getResourceManager().getEvictionHeapPercentage());
-      assertEquals(low + 1, c.getResourceManager().getCriticalHeapPercentage());
+      assertEquals(low, c.getResourceManager().getEvictionHeapPercentage(),0);
+      assertEquals(low + 1, c.getResourceManager().getCriticalHeapPercentage(),0);
     }
     closeCache();
 
@@ -209,8 +219,8 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
     testXml(cache);
     {
       c = getCache();
-      assertEquals(0f, c.getResourceManager().getEvictionHeapPercentage());
-      assertEquals(low, c.getResourceManager().getCriticalHeapPercentage());
+      assertEquals(0f, c.getResourceManager().getEvictionHeapPercentage(),0);
+      assertEquals(low, c.getResourceManager().getCriticalHeapPercentage(),0);
     }
     closeCache();
 
@@ -222,8 +232,8 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
     testXml(cache);
     {
       c = getCache();
-      assertEquals(low, c.getResourceManager().getEvictionHeapPercentage());
-      assertEquals(0f, c.getResourceManager().getCriticalHeapPercentage());
+      assertEquals(low, c.getResourceManager().getEvictionHeapPercentage(),0);
+      assertEquals(0f, c.getResourceManager().getCriticalHeapPercentage(),0);
     }
     closeCache();
 
@@ -234,8 +244,8 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
     cache.setResourceManagerCreation(rmc);
     testXml(cache);
     c = getCache();
-    assertEquals(0f, c.getResourceManager().getEvictionHeapPercentage());
-    assertEquals(0f, c.getResourceManager().getCriticalHeapPercentage());
+    assertEquals(0f, c.getResourceManager().getEvictionHeapPercentage(),0);
+    assertEquals(0f, c.getResourceManager().getCriticalHeapPercentage(),0);
   }
   
   // A bunch of classes for use in testing the serialization schtuff
@@ -286,6 +296,7 @@ public class CacheXml60DUnitTest extends CacheXml58DUnitTest
     {return false;}      
   }
     
+  @Test
   public void testSerializationRegistration()
   {
     CacheCreation cc = new CacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml61DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml61DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml61DUnitTest.java
index 5bbdc59..424cc01 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml61DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml61DUnitTest.java
@@ -16,56 +16,29 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import java.util.Properties;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
-import com.gemstone.gemfire.cache.PartitionAttributes;
-import com.gemstone.gemfire.cache.PartitionAttributesFactory;
-import com.gemstone.gemfire.cache.PartitionResolver;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.client.Pool;
-import com.gemstone.gemfire.cache.client.PoolFactory;
-import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.internal.InternalDataSerializer;
-import com.gemstone.gemfire.internal.InternalInstantiator;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
-import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
-import com.gemstone.gemfire.internal.cache.xmlcache.SerializerCreation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.Host;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 6.1 cache.xml features.
  * 
  * @since GemFire 6.1
  */
-
+@Category(DistributedTest.class)
 public class CacheXml61DUnitTest extends CacheXml60DUnitTest {
   
-  // ////// Constructors
-
-  public CacheXml61DUnitTest(String name) {
-    super(name);
-  }
-
-  // ////// Helper methods
-
   protected String getGemFireVersion()
   {
     return CacheXml.VERSION_6_1;
@@ -77,6 +50,7 @@ public class CacheXml61DUnitTest extends CacheXml60DUnitTest {
    * for delta propogation has the correct attributes.
    * 
    */
+  @Test
   public void testRegionAttributesForRegionEntryCloning() throws CacheException
   {
     final String rNameBase = getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 7ad424a..a957796 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
@@ -20,6 +20,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
@@ -27,6 +29,9 @@ import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.Arrays;
 
+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.CacheException;
@@ -62,12 +67,14 @@ import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 6.5 cache.xml features.
  * 
  * @since GemFire 6.5
  */
+@Category(DistributedTest.class)
 public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
   
   private final static String ALIAS1;
@@ -106,8 +113,8 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
   }
   // ////// Constructors
 
-  public CacheXml65DUnitTest(String name) {
-    super(name);
+  public CacheXml65DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -120,6 +127,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
    * test for checking default value of PR_Single_Hop feature.
    * Test for checking default value of multiuser-authentication attribute.
    */
+  @Test
   public void testDefaultConnectionPool() throws CacheException {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -171,6 +179,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
         .getMultiuserAuthentication());
   }
 
+  @Test
   public void testDiskStore() throws CacheException {
     CacheCreation cache = new CacheCreation();
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -224,6 +233,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
    * test for enabling PRsingleHop feature.
    * Test for enabling multiuser-authentication attribute.
    */
+  @Test
   public void testExplicitConnectionPool() throws CacheException {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -282,6 +292,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(true, cp.getMultiuserAuthentication());
   }
   
+  @Test
   public void testDiskStoreValidation() throws CacheException {
     CacheCreation cache = new CacheCreation();
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -342,6 +353,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     testXml(cache);
   }
 
+  @Test
   public void testDiskStoreFactory() throws CacheException {
     CacheCreation cache = new CacheCreation();
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -403,6 +415,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
 
     testXml(cache);
   }
+  @Test
   public void testRedefineOfDefaultDiskStore() throws CacheException {
     CacheCreation cache = new CacheCreation();
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -435,6 +448,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
   /**
    * Make sure you can create a persistent partitioned region from xml.
    */
+  @Test
   public void testPersistentPartition() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -458,6 +472,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     region.localDestroyRegion();
   }
   
+  @Test
   public void testBridgeAttributesRelatedToHAOverFlow65() throws CacheException {
     CacheCreation cache = new CacheCreation();
     cache.setMessageSyncInterval(3445);
@@ -505,6 +520,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals("overFlow", dsi.getDiskDirs()[0].toString());
   }
   
+  @Test
   public void testClientSubscriptionQueueUsingDefaultDS() throws CacheException {
     CacheCreation cache = new CacheCreation();
     cache.setMessageSyncInterval(3445);
@@ -543,6 +559,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
    * for delta propogation has the correct attributes.
    * 
    */
+  @Test
   public void testTransactionWriter() throws CacheException
   {
     CacheCreation creation = new CacheCreation();
@@ -563,6 +580,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
   /**
    * Tests that a region created with a named attributes with diskstore
    */
+  @Test
   public void testDiskStoreInTemplates() throws CacheException
   {
     File dir = new File("west");
@@ -628,6 +646,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(DataPolicy.PERSISTENT_PARTITION, attrs.getDataPolicy());
   }
   
+  @Test
   public void testBackupFiles() throws CacheException
   {
     CacheCreation cache = new CacheCreation();
@@ -640,6 +659,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Arrays.asList(new File[] {backup1, backup2}), c.getBackupFiles());
   }
 
+  @Test
   public void testClientCache() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     cache.setCopyOnRead(true);
@@ -653,6 +673,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(ClientRegionShortcut.values().length,
                  c.listRegionAttributes().size());
   }
+  @Test
   public void testNormalCache() throws CacheException {
     CacheCreation cache = new CacheCreation();
     cache.setCopyOnRead(true);
@@ -666,6 +687,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(RegionShortcut.values().length,
                  c.listRegionAttributes().size());
   }
+  @Test
   public void testPARTITION() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -679,6 +701,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertNotNull(ra.getPartitionAttributes());
     assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
   }
+  @Test
   public void testPARTITION_REDUNDANT() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -692,6 +715,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertNotNull(ra.getPartitionAttributes());
     assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
   }
+  @Test
   public void testPARTITION_PERSISTENT() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -705,6 +729,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertNotNull(ra.getPartitionAttributes());
     assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
   }
+  @Test
   public void testPARTITION_REDUNDANT_PERSISTENT() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -718,6 +743,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertNotNull(ra.getPartitionAttributes());
     assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
   }
+  @Test
   public void testPARTITION_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     ResourceManagerCreation rmc = new ResourceManagerCreation();
@@ -736,10 +762,11 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(55.0f,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
     assertEquals(80.0f,
-                 c.getResourceManager().getCriticalHeapPercentage());
+                 c.getResourceManager().getCriticalHeapPercentage(),0);
   }
+  @Test
   public void testPARTITION_REDUNDANT_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -754,8 +781,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testPARTITION_PERSISTENT_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     ResourceManagerCreation rmc = new ResourceManagerCreation();
@@ -773,10 +801,11 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(80.0f,
-                 c.getResourceManager().getCriticalHeapPercentage());
+                 c.getResourceManager().getCriticalHeapPercentage(),0);
     assertEquals(75.0f,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testPARTITION_REDUNDANT_PERSISTENT_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     ResourceManagerCreation rmc = new ResourceManagerCreation();
@@ -794,8 +823,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(0.0f,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testPARTITION_HEAP_LRU() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -810,8 +840,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testPARTITION_REDUNDANT_HEAP_LRU() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -826,9 +857,10 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
 
+  @Test
   public void testREPLICATE() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -841,6 +873,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(DataPolicy.REPLICATE, ra.getDataPolicy());
     assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
   }
+  @Test
   public void testREPLICATE_PERSISTENT() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -853,6 +886,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy());
     assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
   }
+  @Test
   public void testREPLICATE_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -866,8 +900,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testREPLICATE_PERSISTENT_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -881,8 +916,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testREPLICATE_HEAP_LRU() throws CacheException, IOException
   {
     CacheCreation cache = new CacheCreation();
@@ -899,8 +935,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testLOCAL() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -913,6 +950,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(DataPolicy.NORMAL, ra.getDataPolicy());
     assertEquals(Scope.LOCAL, ra.getScope());
   }
+  @Test
   public void testLOCAL_PERSISTENT() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -925,6 +963,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy());
     assertEquals(Scope.LOCAL, ra.getScope());
   }
+  @Test
   public void testLOCAL_HEAP_LRU() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -938,8 +977,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testLOCAL_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -953,8 +993,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testLOCAL_PERSISTENT_OVERFLOW() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -968,9 +1009,10 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
 
+  @Test
   public void testPARTITION_PROXY() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -985,6 +1027,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(0, ra.getPartitionAttributes().getLocalMaxMemory());
   }
+  @Test
   public void testPARTITION_PROXY_REDUNDANT() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -999,6 +1042,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
     assertEquals(0, ra.getPartitionAttributes().getLocalMaxMemory());
   }
+  @Test
   public void testREPLICATE_PROXY() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1012,6 +1056,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
   }
 
+  @Test
   public void testPROXY() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1026,6 +1071,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals("DEFAULT", ra.getPoolName());
   }
+  @Test
   public void testCACHING_PROXY() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1040,6 +1086,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals("DEFAULT", ra.getPoolName());
   }
+  @Test
   public void testCACHING_PROXY_HEAP_LRU() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1055,8 +1102,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals("DEFAULT", ra.getPoolName());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(), 0);
   }
+  @Test
   public void testCACHING_PROXY_OVERFLOW() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1072,8 +1120,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals("DEFAULT", ra.getPoolName());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testClientLOCAL() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1088,6 +1137,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals(null, ra.getPoolName());
   }
+  @Test
   public void testClientLOCAL_HEAP_LRU() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1103,8 +1153,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(null, ra.getPoolName());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testClientLOCAL_OVERFLOW() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1120,8 +1171,9 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(null, ra.getPoolName());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
+  @Test
   public void testClientLOCAL_PERSISTENT() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1136,6 +1188,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(Scope.LOCAL, ra.getScope());
     assertEquals(null, ra.getPoolName());
   }
+  @Test
   public void testClientLOCAL_PERSISTENT_OVERFLOW() throws CacheException {
     ClientCacheCreation cache = new ClientCacheCreation();
     RegionCreation root = (RegionCreation)
@@ -1151,7 +1204,7 @@ public class CacheXml65DUnitTest extends CacheXml61DUnitTest {
     assertEquals(null, ra.getPoolName());
     assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
     assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE,
-                 c.getResourceManager().getEvictionHeapPercentage());
+                 c.getResourceManager().getEvictionHeapPercentage(),0);
   }
 
   // @todo add some tests to make sure the new smarter region-attribut defaults work from xml

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml66DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml66DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml66DUnitTest.java
index 8600214..6e4271d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml66DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml66DUnitTest.java
@@ -16,10 +16,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CacheFactory;
@@ -43,18 +48,20 @@ import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 7.0 cache.xml feature : Fixed Partitioning.
  * 
  * @since GemFire 6.6
  */
+@Category(DistributedTest.class)
 public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
   
 //////// Constructors
 
-  public CacheXml66DUnitTest(String name) {
-    super(name);
+  public CacheXml66DUnitTest() {
+    super();
   }
 
   // ////// Helper methods
@@ -71,6 +78,7 @@ public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
    * FixedPartitionAttributes
    * 
    */
+  @Test
   public void testFixedPartitioning() throws CacheException {
 
     CacheCreation cache = new CacheCreation();
@@ -110,6 +118,7 @@ public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
     validateAttributes(region, fpattrsList, resolver, false);
   }
 
+  @Test
   public void testFixedPartitioning_colocation_WithAttributes()
       throws CacheException {
     CacheCreation cache = new CacheCreation();
@@ -227,6 +236,7 @@ public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
   }
   
   
+  @Test
   public void testPdxDefaults() {
     CacheCreation creation = new CacheCreation();
     testXml(creation);
@@ -242,6 +252,7 @@ public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
     assertEquals(false, c.getPdxIgnoreUnreadFields());
   }
   
+  @Test
   public void testPdxAttributes() {
     CacheCreation creation = new CacheCreation();
     creation.setPdxPersistent(true);
@@ -329,6 +340,7 @@ public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
     
   }
   
+  @Test
   public void testTXManagerOnClientCache() {
     ClientCacheCreation cc = new ClientCacheCreation();
     //CacheCreation cc = new CacheCreation();
@@ -348,6 +360,7 @@ public class CacheXml66DUnitTest extends CacheXml65DUnitTest{
     
   }
   
+  @Test
   public void testNoTXWriterOnClient() {
   //test writer is not created
     ClientCacheCreation cc = new ClientCacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml70DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml70DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml70DUnitTest.java
index f502396..4492aa5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml70DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml70DUnitTest.java
@@ -20,10 +20,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -40,15 +45,13 @@ import com.gemstone.gemfire.internal.cache.xmlcache.AsyncEventQueueCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
+@Category(DistributedTest.class)
 public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
-  private static final long serialVersionUID = 225193925777688541L;
 
-  public CacheXml70DUnitTest(String name) {
-    super(name);
+  public CacheXml70DUnitTest() {
+    super();
   }
 
   
@@ -60,6 +63,7 @@ public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
   }
 
   /** make sure we can create regions with concurrencyChecksEnabled=true */
+  @Test
   public void testConcurrencyChecksEnabled() throws CacheException {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -110,6 +114,7 @@ public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
     region.localDestroyRegion();
   }
 
+  @Test
   public void testAsyncEventQueue() {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -143,6 +148,7 @@ public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
     }
   }
   
+  @Test
   public void testConcurrentAsyncEventQueue() {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -179,6 +185,7 @@ public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
   /**
    * Added to test the scenario of defect #50600.
    */
+  @Test
   public void testAsyncEventQueueWithGatewayEventFilter() {
     getSystem();
     CacheCreation cache = new CacheCreation();
@@ -257,6 +264,7 @@ public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
   }
 
   // test bug 47197
+  @Test
   public void testPartitionedRegionAttributesForCoLocation3(){
     closeCache();
     setXmlFile(findFile("coLocation3.xml"));    
@@ -271,6 +279,7 @@ public class CacheXml70DUnitTest extends CacheXml66DUnitTest {
     assertTrue(order.getAttributes().getPartitionAttributes().getColocatedWith().equals("Customer"));
   }
 
+  @Test
   public void testBug44710() {
     closeCache();
     setXmlFile(findFile("bug44710.xml"));



[49/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
index fddf108..ff2f6fa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.client.internal;
 
+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.Cache;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.NoAvailableLocatorsException;
@@ -43,6 +52,7 @@ import java.util.List;
  * - dynamically discovering servers, locators, handling
  * locator disappearance, etc.
  */
+@Category(DistributedTest.class)
 public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
 
   protected static final Object BRIDGE_LISTENER = "BRIDGE_LISTENER";
@@ -53,10 +63,11 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     IgnoredException.addIgnoredException("NoAvailableLocatorsException");
   }
 
-  public AutoConnectionSourceDUnitTest(String name) {
-    super(name);
+  public AutoConnectionSourceDUnitTest() {
+    super();
   }
 
+  @Test
   public void testDiscoverBridgeServers() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -78,6 +89,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     Assert.assertEquals("value", getInVM(vm1, "key"));
   }
 
+  @Test
   public void testNoLocators() {
 
     final Host host = Host.getHost(0);
@@ -93,6 +105,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     }
   }
 
+  @Test
   public void testNoBridgeServer() {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -110,6 +123,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     }
   }
 
+  @Test
   public void testDynamicallyFindBridgeServer() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -138,6 +152,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     Assert.assertEquals("value2", getInVM(vm3, "key2"));
   }
 
+  @Test
   public void testDynamicallyFindLocators() throws Exception {
     try {
       final Host host = Host.getHost(0);
@@ -182,6 +197,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     }
   }
 
+  @Test
   public void testEmbeddedLocator() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -218,6 +234,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     });
   }
 
+  @Test
   public void testServerGroups() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -273,6 +290,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     Assert.assertEquals("value", getInVM(vm1, "B", "key7"));
   }
 
+  @Test
   public void testTwoServersInSameVM() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -300,6 +318,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
     checkEndpoints(vm2, new int[] { serverPort1 });
   }
 
+  @Test
   public void testClientMembershipListener() throws Exception {
     final Host host = Host.getHost(0);
     VM locatorVM = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
index 3c675b8..6c2f3ec 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
@@ -16,32 +16,40 @@
  */
 package com.gemstone.gemfire.cache.client.internal;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.security.AuthenticationRequiredException;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
 /**
  * Tests cacheserver ssl support added. See https://svn.gemstone.com/trac/gemfire/ticket/48995 for details
  */
-public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
-
-  private static final long serialVersionUID = 1L;
+@Category(DistributedTest.class)
+public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase {
 
   private static final String TRUSTED_STORE = "trusted.keystore";
   private static final String CLIENT_KEY_STORE = "client.keystore";
@@ -49,7 +57,7 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
   private static final String SERVER_KEY_STORE = "cacheserver.keystore";
   private static final String SERVER_TRUST_STORE = "cacheserver.truststore";
 
-  private static CacheServerSSLConnectionDUnitTest instance = new CacheServerSSLConnectionDUnitTest("CacheServerSSLConnectionDUnit");
+  private static CacheServerSSLConnectionDUnitTest instance = new CacheServerSSLConnectionDUnitTest(); // TODO: memory leak
 
   private Cache cache;
   private CacheServer cacheServer;
@@ -62,10 +70,6 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
     disconnectAllFromDS();
   }
 
-  public CacheServerSSLConnectionDUnitTest(String name) {
-    super(name);
-  }
-
   public Cache createCache(Properties props) throws Exception
   {
     props.setProperty(MCAST_PORT, "0");
@@ -98,7 +102,6 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
     this.cacheServer.stop();
   }
 
-
   @SuppressWarnings("rawtypes")
   public void setUpServerVM(boolean cacheServerSslenabled) throws Exception {
     Properties gemFireProps = new Properties();
@@ -229,6 +232,7 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testCacheServerSSL() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(1);
@@ -246,10 +250,9 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
     clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled, cacheClientSslRequireAuth, CLIENT_KEY_STORE, CLIENT_TRUST_STORE));
     clientVM.invoke(() -> doClientRegionTestTask());
     serverVM.invoke(() -> doServerRegionTestTask());
-
   }
 
-
+  @Test
   public void testNonSSLClient() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(1);
@@ -292,6 +295,7 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testSSLClientWithNoAuth() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(1);
@@ -328,6 +332,7 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testSSLClientWithNonSSLServer() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
index ea105d3..1bc2322 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.client.internal;
 
+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.Cache;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.locator.ClientConnectionRequest;
@@ -55,6 +64,7 @@ import java.util.concurrent.TimeUnit;
 /**
  *
  */
+@Category(DistributedTest.class)
 public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
 
   /**
@@ -69,14 +79,15 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
   private static final int ALLOWABLE_ERROR_IN_COUNT = 1;
   protected static final long MAX_WAIT = 60000;
 
-  public LocatorLoadBalancingDUnitTest(String name) {
-    super(name);
+  public LocatorLoadBalancingDUnitTest() {
+    super();
   }
 
   /**
    * Test the locator discovers a bridge server and is initialized with
    * the correct load for that bridge server.
    */
+  @Test
   public void testDiscovery() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -112,6 +123,7 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
    * Test that the locator will properly estimate the load for servers when
    * it receives connection requests.
    */
+  @Test
   public void testEstimation() throws IOException, ClassNotFoundException {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -169,6 +181,7 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
    *
    * @throws Exception
    */
+  @Test
   public void testLoadMessaging() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -219,6 +232,7 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
    *
    * @throws Exception
    */
+  @Test
   public void testBalancing() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -284,6 +298,7 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
    *
    * @throws Exception
    */
+  @Test
   public void testIntersectingServerGroups() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -367,6 +382,7 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
 
   }
 
+  @Test
   public void testCustomLoadProbe() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
index 7b1a513..2f79e50 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.client.internal;
 
+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.*;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -38,7 +47,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
 /**
  *
  */
-public abstract class LocatorTestBase extends DistributedTestCase {
+public abstract class LocatorTestBase extends JUnit4DistributedTestCase {
   protected static final String CACHE_KEY = "CACHE";
   protected static final String LOCATOR_KEY = "LOCATOR";
   protected static final String REGION_NAME = "A_REGION";
@@ -50,8 +59,8 @@ public abstract class LocatorTestBase extends DistributedTestCase {
    */
   protected static final HashMap remoteObjects = new HashMap();
 
-  public LocatorTestBase(String name) {
-    super(name);
+  public LocatorTestBase() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
index e143462..c372374 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
@@ -16,31 +16,40 @@
  */
 package com.gemstone.gemfire.cache.client.internal;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
 /**
  * Test for GEODE-396
  */
-public class SSLNoClientAuthDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class SSLNoClientAuthDUnitTest extends JUnit4DistributedTestCase {
   
-  private static final long serialVersionUID = 1L;
   private Cache cache;
   private CacheServer cacheServer;
   private ClientCache clientCache;
@@ -49,17 +58,13 @@ public class SSLNoClientAuthDUnitTest extends DistributedTestCase {
   
   private static final String DEFAULT_STORE = "default.keystore";
   
-  private static SSLNoClientAuthDUnitTest instance = new SSLNoClientAuthDUnitTest("SSLNoClientAuthDUnitTest");
+  private static SSLNoClientAuthDUnitTest instance = new SSLNoClientAuthDUnitTest();
   
   @Override
   public final void preSetUp() throws Exception {
     disconnectAllFromDS();
   }
 
-  public SSLNoClientAuthDUnitTest(String name) {
-    super(name);
-  }  
-
   public Cache createCache(Properties props) throws Exception
   {
     props.setProperty(MCAST_PORT, "0");
@@ -228,6 +233,7 @@ public class SSLNoClientAuthDUnitTest extends DistributedTestCase {
   /**
    * Test for GEODE-396
    */
+  @Test
   public void testSSLServerWithNoAuth() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
index 68dfedc..412713f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
@@ -16,13 +16,50 @@
  */
 package com.gemstone.gemfire.cache.management;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.LowMemoryException;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerOperationException;
 import com.gemstone.gemfire.cache.control.ResourceManager;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionException;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@ -37,28 +74,36 @@ import com.gemstone.gemfire.internal.cache.DistributedRegion;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper;
-import com.gemstone.gemfire.internal.cache.control.*;
+import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor;
+import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
+import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
 import com.gemstone.gemfire.internal.cache.control.MemoryThresholds.MemoryState;
+import com.gemstone.gemfire.internal.cache.control.ResourceAdvisor;
+import com.gemstone.gemfire.internal.cache.control.ResourceListener;
+import com.gemstone.gemfire.internal.cache.control.TestMemoryThresholdListener;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-import util.TestException;
-
-import java.io.Serializable;
-import java.util.*;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
 /**
  * Tests the Heap Memory thresholds of {@link ResourceManager}
  * @since GemFire 6.0
  */
+@Category(DistributedTest.class)
 public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
   
   public static class Range implements Serializable {
@@ -89,10 +134,6 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
   final String removeExpectedFunctionExString =
     "<ExpectedException action=remove>" + expectedFunctionEx + "</ExpectedException>";
   
-  public MemoryThresholdsDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   protected final void postSetUpClientServerTestCase() throws Exception {
     Invoke.invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
@@ -105,10 +146,12 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     Invoke.invokeInEveryVM(resetResourceManager);
   }
 
+  @Test
   public void testPRClientPutRejection() throws Exception {
     doClientServerTest("parRegReject", true/*createPR*/);
   }
 
+  @Test
   public void testDistributedRegionClientPutRejection() throws Exception {
     doClientServerTest("distrReject", false/*createPR*/);
   }
@@ -149,12 +192,15 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
         false/*catchLowMemoryException*/, new Range(Range.DEFAULT, Range.DEFAULT.width()+1));
   }
 
+  @Test
   public void testDistributedRegionRemotePutRejectionLocalDestroy() throws Exception {
     doDistributedRegionRemotePutRejection(true, false);
   }
+  @Test
   public void testDistributedRegionRemotePutRejectionCacheClose() throws Exception {
     doDistributedRegionRemotePutRejection(false, true);
   }
+  @Test
   public void testDistributedRegionRemotePutRejectionBelowThreshold() throws Exception {
     doDistributedRegionRemotePutRejection(false, false);
   }
@@ -242,22 +288,23 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
         false/*catchLowMemoryException*/, r2);
   }
 
+  @Test
   public void testBug45513() {
     ResourceManager rm = getCache().getResourceManager();
-    assertEquals(0.0f, rm.getCriticalHeapPercentage());
-    assertEquals(0.0f, rm.getEvictionHeapPercentage());
+    assertEquals(0.0f, rm.getCriticalHeapPercentage(),0);
+    assertEquals(0.0f, rm.getEvictionHeapPercentage(),0);
     
     rm.setEvictionHeapPercentage(50);
     rm.setCriticalHeapPercentage(90);
     
     // verify
-    assertEquals(50.0f, rm.getEvictionHeapPercentage());
-    assertEquals(90.0f, rm.getCriticalHeapPercentage());
+    assertEquals(50.0f, rm.getEvictionHeapPercentage(),0);
+    assertEquals(90.0f, rm.getCriticalHeapPercentage(),0);
     
     getCache().createRegionFactory(RegionShortcut.REPLICATE_HEAP_LRU).create(getName());
     
-    assertEquals(50.0f, rm.getEvictionHeapPercentage());
-    assertEquals(90.0f, rm.getCriticalHeapPercentage());
+    assertEquals(50.0f, rm.getEvictionHeapPercentage(),0);
+    assertEquals(90.0f, rm.getCriticalHeapPercentage(),0);
   }
 
   /**
@@ -265,6 +312,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
    * critical threshold
    * @throws Exception
    */
+  @Test
   public void testDistributedRegionRemoteClientPutRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -306,6 +354,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
    * remote DISABLED events are delivered
    * @throws Exception
    */
+  @Test
   public void testDisabledThresholds() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -360,6 +409,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-427: random ports, time sensitive, waitForCriterions
+  @Test
   public void testEventDelivery() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -477,6 +527,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     verifyListenerValue(server1, MemoryState.NORMAL, 2, true);
   }
 
+  @Test
   public void testCleanAdvisorClose() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -508,27 +559,33 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     verifyProfiles(server3, 2);
   }
 
+  @Test
   public void testPR_RemotePutRejectionLocalDestroy() throws Exception {
     prRemotePutRejection(false, true, false);
   }
 
+  @Test
   public void testPR_RemotePutRejectionCacheClose() throws Exception {
     prRemotePutRejection(true, false, false);
   }
 
+  @Test
   public void testPR_RemotePutRejection() throws Exception {
     prRemotePutRejection(false, false, false);
   }
 
+  @Test
   public void testPR_RemotePutRejectionLocalDestroyWithTx() throws Exception {
     prRemotePutRejection(false, true, true);
   }
 
+  @Test
   public void testPR_RemotePutRejectionCacheCloseWithTx() throws Exception {
     prRemotePutRejection(true, false, true);
   }
 
   @Category(FlakyTest.class) // GEODE-987: random ports, failed to throw expected ResourceException, overly complex expected exception handling, memory and GC sensitive, expiration, waitForCriterion
+  @Test
   public void testPR_RemotePutRejectionWithTx() throws Exception {
     prRemotePutRejection(false, false, true);
   }
@@ -674,9 +731,9 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     doPutAlls(accessor, regionName, false, false, r1);
   }
 
-  // this test is DISABLED due to test issues.  It sometimes
-  // fails with a TransactionDataNotColocatedException.  See bug #52222
-  public void disabledtestTxCommitInCritical() throws Exception {
+  @Ignore("this test is DISABLED due to test issues.  It sometimes fails with a TransactionDataNotColocatedException.  See bug #52222")
+  @Test
+  public void testTxCommitInCritical() throws Exception {
     final Host host = Host.getHost(0);
     final VM accessor = host.getVM(0);
     final VM server1 = host.getVM(1);
@@ -781,6 +838,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     });
   }
 
+  @Test
   public void testDRFunctionExecutionRejection() throws Exception {
     IgnoredException.addIgnoredException("LowMemoryException");
     final Host host = Host.getHost(0);
@@ -894,8 +952,9 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     });
   }
 
-  // this test is DISABLED due to intermittent failures.  See bug #52222
-  public void disabledtestPRFunctionExecutionRejection() throws Exception {
+  @Ignore("this test is DISABLED due to intermittent failures.  See bug #52222")
+  @Test
+  public void testPRFunctionExecutionRejection() throws Exception {
     IgnoredException.addIgnoredException("LowMemoryException");
     final Host host = Host.getHost(0);
     final VM accessor = host.getVM(0);
@@ -1090,7 +1149,8 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
       }
     });
   }
-  
+
+  @Test
   public void testFunctionExecutionRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -1612,6 +1672,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
   /**
    * putting this test here because junit does not have host stat sampler enabled
    */
+  @Test
   public void testLocalStatListenerRegistration() throws Exception{
     final CountDownLatch latch = new CountDownLatch(1);
     Cache cache = getCache();
@@ -1667,7 +1728,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     while (true) {
       count++;
       if (count > 75) {
-        throw new TestException("Did not receive a stat listener callback");
+        throw new AssertionError("Did not receive a stat listener callback");
       }
       byte[] value = new byte[(int)(maxTenuredMemory*0.01)];
       r.put("key-"+count, value);
@@ -1686,6 +1747,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
    * once the VM is no longer critical
    * @throws Exception
    */
+  @Test
   public void testLRLoadRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM vm = host.getVM(2);
@@ -1693,7 +1755,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     final float criticalHeapThresh = 0.90f;
     final int fakeHeapMaxSize = 1000;
 
-    vm.invoke(() -> DistributedTestCase.disconnectFromDS());
+    vm.invoke(() -> disconnectFromDS());
     
     vm.invoke(new CacheSerializableRunnable("test LocalRegion load passthrough when critical") {
       @Override
@@ -1802,6 +1864,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
    * to a safe state then test that they are allowed.
    * @throws Exception
    */
+  @Test
   public void testDRLoadRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM replicate1 = host.getVM(2);
@@ -1811,8 +1874,8 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     final int fakeHeapMaxSize = 1000;
 
     // Make sure the desired VMs will have a fresh DS.
-    AsyncInvocation d1 = replicate1.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
-    AsyncInvocation d2 = replicate2.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
+    AsyncInvocation d1 = replicate1.invokeAsync(() -> disconnectFromDS());
+    AsyncInvocation d2 = replicate2.invokeAsync(() -> disconnectFromDS());
     d1.join();
     assertFalse(d1.exceptionOccurred());
     d2.join();
@@ -1984,6 +2047,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
    * if the VM with the bucket is in a critical state.
    * @throws Exception
    */
+  @Test
   public void testPRLoadRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM accessor = host.getVM(1);
@@ -1993,8 +2057,8 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     final int fakeHeapMaxSize = 1000;
 
     // Make sure the desired VMs will have a fresh DS.
-    AsyncInvocation d0 = accessor.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
-    AsyncInvocation d1 = ds1.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
+    AsyncInvocation d0 = accessor.invokeAsync(() -> disconnectFromDS());
+    AsyncInvocation d1 = ds1.invokeAsync(() -> disconnectFromDS());
     d0.join();
     assertFalse(d0.exceptionOccurred());
     d1.join();
@@ -2215,6 +2279,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
     };
   };
 
+  @Test
   public void testCriticalMemoryEventTolerance() {
     final Host host = Host.getHost(0);
     final VM vm = host.getVM(0);
@@ -2245,7 +2310,8 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
       }
     });
   }
-  
+
+  @Test
   public void testEvictionMemoryEventTolerance() {
     final Host host = Host.getHost(0);
     final VM vm = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
index 3cd1d98..d89641c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
@@ -16,7 +16,34 @@
  */
 package com.gemstone.gemfire.cache.management;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.LowMemoryException;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerOperationException;
@@ -28,29 +55,46 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.internal.cache.*;
-import com.gemstone.gemfire.internal.cache.control.*;
+import com.gemstone.gemfire.internal.cache.DistributedRegion;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper;
+import com.gemstone.gemfire.internal.cache.ProxyBucketRegion;
+import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
+import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
 import com.gemstone.gemfire.internal.cache.control.MemoryThresholds.MemoryState;
+import com.gemstone.gemfire.internal.cache.control.OffHeapMemoryMonitor;
 import com.gemstone.gemfire.internal.cache.control.OffHeapMemoryMonitor.OffHeapMemoryMonitorObserver;
+import com.gemstone.gemfire.internal.cache.control.ResourceAdvisor;
+import com.gemstone.gemfire.internal.cache.control.ResourceListener;
+import com.gemstone.gemfire.internal.cache.control.TestMemoryThresholdListener;
 import com.gemstone.gemfire.internal.cache.partitioned.RegionAdvisor;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 /**
  * Tests the Off-Heap Memory thresholds of {@link ResourceManager}
  * 
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
-  private static final long serialVersionUID = -684231183212051910L;
 
   final String expectedEx = LocalizedStrings.MemoryMonitor_MEMBER_ABOVE_CRITICAL_THRESHOLD.getRawText().replaceAll("\\{[0-9]+\\}",
       ".*?");
@@ -61,10 +105,6 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
   final String addExpectedBelow = "<ExpectedException action=add>" + this.expectedBelow + "</ExpectedException>";
   final String removeExpectedBelow = "<ExpectedException action=remove>" + this.expectedBelow + "</ExpectedException>";
 
-  public MemoryThresholdsOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postSetUpClientServerTestCase() throws Exception {
     IgnoredException.addIgnoredException(expectedEx);
@@ -93,9 +133,8 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
 
   /**
    * Make sure appropriate events are delivered when moving between states.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testEventDelivery() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -191,8 +230,8 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
   /**
    * test that disabling threshold does not cause remote event and
    * remote DISABLED events are delivered
-   * @throws Exception
    */
+  @Test
   public void testDisabledThresholds() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -304,8 +343,8 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
   /**
    * test that puts in a client are rejected when a remote VM crosses
    * critical threshold
-   * @throws Exception
    */
+  @Test
   public void testDistributedRegionRemoteClientPutRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -344,35 +383,39 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
     setUsageBelowEviction(server2, regionName);
   }
 
+  @Test
   public void testDistributedRegionRemotePutRejectionLocalDestroy() throws Exception {
     doDistributedRegionRemotePutRejection(true, false);
   }
-  
+
+  @Test
   public void testDistributedRegionRemotePutRejectionCacheClose() throws Exception {
     doDistributedRegionRemotePutRejection(false, true);
   }
-  
+
+  @Test
   public void testDistributedRegionRemotePutRejectionBelowThreshold() throws Exception {
     doDistributedRegionRemotePutRejection(false, false);
   }
-  
+
+  @Test
   public void testGettersAndSetters() {
     getSystem(getOffHeapProperties());
     ResourceManager rm = getCache().getResourceManager();
-    assertEquals(0.0f, rm.getCriticalOffHeapPercentage());
-    assertEquals(0.0f, rm.getEvictionOffHeapPercentage());
+    assertEquals(0.0f, rm.getCriticalOffHeapPercentage(),0);
+    assertEquals(0.0f, rm.getEvictionOffHeapPercentage(),0);
     
     rm.setEvictionOffHeapPercentage(50);
     rm.setCriticalOffHeapPercentage(90);
     
     // verify
-    assertEquals(50.0f, rm.getEvictionOffHeapPercentage());
-    assertEquals(90.0f, rm.getCriticalOffHeapPercentage());
+    assertEquals(50.0f, rm.getEvictionOffHeapPercentage(),0);
+    assertEquals(90.0f, rm.getCriticalOffHeapPercentage(),0);
     
     getCache().createRegionFactory(RegionShortcut.REPLICATE_HEAP_LRU).create(getName());
     
-    assertEquals(50.0f, rm.getEvictionOffHeapPercentage());
-    assertEquals(90.0f, rm.getCriticalOffHeapPercentage());
+    assertEquals(50.0f, rm.getEvictionOffHeapPercentage(),0);
+    assertEquals(90.0f, rm.getCriticalOffHeapPercentage(),0);
   }
   
   /**
@@ -464,9 +507,9 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
    * Test that DistributedRegion cacheLoade and netLoad are passed through to the 
    * calling thread if the local VM is in a critical state.  Once the VM has moved
    * to a safe state then test that they are allowed.
-   * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-438: test pollution, async actions, time sensitive, waitForCriterion, TODO: consider disconnect DS in setup
+  @Test
   public void testDRLoadRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM replicate1 = host.getVM(1);
@@ -474,8 +517,8 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
     final String rName = getUniqueName();
     
     // Make sure the desired VMs will have a fresh DS.
-    AsyncInvocation d1 = replicate1.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
-    AsyncInvocation d2 = replicate2.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
+    AsyncInvocation d1 = replicate1.invokeAsync(() -> disconnectFromDS());
+    AsyncInvocation d2 = replicate2.invokeAsync(() -> disconnectFromDS());
     d1.join();
     assertFalse(d1.exceptionOccurred());
     d2.join();
@@ -675,28 +718,34 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
       getCache().getLoggerI18n().fine(removeExpectedBelow);
     };
   };
-  
+
+  @Test
   public void testPR_RemotePutRejectionLocalDestroy() throws Exception {
     prRemotePutRejection(false, true, false);
   }
 
+  @Test
   public void testPR_RemotePutRejectionCacheClose() throws Exception {
     prRemotePutRejection(true, false, false);
   }
 
+  @Test
   public void testPR_RemotePutRejection() throws Exception {
     prRemotePutRejection(false, false, false);
   }
 
+  @Test
   public void testPR_RemotePutRejectionLocalDestroyWithTx() throws Exception {
     prRemotePutRejection(false, true, true);
   }
 
+  @Test
   public void testPR_RemotePutRejectionCacheCloseWithTx() throws Exception {
     prRemotePutRejection(true, false, true);
   }
 
   @Category(FlakyTest.class) // GEODE-500: time sensitive, memory sensitive and GC dependent, waitForCriterions
+  @Test
   public void testPR_RemotePutRejectionWithTx() throws Exception {
     prRemotePutRejection(false, false, true);
   }
@@ -869,9 +918,9 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
   /**
    * Test that a Partitioned Region loader invocation is rejected
    * if the VM with the bucket is in a critical state.
-   * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-551: waitForCriterion, memory sensitive
+  @Test
   public void testPRLoadRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM accessor = host.getVM(1);
@@ -879,8 +928,8 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
     final String rName = getUniqueName();
 
     // Make sure the desired VMs will have a fresh DS. TODO: convert these from AsyncInvocation to invoke
-    AsyncInvocation d0 = accessor.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
-    AsyncInvocation d1 = ds1.invokeAsync(() -> DistributedTestCase.disconnectFromDS());
+    AsyncInvocation d0 = accessor.invokeAsync(() -> disconnectFromDS());
+    AsyncInvocation d1 = ds1.invokeAsync(() -> disconnectFromDS());
     d0.join();
     assertFalse(d0.exceptionOccurred());
     d1.join();
@@ -1096,14 +1145,14 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
    * Test that LocalRegion cache Loads are not stored in the Region
    * if the VM is in a critical state, then test that they are allowed
    * once the VM is no longer critical
-   * @throws Exception
    */
+  @Test
   public void testLRLoadRejection() throws Exception {
     final Host host = Host.getHost(0);
     final VM vm = host.getVM(2);
     final String rName = getUniqueName();
 
-    vm.invoke(() -> DistributedTestCase.disconnectFromDS());
+    vm.invoke(() -> disconnectFromDS());
     
     vm.invoke(new CacheSerializableRunnable("test LocalRegion load passthrough when critical") {
       @Override
@@ -1214,7 +1263,8 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
     }
     return ret;
   }
-  
+
+  @Test
   public void testCleanAdvisorClose() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -1246,11 +1296,13 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
     verifyProfiles(server1, 2);
     verifyProfiles(server3, 2);
   }
-  
+
+  @Test
   public void testPRClientPutRejection() throws Exception {
     doClientServerTest("parRegReject", true/*createPR*/);
   }
 
+  @Test
   public void testDistributedRegionClientPutRejection() throws Exception {
     doClientServerTest("distrReject", false/*createPR*/);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/management/ResourceManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/ResourceManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/ResourceManagerDUnitTest.java
index b8d5008..361ac2e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/ResourceManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/ResourceManagerDUnitTest.java
@@ -16,12 +16,15 @@
  */
 package com.gemstone.gemfire.cache.management;
 
+import static org.junit.Assert.*;
+
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.logging.log4j.Logger;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -36,7 +39,6 @@ import com.gemstone.gemfire.cache.partition.PartitionRegionInfo;
 import com.gemstone.gemfire.cache.query.QueryException;
 import com.gemstone.gemfire.cache.query.QueryInvalidException;
 import com.gemstone.gemfire.cache.query.SelectResults;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.cache.BucketAdvisor;
@@ -47,9 +49,9 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.CreateBucketResult;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
+import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
 import com.gemstone.gemfire.internal.cache.control.ResourceEvent;
 import com.gemstone.gemfire.internal.cache.control.ResourceListener;
-import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
 import com.gemstone.gemfire.internal.cache.partitioned.BecomePrimaryBucketMessage;
 import com.gemstone.gemfire.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse;
 import com.gemstone.gemfire.internal.cache.partitioned.Bucket;
@@ -60,13 +62,14 @@ import com.gemstone.gemfire.internal.cache.partitioned.InternalPartitionDetails;
 import com.gemstone.gemfire.internal.cache.partitioned.PRLoad;
 import com.gemstone.gemfire.internal.cache.partitioned.RemoveBucketMessage;
 import com.gemstone.gemfire.internal.cache.partitioned.RemoveBucketMessage.RemoveBucketResponse;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 /**
@@ -75,19 +78,17 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * TODO: javadoc this test properly and cleanup the helper methods to be
  * more flexible and understandable
  */
-public class ResourceManagerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ResourceManagerDUnitTest extends JUnit4CacheTestCase {
   private static final Logger logger = LogService.getLogger();
 
-  public static final int SYSTEM_LISTENERS = 1;
-
-  public ResourceManagerDUnitTest(final String name) {
-    super(name);
-  }
+  private static final int SYSTEM_LISTENERS = 1;
 
   /**
    * Creates a cache in the controller and exercises all methods on the
    * ResourceManager without having any partitioned regions defined.
    */
+  @Test
   public void testResourceManagerBasics() {
     Cache cache = getCache();
     
@@ -131,6 +132,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * Creates partitioned regions in multiple vms and fully exercises the
    * getPartitionedRegionDetails API on ResourceManager.
    */
+  @Test
   public void testGetPartitionedRegionDetails() {
     // two regions
     final String[] regionPath = new String[] {
@@ -299,6 +301,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * Creates partitioned regions in multiple vms and fully exercises the
    * internal-only getInternalPRDetails API on ResourceManager.
    */
+  @Test
   public void testGetInternalPRDetails() {
     // two regions
     final String[] regionPath = new String[] {
@@ -459,7 +462,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
                 PRLoad load = mbrDetails.getPRLoad();
                 assertNotNull(load);
                 assertEquals((float)localMaxMemory[membersIdx], 
-                             load.getWeight());
+                             load.getWeight(),0);
                 
                 int totalBucketBytes = 0;
                 int primaryCount = 0;
@@ -469,7 +472,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
                   totalBucketBytes += bucketBytes;
                   
                   // validate against the PRLoad
-                  assertEquals((float)bucketBytes, load.getReadLoad(bid));
+                  assertEquals((float)bucketBytes, load.getReadLoad(bid),0);
                   if (load.getWriteLoad(bid) > 0) { // found a primary
                     primaryCount++;
                   }
@@ -681,6 +684,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testDeposePrimaryBucketMessage() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0"
@@ -749,6 +753,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
     assertTrue(deposedPrimary);
   }
 
+  @Test
   public void testBecomePrimaryBucketMessage() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0"
@@ -959,6 +964,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testRemoveDuringGetEntry() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -971,6 +977,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-755: thread unsafe test hook (bucketReadHook), remove bucket fails, possible product bug in rebalancing
+  @Test
   public void testRemoveDuringGet() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -980,6 +987,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-673: thread unsafe test hook (bucketReadHook), remove bucket fails, possible product bug in rebalancing
+  @Test
   public void testRemoveDuringContainsKey() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -988,6 +996,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
       });
   }
 
+  @Test
   public void testRemoveDuringContainsValueForKey() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -996,6 +1005,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
       });
   }
 
+  @Test
   public void testRemoveDuringKeySet() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -1004,6 +1014,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
       });
   }
 
+  @Test
   public void testRemoveDuringValues() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -1012,6 +1023,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
       });
   }
 
+  @Test
   public void testRemoveDuringEntrySet() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -1024,6 +1036,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
       });
   }
 
+  @Test
   public void testRemoveDuringQuery() {
     doOpDuringBucketRemove(new OpDuringBucketRemove() {
         public void runit(PartitionedRegion pr, Object key, Object value) {
@@ -1040,6 +1053,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
       });
   }
 
+  @Test
   public void testRemoveBucketMessage() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0"
@@ -1139,6 +1153,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * to make sure that all colocated buckets are removed together.
    */
   @Category(FlakyTest.class) // GEODE-928: RemoveBucketMessage failure?
+  @Test
   public void testRemoveColocatedBuckets() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0", 
@@ -1259,6 +1274,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * Creates a bucket on two members. Then brings up a third member and creates
    * an extra redundant copy of the bucket on it.
    */
+  @Test
   public void testCreateRedundantBucket() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0"
@@ -1370,6 +1386,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * Creates colocated buckets on two members. Then brings up a third member
    * and creates an extra redundant copy of the buckets on it.
    */
+  @Test
   public void testCreateRedundantColocatedBuckets() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0", 
@@ -1508,6 +1525,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * Creates a bucket on two members. Then brings up a third member and moves
    * the non-primary bucket to it.
    */
+  @Test
   public void testMoveBucket() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0"
@@ -1652,6 +1670,7 @@ public class ResourceManagerDUnitTest extends CacheTestCase {
    * Creates colocated buckets on two members. Then brings up a third member 
    * and moves the non-primary colocated buckets to it.
    */
+  @Test
   public void testMoveColocatedBuckets() {
     final String[] regionPath = new String[] {
         getUniqueName() + "-PR-0", 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/mapInterface/PutAllGlobalLockJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/mapInterface/PutAllGlobalLockJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/mapInterface/PutAllGlobalLockJUnitTest.java
index 0e9256c..1e018f6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/mapInterface/PutAllGlobalLockJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/mapInterface/PutAllGlobalLockJUnitTest.java
@@ -16,34 +16,36 @@
  */
 package com.gemstone.gemfire.cache.mapInterface;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.ThreadUtils;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 import java.util.TreeMap;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
-public class PutAllGlobalLockJUnitTest {
+public class PutAllGlobalLockJUnitTest { // TODO: reformat
     
     Region testRegion = null;
     volatile boolean done = false;
     boolean testOK = false;
     Thread thread;
     
-    public PutAllGlobalLockJUnitTest() {
-    }
-    
     @Before
     public void setUp() throws Exception {
         try {
@@ -59,8 +61,7 @@ public class PutAllGlobalLockJUnitTest {
             RegionAttributes regionAttributes = factory.create();
             testRegion = cache.createRegion("TestRegion", regionAttributes);
         } catch (Exception e) {
-            e.printStackTrace();
-            fail("test failed to create a distributed system/cache");
+            throw new AssertionError("test failed to create a distributed system/cache", e);
         }
     }
     
@@ -76,7 +77,7 @@ public class PutAllGlobalLockJUnitTest {
             ThreadUtils.join(this.thread, 30 * 1000);
             assertTrue(this.testOK);
         } catch (Exception e) {
-            fail("Test has failed due to "+e);
+            throw new AssertionError("Test has failed due to ", e);
         }      
     }
        

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionRegionHelperDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionRegionHelperDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionRegionHelperDUnitTest.java
index 6910089..b96d1e5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionRegionHelperDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/partition/PartitionRegionHelperDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.partition;
 
+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.net.UnknownHostException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -53,12 +62,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.internal.cache.partitioned.fixed.QuarterPartitionResolver;
 
-public class PartitionRegionHelperDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionRegionHelperDUnitTest extends JUnit4CacheTestCase {
 
-  public PartitionRegionHelperDUnitTest(String name) {
-    super(name);
+  public PartitionRegionHelperDUnitTest() {
+    super();
   }
 
+  @Test
   public void testAssignBucketsToPartitions() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -124,6 +135,7 @@ public class PartitionRegionHelperDUnitTest extends CacheTestCase {
   }
 
   
+  @Test
   public void testAssignBucketsToPartitions_FPR() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -288,6 +300,7 @@ public class PartitionRegionHelperDUnitTest extends CacheTestCase {
     
   }
   
+  @Test
   public void testMembersForKey() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -520,6 +533,7 @@ public class PartitionRegionHelperDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testMoveSingleBucket() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -618,6 +632,7 @@ public class PartitionRegionHelperDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testMovePercentage() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryJUnitTest.java
index 455cb32..d677b17 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryJUnitTest.java
@@ -26,9 +26,8 @@
  */
 package com.gemstone.gemfire.cache.query;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.junit.runners.MethodSorters.NAME_ASCENDING;
+import static org.junit.Assert.*;
+import static org.junit.runners.MethodSorters.*;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -44,8 +43,6 @@ import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import util.TestException;
-
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
@@ -415,7 +412,7 @@ public class QueryJUnitTest {
       try {
         q.execute(params);
       } catch (Exception e) {
-        throw new TestException("exception occured while executing query", e);
+        throw new AssertionError("exception occured while executing query", e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryTestUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryTestUtils.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryTestUtils.java
index 16784c4..fa8980c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryTestUtils.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/QueryTestUtils.java
@@ -16,11 +16,7 @@
  */
 package com.gemstone.gemfire.cache.query;
 
-import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-import com.gemstone.gemfire.test.dunit.VM;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import java.io.File;
 import java.io.IOException;
@@ -29,12 +25,23 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
 
 /**
  * Utility class for testing supported queries
- * 
- * 
  */
 public class QueryTestUtils implements Serializable {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CloseCacheAuthorization.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CloseCacheAuthorization.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CloseCacheAuthorization.java
index 720168f..da26f4e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CloseCacheAuthorization.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CloseCacheAuthorization.java
@@ -18,8 +18,6 @@ package com.gemstone.gemfire.cache.query.dunit;
 
 import java.security.Principal;
 
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheClosedException;
@@ -29,7 +27,11 @@ import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.security.AccessControl;
 import com.gemstone.gemfire.security.NotAuthorizedException;
 
-public class CloseCacheAuthorization extends TestCase implements AccessControl {
+/**
+ * Used by CqStateDUnitTest
+ */
+public class CloseCacheAuthorization implements AccessControl {
+
   private DistributedMember remoteDistributedMember;
   private Cache cache;
   private LogWriter logger;
@@ -43,8 +45,7 @@ public class CloseCacheAuthorization extends TestCase implements AccessControl {
   }
 
   @Override
-  public void init(Principal principal, DistributedMember remoteMember,
-      Cache cache) throws NotAuthorizedException {
+  public void init(Principal principal, DistributedMember remoteMember, Cache cache) throws NotAuthorizedException {
     this.remoteDistributedMember = remoteMember;
     this.cache = cache;
     this.logger = cache.getSecurityLogger();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
index 611c461..eb30e65 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
@@ -16,8 +16,13 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.QueryTestUtils;
@@ -25,26 +30,23 @@ import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.index.IndexManager;
 import com.gemstone.gemfire.cache.query.internal.index.IndexManager.TestHook;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheSerializableRunnable.CacheSerializableRunnableException;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class CompactRangeIndexDUnitTest extends DistributedTestCase{
+@Category(DistributedTest.class)
+public class CompactRangeIndexDUnitTest extends JUnit4DistributedTestCase {
 
   QueryTestUtils utils;
   VM vm0;
   
-  public CompactRangeIndexDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     getSystem();
@@ -65,6 +67,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
   /*
    * Tests that the message component of the exception is not null
    */
+  @Test
   public void testIndexInvalidDueToExpressionOnPartitionedRegion() throws Exception {
     Host host = Host.getHost(0);
     utils.createPartitionRegion("examplePartitionedRegion", Portfolio.class, vm0);
@@ -84,6 +87,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
   }
   
 
+  @Test
   public void testCompactRangeIndexForIndexElemArray() throws Exception{
     doPut(200);// around 66 entries for a key in the index (< 100 so does not create a ConcurrentHashSet)
     doQuery();
@@ -94,6 +98,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
     Thread.sleep(5000);
   }
   
+  @Test
   public void testCompactRangeIndexForConcurrentHashSet() throws Exception{
     doPut(333); //111 entries for a key in the index (> 100 so creates a ConcurrentHashSet)
     doQuery();
@@ -103,6 +108,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
     doQuery();
   }
 
+  @Test
   public void testNoSuchElemException() throws Exception{
     setHook();
     doPutSync(300);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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/b914df23/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 b005463..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
@@ -17,6 +17,15 @@
 package com.gemstone.gemfire.cache.query.dunit;
 
 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 org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
@@ -41,10 +50,6 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 @Category(DistributedTest.class)
 public class GroupByPartitionedQueryDUnitTest extends GroupByDUnitImpl {
 
-  public GroupByPartitionedQueryDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   protected GroupByTestImpl createTestInstance() {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 b9ff7cb..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
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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.Iterator;
 
 import org.junit.experimental.categories.Category;
@@ -47,12 +56,9 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  *
  */
 @Category(DistributedTest.class)
-public class GroupByQueryDUnitTest extends CacheTestCase {
-
-  public GroupByQueryDUnitTest(String name) {
-    super(name);
-  }
+public class GroupByQueryDUnitTest extends JUnit4CacheTestCase {
 
+  @Test
   public void testConvertibleGroupByNoIndex() throws Exception {
 
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
index 95a2580..072bef0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
@@ -18,27 +18,28 @@ package com.gemstone.gemfire.cache.query.dunit;
 
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.QueryTestUtils;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class HashIndexDUnitTest extends DistributedTestCase{
+@Category(DistributedTest.class)
+public class HashIndexDUnitTest extends JUnit4DistributedTestCase {
 
   QueryTestUtils utils;
   VM vm0;
   
-  public HashIndexDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     getSystem();
@@ -57,6 +58,7 @@ public class HashIndexDUnitTest extends DistributedTestCase{
   }
   
 
+  @Test
   public void testHashIndexForIndexElemArray() throws Exception{
     doPut(200);// around 66 entries for a key in the index (< 100 so does not create a ConcurrentHashSet)
     doQuery();
@@ -67,6 +69,7 @@ public class HashIndexDUnitTest extends DistributedTestCase{
     Thread.sleep(5000);
   }
   
+  @Test
   public void testHashIndexForConcurrentHashSet() throws Exception{
     doPut(333); //111 entries for a key in the index (> 100 so creates a ConcurrentHashSet)
     doQuery();


[45/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
index 1bb33e7..adaa365 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
@@ -21,16 +21,11 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-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 java.util.Collection;
 import java.util.List;
 
-import junit.framework.Assert;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -60,9 +55,6 @@ import com.gemstone.gemfire.cache.query.internal.types.ObjectTypeImpl;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- * 
- */
 @Category(IntegrationTest.class)
 public class LikePredicateJUnitTest {
 
@@ -399,7 +391,7 @@ public class LikePredicateJUnitTest {
    * Tests a simple % terminated like predicate with an AND condition
    * @throws Exception
    */
-  public void likePercentageTerminated_4(boolean useBindPrm) throws Exception {
+  private void likePercentageTerminated_4(boolean useBindPrm) throws Exception {
     Cache cache = CacheUtils.getCache();
     AttributesFactory attributesFactory = new AttributesFactory();
     RegionAttributes regionAttributes = attributesFactory.create();
@@ -1938,8 +1930,8 @@ public class LikePredicateJUnitTest {
   public void testLikeWithNewLineWithIndex() throws Exception {
     likeWithNewLine(true);
   }
-  
-  public void likeWithNewLine(boolean useIndex) throws Exception {
+
+  private void likeWithNewLine(boolean useIndex) throws Exception {
     // setup
     Cache cache = CacheUtils.getCache();
     AttributesFactory attributesFactory = new AttributesFactory();
@@ -1955,38 +1947,38 @@ public class LikePredicateJUnitTest {
     }
     Query query = qs.newQuery("select * from /pos a where a like '%bc%'");
     SelectResults sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%bc\n%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%bcde%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 0); // no results as newline is required
+    assertEquals(sr.size(), 0); // no results as newline is required
                                        // whitespace
     query = qs.newQuery("select * from /pos a where a like '%bc\nde%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%de%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%\nde%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%bc%de%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%zyx%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 0);
+    assertEquals(sr.size(), 0);
     query = qs.newQuery("select * from /pos a where a like '%\n%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 3); // find newline anywhere in string
+    assertEquals(sr.size(), 3); // find newline anywhere in string
     query = qs.newQuery("select * from /pos a where a like '\n%'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
     query = qs.newQuery("select * from /pos a where a like '%\n'");
     sr = (SelectResults) query.execute();
-    Assert.assertEquals(sr.size(), 1);
+    assertEquals(sr.size(), 1);
   }
   
   
@@ -2007,7 +1999,7 @@ public class LikePredicateJUnitTest {
     removeIndexDuringQuery(true);
   }
 
-  public void removeIndexDuringQuery(boolean isPr) throws Exception {
+  private void removeIndexDuringQuery(boolean isPr) throws Exception {
     String regionName = "exampleRegion";
     String name = "/" + regionName;
 
@@ -2196,7 +2188,7 @@ public class LikePredicateJUnitTest {
     executeInvalidQueryWithLike(true);
   }
   
-  public void executeInvalidQueryWithLike(boolean useBindParam) {
+  private void executeInvalidQueryWithLike(boolean useBindParam) {
     Cache cache = CacheUtils.getCache();
     AttributesFactory attributesFactory = new AttributesFactory();
     RegionAttributes regionAttributes = attributesFactory.create();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/MiscJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/MiscJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/MiscJUnitTest.java
index 4bd3258..4d3e31e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/MiscJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/MiscJUnitTest.java
@@ -22,62 +22,54 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import com.gemstone.gemfire.cache.query.*;
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import parReg.query.unittest.NewPortfolio;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheWriterException;
 import com.gemstone.gemfire.cache.PartitionAttributes;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.TimeoutException;
 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.IndexType;
-import com.gemstone.gemfire.cache.query.NameResolutionException;
 import com.gemstone.gemfire.cache.query.Query;
-import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
 import com.gemstone.gemfire.cache.query.QueryService;
 import com.gemstone.gemfire.cache.query.SelectResults;
 import com.gemstone.gemfire.cache.query.Struct;
-import com.gemstone.gemfire.cache.query.TypeMismatchException;
 import com.gemstone.gemfire.cache.query.data.Data;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
-
-//import com.gemstone.gemfire.cache.query.facets.lang.Employee;
 import com.gemstone.gemfire.cache.query.types.StructType;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import parReg.query.unittest.NewPortfolio;
-import static org.junit.Assert.*;
-import junit.framework.*;
-
-/**
- */
 @Category(IntegrationTest.class)
 public class MiscJUnitTest {
 
   @Before
-  public void setUp() throws java.lang.Exception {
+  public void setUp() throws Exception {
     CacheUtils.startCache();
   }
 
   @After
-  public void tearDown() throws java.lang.Exception {
+  public void tearDown() throws Exception {
     CacheUtils.closeCache();
   }
 
-  public void xtestNestQueryInFromClause() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testNestQueryInFromClause() throws Exception {
     Region region = CacheUtils.createRegion("Portfolios", Portfolio.class);
     region.put("0", new Portfolio(0));
     region.put("1", new Portfolio(1));
@@ -91,7 +83,9 @@ public class MiscJUnitTest {
     if (!p.status.equals("active") || p.getID() != 0) fail(query.getQueryString());
   }
 
-  public void xtestNestQueryInWhereClause() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testNestQueryInWhereClause() throws Exception {
     Region region = CacheUtils.createRegion("Portfolios", Portfolio.class);
     region.put("0", new Portfolio(0));
     region.put("1", new Portfolio(1));
@@ -119,7 +113,9 @@ public class MiscJUnitTest {
     // DISTINCT * FROM /Portfolios p where p.ID = x.ID).status
   }
 
-  public void xtestVoidMethods() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testVoidMethods() throws Exception {
     Region region = CacheUtils.createRegion("Data", Data.class);
     region.put("0", new Data());
     Query query = CacheUtils.getQueryService().newQuery("SELECT DISTINCT * FROM /Data where voidMethod");
@@ -130,7 +126,9 @@ public class MiscJUnitTest {
     if (result.size() != 1) fail(query.getQueryString());
   }
 
-  public void xtestMiscQueries() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testMiscQueries() throws Exception {
     String testData[] = { "NULL", "UNDEFINED"};
     for (int i = 0; i < testData.length; i++) {
       Query query = CacheUtils.getQueryService().newQuery("SELECT DISTINCT * FROM " + testData[i]);
@@ -139,9 +137,9 @@ public class MiscJUnitTest {
     }
   }
 
-  public void xtestBug32763() throws FunctionDomainException, TypeMismatchException, NameResolutionException,
-      QueryInvocationTargetException, TimeoutException, CacheWriterException
-    {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testBug32763() throws Exception {
     Region region = CacheUtils.createRegion("pos", Portfolio.class);
     region.put("0", new Portfolio(0));
     region.put("1", new Portfolio(1));
@@ -164,8 +162,7 @@ public class MiscJUnitTest {
   }
   
   @Test
-  public void testBug() throws TimeoutException, CacheWriterException,
-  FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException, Exception {
+  public void testBug() throws Exception {
     Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
     region.put("0", new Portfolio(0));
     region.put("1", new Portfolio(1));
@@ -192,11 +189,10 @@ public class MiscJUnitTest {
     Query q = qs.newQuery(qStr);
     SelectResults result = (SelectResults) q.execute();
     if(result.size()==0) fail("Test failed as size is zero");
-  
   }
   
   @Test
-  public void testBug37723() {
+  public void testBug37723() throws Exception {
     Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
     region.put("0", new Portfolio(0));
     region.put("1", new Portfolio(1));
@@ -205,28 +201,22 @@ public class MiscJUnitTest {
     QueryService qs = CacheUtils.getQueryService();
     String qry = "select distinct getID, status from /portfolios pf where getID < 10 order by getID desc";
     Query q = qs.newQuery(qry);
-    try {
-      SelectResults result = (SelectResults) q.execute();
-      Iterator itr = result.iterator();
-      int j = 3;
-      while ( itr.hasNext()) {
-       Struct struct = (Struct)itr.next();
-       assertEquals(j--, ((Integer)struct.get("getID")).intValue());
-      }      
-      qry = "select distinct getID, status from /portfolios pf where getID < 10 order by getID asc";
-      q = qs.newQuery(qry);
-      result = (SelectResults) q.execute();
-      itr = result.iterator();
-      j = 0;
-      while ( itr.hasNext()) {
-       Struct struct = (Struct)itr.next();
-       assertEquals(j++, ((Integer)struct.get("getID")).intValue());
-      }      
+    SelectResults result = (SelectResults) q.execute();
+    Iterator itr = result.iterator();
+    int j = 3;
+    while ( itr.hasNext()) {
+     Struct struct = (Struct)itr.next();
+     assertEquals(j--, ((Integer)struct.get("getID")).intValue());
+    }
+    qry = "select distinct getID, status from /portfolios pf where getID < 10 order by getID asc";
+    q = qs.newQuery(qry);
+    result = (SelectResults) q.execute();
+    itr = result.iterator();
+    j = 0;
+    while ( itr.hasNext()) {
+     Struct struct = (Struct)itr.next();
+     assertEquals(j++, ((Integer)struct.get("getID")).intValue());
     }
-    catch (Exception e) {      
-      e.printStackTrace();
-      fail ("Test failed because of exception="+e);      
-    }   
   }
   
   @Test
@@ -276,14 +266,10 @@ public class MiscJUnitTest {
 
     SelectResults rs = (SelectResults)query.execute();
     assertEquals(rs.size(), 2);
-    
   }
 
-  
-  
-  
   @Test
-  public void testMultipleOrderByClauses() {
+  public void testMultipleOrderByClauses() throws Exception  {
     Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
     region.put("2", new Portfolio(2));
     region.put("3", new Portfolio(3));
@@ -294,44 +280,27 @@ public class MiscJUnitTest {
     QueryService qs = CacheUtils.getQueryService();
     String qry = "select distinct status, getID from /portfolios pf where getID < 10 order by status asc, getID desc";
     Query q = qs.newQuery(qry);
-    try {
-      SelectResults result = (SelectResults) q.execute();
-      Iterator itr = result.iterator();
-      int j = 6;
-      while ( itr.hasNext() && j >0) {
-       Struct struct = (Struct)itr.next();
-       assertEquals("active", struct.get("status"));
-       assertEquals(j, ((Integer)struct.get("getID")).intValue());
-      
-       j-=2;
-      }
-      j =7;
-      while ( itr.hasNext()) {
-        Struct struct = (Struct)itr.next();
-        assertEquals(j, ((Integer)struct.get("getID")).intValue());
-        assertEquals("inactive", struct.get("status"));
-        j-=2;
-      }
-      /*
-      qry = "select distinct getID, status from /portfolios pf where getID < 10 order by getID asc";
-      q = qs.newQuery(qry);
-      result = (SelectResults) q.execute();
-      itr = result.iterator();
-      j = 0;
-      while ( itr.hasNext()) {
-       Struct struct = (Struct)itr.next();
-       assertIndexDetailsEquals(j++, ((Integer)struct.get("getID")).intValue());
-      }*/      
+    SelectResults result = (SelectResults) q.execute();
+    Iterator itr = result.iterator();
+    int j = 6;
+    while ( itr.hasNext() && j >0) {
+     Struct struct = (Struct)itr.next();
+     assertEquals("active", struct.get("status"));
+     assertEquals(j, ((Integer)struct.get("getID")).intValue());
+
+     j-=2;
+    }
+    j =7;
+    while ( itr.hasNext()) {
+      Struct struct = (Struct)itr.next();
+      assertEquals(j, ((Integer)struct.get("getID")).intValue());
+      assertEquals("inactive", struct.get("status"));
+      j-=2;
     }
-    catch (Exception e) {      
-      e.printStackTrace();
-      fail ("Test failed because of exception="+e);      
-    }   
   }
   
   /**
    * Tests the where clause formed with CompiledComparison nesting
-   * @throws Exception
    */
   @Test
   public void testBug40333_InLocalRegion_1() throws Exception {
@@ -350,9 +319,10 @@ public class MiscJUnitTest {
    * Commented the test as it is for some reason causing OOM when run in the suite.
    * It is due to presence of PR
    * Tests the where clause formed with CompiledComparison nesting
-   * @throws Exception
    */
-  public void _testBug40333_InPartitionedRegion_1() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testBug40333_InPartitionedRegion_1() throws Exception {
     CacheUtils.startCache();
     final Cache cache = CacheUtils.getCache();
     AttributesFactory attributesFactory = new AttributesFactory();
@@ -370,7 +340,6 @@ public class MiscJUnitTest {
   
   /**
    * Tests the where clause formed with CompiledComparison nesting with CompiledIN
-   * @throws Exception
    */
   @Test
   public void testBug40333_InLocalRegion_2() throws Exception {
@@ -389,9 +358,10 @@ public class MiscJUnitTest {
    * Commented the test as it is for some reason causing OOM when run in the suite.
    * It is due to presence of PR
    * Tests the where clause formed with CompiledComparison nesting with CompiledIN
-   * @throws Exception
    */
-  public void _testBug40333_InPartitionedRegion_2() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testBug40333_InPartitionedRegion_2() throws Exception {
     CacheUtils.startCache();
     final Cache cache = CacheUtils.getCache();
     AttributesFactory attributesFactory = new AttributesFactory();
@@ -545,14 +515,9 @@ public class MiscJUnitTest {
                 "undefinedTestField.toString", "/new_pos");
     final Query q1 = qs.newQuery(queryStr1);
     final Query q2 = qs.newQuery(queryStr2);
-    try {
-      SelectResults sr1 = (SelectResults)q1.execute();
-      SelectResults sr2 = (SelectResults)q2.execute();
-    }catch(Throwable e) {
-      e.printStackTrace();
-      fail("Test failed due to = " +e.toString());
-    }    
-  } 
+    SelectResults sr1 = (SelectResults)q1.execute();
+    SelectResults sr2 = (SelectResults)q2.execute();
+  }
   
   @Test
   public void testBug37119() throws Exception {
@@ -599,126 +564,4 @@ public class MiscJUnitTest {
     pf = (Portfolio)result.iterator().next();
     assertEquals(pf.getID(),3);
   }
-  
- 
-  /*
-  @Test
-  public void testBug37119() throws Exception {
-    Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
-    region.put("0", new Portfolio(0));
-    region.put("1", new Portfolio(1));
-    region.put("2", new Portfolio(2));
-    region.put("3", new Portfolio(3));
-    QueryService qs = CacheUtils.getQueryService();
-    
-    String qStr = "Select distinct * from /portfolios pf where pf.getID() > Integer.MIN_VALUE"; 
-    Query q = qs.newQuery(qStr);
-    SelectResults result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),4);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.getID() > Integer.MAX_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),0);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.getID() > \"Long\".MAX_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),0);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.getID() > \"Long\".MIN_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),4);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.getID() > integer.MIN_VALUE"; 
-    q = qs.newQuery(qStr);
-    try {
-      result = (SelectResults) q.execute();
-      fail("Expected QueryException as integer.MIN_VALUE will not be  resolved");
-    }catch(TypeMismatchException tme) {
-      //Ok
-    }
-    
-    qStr = "Select distinct * from /portfolios pf where pf.intFunction(Integer.MIN_VALUE) = Integer.MIN_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),4);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.intFunction(Integer.MAX_VALUE) = Integer.MAX_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),4);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.longFunction( \"Long\".MAX_VALUE) = \"Long\".MAX_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),4);
-    
-    qStr = "Select distinct * from /portfolios pf where pf.longFunction(\"Long\".MIN_VALUE) = \"Long\".MIN_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),4);
-      
-    qStr = "Select distinct * from /portfolios pf where pf.Integer.MAX_VALUE = Integer.MAX_VALUE"; 
-    q = qs.newQuery(qStr);
-    try {
-    result = (SelectResults) q.execute();
-    fail("Query should have thrown Exception as attribute Integer.MAX_VALUE is not present");
-    }catch(NameNotFoundException nfe) {
-      //Ok;
-    }
-    
-    qStr = "Select distinct Integer.MAX_VALUE from /portfolios pf where Integer.MAX_VALUE = Integer.MAX_VALUE"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),1);
-    assertIndexDetailsEquals(result.iterator().next(),Integer.valueOf(Integer.MAX_VALUE));
-    
-    
-  }
-  
-  @Test
-  public void testBu37119_1() throws Exception {
-    Region region = CacheUtils.createRegion("tempdata",null);
-    region.put("1", new TempData1());
-    QueryService qs = CacheUtils.getQueryService();
-    
-    String qStr = "Select distinct * from /tempdata td where td.Integer.MAX_VALUE > Integer.MAX_VALUE"; 
-    Query q = qs.newQuery(qStr);
-    SelectResults result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),0);
-    
-    qStr = "Select distinct * from /tempdata td where td.Integer.MAX_VALUE = 2 "; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),1);
-       
-    qStr = "Select distinct * from /tempdata td where Integer.MAX_VALUE = 2 "; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),0);
-    
-    qStr = "Select distinct * from /tempdata td where Integer.MAX_VALUE.intValue = Integer.MAX_VALUE "; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),0);
-    
-    qStr = "Select distinct * from /tempdata td where Integer.test = 'test'"; 
-    q = qs.newQuery(qStr);
-    result = (SelectResults) q.execute();
-    assertIndexDetailsEquals(result.size(),1);
-  }  
-  
-  
-  static class TempData1 {
-    public TempData2 Integer = new TempData2();
-    
-  }
-  
-  static class TempData2 {
-    public Integer MAX_VALUE = new Integer(2);
-    public String test ="test";
-  }  */
-  
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NestedQueryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NestedQueryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NestedQueryJUnitTest.java
index 11dcb0e..c7ed9d7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NestedQueryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NestedQueryJUnitTest.java
@@ -22,23 +22,20 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Set;
 
-import junit.framework.AssertionFailedError;
-
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.ErrorCollector;
 
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.CacheUtils;
@@ -53,29 +50,28 @@ import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.cache.query.internal.StructImpl;
 import com.gemstone.gemfire.cache.query.types.ObjectType;
-//import com.gemstone.gemfire.internal.util.DebuggerSupport;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class NestedQueryJUnitTest {
-  ObjectType resType1=null;
-  ObjectType resType2= null;
 
-  int resSize1=0;
-  int resSize2=0;
+  private ObjectType resType1=null;
+  private ObjectType resType2= null;
+
+  private int resSize1=0;
+  private int resSize2=0;
 
-  Iterator itert1=null;
-  Iterator itert2=null;
+  private Iterator itert1=null;
+  private Iterator itert2=null;
 
-  Set set1=null;
-  Set set2=null;
+  private Set set1=null;
+  private Set set2=null;
 
-  String s1;
-  String s2;
+  private String s1;
+  private String s2;
 
+  @Rule
+  public ErrorCollector errorCollector = new ErrorCollector(); // used by testQueries
 
   @Before
   public void setUp() throws java.lang.Exception {
@@ -90,7 +86,9 @@ public class NestedQueryJUnitTest {
     CacheUtils.closeCache();
   }
 
-  public void atestQueries() throws Exception{
+  @Ignore("TODO: this test was disabled")
+  @Test
+  public void testQueries2() throws Exception{
     String queryString;
     Query query;
     Object result;
@@ -119,14 +117,14 @@ public class NestedQueryJUnitTest {
     query = CacheUtils.getQueryService().newQuery(queryString);
     result = query.execute();
     CacheUtils.log(Utils.printResult(result));
-
   }
+
   @Test
   public void testQueries() throws Exception {
     String queries[]={
         "SELECT DISTINCT * FROM /Portfolios WHERE NOT(SELECT DISTINCT * FROM positions.values p WHERE p.secId = 'IBM').isEmpty",
         "SELECT DISTINCT * FROM /Portfolios where NOT(SELECT DISTINCT * FROM /Portfolios p where p.ID = 0).isEmpty",
-        "SELECT DISTINCT * FROM /Portfolios where status = ELEMENT(SELECT DISTINCT * FROM /Portfolios p where ID = 0).status",
+        "SELECT DISTINCT * FROM /Portfolios where status = ELEMENT(SELECT DISTINCT * FROM /Portfolios p where p.ID = 0).status",
         "SELECT DISTINCT * FROM /Portfolios where status = ELEMENT(SELECT DISTINCT * FROM /Portfolios p where p.ID = 0).status",
         "SELECT DISTINCT * FROM /Portfolios x where status = ELEMENT(SELECT DISTINCT * FROM /Portfolios p where x.ID = p.ID).status",
         "SELECT DISTINCT * FROM /Portfolios x where status = ELEMENT(SELECT DISTINCT * FROM /Portfolios p where p.ID = x.ID).status",
@@ -136,19 +134,14 @@ public class NestedQueryJUnitTest {
       try{
         Query query = CacheUtils.getQueryService().newQuery(queries[i]);
         query.execute();
-        //CacheUtils.log(Utils.printResult(result));
-        CacheUtils.log("OK "+queries[i]);
       }catch(Exception e){
-        CacheUtils.log("FAILED "+queries[i]);
-        CacheUtils.log(e.getMessage());
-        //e.printStackTrace();
+        errorCollector.addError(e);
       }
     }
   }
+
   @Test
   public void testNestedQueriesEvaluation() throws Exception {
-
-
     QueryService qs;
     qs = CacheUtils.getQueryService();
     String queries[] = {
@@ -187,8 +180,7 @@ public class NestedQueryJUnitTest {
         // Iterator iter=set1.iterator();
 
       } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+        throw new AssertionError(q.getQueryString(), e);
       }
     }
 
@@ -220,8 +212,7 @@ public class NestedQueryJUnitTest {
         set2=((r[i][1]).asSet());
 
       } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+        throw new AssertionError(q.getQueryString(), e);
       }
     }
     for(int j=0;j<=1;j++){
@@ -246,12 +237,10 @@ public class NestedQueryJUnitTest {
         fail("FAILED: In both the Cases the members of ResultsSet are different.");
     }
     CacheUtils.compareResultsOfWithAndWithoutIndex(r, this);
-
   }
 
   @Test
-  public void testNestedQueriesResultsasStructSet() throws Exception {
-
+  public void testNestedQueriesResultsAsStructSet() throws Exception {
     QueryService qs;
     qs = CacheUtils.getQueryService();
     String queries[] = {
@@ -309,9 +298,7 @@ public class NestedQueryJUnitTest {
         // Iterator iter=set1.iterator();
 
       } catch (Exception e) {
-        AssertionFailedError afe = new AssertionFailedError(q.getQueryString());
-        afe.initCause(e);
-        throw afe;
+        throw new AssertionError(e);
       }
     }
 
@@ -336,8 +323,7 @@ public class NestedQueryJUnitTest {
         set2=((r[i][1]).asSet());
 
       } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+        throw new AssertionError(q.getQueryString(), e);
       }
     }
     for(int j=0;j<queries.length;j++){
@@ -436,7 +422,6 @@ public class NestedQueryJUnitTest {
    * Tests a nested query with shorts converted to integer types in the result 
    * set of the inner query.  The short field in the outer query should be 
    * evaluated against the integer types and match.
-   * @throws Exception
    */
   @Test
   public void testNestedQueryWithShortTypesFromInnerQuery() throws Exception {
@@ -456,8 +441,6 @@ public class NestedQueryJUnitTest {
   /**
    * Tests a nested query that has duplicate results in the inner query
    * Results should not be duplicated in the final result set
-   * 
-   * @throws Exception
    */
   @Test
   public void testNestedQueryWithMultipleMatchingResultsWithIn() throws Exception {
@@ -474,10 +457,8 @@ public class NestedQueryJUnitTest {
     helpTestIndexForQuery("<trace>SELECT * FROM /portfolios1 p where p.ID in (SELECT p.ID FROM /portfolios1 p WHERE p.ID = 1)", "p.ID", "/portfolios1 p");
   }
 
-  /*
+  /**
    * helper method to test against a compact range index
-   * @param query
-   * @throws Exception
    */
   private void helpTestIndexForQuery(String query, String indexedExpression, String regionPath) throws Exception {
     QueryService qs = CacheUtils.getQueryService();
@@ -492,14 +473,17 @@ public class NestedQueryJUnitTest {
     assertTrue(observer.isIndexesUsed);
   }
 
-  class QueryObserverImpl extends QueryObserverAdapter{
-    boolean isIndexesUsed = false;
-    ArrayList indexesUsed = new ArrayList();
+  private static class QueryObserverImpl extends QueryObserverAdapter {
+
+    private boolean isIndexesUsed = false;
+    private ArrayList indexesUsed = new ArrayList();
 
+    @Override
     public void beforeIndexLookup(Index index, int oper, Object key) {
       indexesUsed.add(index.getName());
     }
 
+    @Override
     public void afterIndexLookup(Collection results) {
       if(results != null){
         isIndexesUsed = true;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NumericQueryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NumericQueryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NumericQueryJUnitTest.java
index 017816d..08c48b3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NumericQueryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/NumericQueryJUnitTest.java
@@ -16,20 +16,7 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.query.CacheUtils;
-import com.gemstone.gemfire.cache.query.Index;
-import com.gemstone.gemfire.cache.query.QueryService;
-import com.gemstone.gemfire.cache.query.SelectResults;
-import com.gemstone.gemfire.cache.query.data.Numbers;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static org.junit.Assert.*;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -39,12 +26,27 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.*;
+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.PartitionAttributesFactory;
+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.Index;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.data.Numbers;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- * 
- *
- */
 @Category(IntegrationTest.class)
 public class NumericQueryJUnitTest {
 
@@ -52,13 +54,11 @@ public class NumericQueryJUnitTest {
   private static Region testRegion;
   private static int numElem = 100;
 
-  
   private static String EQ = "=";
   private static String LT = "<";
   private static String GT = ">";
   private static String GTE = ">=";
   private static String LTE = "<=";
-  
 
   @Before
   public void setUp() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/StructSetOrResultsSet.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/StructSetOrResultsSet.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/StructSetOrResultsSet.java
index fe5aa4f..a93a87c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/StructSetOrResultsSet.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/StructSetOrResultsSet.java
@@ -19,9 +19,10 @@
  * Utlity Class : Can be used to compare the results (StructSet OR ResultsSet) under the scenario without/with Index Usage.
  * Created on June 13, 2005, 11:16 AM
  */
-
 package com.gemstone.gemfire.cache.query.functional;
 
+import static org.junit.Assert.*;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -32,8 +33,6 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.query.CacheUtils;
 import com.gemstone.gemfire.cache.query.FunctionDomainException;
@@ -52,23 +51,49 @@ import com.gemstone.gemfire.cache.query.internal.ExecutionContext;
 import com.gemstone.gemfire.cache.query.internal.OrderByComparator;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
-import com.gemstone.gemfire.cache.query.internal.parse.OQLLexerTokenTypes;
 import com.gemstone.gemfire.cache.query.types.ObjectType;
 import com.gemstone.gemfire.internal.util.ArrayUtils;
 
 /**
+ * Used by these tests:
+ *
+ * <li/>EquiJoinIntegrationTest
+ * <li/>IUMRCompositeIteratorJUnitTest
+ * <li/>IUMRMultiIndexesMultiRegionJUnitTest
+ * <li/>IUMRShuffleIteratorsJUnitTest
+ * <li/>IUMRSingleRegionJUnitTest
+ * <li/>IndexCreationJUnitTest
+ * <li/>IndexHintJUnitTest
+ * <li/>IndexMaintainceJUnitTest
+ * <li/>IndexUseJUnitTest
+ * <li/>IndexedMergeEquiJoinScenariosJUnitTest
+ * <li/>MultiRegionIndexUsageJUnitTest
+ * <li/>NonDistinctOrderByPartitionedJUnitTest
+ * <li/>NonDistinctOrderByReplicatedJUnitTest
+ * <li/>NonDistinctOrderByTestImplementation
+ * <li/>OrderByPartitionedJUnitTest
+ * <li/>OrderByReplicatedJUnitTest
+ * <li/>OrderByTestImplementation
+ * <li/>QueryIndexUsingXMLDUnitTest
+ * <li/>QueryREUpdateInProgressJUnitTest
+ * <li/>QueryUsingFunctionContextDUnitTest
+ * <li/>QueryUsingPoolDUnitTest
+ * <li/>TestNewFunctionSSorRSIntegrationTest
+ *
+ * Also used by:
+ *
+ * <li/>GroupByTestImpl
+ * <li/>PdxGroupByTestImpl
+ * <li/>PRQueryDUnitHelper
  */
-public class StructSetOrResultsSet extends TestCase {
+public class StructSetOrResultsSet {
 
- 
-  public void CompareQueryResultsWithoutAndWithIndexes(Object[][] r, int len,
-      String queries[]) {
+  public void CompareQueryResultsWithoutAndWithIndexes(Object[][] r, int len, String queries[]) {
     CompareQueryResultsWithoutAndWithIndexes(r, len, false, queries);
   }
 
   /** Creates a new instance of StructSetOrResultsSet */
-  public void CompareQueryResultsWithoutAndWithIndexes(Object[][] r, int len,
-      boolean checkOrder, String queries[]) {
+  public void CompareQueryResultsWithoutAndWithIndexes(Object[][] r, int len, boolean checkOrder, String queries[]) {
 
     Collection coll1 = null;
     Collection coll2 = null;
@@ -87,8 +112,7 @@ public class StructSetOrResultsSet extends TestCase {
     }
   }
 
-  public void compareExternallySortedQueriesWithOrderBy(String[] queries,
-      Object[][] baseResults) throws Exception {
+  public void compareExternallySortedQueriesWithOrderBy(String[] queries, Object[][] baseResults) throws Exception {
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
       try {
@@ -126,15 +150,12 @@ public class StructSetOrResultsSet extends TestCase {
         }
       } catch (Exception e) {
         e.printStackTrace();
-        fail("query with index=" + i + " has failed. failed query="
-            + queries[i]);
+        throw new AssertionError("query with index=" + i + " has failed. failed query=" + queries[i], e);
       }
-
     }
   }
 
-  private void compareQueryResultsWithExternallySortedResults(SelectResults sr,
-      Object[] externallySorted, String query, Wrapper wrapper) {
+  private void compareQueryResultsWithExternallySortedResults(SelectResults sr, Object[] externallySorted, String query, Wrapper wrapper) {
 
     if (sr.size() == externallySorted.length) {
       CacheUtils.log("Both SelectResults are of Same Size i.e.  Size= "
@@ -187,11 +208,8 @@ public class StructSetOrResultsSet extends TestCase {
     }
   }
 
-  public Wrapper getOrderByComparatorAndLimitForQuery(String orderByQuery,
-      int unorderedResultSize) throws FunctionDomainException,
-      TypeMismatchException, NameResolutionException,
-      QueryInvocationTargetException, NoSuchFieldException, SecurityException,
-      IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+  public Wrapper getOrderByComparatorAndLimitForQuery(String orderByQuery, int unorderedResultSize)
+  throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
     DefaultQuery q = (DefaultQuery) CacheUtils.getQueryService().newQuery(
         orderByQuery);
     CompiledSelect cs = q.getSimpleSelect();    
@@ -272,7 +290,6 @@ public class StructSetOrResultsSet extends TestCase {
       }
     }
     return new Wrapper(finalComparator, limit, validationLevel);
-
   }
 
   enum ValidationLevel {
@@ -292,8 +309,7 @@ public class StructSetOrResultsSet extends TestCase {
   }
 
   /** Creates a new instance of StructSetOrResultsSet */
-  public void CompareCountStarQueryResultsWithoutAndWithIndexes(Object[][] r,
-      int len, boolean checkOrder, String queries[]) {
+  public void CompareCountStarQueryResultsWithoutAndWithIndexes(Object[][] r, int len, boolean checkOrder, String queries[]) {
 
     Integer count1, count2;
     Iterator<Integer> itert1, itert2;
@@ -305,7 +321,6 @@ public class StructSetOrResultsSet extends TestCase {
       assertEquals(queries[j], 1, result1.size());
       assertEquals(queries[j], 1, result2.size());
 
-      
       checkSelectResultTypes((SelectResults) r[j][0], (SelectResults) r[j][1], queries[j]);
       checkResultSizes((SelectResults) r[j][0], (SelectResults) r[j][1], queries[j]);
       compareResults(result1, result2, queries[j], true);
@@ -314,22 +329,13 @@ public class StructSetOrResultsSet extends TestCase {
 
   /**
    * Compares two ArrayLists containing query results with/without order.
-   *
-   * @param r
-   *          Array of ArrayLists
-   * @param len
-   *          Length of array of ArrayLists
-   * @param checkOrder
-   * @param queries
    */
-  public void CompareQueryResultsAsListWithoutAndWithIndexes(Object[][] r,
-      int len, boolean checkOrder, String queries[]) {
+  public void CompareQueryResultsAsListWithoutAndWithIndexes(Object[][] r, int len, boolean checkOrder, String queries[]) {
     CompareQueryResultsAsListWithoutAndWithIndexes(r, len, checkOrder, true,
         queries);
   }
 
-  public void CompareQueryResultsAsListWithoutAndWithIndexes(Object[][] r,
-      int len, boolean checkOrder, boolean checkClass, String queries[]) {
+  public void CompareQueryResultsAsListWithoutAndWithIndexes(Object[][] r, int len, boolean checkOrder, boolean checkClass, String queries[]) {
     Integer count1, count2;
     Iterator<Integer> itert1, itert2;
     ArrayList result1, result2;
@@ -344,8 +350,7 @@ public class StructSetOrResultsSet extends TestCase {
     }
   }
   
-  public void compareQueryResultLists(List r1, List r2,
-      int len, boolean checkOrder, boolean checkClass, String query) {
+  public void compareQueryResultLists(List r1, List r2, int len, boolean checkOrder, boolean checkClass, String query) {
     if (checkClass) {
       if ((r1.get(0).getClass().getName()).equals(r2.get(0)
           .getClass().getName())) {
@@ -380,8 +385,7 @@ public class StructSetOrResultsSet extends TestCase {
           + r2.size() + "; failed query=" + query);
     }
   }
-  
-  
+
   private void compareResults(Collection result1, Collection result2, String query, boolean checkOrder) {
     Iterator itert1 = result1.iterator();
     Iterator itert2 = result2.iterator();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRS.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRS.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRS.java
deleted file mode 100755
index 38b4a07..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRS.java
+++ /dev/null
@@ -1,128 +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.
- */
-/*
- * TestNewFunction.java
- *
- * Created on June 16, 2005, 3:55 PM
- */
-package com.gemstone.gemfire.cache.query.functional;
-
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.query.CacheUtils;
-import com.gemstone.gemfire.cache.query.Index;
-import com.gemstone.gemfire.cache.query.IndexType;
-import com.gemstone.gemfire.cache.query.Query;
-import com.gemstone.gemfire.cache.query.QueryService;
-import com.gemstone.gemfire.cache.query.Utils;
-import com.gemstone.gemfire.cache.query.data.Portfolio;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
-import java.util.ArrayList;
-import java.util.Collection;
-import junit.framework.TestCase;
-
-/**
- *
- */
-public class TestNewFunctionSSorRS extends TestCase {
-    
-    /** Creates a new instance of TestNewFunction */
-    public TestNewFunctionSSorRS(String testName) {
-        super(testName);
-    }
-    protected void setUp() throws java.lang.Exception {
-        CacheUtils.startCache();
-    }
-    
-    protected void tearDown() throws java.lang.Exception {
-        CacheUtils.closeCache();
-    }
-    
-    public void testNewFunc() throws Exception {
-        Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
-        for(int i=0; i<4; i++){
-            region.put(""+i, new Portfolio(i));
-            // CacheUtils.log(new Portfolio(i));
-        }
-        
-        Object r[][] = new Object[2][2];
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        
-        String queries[] = {
-            "SELECT DISTINCT * from /portfolios pf , pf.positions.values pos where status = 'inactive'",
-            "select distinct * from /portfolios where ID > 1 ",
-  
-        };
-        
-        for (int i = 0; i < queries.length; i++) {
-            Query q = null;
-            try {
-                q = CacheUtils.getQueryService().newQuery(queries[i]);
-                QueryObserverImpl observer1 = new QueryObserverImpl();
-                QueryObserverHolder.setInstance(observer1);
-                r[i][0] = q.execute();
-                if(!observer1.isIndexesUsed){
-                    CacheUtils.log("NO INDEX IS USED!");
-                } 
-                CacheUtils.log(Utils.printResult(r[i][0]));
-            } catch(Exception e) {
-                fail("Caught exception");
-                e.printStackTrace();
-            }
-        }
-        
-        qs.createIndex("sIndex", IndexType.FUNCTIONAL,"status","/portfolios");
-        qs.createIndex("iIndex", IndexType.FUNCTIONAL,"ID","/portfolios");
-        for (int i = 0; i < queries.length; i++) {
-            Query q = null;
-            try {
-                q = CacheUtils.getQueryService().newQuery(queries[i]);
-                QueryObserverImpl observer2 = new QueryObserverImpl();
-                QueryObserverHolder.setInstance(observer2);
-                r[i][1] = q.execute();
-                if(observer2.isIndexesUsed){
-                    CacheUtils.log("YES INDEX IS USED!");
-                } else {
-                    fail("Index NOT Used");
-                }
-                 CacheUtils.log(Utils.printResult(r[i][1]));
-            } catch(Exception e) {
-                fail("Caught exception");
-                e.printStackTrace();
-            }
-        }
-        
-        StructSetOrResultsSet ssORrs = new  StructSetOrResultsSet();
-        ssORrs.CompareQueryResultsWithoutAndWithIndexes(r, queries.length,queries);
-    }
-     class QueryObserverImpl extends QueryObserverAdapter{
-        boolean isIndexesUsed = false;
-        ArrayList indexesUsed = new ArrayList();
-        
-        public void beforeIndexLookup(Index index, int oper, Object key) {
-            indexesUsed.add(index.getName());
-        }
-        
-        public void afterIndexLookup(Collection results) {
-            if(results != null){
-                isIndexesUsed = true;
-            }
-        }
-    }
-      
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRSIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRSIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRSIntegrationTest.java
new file mode 100755
index 0000000..98da823
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/TestNewFunctionSSorRSIntegrationTest.java
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+/*
+ * TestNewFunction.java
+ *
+ * Created on June 16, 2005, 3:55 PM
+ */
+package com.gemstone.gemfire.cache.query.functional;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.query.CacheUtils;
+import com.gemstone.gemfire.cache.query.Index;
+import com.gemstone.gemfire.cache.query.IndexType;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.Utils;
+import com.gemstone.gemfire.cache.query.data.Portfolio;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+/**
+ * TODO: does this test provide any valuable coverage?
+ */
+@Category(IntegrationTest.class)
+public class TestNewFunctionSSorRSIntegrationTest {
+
+  @Before
+  public void setUp() throws Exception {
+    CacheUtils.startCache();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    CacheUtils.closeCache();
+  }
+
+  @Test
+  public void testNewFunc() throws Exception {
+    Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
+    for (int i = 0; i < 4; i++) {
+      region.put("" + i, new Portfolio(i));
+      // CacheUtils.log(new Portfolio(i));
+    }
+
+    Object r[][] = new Object[2][2];
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+
+    String queries[] = {
+      "SELECT DISTINCT * from /portfolios pf , pf.positions.values pos where status = 'inactive'",
+      "select distinct * from /portfolios where ID > 1 ",
+
+    };
+
+    for (int i = 0; i < queries.length; i++) {
+      Query q = null;
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      QueryObserverImpl observer1 = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer1);
+      r[i][0] = q.execute();
+      if (!observer1.isIndexesUsed) {
+        CacheUtils.log("NO INDEX IS USED!");
+      }
+      CacheUtils.log(Utils.printResult(r[i][0]));
+    }
+
+    qs.createIndex("sIndex", IndexType.FUNCTIONAL, "status", "/portfolios");
+    qs.createIndex("iIndex", IndexType.FUNCTIONAL, "ID", "/portfolios");
+    for (int i = 0; i < queries.length; i++) {
+      Query q = null;
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      QueryObserverImpl observer2 = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer2);
+      r[i][1] = q.execute();
+      if (observer2.isIndexesUsed) {
+        CacheUtils.log("YES INDEX IS USED!");
+      } else {
+        fail("Index NOT Used");
+      }
+      CacheUtils.log(Utils.printResult(r[i][1]));
+    }
+
+    StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
+    ssORrs.CompareQueryResultsWithoutAndWithIndexes(r, queries.length, queries);
+  }
+
+  private static class QueryObserverImpl extends QueryObserverAdapter {
+
+    boolean isIndexesUsed = false;
+    ArrayList indexesUsed = new ArrayList();
+
+    public void beforeIndexLookup(Index index, int oper, Object key) {
+      indexesUsed.add(index.getName());
+    }
+
+    public void afterIndexLookup(Collection results) {
+      if (results != null) {
+        isIndexesUsed = true;
+      }
+    }
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
index 49270bc..af4ed74 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
@@ -19,6 +19,17 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
+import static org.junit.Assert.*;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CyclicBarrier;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.CacheUtils;
@@ -31,45 +42,26 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.CyclicBarrier;
-
-import static org.junit.Assert.assertFalse;
-
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class AsynchIndexMaintenanceJUnitTest {
+
   private QueryService qs;
 
-  protected Region region;
+  private Region region;
 
-  protected boolean indexUsed = false;
-  protected volatile boolean exceptionOccured = false; 
+  private boolean indexUsed = false;
+  private volatile boolean exceptionOccured = false;
 
   private Set idSet ;
 
-  private void init() {
+  private void init() throws Exception {
     idSet = new HashSet();
-    try {
-      CacheUtils.startCache();
-      Cache cache = CacheUtils.getCache();
-      region = CacheUtils.createRegion("portfolio", Portfolio.class, false);      
-      
-      qs = cache.getQueryService();
-
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-    }
+    CacheUtils.startCache();
+    Cache cache = CacheUtils.getCache();
+    region = CacheUtils.createRegion("portfolio", Portfolio.class, false);
 
+    qs = cache.getQueryService();
   }
 
   @Before
@@ -196,9 +188,7 @@ public class AsynchIndexMaintenanceJUnitTest {
       region.put(""+(i+1), new Portfolio(i+1));
       idSet.add((i+1) + "");
     }    
-    Thread.sleep(10000);
-    //assertIndexDetailsEquals(0, this.getIndexSize(ri));
-        
+    Thread.sleep(10000); // TODO: delete this sleep
   }
   
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndexJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndexJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndexJUnitTest.java
index f5e7f8d..395405a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndexJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndexJUnitTest.java
@@ -16,6 +16,23 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.Index;
 import com.gemstone.gemfire.cache.query.QueryService;
@@ -26,25 +43,10 @@ import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery.TestHook;
 import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import util.TestException;
-
-import java.util.*;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
-
-/**
- * 
- *
- */
 @Category(IntegrationTest.class)
 public class CompactRangeIndexJUnitTest  {
+
   private QueryTestUtils utils;
   private Index index;
 
@@ -76,7 +78,7 @@ public class CompactRangeIndexJUnitTest  {
     executeRangeQueryWithoutDistinct(9);
   }
   
-  /*
+  /**
    * Tests adding entries to compact range index where the key is null
    * fixes bug 47151 where null keyed entries would be removed after being added
    */
@@ -97,10 +99,12 @@ public class CompactRangeIndexJUnitTest  {
     SelectResults results = (SelectResults) qs.newQuery("Select * from /exampleRegion r where r.status = null").execute();
     assertEquals("Null matched Results expected", numObjects, results.size());
   }
-  
-  //Tests race condition where we possibly were missing remove calls due to transitioning
-  //to an empty index elem before adding the entries
-  //the fix is to add the entries to the elem and then transition to that elem
+
+  /**
+   * Tests race condition where we possibly were missing remove calls due to transitioning
+   * to an empty index elem before adding the entries
+   * the fix is to add the entries to the elem and then transition to that elem
+   */
   @Test
   public void testCompactRangeIndexMemoryIndexStoreMaintenance() throws Exception {
     try {
@@ -155,9 +159,11 @@ public class CompactRangeIndexJUnitTest  {
     }
   }
 
-  //Tests race condition when we are transitioning index collection from elem array to concurrent hash set
-  //The other thread could remove from the empty concurrent hash set.
-  //Instead we now set a token, do all the puts into a collection and then unsets the token to the new collection
+  /**
+   * Tests race condition when we are transitioning index collection from elem array to concurrent hash set
+   * The other thread could remove from the empty concurrent hash set.
+   * Instead we now set a token, do all the puts into a collection and then unsets the token to the new collection
+   */
   @Test
   public void testMemoryIndexStoreMaintenanceTransitionFromElemArrayToTokenToConcurrentHashSet() throws Exception {
     try {
@@ -270,7 +276,7 @@ public class CompactRangeIndexJUnitTest  {
     }
   }
 
-  private class MemoryIndexStoreREToIndexElemTestHook implements TestHook {
+  private static class MemoryIndexStoreREToIndexElemTestHook implements TestHook {
 
     private CountDownLatch readyToStartRemoveLatch;
     private CountDownLatch waitForRemoveLatch;
@@ -289,19 +295,19 @@ public class CompactRangeIndexJUnitTest  {
       try {
         if (description.equals("ATTEMPT_REMOVE")) {
           if (!readyToStartRemoveLatch.await(21, TimeUnit.SECONDS)) {
-            throw new TestException("Time ran out waiting for other thread to initiate put");
+            throw new AssertionError("Time ran out waiting for other thread to initiate put");
           }
         }
         else if (description.equals("TRANSITIONED_FROM_REGION_ENTRY_TO_ELEMARRAY")) {
           readyToStartRemoveLatch.countDown();
           if (!waitForRemoveLatch.await(21, TimeUnit.SECONDS)) {
-            throw new TestException("Time ran out waiting for other thread to initiate remove");
+            throw new AssertionError("Time ran out waiting for other thread to initiate remove");
           }
         }
         else if (description.equals("BEGIN_REMOVE_FROM_ELEM_ARRAY")) {
           waitForRemoveLatch.countDown();
           if (waitForTransitioned.await(21, TimeUnit.SECONDS)) {
-            throw new TestException("Time ran out waiting for transition from region entry to elem array");
+            throw new AssertionError("Time ran out waiting for transition from region entry to elem array");
           }
         }
         else if (description.equals("TRANSITIONED_FROM_REGION_ENTRY_TO_ELEMARRAY")) {
@@ -311,16 +317,17 @@ public class CompactRangeIndexJUnitTest  {
         }
       }
       catch (InterruptedException e) {
-        throw new TestException("Interrupted while waiting for test to complete");
+        throw new AssertionError("Interrupted while waiting for test to complete");
       }
     }
   }
-  
-  
-  //Test hook that waits for another thread to begin removing
-  //The current thread should then continue to set the token
-  //then continue and convert to chs while holding the lock to the elem array still
-  //After the conversion of chs, the lock is released and then remove can proceed
+
+  /**
+   * Test hook that waits for another thread to begin removing
+   * The current thread should then continue to set the token
+   * then continue and convert to chs while holding the lock to the elem array still
+   * After the conversion of chs, the lock is released and then remove can proceed
+   */
   private class MemoryIndexStoreIndexElemToTokenToConcurrentHashSetTestHook implements TestHook {
 
     private CountDownLatch waitForRemoveLatch;
@@ -334,27 +341,29 @@ public class CompactRangeIndexJUnitTest  {
       waitForRetry = new CountDownLatch(1);
       readyToStartRemoveLatch = new CountDownLatch(1);
     }
+
+    @Override
     public void doTestHook(int spot) {
-      
     }
 
+    @Override
     public void doTestHook(String description) {
       try {
         if (description.equals("ATTEMPT_REMOVE")) {
           if (!readyToStartRemoveLatch.await(21, TimeUnit.SECONDS)) {
-            throw new TestException("Time ran out waiting for other thread to initiate put");
+            throw new AssertionError("Time ran out waiting for other thread to initiate put");
           }
         }
         else if (description.equals("BEGIN_TRANSITION_FROM_ELEMARRAY_TO_CONCURRENT_HASH_SET")) {
           readyToStartRemoveLatch.countDown();
           if (!waitForRemoveLatch.await(21, TimeUnit.SECONDS)) {
-            throw new TestException("Time ran out waiting for other thread to initiate remove");
+            throw new AssertionError("Time ran out waiting for other thread to initiate remove");
           }
         }
         else if (description.equals("BEGIN_REMOVE_FROM_ELEM_ARRAY")) {
           waitForRemoveLatch.countDown();
           if (!waitForTransitioned.await(21, TimeUnit.SECONDS)) {
-            throw new TestException("Time ran out waiting for transition from elem array to token");
+            throw new AssertionError("Time ran out waiting for transition from elem array to token");
           }
         }
         else if (description.equals("TRANSITIONED_FROM_ELEMARRAY_TO_TOKEN")) {
@@ -362,13 +371,11 @@ public class CompactRangeIndexJUnitTest  {
         }
       }
       catch (InterruptedException e) {
-        throw new TestException("Interrupted while waiting for test to complete");
+        throw new AssertionError("Interrupted while waiting for test to complete");
       }
     }
   }
 
-  
- 
   private void putValues(int num) {
     Region region = utils.getRegion("exampleRegion");
     for (int i = 1; i <= num; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
index 4dc2890..1d044a6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
@@ -19,6 +19,15 @@
  */
 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.IOException;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -55,7 +64,8 @@ import com.gemstone.gemfire.test.dunit.Wait;
 /**
  * 
  */
-public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends JUnit4CacheTestCase {
 
   String name;
 
@@ -72,13 +82,14 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
   /**
    * @param name
    */
-  public ConcurrentIndexInitOnOverflowRegionDUnitTest(String name) {
-    super(name);
+  public ConcurrentIndexInitOnOverflowRegionDUnitTest() {
+    super();
   }
 
   /**
   *
   */
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQueryOnRR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -187,6 +198,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
   /**
   *
   */
+  @Test
   public void testAsyncIndexInitDuringEntryPutUsingClientOnRR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -338,6 +350,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
    * This tests if index updates are blocked while region.clear() is
    * called and indexes are being reinitialized.
    */
+  @Test
   public void testIndexUpdateWithRegionClear() {
     
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 466483d..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
@@ -19,6 +19,15 @@
  */
 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.Collection;
 import java.util.Set;
 
@@ -56,23 +65,18 @@ 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(String name) {
-    super(name);
-  }
-
-  /**
    *
    */
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQueryOnRR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -175,6 +179,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
   /**
    *
    */
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQueryOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -277,6 +282,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
   /**
   *
   */
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQueryOnPersistentRR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -382,6 +388,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
   /**
   *
   */
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQueryOnPersistentPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -487,7 +494,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
   /**
   *
   */
- public void testAsyncIndexInitDuringEntryDestroyAndQueryOnNonOverflowRR() {
+  @Test
+  public void testAsyncIndexInitDuringEntryDestroyAndQueryOnNonOverflowRR() {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    hooked = false;
@@ -580,7 +588,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
  /**
   *
   */
- public void testAsyncIndexInitDuringEntryDestroyAndQueryOnOnNonOverflowPR() {
+  @Test
+  public void testAsyncIndexInitDuringEntryDestroyAndQueryOnOnNonOverflowPR() {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    hooked = false;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
index de87304..0061ec3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
@@ -19,7 +19,18 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.Index;
 import com.gemstone.gemfire.cache.query.IndexStatistics;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
@@ -31,13 +42,24 @@ import com.gemstone.gemfire.cache.query.partitioned.PRQueryDUnitHelper;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.CachedDeserializable;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
+import com.gemstone.gemfire.internal.cache.Token;
 import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.util.Collection;
 
 /**
  * This test is similar to {@link ConcurrentIndexUpdateWithoutWLDUnitTest} except
@@ -47,7 +69,8 @@ import java.util.Collection;
  * During validation all region operations are paused for a while. Validation
  * happens multiple time during one test run on a fixed time interval.
  */
-public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends JUnit4DistributedTestCase {
   
   PRQueryDUnitHelper helper = new PRQueryDUnitHelper();
   private static String regionName = "Portfolios";
@@ -92,13 +115,6 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends Dis
     }
   }
 
-  /**
-   * @param name
-   */
-  public ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void preSetUp() throws Exception {
     Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
@@ -138,6 +154,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends Dis
   }
 
   // Tests on Local/Replicated Region
+  @Test
   public void testCompactRangeIndex() {
     // Create a Local Region.
     Host host = Host.getHost(0);
@@ -184,6 +201,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends Dis
   }
 
   @Category(FlakyTest.class) // GEODE-431: time sensitive, uses PRQueryDUnitHelper whcih eats exceptions, async actions, uses Random
+  @Test
   public void testRangeIndex() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -212,6 +230,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends Dis
   }
 
   // Tests on Partition Region
+  @Test
   public void testCompactRangeIndexOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -275,6 +294,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends Dis
   }
   
 
+  @Test
   public void testRangeIndexOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 cd18314..791327c 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
@@ -19,7 +19,19 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.Index;
 import com.gemstone.gemfire.cache.query.IndexStatistics;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
@@ -31,22 +43,30 @@ import com.gemstone.gemfire.cache.query.partitioned.PRQueryDUnitHelper;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.CachedDeserializable;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
+import com.gemstone.gemfire.internal.cache.Token;
 import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.Collection;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * During validation all region operations are paused for a while. Validation
  * happens multiple time during one test run on a fixed time interval.
- * 
- * 
  */
-public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
-    DistributedTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentIndexUpdateWithoutWLDUnitTest extends JUnit4DistributedTestCase {
   
   PRQueryDUnitHelper helper = new PRQueryDUnitHelper();
   private static String regionName = "Portfolios";
@@ -66,13 +86,6 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
   int stepSize = 10;
   private int totalDataSize = 50;
 
-  /**
-   * @param name
-   */
-  public ConcurrentIndexUpdateWithoutWLDUnitTest(String name) {
-    super(name);
-  }
-
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
       vm.invoke(() -> getAvailableCacheElseCreateCache());
@@ -115,7 +128,9 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
       if (region != null) region.destroyRegion();
     }
   }
+
   // Tests on Local/Replicated Region
+  @Test
   public void testCompactRangeIndex() {
     // Create a Local Region.
     Host host = Host.getHost(0);
@@ -145,6 +160,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
     
   }
 
+  @Test
   public void testMultiIndexCreation() {
     // Create a Local Region.
     Host host = Host.getHost(0);
@@ -201,6 +217,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
     };
   }
 
+  @Test
   public void testRangeIndex() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -229,6 +246,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
   }
 
   // Tests on Partition Region
+  @Test
   public void testCompactRangeIndexOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -291,6 +309,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
     vm3.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));
   }
 
+  @Test
   public void testRangeIndexOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -352,6 +371,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
     vm3.invoke(getCacheSerializableRunnableForIndexValidation(regionName, rindexName));
   }
 
+  @Test
   public void testMultiIndexOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -427,13 +447,10 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
   /**
    * This validator will iterate over RegionEntries and verify their corresponding
    * index key and entry presence in index valuesToEntriesMap.
-   * 
-   *
    */
-  public class IndexValidator {
+  private static class IndexValidator {
 
     public IndexValidator() {
-      
     }
 
     private boolean isValidationInProgress;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
index 5f8080b..790421e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
@@ -16,35 +16,58 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.Index;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.QueryTestUtils;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.Struct;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.data.Position;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class CopyOnReadIndexDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CopyOnReadIndexDUnitTest extends JUnit4CacheTestCase {
 
   VM vm0;
   VM vm1;
   VM vm2;
 
-  public CopyOnReadIndexDUnitTest(String name) {
-    super(name);
+  public CopyOnReadIndexDUnitTest() {
+    super();
   }
 
   @Override
@@ -67,6 +90,7 @@ public class CopyOnReadIndexDUnitTest extends CacheTestCase {
   }
 
   //test different queries against partitioned region
+  @Test
   public void testPRQueryOnLocalNode() throws Exception {
     QueryTestUtils utils = new QueryTestUtils();
     configureServers();
@@ -84,6 +108,7 @@ public class CopyOnReadIndexDUnitTest extends CacheTestCase {
   }
   
   //tests different queries with a transaction for replicated region
+  @Test
   public void testTransactionsOnReplicatedRegion() throws Exception {
     QueryTestUtils utils = new QueryTestUtils();
     configureServers();


[31/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java
index b38de12..8d1fe4f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java
@@ -16,48 +16,49 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.ThreadUtils;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-// @TODO: use DiskRegionTestingBase and DiskRegionHelperFactory
 /**
  * Test methods to ensure that disk Clear is apparently atomic to region clear.
  * 
  * Data on disk should reflect data in memory. A put while clear is going on should
  * wait for clear and if it is successfully recorded in memory than it should
- * be recored on disk. Else if not successfully recorded in memory than should not be
+ * be recorded on disk. Else if not successfully recorded in memory than should not be
  * recorded on disk
- * 
+ *
+ * TODO: use DiskRegionTestingBase and DiskRegionHelperFactory
  */
 @Category(IntegrationTest.class)
 public class DiskRegionClearJUnitTest {
 
-  static Region testRegion = null;
-  static Object returnObject = null;
-  static boolean done = false;
-  static volatile int counter = 0;
-  static volatile boolean cleared = false;
-  static volatile long entries = 0;
-  static Cache cache = null;  
-  static DistributedSystem distributedSystem = null;
-  
-  private static String regionName = "TestRegion";
+  private static Region testRegion = null;
+  private static volatile int counter = 0;
+  private static volatile boolean cleared = false;
+  private static Cache cache = null;
+  private static DistributedSystem distributedSystem = null;
 
   @Before
   public void setUp() throws Exception {
@@ -73,7 +74,6 @@ public class DiskRegionClearJUnitTest {
     RegionAttributes regionAttributes = factory.create();
     testRegion = cache.createRegion("TestRegion1", regionAttributes);
     CacheObserverHolder.setInstance(new CacheObserverListener());
-    
   }
 
   @After
@@ -89,7 +89,7 @@ public class DiskRegionClearJUnitTest {
           try {
             root.localDestroyRegion("teardown");
           }
-          catch (VirtualMachineError e) {
+          catch (VirtualMachineError e) { // TODO: remove all this error handling
             SystemFailure.initiateFailure(e);
             throw e;
           }
@@ -103,7 +103,7 @@ public class DiskRegionClearJUnitTest {
       try {
         closeCache();
       }
-      catch (VirtualMachineError e) {
+      catch (VirtualMachineError e) { // TODO: remove all this error handling
         SystemFailure.initiateFailure(e);
         throw e;
       }
@@ -113,8 +113,7 @@ public class DiskRegionClearJUnitTest {
       }
     }
   }
-  
-  
+
   /**
    * Make sure the disk region stats are set to zero when the region is cleared.
    */
@@ -128,7 +127,6 @@ public class DiskRegionClearJUnitTest {
     testRegion.clear();
     assertEquals(0, dr.getStats().getNumEntriesInVM());
   }
- 
 
   /** Close the cache */
   private static synchronized final void closeCache() {
@@ -173,72 +171,64 @@ public class DiskRegionClearJUnitTest {
       }
     }
     ThreadUtils.join(thread, 10 * 60 * 1000);
-    Assert.assertTrue(counter == 3);
+    assertTrue(counter == 3);
     if(!cleared)
       fail("clear not done although puts have been done");    
   }
 
   @Test
-  public void testRecreateRegionAndCacheNegative() {
-    try {
-      LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
-      for(long i=0;i<100; i++) {
-        testRegion.put(new Long(i), new Long(i));
-      }
-      testRegion.clear();
-      assertEquals(0, testRegion.size());
-      cache.close();
-      distributedSystem.disconnect();
-      Properties properties = new Properties();
-      properties.setProperty(MCAST_PORT, "0");
-      properties.setProperty(LOCATORS, "");
-      distributedSystem = DistributedSystem.connect(properties);
-      cache = CacheFactory.create(distributedSystem);
-      AttributesFactory factory = new AttributesFactory();
-      factory.setScope(Scope.DISTRIBUTED_ACK);
-      factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-      RegionAttributes regionAttributes = factory.create();
-      testRegion = cache.createRegion("TestRegion1", regionAttributes);
-      
+  public void testRecreateRegionAndCacheNegative() throws Exception {
+    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
+    for(long i=0;i<100; i++) {
+      testRegion.put(new Long(i), new Long(i));
     }
-    catch (Exception e) {
-      fail("test failed due to "+e);
-     }
+    testRegion.clear();
+    assertEquals(0, testRegion.size());
+    cache.close();
+    distributedSystem.disconnect();
+    Properties properties = new Properties();
+    properties.setProperty(MCAST_PORT, "0");
+    properties.setProperty(LOCATORS, "");
+    distributedSystem = DistributedSystem.connect(properties);
+    cache = CacheFactory.create(distributedSystem);
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.DISTRIBUTED_ACK);
+    factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
+    RegionAttributes regionAttributes = factory.create();
+    testRegion = cache.createRegion("TestRegion1", regionAttributes);
+      
     System.out.println("keySet after recovery = " + testRegion.keySet());
     assertEquals(0, testRegion.size());
   }
   
   @Test
   public void testRecreateRegionAndCachePositive() {
-    int size = 0;
-      LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
-      for(long i=0;i<1000; i++) {
-        testRegion.put(new Long(i), new Long(i));
-      }
-      testRegion.clear();
-      for(long i=0;i<1000; i++) {
-        testRegion.put(new Long(i), new Long(i));
-      }
-      assertEquals(1000, testRegion.size());
-      cache.close();
-      distributedSystem.disconnect();
-      Properties properties = new Properties();
+    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
+    for(long i=0;i<1000; i++) {
+      testRegion.put(new Long(i), new Long(i));
+    }
+    testRegion.clear();
+    for(long i=0;i<1000; i++) {
+      testRegion.put(new Long(i), new Long(i));
+    }
+    assertEquals(1000, testRegion.size());
+    cache.close();
+    distributedSystem.disconnect();
+    Properties properties = new Properties();
     properties.setProperty(MCAST_PORT, "0");
     properties.setProperty(LOCATORS, "");
-      distributedSystem = DistributedSystem.connect(properties);
-      cache = CacheFactory.create(distributedSystem);
-      AttributesFactory factory = new AttributesFactory();
-      factory.setScope(Scope.DISTRIBUTED_ACK);
-      factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-      RegionAttributes regionAttributes = factory.create();
-      testRegion = cache.createRegion("TestRegion1", regionAttributes);
+    distributedSystem = DistributedSystem.connect(properties);
+    cache = CacheFactory.create(distributedSystem);
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.DISTRIBUTED_ACK);
+    factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
+    RegionAttributes regionAttributes = factory.create();
+    testRegion = cache.createRegion("TestRegion1", regionAttributes);
     assertEquals(1000, testRegion.size());
   }
-  
-  protected static class Thread1 implements Runnable {
 
-    
-    
+  private static class Thread1 implements Runnable {
+    @Override
     public void run() {
       for(long i=0 ; i< 100 ; i++) {     
       testRegion.put(new Long(i), new Long(i));
@@ -247,20 +237,21 @@ public class DiskRegionClearJUnitTest {
     }
   }
 
-  protected static class Thread2 implements Runnable {
-
+  private static class Thread2 implements Runnable {
+    @Override
     public void run() {
       testRegion.clear();
     }
   }
 
-  protected static class CacheObserverListener extends CacheObserverAdapter {
-    
-    
+  private static class CacheObserverListener extends CacheObserverAdapter {
+
+    @Override
     public void afterRegionClear(RegionEvent event) {
       cleared = true;
     }
 
+    @Override
     public void beforeDiskClear() {
       for(int i=0; i<3; i++) {
       Thread thread = new Thread(new Thread1());
@@ -269,8 +260,6 @@ public class DiskRegionClearJUnitTest {
     }
   }
 
-  protected static class CacheObserver extends CacheObserverAdapter
-  {
-
+  private static class CacheObserver extends CacheObserverAdapter {
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java
index fd64ceb..baba67f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java
@@ -17,52 +17,44 @@
 package com.gemstone.gemfire.internal.cache;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Properties;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.DiskStoreFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.io.File;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
- * This test tests Illegal arguements being passed to create disk regions. The
+ * This test tests Illegal arguments being passed to create disk regions. The
  * creation of the DWA object should throw a relevant exception if the
- * arguements specified are incorrect.
- * 
- *  
+ * arguments specified are incorrect.
  */
 @Category(IntegrationTest.class)
-public class DiskRegionIllegalArguementsJUnitTest
-{
+public class DiskRegionIllegalArguementsJUnitTest {
 
   protected static Cache cache = null;
 
   protected static DistributedSystem ds = null;
-  protected static Properties props = new Properties();
 
-  static {
+  @Before
+  public void setUp() throws Exception {
+    Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(LOG_LEVEL, "config"); // to keep diskPerf logs smaller
     props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
     props.setProperty(ENABLE_TIME_STATISTICS, "true");
     props.setProperty(STATISTIC_ARCHIVE_FILE, "stats.gfs");
-  }
 
-  @Before
-  public void setUp() throws Exception {
     cache = new CacheFactory(props).create();
     ds = cache.getDistributedSystem();
   }
@@ -75,7 +67,6 @@ public class DiskRegionIllegalArguementsJUnitTest
   /**
    * test Illegal max oplog size
    */
-
   @Test
   public void testMaxOplogSize()
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
index d2291f1..4bac646 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
@@ -16,33 +16,31 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.CacheXmlException;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.fail;
 
 /**
  * This test tests Illegal arguements being passed to 
  * create disk regions. The creation of the DWA object should
  * throw a relevant exception if the arguements specified are incorrect.
- * 
- *
  */
 @Category(IntegrationTest.class)
-public class DiskRegionIllegalCacheXMLvaluesJUnitTest
-{
+public class DiskRegionIllegalCacheXMLvaluesJUnitTest {
 
-  public void createRegion(String path)
-  {
+  public void createRegion(String path) {
     DistributedSystem ds = null;
     try {
       boolean exceptionOccured = false;
@@ -82,59 +80,51 @@ public class DiskRegionIllegalCacheXMLvaluesJUnitTest
     }
   }
  
-  
   /**
    * test Illegal max oplog size
    */
-
   @Test
-  public void testMaxOplogSize()
-  {
+  public void testMaxOplogSize() {
     createRegion("faultyDiskXMLsForTesting/incorrect_max_oplog_size.xml");
   }
 
+  @Ignore("TODO: test is empty")
   @Test
-  public void testSynchronous()
-  {}
+  public void testSynchronous() {
+  }
 
   @Test
-  public void testIsRolling()
-  {
+  public void testIsRolling() {
     createRegion("faultyDiskXMLsForTesting/incorrect_roll_oplogs_value.xml");
   }
 
   @Test
-  public void testDiskDirSize()
-  {
+  public void testDiskDirSize() {
     createRegion("faultyDiskXMLsForTesting/incorrect_dir_size.xml");
   }
 
   @Test
-  public void testDiskDirs()
-  {
+  public void testDiskDirs() {
     createRegion("faultyDiskXMLsForTesting/incorrect_dir.xml");
   }
 
   @Test
-  public void testBytesThreshold()
-  {
+  public void testBytesThreshold() {
     createRegion("faultyDiskXMLsForTesting/incorrect_bytes_threshold.xml");
   }
 
   @Test
-  public void testTimeInterval()
-  {
+  public void testTimeInterval() {
     createRegion("faultyDiskXMLsForTesting/incorrect_time_interval.xml");
   }
 
   @Test
-  public void testMixedDiskStoreWithDiskDir()
-  {
+  public void testMixedDiskStoreWithDiskDir() {
     createRegion("faultyDiskXMLsForTesting/mixed_diskstore_diskdir.xml");
   }
+
   @Test
-  public void testMixedDiskStoreWithDWA()
-  {
+  public void testMixedDiskStoreWithDWA() {
     createRegion("faultyDiskXMLsForTesting/mixed_diskstore_diskwriteattrs.xml");
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionJUnitTest.java
index 4d88f43..ddc1d6e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionJUnitTest.java
@@ -16,26 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.lang.reflect.Array;
 import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
 
-import org.junit.After;
-import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
 
-import static org.junit.Assert.*;
-import junit.framework.Assert;
-
-import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.DiskAccessException;
 import com.gemstone.gemfire.cache.DiskStore;
 import com.gemstone.gemfire.cache.EntryEvent;
@@ -55,44 +51,74 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 /**
  * TODO: fails when running integrationTest from gradle command-line on Windows 7
  * 
-com.gemstone.gemfire.internal.cache.DiskRegionJUnitTest > testAssertionErrorIfMissingOplog FAILED
-    junit.framework.AssertionFailedError
-        at junit.framework.Assert.fail(Assert.java:55)
-        at junit.framework.Assert.assertTrue(Assert.java:22)
-        at junit.framework.Assert.assertTrue(Assert.java:31)
-        at com.gemstone.gemfire.internal.cache.DiskRegionJUnitTest.testAssertionErrorIfMissingOplog(DiskRegionJUnitTest.java:2630)
- * 
- * JUnit tests covering some miscellaneous functionalites of Disk Region.
+ * JUnit tests covering some miscellaneous functionality of Disk Region.
  */
 @Category(IntegrationTest.class)
-public class DiskRegionJUnitTest extends DiskRegionTestingBase
-{
-  DiskRegionProperties diskProps = new DiskRegionProperties();
-
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+public class DiskRegionJUnitTest extends DiskRegionTestingBase {
+
+  private static volatile boolean hasNotified = false;
+  private static volatile boolean putsHaveStarted = false;
+
+  private volatile boolean exceptionOccured = false;
+  private volatile boolean finished = false;
+
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
+
+  private DiskRegionProperties diskProps1 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps2 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps3 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps4 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps5 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps6 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps7 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps8 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps9 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps10 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps11 = new DiskRegionProperties();
+  private DiskRegionProperties diskProps12 = new DiskRegionProperties();
+
+  private Region region1;
+  private Region region2;
+  private Region region3;
+  private Region region4;
+  private Region region5;
+  private Region region6;
+  private Region region7;
+  private Region region8;
+  private Region region9;
+  private Region region10;
+  private Region region11;
+  private Region region12;
+
+  private boolean failed = false;
+
+  private int counter = 0;
+  private boolean hasBeenNotified = false;
+
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  @Override
+  protected final void postSetUp() throws Exception {
     this.exceptionOccured = false;
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = true;
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = false;
   }
 
   private static class MyCL extends CacheListenerAdapter {
     public EntryEvent lastEvent;
+    @Override
     public void afterDestroy(EntryEvent event) {
       this.lastEvent = event;
     }
   }
 
   @Test
-  public void testRemoveCorrectlyRecorded() {
+  public void testRemoveCorrectlyRecorded() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(true);
     props.setOverFlowCapacity(1);
@@ -105,12 +131,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
 
     MyCL cacheListener = new MyCL();
     region.getAttributesMutator().addCacheListener(cacheListener);
-    try {
-      region.destroy("1");
-    }
-    catch (Exception e) {
-      fail("Exception not expected but did occur due to "+e);
-    }
+    region.destroy("1");
 
     // Make sure we don't get an old value when doing a destroy
     // of an entry that overflowed to disk.
@@ -118,7 +139,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     assertNotNull(cacheListener.lastEvent);
     assertEquals(null, cacheListener.lastEvent.getOldValue());
 
-    Assert.assertTrue(region.get("1")==null);
+    assertTrue(region.get("1")==null);
     
     boolean exceptionOccured = false;
     try {
@@ -131,29 +152,23 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       exceptionOccured = true;
     }
     
-    if(!exceptionOccured){
+    if (!exceptionOccured){
       fail("exception did not occur although was supposed to occur");
     }
 
     region.close();
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,props);
     
-    Assert.assertTrue(region.get("1")==null);
+    assertTrue(region.get("1")==null);
     region.destroyRegion();
-    
   }
-  
-  
-  
+
   /**
    * Tests if region overflows correctly and stats are create and updated
    * correctly.
-   *  
    */
   @Test
-  public void testDiskRegionOverflow()
-  {
-
+  public void testDiskRegionOverflow() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(true);
     props.setOverFlowCapacity(100);
@@ -210,8 +225,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
   }
 
-  public void assertArrayEquals(Object expected, Object v)
-  {
+  private void assertArrayEquals(Object expected, Object v) {
     assertEquals(expected.getClass(), v.getClass());
     int vLength = Array.getLength(v);
     assertEquals(Array.getLength(expected), vLength);
@@ -223,12 +237,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   /**
    * test method for putting different objects and validating that they have
    * been correctly put
-   *  
    */
   @Test
-  public void testDifferentObjectTypePuts()
-  {
-
+  public void testDifferentObjectTypePuts() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(true);
     props.setOverFlowCapacity(100);
@@ -244,33 +255,29 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
         region.put(s, s);
       }
       region.put("foobar", "junk");
-      try {
-        region.localDestroy("foobar");
-
-        region.put("foobar2", "junk");
-        dr.flushForTesting();
-        region.localDestroy("foobar2");
-        // test invalidate
-        region.put("invalid", "invalid");
-        dr.flushForTesting();
-        region.invalidate("invalid");
-        dr.flushForTesting();
-        assertTrue(region.containsKey("invalid")
-            && !region.containsValueForKey("invalid"));
-        total++;
-        // test local-invalidate
-        region.put("localinvalid", "localinvalid");
-        dr.flushForTesting();
-        region.localInvalidate("localinvalid");
-        dr.flushForTesting();
-        assertTrue(region.containsKey("localinvalid")
-            && !region.containsValueForKey("localinvalid"));
-        total++;
-      }
-      catch (EntryNotFoundException e) {
-        logWriter.error("Exception occured", e);
-        fail(" Entry not found although was expected to be there");
-      }
+
+      region.localDestroy("foobar");
+
+      region.put("foobar2", "junk");
+      dr.flushForTesting();
+      region.localDestroy("foobar2");
+      // test invalidate
+      region.put("invalid", "invalid");
+      dr.flushForTesting();
+      region.invalidate("invalid");
+      dr.flushForTesting();
+      assertTrue(region.containsKey("invalid")
+          && !region.containsValueForKey("invalid"));
+      total++;
+      // test local-invalidate
+      region.put("localinvalid", "localinvalid");
+      dr.flushForTesting();
+      region.localInvalidate("localinvalid");
+      dr.flushForTesting();
+      assertTrue(region.containsKey("localinvalid")
+          && !region.containsValueForKey("localinvalid"));
+      total++;
+
       // test byte[] values
       region.put("byteArray", new byte[0]);
       dr.flushForTesting();
@@ -286,13 +293,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       assertEquals(total, region.size());
     }
     cache.close();
-    try {
-      cache = createCache();
-    }
-    catch (Exception e) {
-      logWriter.error("Exception occured", e);
-      fail("Exception in trying to create a cache due to " + e);
-    }
+    cache = createCache();
     {
       Region region = DiskRegionHelperFactory.getAsyncOverFlowAndPersistRegion(
           cache, props);
@@ -300,30 +301,23 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       assertEquals(true, region.containsKey("invalid"));
       assertEquals(null, region.get("invalid"));
       assertEquals(false, region.containsValueForKey("invalid"));
-      try {
-        region.localDestroy("invalid");
-        total--;
-        assertTrue(region.containsKey("localinvalid")
-            && !region.containsValueForKey("localinvalid"));
-        region.localDestroy("localinvalid");
-        total--;
-        assertArrayEquals(new byte[0], region.get("byteArray"));
-        region.localDestroy("byteArray");
-        total--;
-        assertEquals("modified", region.get("modified"));
-        region.localDestroy("modified");
-        total--;
-      }
-      catch (EntryNotFoundException e) {
-        logWriter.error("Exception occured", e);
-        fail(" Entry not found although was expected to be there");
-      }
+
+      region.localDestroy("invalid");
+      total--;
+      assertTrue(region.containsKey("localinvalid")
+          && !region.containsValueForKey("localinvalid"));
+      region.localDestroy("localinvalid");
+      total--;
+      assertArrayEquals(new byte[0], region.get("byteArray"));
+      region.localDestroy("byteArray");
+      total--;
+      assertEquals("modified", region.get("modified"));
+      region.localDestroy("modified");
+      total--;
     }
   }
 
-
-  class DoesPut implements Runnable
-  {
+  private static class DoesPut implements Runnable {
 
     private Region region;
 
@@ -331,15 +325,14 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       this.region = region;
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       region.put(new Integer(1), new Integer(2));
     }
 
   }
 
-  class DoesGet implements Runnable
-  {
+  private class DoesGet implements Runnable {
 
     private final Region region;
 
@@ -347,8 +340,8 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       this.region = region;
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       synchronized (this.region) {
         if (!hasNotified) {
           try {
@@ -364,8 +357,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
           catch (InterruptedException e) {
             testFailed = true;
             failureCause = "interrupted exception not expected here";
-            fail("exception not expected here");
-
+            throw new AssertionError("exception not expected here", e);
           }
         }
         region.get(new Integer(0));
@@ -373,12 +365,8 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     } // run()
   }
 
-  boolean failed = false;
-  static volatile boolean hasNotified = false;
-
   @Test
-  public void testFaultingInRemovalFromAsyncBuffer()
-  {
+  public void testFaultingInRemovalFromAsyncBuffer() throws Exception {
     failed = false;
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(true);
@@ -426,16 +414,8 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
 
   }
 
-  protected int counter = 0;
-
-  protected boolean hasBeenNotified = false;
-
-  volatile boolean finished = false;
-  
   @Test
-  public void testGetWhileRolling()
-  {
-
+  public void testGetWhileRolling() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(true);
     props.setOverFlowCapacity(1);
@@ -446,8 +426,8 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
         cache, props);
 
     CacheObserverHolder.setInstance(new CacheObserverAdapter() {
-      public void beforeGoingToCompact()
-      {
+      @Override
+      public void beforeGoingToCompact() {
         synchronized (region) {
           region.notifyAll();
           hasBeenNotified = true;
@@ -456,30 +436,12 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     });
 
     Runnable get = new Runnable() {
-      public void run()
-      {
+      @Override
+      public void run() {
         int localCounter = 0;
         synchronized (region) {
           localCounter = counter;
           counter++;
-//          try {
-//            if (!hasBeenNotified) {
-//              long startTime = System.currentTimeMillis();
-//              region.wait(24000);
-//              long interval = System.currentTimeMillis() - startTime;
-//              if (interval > 24000) {
-//                failed = true;
-//                fail("Getter #" + localCounter + " took too long in going to join, it should have exited before 24000 ms");
-//              }
-//            }
-//
-//          }
-//          catch (InterruptedException e) {
-//            if (finished) {
-//              return;
-//            }
-//            fail("interrupted");
-//          }
         }
         int limit = ((localCounter * 1000) + 1000);
         for (int i = localCounter * 1000; i < limit; i++) {
@@ -495,8 +457,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
               return;
             }
             failed = true;
-            fail(" failed due to " + e);
-            logWriter.error("Exception occured but not failing test ", e); // NOTREACHED
+            throw new AssertionError("failed due to ", e);
           }
         }
 
@@ -545,12 +506,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * to the Max Oplog Size. In such situations , if during switch over , if the
    * Oplog to be rolled is added after function call of obtaining nextDir , a
    * dead lock occurs
-   * 
    */
-
   @Test
-  public void testSingleDirectoryNotHanging()
-  {
+  public void testSingleDirectoryNotHanging() throws Exception {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     //setting to null will make only one directory
     File dir = new File("testSingleDirectoryNotHanging");
@@ -586,11 +544,8 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     closeDown();
   }
 
-  static volatile boolean putsHaveStarted = false;
-  
   @Test
-  public void testOperationGreaterThanMaxOplogSize()
-  {
+  public void testOperationGreaterThanMaxOplogSize() throws Exception {
     putsHaveStarted = false;
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -617,15 +572,13 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     if (puts.exceptionOccurred()) {
       fail(" Exception was not supposed to occur but did occur");
     }
-
   }
   
   /**
    * As we have relaxed the constraint of max dir size 
    */
   @Test
-  public void testOperationGreaterThanMaxDirSize()
-  {
+  public void testOperationGreaterThanMaxDirSize() throws Exception {
     putsHaveStarted = false;
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setRegionName("IGNORE_EXCEPTION_testOperationGreaterThanMaxDirSize");
@@ -669,7 +622,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * one op per oplog (which is caused by bug 42464).
    */
   @Test
-  public void testBug42464() {
+  public void testBug42464() throws Exception  {
     putsHaveStarted = false;
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     File[] myDirs = new File[] { dirs[0] };
@@ -727,10 +680,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     assertEquals(1, oplogs.size());
   }
 
-  protected volatile boolean exceptionOccured = false;
-
-  class Puts implements Runnable
-  {
+  private static class Puts implements Runnable {
 
     private int dataSize = 1024;
     private Region region;
@@ -753,6 +703,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       return putSuccessful[index];
     }
 
+    @Override
     public void run() {
       performPuts();
     }
@@ -783,15 +734,11 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testSingleDirectorySizeViolation()
-  {
-
+  public void testSingleDirectorySizeViolation() throws Exception {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setRegionName("IGNORE_EXCEPTION_testSingleDirectorySizeViolation");
     //setting to null will make only one directory
-    File dir = new File("testSingleDirectoryNotHanging");
-    dir.mkdir();
-    dir.deleteOnExit();
+    File dir = temporaryFolder.newFolder("testSingleDirectoryNotHanging");
     File[] dirs = new File[] {dir};
     int[] dirSizes = { 2048 };
     diskRegionProperties.setDiskDirsAndSizes(dirs, dirSizes);
@@ -824,8 +771,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * DiskRegDiskAccessExceptionTest : Disk region test for DiskAccessException.
    */
   @Test
-  public void testDiskFullExcep()
-  {
+  public void testDiskFullExcep() throws Exception {
     int[] diskDirSize1 = new int[4];
     diskDirSize1[0] = (2048 + 500);
     diskDirSize1[1] = (2048 + 500);
@@ -849,14 +795,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
 
     final byte[] value = new byte[1024];
     Arrays.fill(value, (byte)77);
-    try {
-      for (int i = 0; i < 8; i++) {
-        region.put("" + i, value);
-      }
-    }
-    catch (DiskAccessException e) {
-      logWriter.error("Exception occured but not expected", e);
-      fail("FAILED::" + e.toString());
+
+    for (int i = 0; i < 8; i++) {
+      region.put("" + i, value);
     }
 
     // we should have put 2 values in each dir so the next one should not fit
@@ -883,8 +824,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * Make sure if compaction is enabled that we can exceed the disk dir limit
    */
   @Test
-  public void testNoDiskFullExcep()
-  {
+  public void testNoDiskFullExcep() throws Exception {
     int[] diskDirSize1 = new int[4];
     diskDirSize1[0] = (2048 + 500);
     diskDirSize1[1] = (2048 + 500);
@@ -915,7 +855,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (DiskAccessException e) {
       logWriter.error("Exception occured but not expected", e);
-      fail("FAILED::" + e.toString());
+      throw new AssertionError("FAILED::", e);
     }
 
     // we should have put 2 values in each dir so the next one should not fit
@@ -926,17 +866,17 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (DiskAccessException e) {
       logWriter.error("Exception occured but not expected", e);
-      fail("FAILED::" + e.toString());
+      throw new AssertionError("FAILED::", e);
     }
 
     assertEquals(false, cache.isClosed());
   }
+
   /**
    * DiskRegDiskAccessExceptionTest : Disk region test for DiskAccessException.
    */
   @Test
-  public void testDiskFullExcepOverflowOnly()
-  {
+  public void testDiskFullExcepOverflowOnly() throws Exception {
     int[] diskDirSize1 = new int[4];
     diskDirSize1[0] = (2048 + 500);
     diskDirSize1[1] = (2048 + 500);
@@ -971,7 +911,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (DiskAccessException e) {
       logWriter.error("Exception occured but not expected", e);
-      fail("FAILED::" + e.toString());
+      throw new AssertionError("FAILED::", e);
     }
 
     // we should have put 2 values in each dir so the next one should not fit
@@ -998,8 +938,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * Make sure if compaction is enabled that we can exceed the disk dir limit
    */
   @Test
-  public void testNoDiskFullExcepOverflowOnly()
-  {
+  public void testNoDiskFullExcepOverflowOnly() throws Exception {
     int[] diskDirSize1 = new int[4];
     diskDirSize1[0] = (2048 + 500);
     diskDirSize1[1] = (2048 + 500);
@@ -1033,7 +972,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (DiskAccessException e) {
       logWriter.error("Exception occured but not expected", e);
-      fail("FAILED::" + e.toString());
+      throw new AssertionError("FAILED::", e);
     }
 
     // we should have put 2 values in each dir so the next one should not fit
@@ -1044,7 +983,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (DiskAccessException e) {
       logWriter.error("Exception occured but not expected", e);
-      fail("FAILED::" + e.toString());
+      throw new AssertionError("FAILED::", e);
     }
 
     assertEquals(false, cache.isClosed());
@@ -1055,8 +994,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * time, the operation should not get stuck or see Exception
    */
   @Test
-  public void testSynchModeAllowOperationToProceedEvenIfDiskSpaceIsNotSufficient()
-  {
+  public void testSynchModeAllowOperationToProceedEvenIfDiskSpaceIsNotSufficient() throws Exception {
     File[] dirs1 = null;
     File testingDirectory1 = new File("testingDirectory1");
     testingDirectory1.mkdir();
@@ -1089,8 +1027,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }// end of testSyncPersistRegionDAExp
 
   @Test
-  public void testAsynchModeAllowOperationToProceedEvenIfDiskSpaceIsNotSufficient()
-  {
+  public void testAsynchModeAllowOperationToProceedEvenIfDiskSpaceIsNotSufficient() throws Exception {
     File[] dirs1 = null;
     File testingDirectory1 = new File("testingDirectory1");
     testingDirectory1.mkdir();
@@ -1142,7 +1079,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
           logWriter.error("Exception occured but not expected", e);
           testFailed = true;
           failureCause = "FAILED::" + e.toString();
-          fail("FAILED::" + e.toString());
+          throw new AssertionError("FAILED::", e);
         }
 
         final Thread t1 = Thread.currentThread();
@@ -1154,11 +1091,10 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
                 try {
                   ThreadUtils.join(t1, 60 * 1000);
                 }
-                catch (Exception ignore) {
-                  logWriter.error("Exception occured", ignore);
+                catch (Exception e) {
                   testFailed = true;
                   failureCause = "Test failed as the compactor thread not guaranteed to have not rolled the oplog";
-                  fail("Test failed as the compactor thread not guaranteed to have not rolled the oplog");
+                  throw new AssertionError("Test failed as the compactor thread not guaranteed to have not rolled the oplog", e);
                 }
               }
 
@@ -1201,60 +1137,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   /**
    * DiskRegDiskAttributesTest: This test is for testing Disk attributes set
    * programmatically
-   *  
    */
-
-  DiskRegionProperties diskProps1 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps2 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps3 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps4 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps5 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps6 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps7 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps8 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps9 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps10 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps11 = new DiskRegionProperties();
-
-  DiskRegionProperties diskProps12 = new DiskRegionProperties();
-
-  Region region1;
-
-  Region region2;
-
-  Region region3;
-
-  Region region4;
-
-  Region region5;
-
-  Region region6;
-
-  Region region7;
-
-  Region region8;
-
-  Region region9;
-
-  Region region10;
-
-  Region region11;
-
-  Region region12;
-
   @Test
-  public void testDiskRegDWAttrbts()
-  {
+  public void testDiskRegDWAttrbts() throws Exception {
     diskProps1.setDiskDirs(dirs);
     diskProps2.setDiskDirs(dirs);
     diskProps3.setDiskDirs(dirs);
@@ -1373,13 +1258,12 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     lr.getDiskStore().close();
     lr.getGemFireCache().removeDiskStore(lr.getDiskStore());
   }
+
   /**
    * DiskRegGetInvalidEntryTest: get invalid entry should return null.
-   *  
    */
   @Test
-  public void testDiskGetInvalidEntry()
-  {
+  public void testDiskGetInvalidEntry() throws Exception {
     Object getInvalidEnt = "some val";
 
     diskProps.setDiskDirsAndSizes(dirs, diskDirSize);
@@ -1398,17 +1282,14 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       }
     }
     catch (Exception e) {
-      logWriter.error("Exception occured but not expected", e);
-      fail("Failed while put:" + e.toString());
+      throw new AssertionError("Failed while put:", e);
     }
     // invalidate an entry
     try {
       region.invalidate("key1");
     }
     catch (Exception e) {
-
-      fail("Failed while invalidating:" + e.toString());
-
+      throw new AssertionError("Failed while invalidating:" + e.toString());
     }
     // get the invalid entry and verify that the value returned is null
     try {
@@ -1416,7 +1297,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (Exception e) {
       logWriter.error("Exception occured but not expected", e);
-      fail("Failed while getting invalid entry:" + e.toString());
+      throw new AssertionError("Failed while getting invalid entry:", e);
 
     }
     assertTrue("get operation on invalid entry returned non null value",
@@ -1432,8 +1313,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * presented as a byte array
    */
   @Test
-  public void testDiskRegionByteArray()
-  {
+  public void testDiskRegionByteArray() throws Exception {
     Object val = null;
     diskProps.setPersistBackup(true);
     diskProps.setDiskDirs(dirs);
@@ -1457,8 +1337,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("Failed to get the value on disk");
-
+      throw new AssertionError("Failed to get the value on disk", ex);
     }
     //verify that the value retrieved above represents byte array.
     //verify the length of the byte[]
@@ -1483,9 +1362,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * SimpleDiskRegion.
    */
   @Test
-  public void testInstanceOfDiskRegion()
-  {
-
+  public void testInstanceOfDiskRegion() throws Exception {
     DiskRegionProperties diskProps = new DiskRegionProperties();
 
     diskProps.setDiskDirs(dirs); // dirs is an array of four dirs
@@ -1525,11 +1402,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
 
   /**
    * DiskRegionStatsJUnitTest :
-   *  
    */
   @Test
-  public void testStats()
-  {
+  public void testStats() throws Exception {
     final int overflowCapacity = 100;
     int counter = 0;
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
@@ -1568,11 +1443,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   /**
    * DiskRegOverflowOnlyNoFilesTest: Overflow only mode has no files of previous
    * run, during startup
-   *  
    */
   @Test
-  public void testOverflowOnlyNoFiles()
-  {
+  public void testOverflowOnlyNoFiles() throws Exception {
     diskProps.setTimeInterval(15000l);
     diskProps.setBytesThreshold(100000l);
     diskProps.setOverFlowCapacity(1000);
@@ -1618,7 +1491,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }//end of testOverflowOnlyNoFiles
 
   @Test
-  public void testPersistNoFiles() {
+  public void testPersistNoFiles() throws Exception {
     diskProps.setOverflow(false);
     diskProps.setRolling(false);
     diskProps.setDiskDirs(dirs);
@@ -1666,12 +1539,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * Test to verify that DiskAccessException is not thrown if rolling has been enabled. The
    * test configurations will cause the disk to go full and wait for the compactor to release space. 
    * A DiskAccessException should not be thrown by this test
-   * 
-   * @throws Exception
    */
   @Test
-  public void testDiskAccessExceptionNotThrown() throws Exception
-  {
+  public void testDiskAccessExceptionNotThrown() throws Exception {
     File diskDir = new File("dir");
     diskDir.mkdir();
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
@@ -1681,31 +1551,18 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     diskRegionProperties.setSynchronous(true);   
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache, diskRegionProperties);
     byte[] bytes = new byte[256];
-    try {
     for(int i=0; i<1500; i++){
       region.put(new Integer(i%10),bytes);
     }  
-    }
-    catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    }
-    catch(Throwable th) {
-      th.printStackTrace();
-      logWriter.error(th);
-      fail("Test failed due to exception (see logs for details):" + th);
-    }    
   }
   
   /**
    * If an entry which has just been written on the disk, sees clear just before
    * updating the LRULiist, then that deleted entry should not go into the
    * LRUList
-   * 
    */
   @Test
-  public void testClearInteractionWithLRUList_Bug37605()
-  {
+  public void testClearInteractionWithLRUList_Bug37605() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(true);
     props.setOverFlowCapacity(1);
@@ -1755,11 +1612,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * happened, the entry on which create op is going on was no longer valid, but
    * we would not be able to detect the conflict. The fix was to first clear the
    * region map & then reset the Htree Ref.
-   * 
    */
   @Test
-  public void testClearInteractionWithCreateOperation_Bug37606()
-  {
+  public void testClearInteractionWithCreateOperation_Bug37606() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(false);
     props.setRolling(false);
@@ -1802,9 +1657,6 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       assertEquals(1, DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
           props, Scope.LOCAL).size());
     }
-    catch (Exception e) {
-      logWriter.error("Test failed", e);
-    }
     finally {
       CacheObserverHolder.setInstance(old);
       LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
@@ -1815,8 +1667,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * Similar test in case of 'update'
    */
   @Test
-  public void testClearInteractionWithUpdateOperation_Bug37606()
-  {
+  public void testClearInteractionWithUpdateOperation_Bug37606() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setOverflow(false);
     props.setRolling(false);
@@ -1861,53 +1712,43 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       assertEquals(1,DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
           props, Scope.LOCAL).size());
     }
-    catch (Exception e) {
-      fail("Exception not expected but did occur due to " + e);
-    }
     finally {
       CacheObserverHolder.setInstance(old);
       LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
     }
   }
   
-
   /**
    * If IOException occurs while updating an entry in a persist only synch mode,
    * DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
    */
   @Test
-  public void testEntryUpdateInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInSynchPersistOnlyForIOExceptionCase");
-      props.setOverflow(false);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);
-      
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-      entryUpdateInSynchPersistTypeForIOExceptionCase(region);
+  public void testEntryUpdateInSynchPersistOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInSynchPersistOnlyForIOExceptionCase");
+    props.setOverflow(false);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
+
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+    entryUpdateInSynchPersistTypeForIOExceptionCase(region);
   }
   
   /**
    * If IOException occurs while updating an entry in a persist overflow synch mode,
    * we should get DiskAccessException & region be destroyed
-   * 
-   * @throws Exception
    */
   @Test
-  public void testEntryUpdateInSyncOverFlowPersistOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInSyncOverFlowPersistOnlyForIOExceptionCase");
-      props.setOverflow(true);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);     
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-      entryUpdateInSynchPersistTypeForIOExceptionCase(region);
+  public void testEntryUpdateInSyncOverFlowPersistOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInSyncOverFlowPersistOnlyForIOExceptionCase");
+    props.setOverflow(true);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+    entryUpdateInSynchPersistTypeForIOExceptionCase(region);
   }
   
   /**
@@ -1939,42 +1780,37 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   
   /**
    * If IOException occurs while invalidating an entry in a persist only synch mode,
-   *  DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
+   * DiskAccessException should occur & region should be destroyed
    */
   @Test
-  public void testEntryInvalidateInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryInvalidateInSynchPersistOnlyForIOExceptionCase");
-      props.setOverflow(false);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);      
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-      entryInvalidateInSynchPersistTypeForIOExceptionCase(region);
+  public void testEntryInvalidateInSynchPersistOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryInvalidateInSynchPersistOnlyForIOExceptionCase");
+    props.setOverflow(false);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+    entryInvalidateInSynchPersistTypeForIOExceptionCase(region);
   }
   
   /**
    * If IOException occurs while invalidating an entry in a persist overflow synch mode,
-   *  DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
+   * DiskAccessException should occur & region should be destroyed
    */
   @Test
-  public void testEntryInvalidateInSynchPersistOverflowForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryInvalidateInSynchPersistOverflowForIOExceptionCase");
-      
-      props.setOverflow(true);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-      entryInvalidateInSynchPersistTypeForIOExceptionCase(region);
+  public void testEntryInvalidateInSynchPersistOverflowForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryInvalidateInSynchPersistOverflowForIOExceptionCase");
+
+    props.setOverflow(true);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+    entryInvalidateInSynchPersistTypeForIOExceptionCase(region);
   }
+
   /**
    * If IOException occurs while invalidating an entry in a persist only synch mode,
    * DiskAccessException should occur & region should be destroyed
@@ -2002,15 +1838,11 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
   
   /**
-   * 
    * If IOException occurs while creating an entry in a persist only synch mode,
-   *  DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
+   * DiskAccessException should occur & region should be destroyed
    */
   @Test
-  public void testEntryCreateInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {
+  public void testEntryCreateInSynchPersistOnlyForIOExceptionCase() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("IGNORE_EXCEPTION_testEntryCreateInSynchPersistOnlyForIOExceptionCase");
     props.setOverflow(false);
@@ -2022,15 +1854,11 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
   
   /**
-   * 
    * If IOException occurs while creating an entry in a persist overflow synch mode,
    * DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
    */
   @Test
-  public void testEntryCreateInSynchPersistOverflowForIOExceptionCase()
-      throws Exception {
+  public void testEntryCreateInSynchPersistOverflowForIOExceptionCase() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("IGNORE_EXCEPTION_testEntryCreateInSynchPersistOverflowForIOExceptionCase");
     props.setOverflow(true);
@@ -2069,13 +1897,10 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   
   /**
    * If IOException occurs while destroying an entry in a persist only synch mode,
-    DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
+   * DiskAccessException should occur & region should be destroyed
    */
   @Test
-  public void testEntryDestructionInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {
+  public void testEntryDestructionInSynchPersistOnlyForIOExceptionCase() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("IGNORE_EXCEPTION_testEntryDestructionInSynchPersistOnlyForIOExceptionCase");
     props.setOverflow(false);
@@ -2084,18 +1909,14 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     props.setPersistBackup(true); 
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
     entryDestructionInSynchPersistTypeForIOExceptionCase(region);
-    
   }
   
   /**
    * If IOException occurs while destroying an entry in a persist overflow synch mode,
    * DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
    */
   @Test
-  public void testEntryDestructionInSynchPersistOverflowForIOExceptionCase()
-      throws Exception {
+  public void testEntryDestructionInSynchPersistOverflowForIOExceptionCase() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("IGNORE_EXCEPTION_testEntryDestructionInSynchPersistOverflowForIOExceptionCase");
     props.setOverflow(true);
@@ -2104,7 +1925,6 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     props.setPersistBackup(true);
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
     entryDestructionInSynchPersistTypeForIOExceptionCase(region);
-    
   }
   
   /**
@@ -2134,198 +1954,176 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   
   /**
    * If IOException occurs while updating an entry in a Overflow only synch mode,
-   *  DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
+   * DiskAccessException should occur & region should be destroyed
    */
   @Test
-  public void testEntryUpdateInSynchOverflowOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInSynchOverflowOnlyForIOExceptionCase");
-      props.setOverflow(true);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(false);
-      props.setOverFlowCapacity(1);
-      region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, props);
+  public void testEntryUpdateInSynchOverflowOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInSynchOverflowOnlyForIOExceptionCase");
+    props.setOverflow(true);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(false);
+    props.setOverFlowCapacity(1);
+    region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, props);
 
-      region.create("key1", "value1");
-      region.create("key2", "value2");
-      ((LocalRegion)region).getDiskRegion().testHookCloseAllOverflowChannels();
-      try {
-        //Update key1, so that key2 goes on disk & encounters an exception
-        region.put("key1", "value1'");
-        fail("Should have encountered DiskAccessException");
-      }
-      catch (DiskAccessException dae) {
-        //OK
-      }        
-      ((LocalRegion) region).getDiskStore().waitForClose();
-      assertTrue(cache.isClosed());
-      region = null;
+    region.create("key1", "value1");
+    region.create("key2", "value2");
+    ((LocalRegion)region).getDiskRegion().testHookCloseAllOverflowChannels();
+    try {
+      //Update key1, so that key2 goes on disk & encounters an exception
+      region.put("key1", "value1'");
+      fail("Should have encountered DiskAccessException");
+    }
+    catch (DiskAccessException dae) {
+      //OK
+    }
+    ((LocalRegion) region).getDiskStore().waitForClose();
+    assertTrue(cache.isClosed());
+    region = null;
   }
   
   /**
    * If IOException occurs while creating an entry in a Overflow only synch mode,
    * DiskAccessException should occur & region should be destroyed
-   * 
-   * @throws Exception
    */
   @Test
-  public void testEntryCreateInSynchOverflowOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryCreateInSynchOverflowOnlyForIOExceptionCase");
-      props.setOverflow(true);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(false);
-      props.setOverFlowCapacity(1);
-      region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, props);
+  public void testEntryCreateInSynchOverflowOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryCreateInSynchOverflowOnlyForIOExceptionCase");
+    props.setOverflow(true);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(false);
+    props.setOverFlowCapacity(1);
+    region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, props);
 
-      region.create("key1", "value1");
-      region.create("key2", "value2");
-      ((LocalRegion)region).getDiskRegion().testHookCloseAllOverflowChannels();
-      try {
-        region.create("key3", "value3");
-        fail("Should have encountered DiskAccessException");
-      }
-      catch (DiskAccessException dae) {
-        //OK
-      }       
-      ((LocalRegion) region).getDiskStore().waitForClose();
-      assertTrue(cache.isClosed());
-      region = null;
+    region.create("key1", "value1");
+    region.create("key2", "value2");
+    ((LocalRegion)region).getDiskRegion().testHookCloseAllOverflowChannels();
+    try {
+      region.create("key3", "value3");
+      fail("Should have encountered DiskAccessException");
+    }
+    catch (DiskAccessException dae) {
+      //OK
+    }
+    ((LocalRegion) region).getDiskStore().waitForClose();
+    assertTrue(cache.isClosed());
+    region = null;
   }
   
   /**
    * A deletion of an entry in overflow only mode should not cause
    * any eviction & hence no DiskAccessException 
-   * 
-   * @throws Exception
    */
   @Test
-  public void testEntryDeletionInSynchOverflowOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setOverflow(true);
-      props.setRolling(false);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(false);
-      props.setOverFlowCapacity(1);
-      region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, props);
+  public void testEntryDeletionInSynchOverflowOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setOverflow(true);
+    props.setRolling(false);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(false);
+    props.setOverFlowCapacity(1);
+    region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, props);
 
-      region.create("key1", "value1");
-      region.create("key2", "value2");
-      region.create("key3", "value3");
-      ((LocalRegion)region).getDiskRegion().testHookCloseAllOverflowChannels();
-      try {
-        //Update key1, so that key2 goes on disk & encounters an exception
-        region.destroy("key1");
-        region.destroy("key3");          
-      }
-      catch (DiskAccessException dae) {
-        fail("Should not have encountered DiskAccessException");
-      }        
+    region.create("key1", "value1");
+    region.create("key2", "value2");
+    region.create("key3", "value3");
+    ((LocalRegion)region).getDiskRegion().testHookCloseAllOverflowChannels();
+
+    //Update key1, so that key2 goes on disk & encounters an exception
+    region.destroy("key1");
+    region.destroy("key3");
   }
   
   /**
    * If IOException occurs while updating an entry in an  Asynch mode,
-   *  DiskAccessException should occur & region should be destroyed
-   *
-   * 
-   * @throws Exception
+   * DiskAccessException should occur & region should be destroyed
    */
   @Test
-  public void testEntryUpdateInASynchPersistOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInASynchPersistOnlyForIOExceptionCase");
-      props.setOverflow(true);
-      props.setRolling(false);
-      props.setBytesThreshold(48);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);
-      region = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache, props);
-      // Get the oplog handle & hence the underlying file & close it
-      UninterruptibleFileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion()
-          .testHook_getChild().getFileChannel();
-      oplogFileChannel.close();
-      
-      region.create("key1", new byte[16]);
-      region.create("key2", new byte[16]);       
+  public void testEntryUpdateInASynchPersistOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testEntryUpdateInASynchPersistOnlyForIOExceptionCase");
+    props.setOverflow(true);
+    props.setRolling(false);
+    props.setBytesThreshold(48);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
+    region = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache, props);
+    // Get the oplog handle & hence the underlying file & close it
+    UninterruptibleFileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion()
+        .testHook_getChild().getFileChannel();
+    oplogFileChannel.close();
 
-      DiskRegion dr = ((LocalRegion)region).getDiskRegion();
-      dr.flushForTesting();
-      //Join till the asynch writer terminates
-      if (!dr.testWaitForAsyncFlusherThread(2000)) {
-        fail("async flusher thread did not terminate");
+    region.create("key1", new byte[16]);
+    region.create("key2", new byte[16]);
+
+    DiskRegion dr = ((LocalRegion)region).getDiskRegion();
+    dr.flushForTesting();
+    //Join till the asynch writer terminates
+    if (!dr.testWaitForAsyncFlusherThread(2000)) {
+      fail("async flusher thread did not terminate");
+    }
+
+    Wait.waitForCriterion(new WaitCriterion() {
+      @Override
+      public boolean done() {
+        return cache.isClosed();
       }
 
-      Wait.waitForCriterion(new WaitCriterion() {
-        @Override
-        public boolean done() {
-          return cache.isClosed();
-        }
+      @Override
+      public String description() {
+        return "Waiting for region IGNORE_EXCEPTION_testEntryUpdateInASynchPersistOnlyForIOExceptionCase to be destroyed.";
+      }
+    }, 5000, 500, true);
 
-        @Override
-        public String description() {
-          return "Waiting for region IGNORE_EXCEPTION_testEntryUpdateInASynchPersistOnlyForIOExceptionCase to be destroyed.";
-        }                
-      }, 5000, 500, true);
-      
-      ((LocalRegion) region).getDiskStore().waitForClose();
-      assertTrue(cache.isClosed());
-      region = null;
+    ((LocalRegion) region).getDiskStore().waitForClose();
+    assertTrue(cache.isClosed());
+    region = null;
   }
   
   /**
    * If IOException occurs while updating an entry in an already initialized
    * DiskRegion ,then the bridge servers should not be stopped , if any running as
    * they are no clients connected to it.
-   * 
-   * @throws Exception
    */
   @Test
-  public void testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase");
-      props.setOverflow(true);
-      props.setRolling(true);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);
-  
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-      CacheServer bs1 = cache.addCacheServer();
-      bs1.setPort(5555);
-      bs1.start();
+  public void testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase");
+    props.setOverflow(true);
+    props.setRolling(true);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
 
-      region.create("key1", new byte[16]);
-      region.create("key2", new byte[16]);
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+    CacheServer bs1 = cache.addCacheServer();
+    bs1.setPort(5555);
+    bs1.start();
+
+    region.create("key1", new byte[16]);
+    region.create("key2", new byte[16]);
 //      Get the oplog handle & hence the underlying file & close it
-      UninterruptibleFileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion()
-          .testHook_getChild().getFileChannel();         
-      oplogFileChannel.close();
-      try {
-        region.put("key2", new byte[16]);
-      }catch(DiskAccessException dae) {
-        //OK expected
-      }
-      ((LocalRegion) region).getDiskStore().waitForClose();
-      assertTrue(cache.isClosed());        
-      region = null;
-      List bsRunning = cache.getCacheServers();
-      // [anil & bruce] the following assertion was changed to true because
-      // a disk access exception in a server should always stop the server
-      assertTrue(bsRunning.isEmpty());
+    UninterruptibleFileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion()
+        .testHook_getChild().getFileChannel();
+    oplogFileChannel.close();
+    try {
+      region.put("key2", new byte[16]);
+    }catch(DiskAccessException dae) {
+      //OK expected
+    }
+    ((LocalRegion) region).getDiskStore().waitForClose();
+    assertTrue(cache.isClosed());
+    region = null;
+    List bsRunning = cache.getCacheServers();
+    // [anil & bruce] the following assertion was changed to true because
+    // a disk access exception in a server should always stop the server
+    assertTrue(bsRunning.isEmpty());
   }
   
   @Test
-  public void testDummyByteBugDuringRegionClose_Bug40250()
-      throws Exception
-  {
+  public void testDummyByteBugDuringRegionClose_Bug40250() throws Exception {
     try {
       // Create a region with rolling enabled.
       DiskRegionProperties props = new DiskRegionProperties();
@@ -2395,63 +2193,58 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
       CacheObserverHolder.setInstance(new CacheObserverAdapter());
     }
-
   }
    
   /**
    * If IOException occurs while initializing a region 
    * ,then the bridge servers should not be stopped 
-   * 
-   * @throws Exception
    */
   @Test
-  public void testBridgeServerRunningInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {    
-      DiskRegionProperties props = new DiskRegionProperties();
-      props.setRegionName("IGNORE_EXCEPTION_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase");
-      props.setOverflow(true);
-      props.setRolling(true);
-      props.setDiskDirs(dirs);
-      props.setPersistBackup(true);
-      props.setMaxOplogSize(100000); // just needs to be bigger than 65550
+  public void testBridgeServerRunningInSynchPersistOnlyForIOExceptionCase() throws Exception {
+    DiskRegionProperties props = new DiskRegionProperties();
+    props.setRegionName("IGNORE_EXCEPTION_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase");
+    props.setOverflow(true);
+    props.setRolling(true);
+    props.setDiskDirs(dirs);
+    props.setPersistBackup(true);
+    props.setMaxOplogSize(100000); // just needs to be bigger than 65550
 
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-      CacheServer bs1 = cache.addCacheServer();
-      bs1.setPort(5555);
-      bs1.start();      
-
-      region.create("key1", new byte[16]);
-      region.create("key2", new byte[16]);
-      //Get the oplog file path
-      UninterruptibleFileChannel oplogFileChnl = ((LocalRegion)region).getDiskRegion()
-      .testHook_getChild().getFileChannel();
-      //corrupt the opfile
-      oplogFileChnl.position(2);
-      ByteBuffer bf = ByteBuffer.allocate(416);
-      for(int i = 0; i <5;++i) {
-        bf.putInt(i);
-      }
-      bf.flip();
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+    CacheServer bs1 = cache.addCacheServer();
+    bs1.setPort(5555);
+    bs1.start();
+
+    region.create("key1", new byte[16]);
+    region.create("key2", new byte[16]);
+    //Get the oplog file path
+    UninterruptibleFileChannel oplogFileChnl = ((LocalRegion)region).getDiskRegion()
+    .testHook_getChild().getFileChannel();
+    //corrupt the opfile
+    oplogFileChnl.position(2);
+    ByteBuffer bf = ByteBuffer.allocate(416);
+    for(int i = 0; i <5;++i) {
+      bf.putInt(i);
+    }
+    bf.flip();
 //      Corrupt the oplogFile
-      oplogFileChnl.write(bf);
-      //Close the region
-      region.close();        
-      assertTrue(region.isDestroyed());        
-      try {
-        region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
-        fail("expected DiskAccessException");
-      }catch(DiskAccessException dae) {
-        //OK expected          
-      }
-      assertTrue(region.isDestroyed());        
-      region = null;
-      List bsRunning = cache.getCacheServers();
-      assertTrue(!bsRunning.isEmpty());
+    oplogFileChnl.write(bf);
+    //Close the region
+    region.close();
+    assertTrue(region.isDestroyed());
+    try {
+      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, props, Scope.LOCAL);
+      fail("expected DiskAccessException");
+    }catch(DiskAccessException dae) {
+      //OK expected
+    }
+    assertTrue(region.isDestroyed());
+    region = null;
+    List bsRunning = cache.getCacheServers();
+    assertTrue(!bsRunning.isEmpty());
   }
 
   @Test
-  public void testEarlyTerminationOfCompactorByDefault()
-      throws Exception {
+  public void testEarlyTerminationOfCompactorByDefault() throws Exception {
     try {
       // Create a region with rolling enabled.
       DiskRegionProperties props = new DiskRegionProperties();
@@ -2601,11 +2394,9 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
       CacheObserverHolder.setInstance(new CacheObserverAdapter());
     }    
   }
-  
-  
+
   @Test
-  public void testAssertionErrorIfMissingOplog()
-      throws Exception {
+  public void testAssertionErrorIfMissingOplog() throws Exception {
     try {
       // Create a region with rolling enabled.
       DiskRegionProperties props = new DiskRegionProperties();
@@ -2639,7 +2430,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
         }
       }
       assertTrue(i > 1);
-      Assert.assertTrue(switchedOplog[0].getOplogFile().delete());
+      assertTrue(switchedOplog[0].getOplogFile().delete());
       region.close();
       //We don't validate the oplogs until we recreate the disk store.
       DiskStoreImpl store = ((LocalRegion) region).getDiskStore();
@@ -2669,8 +2460,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testNoTerminationOfCompactorTillRollingCompleted()
-      throws Exception {
+  public void testNoTerminationOfCompactorTillRollingCompleted() throws Exception {
     try {
       // Create a region with rolling enabled.
       System.getProperties().setProperty(DiskStoreImpl.COMPLETE_COMPACTION_BEFORE_TERMINATION_PROPERTY_NAME, "true");
@@ -2874,7 +2664,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testBug40648part1() {
+  public void testBug40648part1() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("testBug40648part1");
     props.setRolling(true);
@@ -2898,7 +2688,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testBug40648part2() {
+  public void testBug40648part2() throws Exception {
     // Same as part1 but no persistence. I wasn't able to get part2
     // to fail but thought this was worth testing anyway.
     DiskRegionProperties props = new DiskRegionProperties();
@@ -2924,7 +2714,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testForceCompactionDoesRoll() {
+  public void testForceCompactionDoesRoll() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("testForceCompactionDoesRoll");
     props.setRolling(false);
@@ -2955,7 +2745,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * Confirm that forceCompaction waits for the compaction to finish
    */
   @Test
-  public void testNonDefaultCompaction() {
+  public void testNonDefaultCompaction() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("testForceCompactionDoesRoll");
     props.setRolling(false);
@@ -2985,7 +2775,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
    * Confirm that forceCompaction waits for the compaction to finish
    */
   @Test
-  public void testForceCompactionIsSync() {
+  public void testForceCompactionIsSync() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("testForceCompactionDoesRoll");
     props.setRolling(false);
@@ -3011,8 +2801,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
   
   @Test
-  public void testBug40876() throws Exception
-  {
+  public void testBug40876() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
 
     props.setRegionName("testBug40876");
@@ -3027,15 +2816,13 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
     Object obj =((LocalRegion)this.region).getValueOnDiskOrBuffer("key1");
     assertEquals(Token.INVALID,obj);
     assertFalse(this.region.containsValueForKey("key1"));
-    
-     
   }
 
   /**
    * Make sure oplog created by recovery goes in the proper directory
    */
   @Test
-  public void testBug41822() {
+  public void testBug41822() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("testBug41822");
     props.setRolling(false);
@@ -3104,7 +2891,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase
   }
   
   @Test
-  public void testBug41770() throws InterruptedException {
+  public void testBug41770() throws Exception {
     DiskRegionProperties props = new DiskRegionProperties();
     props.setRegionName("testBug41770");
     props.setOverflow(false);


[13/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
index f1fba88..e7e128b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
@@ -16,27 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Redundancy Level Functionality
- * 
- * 
  */
-public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
-{
-    /** constructor */
-  public RedundancyLevelPart1DUnitTest(String name) {
-    super(name);
-  }
-  
+@Category(DistributedTest.class)
+public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase {
+
+  @BeforeClass
   public static void caseSetUp() throws Exception {
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
 
   private void waitConnectedServers(final int expected) {
@@ -52,12 +54,12 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
   }
   
-  /*
+  /**
    * Redundancy level not specifed, an EP which dies of should be removed from
    * the fail over set as well as the live server map
    */
-  public void testRedundancyNotSpecifiedNonPrimaryServerFail()
-  {    
+  @Test
+  public void testRedundancyNotSpecifiedNonPrimaryServerFail() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0);
       verifyOrderOfEndpoints();
@@ -86,13 +88,13 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * Redundancy level not specified. If an EP which dies of is a Primary EP ,
    * then the EP should be removed from the live server map, added to dead
    * server map. 
    */
-  public void testRedundancyNotSpecifiedPrimaryServerFails()
-  {
+  @Test
+  public void testRedundancyNotSpecifiedPrimaryServerFails() {
     /*ClientServerObserver oldBo = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
       public void beforeFailoverByCacheClientUpdater(Endpoint epFailed)
       {
@@ -139,14 +141,14 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }*/
   }
 
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & was not
    * part of the fail over list , then it should be removed from Live Server Map &
    * added to dead server map. It should not change the current failover set.
    * Failover detection by LSM
    */
-  public void testRedundancySpecifiedNonFailoverEPFails()
-  {
+  @Test
+  public void testRedundancySpecifiedNonFailoverEPFails() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
@@ -175,132 +177,111 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & was not
    * part of the fail over list , then it should be removed from Live Server Map &
    * added to dead server map. It should not change the current failover set.
    * Failover detection by CCU
    */
-  
-  public void _testRedundancySpecifiedNonFailoverEPFailsDetectionByCCU()
-  {
-    try {
-      
-      FailOverDetectionByCCU = true;
-      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1, 250, 500);
-      waitConnectedServers(4);
-      assertEquals(1, pool.getRedundantNames().size());
-      // assertTrue(pool.getRedundantNames()
-      // .contains(SERVER1));
-      assertTrue(pool.getRedundantNames().contains(SERVER4));
-      //assertIndexDetailsEquals(0, proxy.getDeadServers().size());
-      verifyOrderOfEndpoints();
-      server2.invoke(() -> RedundancyLevelTestBase.stopServer());
-      // pause(5000);
-      verifyDeadServers(1);
-      verifyRedundantServersContain(SERVER4);
-      verifyLiveAndRedundantServers(3, 1);
-      verifyOrderOfEndpoints();
-      // assertTrue(proxy.getDeadServers().contains(SERVER3));
-      // assertIndexDetailsEquals(2, pool.getRedundantNames().size());
-      // assertTrue(pool.getRedundantNames()
-      // .contains(SERVER1));
-      // assertIndexDetailsEquals(3, pool.getConnectedServerCount());
-      //assertIndexDetailsEquals(1, proxy.getDeadServers().size());
-    }
-    catch (Exception ex) {
-      Assert.fail(
-          "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByCCU ",
-          ex);
-    }
+  @Ignore("TODO")
+  @Test
+  public void testRedundancySpecifiedNonFailoverEPFailsDetectionByCCU() throws Exception {
+    FailOverDetectionByCCU = true;
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1, 250, 500);
+    waitConnectedServers(4);
+    assertEquals(1, pool.getRedundantNames().size());
+    // assertTrue(pool.getRedundantNames()
+    // .contains(SERVER1));
+    assertTrue(pool.getRedundantNames().contains(SERVER4));
+    //assertIndexDetailsEquals(0, proxy.getDeadServers().size());
+    verifyOrderOfEndpoints();
+    server2.invoke(() -> RedundancyLevelTestBase.stopServer());
+    // pause(5000);
+    verifyDeadServers(1);
+    verifyRedundantServersContain(SERVER4);
+    verifyLiveAndRedundantServers(3, 1);
+    verifyOrderOfEndpoints();
+    // assertTrue(proxy.getDeadServers().contains(SERVER3));
+    // assertIndexDetailsEquals(2, pool.getRedundantNames().size());
+    // assertTrue(pool.getRedundantNames()
+    // .contains(SERVER1));
+    // assertIndexDetailsEquals(3, pool.getConnectedServerCount());
+    //assertIndexDetailsEquals(1, proxy.getDeadServers().size());
   }
-  /*
+
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & was not
    * part of the fail over list , then it should be removed from Live Server Map &
    * added to dead server map. It should not change the current failover set.
    * Failover detection by Register Interest
    */
-  
-  public void _testRedundancySpecifiedNonFailoverEPFailsDetectionByRegisterInterest()
-  {
-    try {
-      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
-      waitConnectedServers(4);
-      assertEquals(1, pool.getRedundantNames().size());
-      // assertTrue(pool.getRedundantNames()
-      // .contains(SERVER1));
-      assertTrue(pool.getRedundantNames().contains(SERVER4));
-      //assertIndexDetailsEquals(0, proxy.getDeadServers().size());
-      verifyOrderOfEndpoints();
-      server2.invoke(() -> RedundancyLevelTestBase.stopServer());
-      // pause(5000);
-      createEntriesK1andK2();
-      registerK1AndK2();
-      verifyDeadServers(1);
-      verifyRedundantServersContain(SERVER4);
-      verifyLiveAndRedundantServers(3, 1);
-      verifyOrderOfEndpoints();
-      // assertTrue(proxy.getDeadServers().contains(SERVER3));
-      // assertIndexDetailsEquals(2, pool.getRedundantNames().size());
-      // assertTrue(pool.getRedundantNames()
-      // .contains(SERVER1));
-      // assertIndexDetailsEquals(3, pool.getConnectedServerCount());
-      //assertIndexDetailsEquals(1, proxy.getDeadServers().size());
-    }
-    catch (Exception ex) {
-      Assert.fail(
-          "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByRegisterInterest ",
-          ex);
-    }
+  @Ignore("TODO")
+  @Test
+  public void testRedundancySpecifiedNonFailoverEPFailsDetectionByRegisterInterest() throws Exception {
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
+    waitConnectedServers(4);
+    assertEquals(1, pool.getRedundantNames().size());
+    // assertTrue(pool.getRedundantNames()
+    // .contains(SERVER1));
+    assertTrue(pool.getRedundantNames().contains(SERVER4));
+    //assertIndexDetailsEquals(0, proxy.getDeadServers().size());
+    verifyOrderOfEndpoints();
+    server2.invoke(() -> RedundancyLevelTestBase.stopServer());
+    // pause(5000);
+    createEntriesK1andK2();
+    registerK1AndK2();
+    verifyDeadServers(1);
+    verifyRedundantServersContain(SERVER4);
+    verifyLiveAndRedundantServers(3, 1);
+    verifyOrderOfEndpoints();
+    // assertTrue(proxy.getDeadServers().contains(SERVER3));
+    // assertIndexDetailsEquals(2, pool.getRedundantNames().size());
+    // assertTrue(pool.getRedundantNames()
+    // .contains(SERVER1));
+    // assertIndexDetailsEquals(3, pool.getConnectedServerCount());
+    //assertIndexDetailsEquals(1, proxy.getDeadServers().size());
   }
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & was not
    * part of the fail over list , then it should be removed from Live Server Map &
    * added to dead server map. It should not change the current failover set.
    * Failover detection by Unregister Interest
    */
-  
-  public void _testRedundancySpecifiedNonFailoverEPFailsDetectionByUnregisterInterest()
-  {
-    try {
-      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
-      waitConnectedServers(4);
-      assertEquals(1, pool.getRedundantNames().size());
-      // assertTrue(pool.getRedundantNames()
-      // .contains(SERVER1));
-      assertTrue(pool.getRedundantNames().contains(SERVER4));
-      //assertIndexDetailsEquals(0, proxy.getDeadServers().size());
-      verifyOrderOfEndpoints();
-      server2.invoke(() -> RedundancyLevelTestBase.stopServer());
-      // pause(5000);
-      unregisterInterest();
-      verifyDeadServers(1);
-      verifyRedundantServersContain(SERVER4);
-      verifyLiveAndRedundantServers(3, 1);
-      verifyOrderOfEndpoints();
-      // assertTrue(proxy.getDeadServers().contains(SERVER3));
-      // assertIndexDetailsEquals(2, pool.getRedundantNames().size());
-      // assertTrue(pool.getRedundantNames()
-      // .contains(SERVER1));
-      // assertIndexDetailsEquals(3, pool.getConnectedServerCount());
-      //assertIndexDetailsEquals(1, proxy.getDeadServers().size());
-    }
-    catch (Exception ex) {
-      Assert.fail(
-          "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByUnregisterInterest ",
-          ex);
-    }    
+  @Ignore("TODO")
+  @Test
+  public void testRedundancySpecifiedNonFailoverEPFailsDetectionByUnregisterInterest() throws Exception {
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
+    waitConnectedServers(4);
+    assertEquals(1, pool.getRedundantNames().size());
+    // assertTrue(pool.getRedundantNames()
+    // .contains(SERVER1));
+    assertTrue(pool.getRedundantNames().contains(SERVER4));
+    //assertIndexDetailsEquals(0, proxy.getDeadServers().size());
+    verifyOrderOfEndpoints();
+    server2.invoke(() -> RedundancyLevelTestBase.stopServer());
+    // pause(5000);
+    unregisterInterest();
+    verifyDeadServers(1);
+    verifyRedundantServersContain(SERVER4);
+    verifyLiveAndRedundantServers(3, 1);
+    verifyOrderOfEndpoints();
+    // assertTrue(proxy.getDeadServers().contains(SERVER3));
+    // assertIndexDetailsEquals(2, pool.getRedundantNames().size());
+    // assertTrue(pool.getRedundantNames()
+    // .contains(SERVER1));
+    // assertIndexDetailsEquals(3, pool.getConnectedServerCount());
+    //assertIndexDetailsEquals(1, proxy.getDeadServers().size());
   }
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & was not
    * part of the fail over list , then it should be removed from Live Server Map &
    * added to dead server map. It should not change the current failover set.
    * Failover detection by Put operation.
    */
-  public void testRedundancySpecifiedNonFailoverEPFailsDetectionByPut()
-  {
+  @Test
+  public void testRedundancySpecifiedNonFailoverEPFailsDetectionByPut() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,500,1000);
       waitConnectedServers(4);
@@ -331,16 +312,15 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }  
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the Live Server
    * Map to compensate for the failure.
    * Failure Detection by LSM.
    */
-
-  public void testRedundancySpecifiedNonPrimaryEPFails()
-  {
+  @Test
+  public void testRedundancySpecifiedNonPrimaryEPFails() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
@@ -369,16 +349,15 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the Live Server
    * Map to compensate for the failure.
    * Failure Detection by CCU.
    */
-
-  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByCCU()
-  {
+  @Test
+  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByCCU() {
     try {
       
       FailOverDetectionByCCU = true;
@@ -409,16 +388,15 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the Live Server
    * Map to compensate for the failure.
    * Failure Detection by Register Interest.
    */
-  
-  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByRegisterInterest()
-  {
+  @Test
+  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByRegisterInterest() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
       waitConnectedServers(4);
@@ -449,16 +427,15 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the Live Server
    * Map to compensate for the failure.
    * Failure Detection by Unregister Interest.
    */
-
-  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByUnregisterInterest()
-  {
+  @Test
+  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByUnregisterInterest() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
       waitConnectedServers(4);
@@ -489,16 +466,15 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the Live Server
    * Map to compensate for the failure.
    * Failure Detection by Put operation.
    */
-
-  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByPut()
-  {
+  @Test
+  public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByPut() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
       waitConnectedServers(4);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
index 0499847..7847092 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
@@ -16,24 +16,25 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
-{
-  
-  
-  /** constructor */
-  public RedundancyLevelPart2DUnitTest(String name) {
-    super(name);
-  }
-  
+@Category(DistributedTest.class)
+public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase {
+
+  @BeforeClass
   public static void caseSetUp() throws Exception {
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
 
   private void waitConnectedServers(final int expected) {
@@ -49,7 +50,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     Wait.waitForCriterion(wc, 2 * 60 * 1000, 1000, true);
   }
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the live server
@@ -59,8 +60,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * registartion.
    * Failure Detection by LSM
    */
-  public void testRedundancySpecifiedPrimaryEPFails()
-  {
+  @Test
+  public void testRedundancySpecifiedPrimaryEPFails() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
@@ -89,7 +90,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     }
   }
   
-  /*
+  /**
    * Redundancy level specified & less than total Eps. If an EP dies & is part
    * of the fail over list , then it should be removed from live server map &
    * added to dead server map. A new EP should be picked from the live server
@@ -99,8 +100,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * registartion.
    * Failure Detection by CCU
    */
-  public void testRedundancySpecifiedPrimaryEPFailsDetectionByCCU()
-  {
+  @Test
+  public void testRedundancySpecifiedPrimaryEPFailsDetectionByCCU() {
     try {
       
       FailOverDetectionByCCU = true;
@@ -140,8 +141,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * registartion.
    * Failure Detection by Register Interest
    */
-  public void testRedundancySpecifiedPrimaryEPFailsDetectionByRegisterInterest()
-  {
+  @Test
+  public void testRedundancySpecifiedPrimaryEPFailsDetectionByRegisterInterest() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000, 100);
       waitConnectedServers(4);
@@ -181,8 +182,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * registartion.
    * Failure Detection by Unregister Interest
    */  
-  public void testRedundancySpecifiedPrimaryEPFailsDetectionByUnregisterInterest()
-  {
+  @Test
+  public void testRedundancySpecifiedPrimaryEPFailsDetectionByUnregisterInterest() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000,100);
       waitConnectedServers(4);
@@ -221,8 +222,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * registartion.
    * Failure Detection by put operation
    */
-  public void testRedundancySpecifiedPrimaryEPFailsDetectionByPut()
-  {
+  @Test
+  public void testRedundancySpecifiedPrimaryEPFailsDetectionByPut() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000, 100);
       waitConnectedServers(4);
@@ -257,8 +258,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * existing EP in the set should be the new primary and make sure that CCP is
    * created on both the server with relevant interest registartion.
    */
-  public void testRedundancySpecifiedPrimarySecondaryEPFails()
-  {
+  @Test
+  public void testRedundancySpecifiedPrimarySecondaryEPFails() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
@@ -287,7 +288,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * There are 4 Eps in Live serevr Map with redundancy level as 2. Kill two Eps
    * (excluding the primary). As a result live server map will contain 2 ,
    * active list will contain two & dead server map will contain 2. Redundancy
@@ -296,8 +297,8 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
    * sure that CCP is created on the server with relevant interest registartion.
    * Bringing the 4th EP alive should simply add it to Live server map.
    */
-  public void testRedundancySpecifiedEPFails()
-  {
+  @Test
+  public void testRedundancySpecifiedEPFails() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
       waitConnectedServers(4);
@@ -345,13 +346,13 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * Redundancy level specified but not satisfied, new EP is added then it
    * should be added in Live server map as well as failover set and make sure
    * that CCP is created on the server with relevant interest registartion.
    */
-  public void testRedundancyLevelSpecifiedButNotSatisfied()
-  {
+  @Test
+  public void testRedundancyLevelSpecifiedButNotSatisfied() {
     try {
       // stop two secondaries
       server2.invoke(() -> RedundancyLevelTestBase.stopServer());
@@ -403,13 +404,13 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
 
   }
 
-  /*
+  /**
    * Redundancy level specified and satisfied, new EP is added then it should be
    * added only in Live server map and make sure that no CCP is created on the
    * server.
    */
-  public void testRedundancyLevelSpecifiedAndSatisfied()
-  {
+  @Test
+  public void testRedundancyLevelSpecifiedAndSatisfied() {
     try {
       // TODO: Yogesh
       server1.invoke(() -> RedundancyLevelTestBase.stopServer());
@@ -443,13 +444,13 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
+  /**
    * Redundancy level not specified, new EP is added then it should be added in
    * live server map as well as failover set and make sure that CCP is created
    * on the server with relevant interest registartion.
    */
-  public void testRedundancyLevelNotSpecified()
-  {
+  @Test
+  public void testRedundancyLevelNotSpecified() {
     try {
       // TODO: Yogesh
       server2.invoke(() -> RedundancyLevelTestBase.stopServer());
@@ -486,36 +487,12 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     }
   }
 
-  /*
-   * There are 4 EndPoints. Redundancy level is 1. The load balancing policy is round
-   * robin. 4 Explicit calls to proxy.acquireConnection should given Connections to all
-   * the 4 end points & not just the Eps satisfying redundancy. 
-   
-  public void testAcquireConnectionWithRedundancy()
-  {
-    try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
-      assertIndexDetailsEquals(1, proxy.getRedundantServers().size());
-      assertIndexDetailsEquals(PORT3, proxy.acquireConnection().getEndpoint().getPort());
-      assertIndexDetailsEquals(PORT4, proxy.acquireConnection().getEndpoint().getPort());
-      assertIndexDetailsEquals(PORT1, proxy.acquireConnection().getEndpoint().getPort());
-      assertIndexDetailsEquals(PORT2, proxy.acquireConnection().getEndpoint().getPort());
-      assertIndexDetailsEquals(PORT3, proxy.acquireConnection().getEndpoint().getPort());
-    }
-    catch (Exception ex) {
-      ex.printStackTrace();
-      fail(
-          "test failed due to exception in test testAcquireConnectionWithRedundancy ",
-          ex);
-    }
-  }*/
-
-  /*
+  /**
    * Redundancy level specified is more than the total EndPoints. In such situation there should
    * not be any exception & all the EPs should has CacheClientProxy created.
    */
-  public void testRedundancySpecifiedMoreThanEPs()
-  {
+  @Test
+  public void testRedundancySpecifiedMoreThanEPs() {
     try {
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 5);
       assertEquals(3, pool.getRedundantNames().size());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
index 484d7e9..88dca25 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
@@ -16,28 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
-import com.gemstone.gemfire.cache.client.internal.PoolImpl;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Redundancy Level Functionality
- * 
- * 
  */
-public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
-{
-    /** constructor */
-  public RedundancyLevelPart3DUnitTest(String name) {
-    super(name);
-  }
-  
+@Category(DistributedTest.class)
+public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase {
+
+  @BeforeClass
   public static void caseSetUp() throws Exception {
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
   
   /**
@@ -45,10 +46,9 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
    * After every failure, the order, the dispatcher, the interest registration and the makePrimary calls
    * are verified. The failure detection in these tests could be either through CCU or cache operation,
    * whichever occurs first
-   *
    */
-  public void testRegisterInterestAndMakePrimaryWithFullRedundancy()
-  {
+  @Test
+  public void testRegisterInterestAndMakePrimaryWithFullRedundancy() {
     try {
       CacheServerTestUtil.disableShufflingOfEndpoints();
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 3);
@@ -148,11 +148,9 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
    * After every failure, the order, the dispatcher, the interest registration and the makePrimary calls
    * are verified. The failure detection in these tests could be either through CCU or cache operation,
    * whichever occurs first
-   *
    */
-  
-  public void testRegisterInterestAndMakePrimaryWithZeroRedundancy()
-  {
+  @Test
+  public void testRegisterInterestAndMakePrimaryWithZeroRedundancy() {
     try {
       CacheServerTestUtil.disableShufflingOfEndpoints();
       createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0);
@@ -200,10 +198,9 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
    * After every failure, the order, the dispatcher, the interest registration and the makePrimary calls
    * are verified. The failure detection in these tests could be either through CCU or cache operation,
    * whichever occurs first
-   *
    */
-  public void testRegisterInterestAndMakePrimaryWithRedundancyOne()
-  {
+  @Test
+  public void testRegisterInterestAndMakePrimaryWithRedundancyOne() {
     try {
 //      long maxWaitTime = 60000;
       CacheServerTestUtil.disableShufflingOfEndpoints();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index 0d2c80a..a426b8e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -16,7 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker;
@@ -28,36 +47,35 @@ import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.ClientServerObserver;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Redundancy Level Functionality
- * 
- * 
  */
-public class RedundancyLevelTestBase extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class RedundancyLevelTestBase extends JUnit4DistributedTestCase {
+
+  protected static volatile boolean registerInterestCalled = false;
+  protected static volatile boolean makePrimaryCalled = false;
+
   static Cache cache = null;
 
   VM server0 = null;
-
   VM server1 = null;
-
   VM server2 = null;
-
   VM server3 = null;
 
   static int PORT1;
-
   static int PORT2;
-
   static int PORT3;
-
   static int PORT4;
 
   static String SERVER1;
@@ -66,7 +84,6 @@ public class RedundancyLevelTestBase extends DistributedTestCase
   static String SERVER4;
 
   static final String k1 = "k1";
-
   static final String k2 = "k2";
 
   static final String REGION_NAME = "RedundancyLevelTestBase_region";
@@ -77,13 +94,9 @@ public class RedundancyLevelTestBase extends DistributedTestCase
   
   static boolean FailOverDetectionByCCU = false;
   
-  /** constructor */
-  public RedundancyLevelTestBase(String name) {
-    super(name);
-  }
-
+  @BeforeClass
   public static void caseSetUp() throws Exception {
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
 
   @Override
@@ -112,9 +125,6 @@ public class RedundancyLevelTestBase extends DistributedTestCase
     CacheServerTestUtil.disableShufflingOfEndpoints();
   }
 
-  protected static volatile boolean registerInterestCalled = false;
-  protected static volatile boolean makePrimaryCalled = false;
-  
   public static void doPuts()
   {
     putEntriesK1andK2();
@@ -133,16 +143,14 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       assertEquals(r1.getEntry(k1).getValue(), k1);
       assertEquals(r1.getEntry(k2).getValue(), k2);
     }
-    catch (Exception ex) {
-      //ignore
+    catch (Exception ignore) {
+      // not sure why it's ok to ignore but if you don't ignore it, RedundancyLevelPart3DUnitTest will fail
     }
   }
 
   public static void verifyDispatcherIsAlive()
   {
     try {
-//      assertIndexDetailsEquals("More than one BridgeServer", 1, cache.getCacheServers()
-//          .size());
       WaitCriterion wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -200,8 +208,6 @@ public class RedundancyLevelTestBase extends DistributedTestCase
   public static void verifyDispatcherIsNotAlive()
   {
     try {
-      // assertIndexDetailsEquals("More than one BridgeServer", 1,
-      // cache.getCacheServers().size());
       WaitCriterion wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -242,8 +248,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       Assert.fail("while setting verifyDispatcherIsNotAlive  ", ex);
     }
   }
-  
-  
+
   public static void verifyRedundantServersContain(final String server) {
     WaitCriterion wc = new WaitCriterion() {
       public boolean done() {
@@ -458,7 +463,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       }
     }
     catch (Exception ex) {
-      fail("while setting verifyInterestRegistration  " + ex);
+      fail("while setting verifyInterestRegistration", ex);
     }
   }
 
@@ -486,7 +491,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       bs.start();
     }
     catch (Exception ex) {
-      Assert.fail("while startServer()  ", ex);
+      Assert.fail("while startServer()", ex);
     }
   }
 
@@ -501,19 +506,13 @@ public class RedundancyLevelTestBase extends DistributedTestCase
   }
 
   
-  public static void createClientCache(String host, int port1, int port2, int port3,
-                                       int port4, int redundancy)
-    throws Exception {
+  public static void createClientCache(String host, int port1, int port2, int port3, int port4, int redundancy) throws Exception {
     createClientCache(host, port1, port2, port3,
                       port4,  redundancy, 3000, /* defaul socket timeout of 250 millisec*/
                       10 /*default retry interval*/);
   }
-  public static void createClientCache(String host, int port1, int port2, int port3,
-                                       int port4, int redundancy,
-                                       int socketReadTimeout,
-                                       int retryInterval) throws Exception
-  {
-    
+
+  public static void createClientCache(String host, int port1, int port2, int port3, int port4, int redundancy, int socketReadTimeout, int retryInterval) throws Exception {
     if(!FailOverDetectionByCCU)
     {
         oldBo = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
@@ -534,7 +533,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new RedundancyLevelTestBase("temp").createCache(props);
+    new RedundancyLevelTestBase().createCache(props);
 
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, PORT1)
@@ -562,7 +561,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new RedundancyLevelTestBase("temp").createCache(new Properties());
+    new RedundancyLevelTestBase().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableConflation(true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
index 193e329..468d82a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
@@ -16,29 +16,43 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test to verify that client side region.close() should unregister the client with the server.
  * It also checks that client region queue also gets removed properly.
- *
  */
-
-public class RegionCloseDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class RegionCloseDUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -53,8 +67,8 @@ public class RegionCloseDUnitTest extends DistributedTestCase
   private static Cache cache = null;
 
   /** constructor */
-  public RegionCloseDUnitTest(String name) {
-    super(name);
+  public RegionCloseDUnitTest() {
+    super();
   }
 
   @Override
@@ -81,6 +95,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
   }
 
 
+  @Test
   public void testCloseRegionOnClient()
   {
     server1.invoke(() -> RegionCloseDUnitTest.VerifyClientProxyOnServerBeforeClose());
@@ -95,7 +110,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new RegionCloseDUnitTest("temp").createCache(props);
+    new RegionCloseDUnitTest().createCache(props);
     Pool p = PoolManager.createFactory()
       .addServer(host, PORT1)
       .setSubscriptionEnabled(true)
@@ -118,7 +133,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new RegionCloseDUnitTest("temp").createCache(new Properties());
+    new RegionCloseDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
index 7b8cd12..b390f51 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
@@ -16,7 +16,24 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
@@ -25,12 +42,13 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
 import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test tests the scenario whereby a register interest has been called before
@@ -47,13 +65,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * - mirrored region1 is created on server2
  * - data will come to region1 on server2 via GII
  * - data should be sent to client2 
- * 
- * 
- * 
  */
-
-public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class RegisterInterestBeforeRegionCreationDUnitTest extends JUnit4DistributedTestCase {
 
  /** Server1 VM **/
   static VM server1 = null;
@@ -68,14 +82,10 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
   /** Server2 port **/
   public static int PORT2;
   /** Region name **/
-  private static final String REGION_NAME = "RegisterInterestBeforeRegionCreationDUnitTest_Region";
+  private static final String REGION_NAME = RegisterInterestBeforeRegionCreationDUnitTest.class.getSimpleName() + "_Region";
   /** Server2 VM **/
   protected static Cache cache = null;
 
-  public RegisterInterestBeforeRegionCreationDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -88,7 +98,6 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
 
   /**
    * close the cache on all the vms
-   * @throws Exception
    */
   @Override
   public final void preTearDown() throws Exception {
@@ -98,7 +107,6 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
     server2.invoke(() -> RegisterInterestBeforeRegionCreationDUnitTest.closeCache());
   }
 
-  
   /**
    * - Creates the client-server configuration (which also registers interest)
    * - put on server1
@@ -106,11 +114,10 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
    * - create region on server2
    * - verify puts received on server2 via GII
    * - verify puts received on client2 via server2
-   * 
-   * @throws Exception
    */
-  public void YOGESH_testRegisterInterestHappeningBeforeRegionCreation() throws Exception
-  {
+  @Ignore("TODO:YOGESH: test is disabled")
+  @Test
+  public void testRegisterInterestHappeningBeforeRegionCreation() throws Exception {
     createClientServerConfigurationForClearTest();
     server1.invoke(putFromServer());
     client1.invoke(verifyIfAllPutsGot());
@@ -118,9 +125,6 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
     server2.invoke(verifyIfAllPutsGot());
     client2.invoke(verifyIfAllPutsGot());
   }
-  public void testDummyAsThereIsNoOtherTestInThisClass(){
-    //DO NOTHING
-  }
 
   private CacheSerializableRunnable putFromServer()
   {
@@ -196,7 +200,7 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
 
   public static Integer createServer(Boolean createRegion) throws Exception
   {
-    new RegisterInterestBeforeRegionCreationDUnitTest("temp").createCache(new Properties());
+    new RegisterInterestBeforeRegionCreationDUnitTest().createCache(new Properties());
     boolean isCreateRegion = createRegion.booleanValue();
     if (isCreateRegion) {
       AttributesFactory factory = new AttributesFactory();
@@ -230,7 +234,7 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new RegisterInterestBeforeRegionCreationDUnitTest("temp").createCache(props);
+    new RegisterInterestBeforeRegionCreationDUnitTest().createCache(props);
     Pool p = PoolManager.createFactory()
       .addServer(host, PORT1)
       .setSubscriptionEnabled(true)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
index f22544b..a4a8d16 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
@@ -16,30 +16,44 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.Pool;
-import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.Pool;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test code copied from UpdatePropagationDUnitTest
  * Tests that registering interest KEYS works correctly.
- *
- *
  */
-
-public class RegisterInterestKeysDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class RegisterInterestKeysDUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -60,8 +74,8 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
   static RegisterInterestKeysDUnitTest impl;
 
   /** constructor */
-  public RegisterInterestKeysDUnitTest(String name) {
-    super(name);
+  public RegisterInterestKeysDUnitTest() {
+    super();
   }
 
   @Override
@@ -100,7 +114,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
 
   /** subclass support */
   public static void createImpl() {
-    impl = new RegisterInterestKeysDUnitTest("temp");
+    impl = new RegisterInterestKeysDUnitTest();
   }
 
   private void createCache(Properties props) throws Exception
@@ -116,6 +130,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
    * situation of Interest List fail over
    *
    */
+  @Test
   public void testRegisterCreatesInvalidEntry()
   {
     //  First create entries on both servers via the two client
@@ -148,7 +163,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new RegisterInterestKeysDUnitTest("temp").createCache(props);
+    new RegisterInterestKeysDUnitTest().createCache(props);
     CacheServerTestUtil.disableShufflingOfEndpoints();
     Pool p;
     try {
@@ -176,7 +191,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new RegisterInterestKeysDUnitTest("temp").createCache(new Properties());
+    new RegisterInterestKeysDUnitTest().createCache(new Properties());
    
     RegionAttributes attrs = impl.createServerCacheAttributes();
     cache.createRegion(REGION_NAME, attrs);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysPRDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysPRDUnitTest.java
index 310112c..62d41e5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysPRDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysPRDUnitTest.java
@@ -16,19 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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.*;
 
 /**
  * subclass of UpdatePropagationDUnitTest to exercise partitioned regions
  *
  */
+@Category(DistributedTest.class)
 public class RegisterInterestKeysPRDUnitTest extends RegisterInterestKeysDUnitTest {
 
-  public RegisterInterestKeysPRDUnitTest(String name) {
-    super(name);
+  public RegisterInterestKeysPRDUnitTest() {
+    super();
   }
   public static void createImpl() {
-    impl = new RegisterInterestKeysPRDUnitTest("temp");
+    impl = new RegisterInterestKeysPRDUnitTest();
   }
   
   protected RegionAttributes createServerCacheAttributes()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
index f4a4fa5..e69d3d8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
@@ -16,7 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
@@ -29,22 +45,24 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.ha.HAHelper;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
 import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
 /**
  * Tests the reliable messaging functionality - Client sends a periodic
  * ack to the primary server for the messages received.
  */
-public class ReliableMessagingDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class ReliableMessagingDUnitTest extends JUnit4DistributedTestCase {
 
   static VM server1 = null;
 
@@ -69,19 +87,13 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase {
   static int CLIENT_ACK_INTERVAL = 5000;
 
   /** name of the test region */
-  private static final String REGION_NAME = "ReliableMessagingDUnitTest_Region";
+  private static final String REGION_NAME = ReliableMessagingDUnitTest.class.getSimpleName() + "_Region";
 
-  /**
-   * Constructor
-   */
-  public ReliableMessagingDUnitTest(String name) {
-    super(name);
-  }
-  
   /*
    * Test verifies that client is sending periodic ack to the primary 
    * server for messages received.
    */  
+  @Test
   public void testPeriodicAckSendByClient() throws Exception
   {
     createEntries();
@@ -98,6 +110,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase {
    * QRM to other redundant servers.    
    */
   @Category(FlakyTest.class) // GEODE-694: async queuing
+  @Test
   public void testPeriodicAckSendByClientPrimaryFailover() throws Exception {    
     IgnoredException.addIgnoredException("java.net.ConnectException");
     createEntries();
@@ -341,7 +354,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase {
 
   public static Integer createServerCache() throws Exception
   {
-    ReliableMessagingDUnitTest test = new ReliableMessagingDUnitTest("temp");
+    ReliableMessagingDUnitTest test = new ReliableMessagingDUnitTest();
     Properties props = new Properties();
     cache = test.createCache(props);
     AttributesFactory factory = new AttributesFactory();
@@ -365,7 +378,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase {
 
   public static void createClientCache(int port1, int port2) throws Exception
   {
-    ReliableMessagingDUnitTest test = new ReliableMessagingDUnitTest("temp");
+    ReliableMessagingDUnitTest test = new ReliableMessagingDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
index a5059f7..3638eaf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
@@ -19,7 +19,21 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -30,17 +44,17 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.FilterProfile;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-/**
- */
-public class UnregisterInterestDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class UnregisterInterestDUnitTest extends JUnit4DistributedTestCase {
 
   private VM server0 = null;
   private VM client1 = null;
@@ -48,20 +62,13 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
 
   private static GemFireCache cache = null;
 
-  private static final String regionname = "UnregisterInterestDUnitTest_region";
+  private static final String regionname = UnregisterInterestDUnitTest.class.getSimpleName() + "_region";
   private static final int all_keys = 0;
   private static final int list = 1;
   private static final int regex = 2;
   private static final int filter = 3;
   private static final boolean receiveValuesConstant = true;
 
-  /**
-   * @param name
-   */
-  public UnregisterInterestDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -98,6 +105,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testUnregisterInterestAllKeys() throws Exception {
     server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(all_keys, 0, 0));
     client1.invoke(() -> UnregisterInterestDUnitTest.registerInterest(all_keys, receiveValuesConstant, null));
@@ -117,6 +125,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testUnregisterInterestKeys() throws Exception {
     server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(list, 0, 0));
     client1.invoke(UnregisterInterestDUnitTest.class, "registerInterest", new Object[] {list, receiveValuesConstant, new String[]{"key_1", "key_2", "key_3", "key_4", "key_5"}});
@@ -137,6 +146,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testUnregisterInterestPatterns() throws Exception {
     server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(regex, 0, 0));
     client1.invoke(UnregisterInterestDUnitTest.class, "registerInterest", new Object[] {regex, receiveValuesConstant, new String[] {"[a-z]*[0-9]"}});
@@ -158,6 +168,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testUnregisterInterestKeysInvForOneClientDoesNotAffectOtherClient() throws Exception {
     server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(list, 0, 0));
     client1.invoke(UnregisterInterestDUnitTest.class, "registerInterest", new Object[] {list, !receiveValuesConstant, new String[] {"key_1", "key_2", "key_3", "key_4", "key_5"}});
@@ -181,6 +192,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testUnregisterInterestRegexInvForOneClientDoesNotAffectOtherClient() throws Exception {
     server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(regex, 0, 0));
     client1.invoke(UnregisterInterestDUnitTest.class, "registerInterest", new Object[] {regex, !receiveValuesConstant, new String[] {"[a-z]*[0-9]"}});
@@ -192,8 +204,9 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
     client2.invoke(() -> UnregisterInterestDUnitTest.timedWaitForInvalidates(5));
   }
 
-  public void _testUnregisterInterestFilters() throws Exception {
-    
+  @Ignore("TODO: never implemented")
+  @Test
+  public void testUnregisterInterestFilters() throws Exception {
   }
 
   public static void checkRIArtifacts(Integer interestType, Integer value, Integer valueInv) {
@@ -303,7 +316,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
   }
 
   public static Integer createCacheAndStartServer() throws Exception {
-    DistributedSystem ds = new UnregisterInterestDUnitTest("UnregisterInterestDUnitTest").getSystem();
+    DistributedSystem ds = new UnregisterInterestDUnitTest().getSystem();
     ds.disconnect();
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
@@ -318,7 +331,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
   }
 
   public static void createClientCache(Host host, Integer port) throws Exception {
-    DistributedSystem ds = new UnregisterInterestDUnitTest("UnregisterInterestDUnitTest").getSystem();
+    DistributedSystem ds = new UnregisterInterestDUnitTest().getSystem();
     ds.disconnect();
 
     Properties props = new Properties();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
index 54d993f..055a424 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
@@ -16,7 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static junit.framework.TestCase.assertNotNull;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+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.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -29,21 +52,12 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static junit.framework.TestCase.assertNotNull;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Start client 1
@@ -64,20 +78,16 @@ import static org.junit.Assert.assertEquals;
 @Category(DistributedTest.class)
 public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
 
-  VM server1 = null;
-
-  VM server2 = null;
-
-  VM client1 = null;
+  private static final String REGION_NAME = "UpdatePropagationDUnitTest_region";
 
-  VM client2 = null;
+  private VM server1 = null;
+  private VM server2 = null;
+  private VM client1 = null;
+  private VM client2 = null;
 
   private int PORT1 ;
-
   private int PORT2 ;
 
-  private static final String REGION_NAME = "UpdatePropagationDUnitTest_region";
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -173,27 +183,23 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     return servers.stream().anyMatch(location -> location.getPort() == port);
   }
 
-  public void acquireConnectionsAndPutonK1andK2(String host)
-  {
+  private void acquireConnectionsAndPutonK1andK2(String host) {
     Region r1 = getCache().getRegion(Region.SEPARATOR + REGION_NAME);
     r1.put("key1", "server-value1");
     r1.put("key2", "server-value2");
   }
 
-  public void killServer(Integer port )
-  {
+  private void killServer(Integer port ) {
     Iterator iter = getCache().getCacheServers().iterator();
     if (iter.hasNext()) {
       CacheServer server = (CacheServer)iter.next();
       if(server.getPort() == port.intValue()){
         server.stop();
       }
-
     }
   }
 
-  public void startServer(Integer port) throws IOException
-  {
+  private void startServer(Integer port) throws IOException {
     CacheServer server1 = getCache().addCacheServer();
     server1.setPort(port.intValue());
     server1.setNotifyBySubscription(true);
@@ -202,10 +208,8 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * Creates entries on the server
-   *
    */
-  public void createEntriesK1andK2()
-  {
+  private void createEntriesK1andK2() {
     Region r1 = getCache().getRegion(Region.SEPARATOR+REGION_NAME);
     assertNotNull(r1);
     if (!r1.containsKey("key1")) {
@@ -225,8 +229,7 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     }
   }
 
-  public void createClientCache(String host, Integer port1 , Integer port2 ) throws Exception
-  {
+  private void createClientCache(String host, Integer port1 , Integer port2 ) throws Exception {
     ClientCache cache;
     try {
       System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.DISABLE_RANDOM", "true");
@@ -254,8 +257,7 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
       .create(REGION_NAME);
   }
 
-  public Integer createServerCache() throws Exception
-  {
+  private Integer createServerCache() throws Exception {
     Cache cache = getCache();
     RegionAttributes attrs = createCacheServerAttributes();
     cache.createRegion(REGION_NAME, attrs);
@@ -268,32 +270,23 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     return new Integer(server.getPort());
   }
   
-  protected RegionAttributes createCacheServerAttributes()
-  {
+  protected RegionAttributes createCacheServerAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
     return factory.create();
   }
 
-  public void registerKeysK1andK2()
-  {
-    try {
-      Region r = getCache().getRegion(Region.SEPARATOR+ REGION_NAME);
-      assertNotNull(r);
-      List list = new ArrayList();
-      list.add("key1");
-      list.add("key2");
-      r.registerInterest(list);
-
-    }
-    catch (Exception ex) {
-      Assert.fail("failed while registering interest", ex);
-    }
+  private void registerKeysK1andK2() {
+    Region r = getCache().getRegion(Region.SEPARATOR+ REGION_NAME);
+    assertNotNull(r);
+    List list = new ArrayList();
+    list.add("key1");
+    list.add("key2");
+    r.registerInterest(list);
   }
 
-  public void verifySenderUpdateCount()
-  {
+  private void verifySenderUpdateCount() {
     Region r = getCache().getRegion(Region.SEPARATOR+ REGION_NAME);
     EventTrackingCacheListener listener = (EventTrackingCacheListener) r.getAttributes().getCacheListeners()[0];
 
@@ -304,8 +297,7 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     assertEquals("Expected only 2 events for key2", 2, events.stream().filter(event -> event.getKey().equals("key2")).count());
   }
 
-  public void verifyUpdates()
-  {
+  private void verifyUpdates() {
     Awaitility.await().atMost(60, TimeUnit.SECONDS).until(() -> {
       Region r = getCache().getRegion(Region.SEPARATOR + REGION_NAME);
       // verify updates
@@ -321,21 +313,23 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
   }
 
   private static class EventTrackingCacheListener extends CacheListenerAdapter {
+
     List<EntryEvent> receivedEvents = new ArrayList<>();
 
-    @Override public void afterCreate(final EntryEvent event) {
+    @Override
+    public void afterCreate(final EntryEvent event) {
       receivedEvents.add(event);
     }
 
-    @Override public void afterUpdate(final EntryEvent event) {
+    @Override
+    public void afterUpdate(final EntryEvent event) {
       receivedEvents.add(event);
     }
 
-    @Override public void afterDestroy(final EntryEvent event) {
+    @Override
+    public void afterDestroy(final EntryEvent event) {
       receivedEvents.add(event);
     }
-
-
   }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
index 589b455..45bf2b8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
@@ -16,17 +16,17 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.RegionAttributes;
 
 /**
  * subclass of UpdatePropagationDUnitTest to exercise partitioned regions
- *
  */
 public class UpdatePropagationPRDUnitTest extends UpdatePropagationDUnitTest {
 
   @Override
-  protected RegionAttributes createCacheServerAttributes()
-  {
+  protected RegionAttributes createCacheServerAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setPartitionAttributes((new PartitionAttributesFactory()).create());
     return factory.create();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
index 167063e..b3fafe7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
@@ -16,8 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+import org.junit.Ignore;
+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.CacheFactory;
@@ -31,21 +37,19 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * To verify that new events get generated on the node by get operation for key
  * that is not present in the node's region.
  * Currently test is commented because of the bug.
- * 
- * 
  */
+@Category(DistributedTest.class)
+public class VerifyEventIDGenerationInP2PDUnitTest extends JUnit4DistributedTestCase {
 
-public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
 
   static VM vm0 = null;
@@ -62,8 +66,8 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
 
   /* Constructor */
 
-  public VerifyEventIDGenerationInP2PDUnitTest(String name) {
-    super(name);
+  public VerifyEventIDGenerationInP2PDUnitTest() {
+    super();
   }
 
   @Override
@@ -76,19 +80,15 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
     receiver = false;
   }
 
-  public void _testEventIDGeneration() throws Exception
-  {
+  @Ignore("TODO")
+  @Test
+  public void testEventIDGeneration() throws Exception {
     createEntry();
     vm0.invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.get());
     Boolean pass = (Boolean)vm0.invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.verifyResult());
     assertFalse(pass.booleanValue());
   }
 
-  public void testDummy() throws Exception
-  {
-    
-  }
-  
   private void createCache(Properties props) throws Exception
   {
     DistributedSystem ds = getSystem(props);
@@ -106,7 +106,7 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
 
   public static void createServerCache() throws Exception
   {
-    new VerifyEventIDGenerationInP2PDUnitTest("temp")
+    new VerifyEventIDGenerationInP2PDUnitTest()
         .createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
index 897cd87..53267b5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
@@ -16,7 +16,21 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -27,38 +41,36 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * One Client , two servers.
  * Ensure that client 1 has registered interest list on server 2.
  * Now Client does a put on server1 .
  * The Client should not receive callback of his own put.
-
- *
  */
-public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTestCase
-{
-  VM vm0 = null;
-
-  VM vm1 = null;
+@Category(DistributedTest.class)
+public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends JUnit4DistributedTestCase {
 
-  VM vm2 = null;
+  private VM vm0 = null;
+  private VM vm1 = null;
+  private VM vm2 = null;
 
   private int PORT1;
   private int PORT2;
-  private static final String REGION_NAME = "VerifyUpdatesFromNonInterestEndPointDUnitTest_region";
+  private static final String REGION_NAME = VerifyUpdatesFromNonInterestEndPointDUnitTest.class.getSimpleName() + "_region";
 
   private static Cache cache = null;
 
   /** constructor */
-  public VerifyUpdatesFromNonInterestEndPointDUnitTest(String name) {
-    super(name);
+  public VerifyUpdatesFromNonInterestEndPointDUnitTest() {
+    super();
   }
 
   @Override
@@ -87,7 +99,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     return cache;
   }
 
-
+  @Test
   public void testVerifyUpdatesFromNonInterestEndPoint()
   {
     vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createEntries());
@@ -101,7 +113,6 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.verifyPut());
   }
 
-
   public static void acquireConnectionsAndPut(Integer port)
   {
     try {
@@ -148,7 +159,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
 
   public static void createClientCache(String host, Integer port1, Integer port2) throws Exception
   {
-    VerifyUpdatesFromNonInterestEndPointDUnitTest test = new VerifyUpdatesFromNonInterestEndPointDUnitTest("temp");
+    VerifyUpdatesFromNonInterestEndPointDUnitTest test = new VerifyUpdatesFromNonInterestEndPointDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -180,7 +191,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
 
   public static Integer createServerCache() throws Exception
   {
-    cache = new VerifyUpdatesFromNonInterestEndPointDUnitTest("temp").createCache(new Properties());
+    cache = new VerifyUpdatesFromNonInterestEndPointDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -194,7 +205,6 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     return new Integer(server1.getPort());
   }
 
-
   public static void registerKey()
   {
     try {



[47/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/CountStarJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/CountStarJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/CountStarJUnitTest.java
index f58d4bd..5272f2b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/CountStarJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/CountStarJUnitTest.java
@@ -19,26 +19,34 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.query.*;
-import com.gemstone.gemfire.cache.query.data.Portfolio;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import static org.junit.Assert.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+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.IndexType;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.data.Portfolio;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * This test runs {Select COUNT(*) from /regionName [where clause]} queries
  * on different types of regions with and without multiple indexes.
- * 
- *
  */
 @Category(IntegrationTest.class)
 public class CountStarJUnitTest {
@@ -47,9 +55,6 @@ public class CountStarJUnitTest {
   private static String exampleRegionName = "employee";
   private int numElem = 100;
   
-  public CountStarJUnitTest() {
-  }
-
   @Before
   public void setUp() throws Exception {
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "Query.VERBOSE", "true");
@@ -63,7 +68,6 @@ public class CountStarJUnitTest {
 
   private static HashMap<String, Integer> countStarQueries = new HashMap<String, Integer>();
 
-
   //EquiJoin Queries
   private static String[] countStarQueriesWithEquiJoins = { "select COUNT(*) from /" + regionName + " p, /"+ exampleRegionName +" e where p.ID = e.ID AND p.ID > 0",
     "select COUNT(*) from /" + regionName + " p, /"+ exampleRegionName +" e where p.ID = e.ID AND p.ID > 20 AND e.ID > 40",
@@ -98,11 +102,12 @@ public class CountStarJUnitTest {
   }
   
   //Queries without indexes.
+
   /**
    * Test on Local Region data
    */
   @Test
-  public void testCountStartQueriesOnLocalRegion(){
+  public void testCountStartQueriesOnLocalRegion() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createLocalRegion();
@@ -112,27 +117,23 @@ public class CountStarJUnitTest {
     QueryService queryService = cache.getQueryService();
     Query query1 = null;
     Query query2 = null;
-    try {
-      for(String queryStr: countStarQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        assertEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-        
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+
+    for(String queryStr: countStarQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      assertEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
+
     }
   }
 
@@ -140,7 +141,7 @@ public class CountStarJUnitTest {
    * Test on Replicated Region data
    */
   @Test
-  public void testCountStarQueriesOnReplicatedRegion(){
+  public void testCountStarQueriesOnReplicatedRegion() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createReplicatedRegion();
@@ -150,28 +151,24 @@ public class CountStarJUnitTest {
     QueryService queryService = cache.getQueryService();
     Query query1 = null;
     Query query2 = null;
-    try {
-      for(String queryStr: countStarQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        assertEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+
+    for(String queryStr: countStarQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      assertEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
-    
+
     //Destroy current Region for other tests
     cache.getRegion(regionName).destroyRegion();
   }
@@ -180,7 +177,7 @@ public class CountStarJUnitTest {
    * Test on Partitioned Region data
    */
   @Test
-  public void testCountStarQueriesOnPartitionedRegion(){
+  public void testCountStarQueriesOnPartitionedRegion() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createPartitionedRegion();
@@ -190,35 +187,31 @@ public class CountStarJUnitTest {
     QueryService queryService = cache.getQueryService();
     Query query1 = null;
     Query query2 = null;
-    try {
-      for(String queryStr: countStarQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+
+    for(String queryStr: countStarQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
-    
+
     //Destroy current Region for other tests
     cache.getRegion(regionName).destroyRegion();
   }
 
   //Test with indexes available on region
   @Test
-  public void testCountStartQueriesOnLocalRegionWithIndex(){
+  public void testCountStartQueriesOnLocalRegionWithIndex() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createLocalRegion();
@@ -228,14 +221,10 @@ public class CountStarJUnitTest {
     QueryService queryService = cache.getQueryService();
     
     //CReate Index on status and ID
-    try {
-      queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
-    } catch (Exception e1) {
-      fail("Index Creation Failed with message: " + e1.getMessage());
-    }
-    
+    queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
+
     Region region = cache.getRegion(regionName);
     //Verify Index Creation
     assertNotNull(queryService.getIndex(region, "sampleIndex-1"));
@@ -245,34 +234,30 @@ public class CountStarJUnitTest {
     //Run queries
     Query query1 = null;
     Query query2 = null;
-    try {
-      for(String queryStr: countStarQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+
+    for(String queryStr: countStarQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
-    
+
     //Destroy current Region for other tests
     region.destroyRegion();
   }
 
   @Test
-  public void testCountStarQueriesOnReplicatedRegionWithIndex(){
+  public void testCountStarQueriesOnReplicatedRegionWithIndex() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createReplicatedRegion();
@@ -281,52 +266,43 @@ public class CountStarJUnitTest {
     
     QueryService queryService = cache.getQueryService();
     //CReate Index on status and ID
-    try {
-      queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
-    } catch (Exception e1) {
-      fail("Index Creation Failed with message: " + e1.getMessage());
-    }
-    
+    queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
+
     Region region = cache.getRegion(regionName);
     //Verify Index Creation
     assertNotNull(queryService.getIndex(region, "sampleIndex-1"));
     assertNotNull(queryService.getIndex(region, "sampleIndex-2"));
     assertEquals(3, queryService.getIndexes().size());
 
-
-  //Run queries
+    //Run queries
     Query query1 = null;
     Query query2 = null;
-    try {
-      for(String queryStr: countStarQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+
+    for(String queryStr: countStarQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
-    
+
     //Destroy current Region for other tests
     region.destroyRegion();
   }
 
   @Test
-  public void testCountStarQueriesOnPartitionedRegionWithIndex(){
+  public void testCountStarQueriesOnPartitionedRegionWithIndex() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createPartitionedRegion();
@@ -336,15 +312,10 @@ public class CountStarJUnitTest {
     QueryService queryService = cache.getQueryService();
     //CReate Index on status and ID
     
-    try {
-      queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
-      //queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
-      //queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
-    } catch (Exception e1) {
-      fail("Index Creation Failed with message: " + e1.getMessage());
-    }
-    
-    
+    queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
+    //queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
+    //queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
+
     Region region = cache.getRegion(regionName);
     //Verify Index Creation
     //assertNotNull(queryService.getIndex(region, "sampleIndex-1"));
@@ -354,34 +325,30 @@ public class CountStarJUnitTest {
     //Run queries
     Query query1 = null;
     Query query2 = null;
-    try {
-      for(String queryStr: countStarQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+
+    for(String queryStr: countStarQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
+
     //Destroy current Region for other tests
     region.destroyRegion();
   }
 
   @Test
-  public void testEquiJoinCountStarQueries(){
-
+  public void testEquiJoinCountStarQueries() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createLocalRegion();
@@ -397,38 +364,29 @@ public class CountStarJUnitTest {
     Query query2 = null;
     
     // Without Indexes
-    try {
-      for(String queryStr: countStarQueriesWithEquiJoins){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+    for(String queryStr: countStarQueriesWithEquiJoins){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
-    
+
     //CReate Index on status and ID
-    try {
-      queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "e.ID", "/"+exampleRegionName+ " e");
-      queryService.createIndex("sampleIndex-4", IndexType.FUNCTIONAL, "e.status", "/"+exampleRegionName+ " e");
-    } catch (Exception e1) {
-      fail("Index Creation Failed with message: " + e1.getMessage());
-    }
-    
+    queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "e.ID", "/"+exampleRegionName+ " e");
+    queryService.createIndex("sampleIndex-4", IndexType.FUNCTIONAL, "e.status", "/"+exampleRegionName+ " e");
+
     Region region = cache.getRegion(regionName);
     Region region2 = cache.getRegion(exampleRegionName);
     //Verify Index Creation
@@ -439,35 +397,30 @@ public class CountStarJUnitTest {
     assertEquals(4, queryService.getIndexes().size());
 
     //With Indexes
-    try {
-      for(String queryStr: countStarQueriesWithEquiJoins){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query with indexes: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+    for(String queryStr: countStarQueriesWithEquiJoins){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query with indexes: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarQueries.get(queryStr).intValue(), count);
     }
-    
+
     //Destroy current Region for other tests
     region.destroyRegion();
     region2.destroyRegion();
   }
   
   @Test
-  public void testCountStarOnCollection() {
+  public void testCountStarOnCollection() throws Exception {
     String collection = "$1";
     HashMap<String, Integer> countStarQueriesWithParms = new HashMap<String, Integer>();
     countStarQueriesWithParms.put("select COUNT(*) from " + collection , 100);
@@ -495,32 +448,26 @@ public class CountStarJUnitTest {
       portfolios.add(new Portfolio(i, i));
     }
     // Without Indexes
-    try {
-      for(String queryStr: countStarQueriesWithParms.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute(new Object[]{portfolios});
-        SelectResults result2 = (SelectResults)query2.execute(new Object[]{portfolios});
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        assertEquals("Query: "+ queryStr, countStarQueriesWithParms.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+    for(String queryStr: countStarQueriesWithParms.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute(new Object[]{portfolios});
+      SelectResults result2 = (SelectResults)query2.execute(new Object[]{portfolios});
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      assertEquals("Query: "+ queryStr, countStarQueriesWithParms.get(queryStr).intValue(), count);
     }
   }
   
   @Test
-  public void testCountStarWithDuplicateValues() {
-
+  public void testCountStarWithDuplicateValues() throws Exception {
     Cache cache = CacheUtils.getCache();
 
     createLocalRegion();
@@ -539,7 +486,6 @@ public class CountStarJUnitTest {
     countStarDistinctQueries.put("select distinct COUNT(*) from /" + regionName + " where ID IN SET(1, 2, 3, 4, 5)", 5);
     countStarDistinctQueries.put("select distinct COUNT(*) from /" + regionName + " where NOT (ID > 5)", 5);
     
-
     QueryService queryService = cache.getQueryService();
     //Run queries
     Query query1 = null;
@@ -556,65 +502,52 @@ public class CountStarJUnitTest {
       region.put(i+100, new Portfolio(i, i));
     }
     // Without Indexes
-    try {
-      for(String queryStr: countStarDistinctQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarDistinctQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
-    }
-    
-  //CReate Index on status and ID
-    try {
-      queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
-      queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
-    } catch (Exception e1) {
-      fail("Index Creation Failed with message: " + e1.getMessage());
+    for(String queryStr: countStarDistinctQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarDistinctQueries.get(queryStr).intValue(), count);
     }
-    
+
+    //CReate Index on status and ID
+    queryService.createIndex("sampleIndex-1", IndexType.FUNCTIONAL, "p.ID", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-2", IndexType.FUNCTIONAL, "p.status", "/"+regionName+ " p");
+    queryService.createIndex("sampleIndex-3", IndexType.FUNCTIONAL, "pos.secId", "/"+regionName+" p, p.positions.values pos");
+
     //Verify Index Creation
     assertNotNull(queryService.getIndex(region, "sampleIndex-1"));
     assertNotNull(queryService.getIndex(region, "sampleIndex-2"));
     assertEquals(3, queryService.getIndexes().size());
 
- // Without Indexes
-    try {
-      for(String queryStr: countStarDistinctQueries.keySet()){
-        query1 = queryService.newQuery(queryStr);
-        query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
-        
-        SelectResults result1 = (SelectResults)query1.execute();
-        SelectResults result2 = (SelectResults)query2.execute();
-        assertEquals(queryStr, 1, result1.size());
-        assertTrue(result1.asList().get(0) instanceof Integer);
-        
-        int count = ((Integer)result1.asList().get(0)).intValue();
-        
-        //Also verify with size of result2 to count
-        assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
-        
-        //assertIndexDetailsEquals("Query: "+ queryStr, countStarDistinctQueries.get(queryStr).intValue(), count);
-      }
-    } catch (Exception e){
-      e.printStackTrace();
-      fail("Query "+ query1+" Execution Failed!");
+    // Without Indexes
+    for(String queryStr: countStarDistinctQueries.keySet()){
+      query1 = queryService.newQuery(queryStr);
+      query2 = queryService.newQuery(queryStr.replace("COUNT(*)", "*"));
+
+      SelectResults result1 = (SelectResults)query1.execute();
+      SelectResults result2 = (SelectResults)query2.execute();
+      assertEquals(queryStr, 1, result1.size());
+      assertTrue(result1.asList().get(0) instanceof Integer);
+
+      int count = ((Integer)result1.asList().get(0)).intValue();
+
+      //Also verify with size of result2 to count
+      assertEquals("COUNT(*) query result is wrong for query: " + queryStr , result2.size(), count);
+
+      //assertIndexDetailsEquals("Query: "+ queryStr, countStarDistinctQueries.get(queryStr).intValue(), count);
     }
   }
+
   private void createLocalRegion() {
     Cache cache = CacheUtils.getCache();
     AttributesFactory attributesFactory = new AttributesFactory();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/FunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/FunctionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/FunctionJUnitTest.java
index f2a1743..5c845ff 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/FunctionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/FunctionJUnitTest.java
@@ -22,6 +22,8 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
+import static org.junit.Assert.*;
+
 import java.text.SimpleDateFormat;
 import java.util.Collection;
 import java.util.Date;
@@ -32,10 +34,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.CacheUtils;
 import com.gemstone.gemfire.cache.query.FunctionDomainException;
@@ -49,13 +47,9 @@ import com.gemstone.gemfire.cache.query.internal.ExecutionContext;
 import com.gemstone.gemfire.cache.query.internal.parse.OQLLexerTokenTypes;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class FunctionJUnitTest {
 
-
   @Before
   public void setUp() throws java.lang.Exception {
     CacheUtils.startCache();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IUMRShuffleIteratorsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IUMRShuffleIteratorsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IUMRShuffleIteratorsJUnitTest.java
index c4042da..1eaa1f9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IUMRShuffleIteratorsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IUMRShuffleIteratorsJUnitTest.java
@@ -21,6 +21,19 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.CacheUtils;
 import com.gemstone.gemfire.cache.query.Index;
@@ -36,30 +49,11 @@ import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import static org.junit.Assert.*;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class IUMRShuffleIteratorsJUnitTest {
 
-
   @Before
-  public void setUp() throws java.lang.Exception {
+  public void setUp() throws Exception {
     CacheUtils.startCache();
     Region r1 = CacheUtils.createRegion("portfolios", Portfolio.class);
     for(int i=0;i<4;i++){
@@ -83,41 +77,33 @@ public class IUMRShuffleIteratorsJUnitTest {
     for(int i=0;i<4;i++){
       r3.put(new Integer(i), new Address("411001","Pune",str,ph));
     }
-
   }
 
   @After
-  public void tearDown() throws java.lang.Exception {
+  public void tearDown() throws Exception {
     CacheUtils.closeCache();
   }
 
   @Test
   public void testQueryWithNOIndexes1() throws Exception {
-    //        Object r = new Object();
     CacheUtils.getQueryService();
+
     String queries[] = {
         "select distinct * from /portfolios p, /employees e",
         "Select distinct * from /portfolios pf,/employees e  where pf.status='active'"
-
     };
 
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        q.execute();
-        if(observer.isIndexesUsed){
-          fail("Index is uesd");
-        }
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      q.execute();
+      if(observer.isIndexesUsed){
+        fail("Index is uesd");
       }
     }
-
   }//end of test 1
 
   @Test
@@ -128,41 +114,31 @@ public class IUMRShuffleIteratorsJUnitTest {
 
     String queries[] = {
         "Select distinct * from /portfolios pf,/employees e  where pf.status='active'"
-
     };
+
     //Execute Queries without Indexes
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r[i][0] = q.execute();
-      } catch (Exception e) {
-        e.printStackTrace();
-      }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r[i][0] = q.execute();
     }
     //Create Index and Execute the Queries
     qs.createIndex("statusIndex", IndexType.FUNCTIONAL,"status","/portfolios");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r[i][1] = q.execute();
-        if(!observer.isIndexesUsed){
-          fail("Index is NOT uesd");
-        }
-        CacheUtils.log("*****************IndexUsed::"+observer.IndexName);
-
-        Iterator itr = observer.indexesUsed.iterator();
-        assertEquals("statusIndex",itr.next().toString());
-
-      } catch (Exception e) {
-        e.printStackTrace();
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][1] = q.execute();
+      if(!observer.isIndexesUsed){
+        fail("Index is NOT uesd");
       }
+      CacheUtils.log("*****************IndexUsed::"+observer.IndexName);
+
+      Iterator itr = observer.indexesUsed.iterator();
+      assertEquals("statusIndex",itr.next().toString());
     }
     //Verifying the query results
     StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -181,39 +157,27 @@ public class IUMRShuffleIteratorsJUnitTest {
     //Execute Queries without Indexes
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r[i][0] = q.execute();
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
-      }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r[i][0] = q.execute();
     }
     //Create Index andExecute the Queries
     qs.createIndex("nameIndex", IndexType.FUNCTIONAL,"e.name","/employees e");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r[i][1] = q.execute();
-
-        if(!observer.isIndexesUsed){
-          fail("Index is NOT uesd");
-          //Test fails here. Index on second region is not getting used.
-        }
-        CacheUtils.log("*****************IndexUsed::"+observer.IndexName);
-        Iterator itr = observer.indexesUsed.iterator();
-        assertEquals("nameIndex",itr.next().toString());
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][1] = q.execute();
+
+      if(!observer.isIndexesUsed){
+        fail("Index is NOT uesd");
+        //Test fails here. Index on second region is not getting used.
       }
+      CacheUtils.log("*****************IndexUsed::"+observer.IndexName);
+      Iterator itr = observer.indexesUsed.iterator();
+      assertEquals("nameIndex",itr.next().toString());
     }
     //Verifying the query results
     StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -226,21 +190,18 @@ public class IUMRShuffleIteratorsJUnitTest {
     Object r[][] = new Object[9][2];
     QueryService qs;
     qs = CacheUtils.getQueryService();
+
     String queries[] = {
         //Test Case No. IUMR002
         "Select distinct * from /portfolios pf, /employees e  where e.name ='empName' and pf.status='active'",
     };
+
     //Execute Query without Indexes
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r[i][0] = q.execute();
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
-      }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r[i][0] = q.execute();
     }
 
     //Create Indexes and Execute Queries
@@ -249,41 +210,34 @@ public class IUMRShuffleIteratorsJUnitTest {
 
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r[i][1] = q.execute();
-        if(!observer.isIndexesUsed){
-          fail("Index is NOT uesd");
-        }
-        int indxs = observer.indexesUsed.size();
-        CacheUtils.log("***********Indexes Used :::: "+indxs+" IndexName::"+observer.IndexName);
-        if(indxs!=2){
-          fail("FAILED: Both The Indexes should be used. Presently only "+indxs+" Index(es) is used");
-        }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][1] = q.execute();
+      if(!observer.isIndexesUsed){
+        fail("Index is NOT uesd");
+      }
+      int indxs = observer.indexesUsed.size();
+      CacheUtils.log("***********Indexes Used :::: "+indxs+" IndexName::"+observer.IndexName);
+      if(indxs!=2){
+        fail("FAILED: Both The Indexes should be used. Presently only "+indxs+" Index(es) is used");
+      }
 
-        Iterator itr = observer.indexesUsed.iterator();
-        String temp;
+      Iterator itr = observer.indexesUsed.iterator();
+      String temp;
 
-        while(itr.hasNext()){
-          temp = itr.next().toString();
+      while(itr.hasNext()){
+        temp = itr.next().toString();
 
-          if(temp.equals("nameIndex")){
-            break;
-          }else if(temp.equals("statusIndex")){
-            break;
-          }else{
-            fail("indices used do not match with those which are expected to be used" +
-                "<nameIndex> and <statusIndex> were expected but found " +itr.next());
-          }
+        if(temp.equals("nameIndex")){
+          break;
+        }else if(temp.equals("statusIndex")){
+          break;
+        }else{
+          fail("indices used do not match with those which are expected to be used" +
+              "<nameIndex> and <statusIndex> were expected but found " +itr.next());
         }
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
       }
     }
     //Verifying the query results
@@ -303,20 +257,14 @@ public class IUMRShuffleIteratorsJUnitTest {
         "select distinct * from /address a, /portfolios p, /employees e, a.street s  where s.street ='DPStreet1'",
         //Scenario B: Only Index on the first region in the Query is used
         //"select distinct * from /address a, /portfolios p, /employees e, a.street s where p.status='active' and s.street ='DPStreet1'",
-
     };
+
     //Execute queries without Indexes
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r [i][0]= q.execute();
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
-      }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r [i][0]= q.execute();
     }
     //Create Indexes and Execute the queries
     qs.createIndex("nameIndex", IndexType.FUNCTIONAL,"e.name","/employees e");
@@ -324,25 +272,18 @@ public class IUMRShuffleIteratorsJUnitTest {
     qs.createIndex("streetIndex", IndexType.FUNCTIONAL,"s.street","/address a, a.street s");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r [i][1]= q.execute();
-        if(!observer.isIndexesUsed){
-          fail("Index is NOT uesd");
-        }
-        int indxs = observer.indexesUsed.size();
-        CacheUtils.log("*******************Indexes Used::: "+indxs+" IndexName::"+observer.IndexName);
-        Iterator itr = observer.indexesUsed.iterator();
-        assertEquals("streetIndex",itr.next().toString());
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r [i][1]= q.execute();
+      if(!observer.isIndexesUsed){
+        fail("Index is NOT uesd");
       }
-
+      int indxs = observer.indexesUsed.size();
+      CacheUtils.log("*******************Indexes Used::: "+indxs+" IndexName::"+observer.IndexName);
+      Iterator itr = observer.indexesUsed.iterator();
+      assertEquals("streetIndex",itr.next().toString());
     }
     //Verifying the query results
     StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -359,42 +300,31 @@ public class IUMRShuffleIteratorsJUnitTest {
         "select distinct * from /address itr1,itr1.phoneNo itr2,itr1.street itr3 where itr2.mobile>333",
         "select distinct * from /address itr1,itr1.street itr2,itr1.phoneNo itr3 where itr3.mobile>333",
     };
+
     //Execute the query without index
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r[i][0] = q.execute();
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
-      }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r[i][0] = q.execute();
     }
     //Create index and Execute the query
     qs.createIndex("mobileIndex",IndexType.FUNCTIONAL,"itr2.mobile","/address itr1,itr1.phoneNo itr2,itr1.street itr3");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r[i][1] = q.execute();
-        if(!observer.isIndexesUsed){
-          fail("Index is NOT uesd");
-        }
-        int indxs = observer.indexesUsed.size();
-        CacheUtils.log("*******************Indexes Used::: "+indxs+" IndexName::"+observer.IndexName);
-
-        Iterator itr = observer.indexesUsed.iterator();
-        assertEquals("mobileIndex",itr.next().toString());
-
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][1] = q.execute();
+      if(!observer.isIndexesUsed){
+        fail("Index is NOT uesd");
       }
+      int indxs = observer.indexesUsed.size();
+      CacheUtils.log("*******************Indexes Used::: "+indxs+" IndexName::"+observer.IndexName);
+
+      Iterator itr = observer.indexesUsed.iterator();
+      assertEquals("mobileIndex",itr.next().toString());
     }
     //Verifying the query results
     StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
@@ -414,15 +344,9 @@ public class IUMRShuffleIteratorsJUnitTest {
     //Execute queries without Indexes
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r [i][0]= q.execute();
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
-      }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r [i][0]= q.execute();
     }
     //Create Indexes and Execute the queries
     qs.createIndex("nameIndex", IndexType.FUNCTIONAL,"e.name","/employees e");
@@ -430,54 +354,51 @@ public class IUMRShuffleIteratorsJUnitTest {
     qs.createIndex("streetIndex", IndexType.FUNCTIONAL,"s.street","/address a, a.street s");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r [i][1]= q.execute();
-        if(!observer.isIndexesUsed){
-          fail("Index is NOT uesd");
-        }
-        int indxs = observer.indexesUsed.size();
-        CacheUtils.log("*******************Indexes Used::: "+indxs+" IndexName::"+observer.IndexName);
-
-        Iterator itr = observer.indexesUsed.iterator();
-        String temp;
-
-        while(itr.hasNext()){
-          temp = itr.next().toString();
-
-          if(temp.equals("streetIndex")){
-            break;
-          }else if(temp.equals("statusIndex")){
-            break;
-          }else{
-            fail("indices used do not match with those which are expected to be used" +
-                "<streetIndex> and <statusIndex> were expected but found " +itr.next());
-          }
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r [i][1]= q.execute();
+      if(!observer.isIndexesUsed){
+        fail("Index is NOT uesd");
+      }
+      int indxs = observer.indexesUsed.size();
+      CacheUtils.log("*******************Indexes Used::: "+indxs+" IndexName::"+observer.IndexName);
+
+      Iterator itr = observer.indexesUsed.iterator();
+      String temp;
+
+      while(itr.hasNext()){
+        temp = itr.next().toString();
+
+        if(temp.equals("streetIndex")){
+          break;
+        }else if(temp.equals("statusIndex")){
+          break;
+        }else{
+          fail("indices used do not match with those which are expected to be used" +
+              "<streetIndex> and <statusIndex> were expected but found " +itr.next());
         }
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
       }
-
     }
     //Verifying the query results
     StructSetOrResultsSet ssORrs = new StructSetOrResultsSet();
     ssORrs.CompareQueryResultsWithoutAndWithIndexes(r,queries.length,queries);
   } //end of test7
 
-  class QueryObserverImpl extends QueryObserverAdapter{
+  private static class QueryObserverImpl extends QueryObserverAdapter {
+
     boolean isIndexesUsed = false;
     ArrayList indexesUsed = new ArrayList();
     String IndexName;
+
+    @Override
     public void beforeIndexLookup(Index index, int oper, Object key) {
       IndexName = index.getName();
       indexesUsed.add(index.getName());
     }
 
+    @Override
     public void afterIndexLookup(Collection results) {
       if(results != null){
         isIndexesUsed = true;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
index 3a2d9da..8f02f63 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
@@ -16,14 +16,10 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.io.File;
 
-import junit.framework.Assert;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,25 +45,21 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
-*
-*/
 @Category(IntegrationTest.class)
-public class IndexCreationDeadLockJUnitTest
-{
-  protected boolean testFailed = false;
+public class IndexCreationDeadLockJUnitTest {
+
+  private static final String indexName = "queryTest";
 
-  protected String cause = "";
+  private boolean testFailed = false;
 
-  boolean exceptionInCreatingIndex = false;
+  private String cause = "";
 
-  Region region;
+  private boolean exceptionInCreatingIndex = false;
 
-  final String indexName = "queryTest";
+  private Region region;
 
   @Before
-  public void setUp() throws java.lang.Exception
-  {
+  public void setUp() throws Exception {
     CacheUtils.startCache();
     this.testFailed = false;
     this.cause = "";
@@ -83,25 +75,21 @@ public class IndexCreationDeadLockJUnitTest
   }
 
   @After
-  public void tearDown() throws java.lang.Exception
-  {
-	try{
-		this.region.localDestroyRegion();
-	}catch(RegionDestroyedException  rde) {
-		//Ignore
-	}
+  public void tearDown() throws Exception {
+    try{
+      this.region.localDestroyRegion();
+    }catch(RegionDestroyedException  rde) {
+      //Ignore
+    }
 
     CacheUtils.closeCache();
   }
 
   /**
    * Tests Index creation and maintenance deadlock scenario for in memory region
-   *
    */
   @Test
-  public void testIndexCreationDeadLock() throws Exception
-  {
-
+  public void testIndexCreationDeadLock() throws Exception {
     simulateDeadlockScenario();
     assertFalse(this.cause, this.testFailed);
     assertFalse("Index creation failed", this.exceptionInCreatingIndex);
@@ -111,8 +99,7 @@ public class IndexCreationDeadLockJUnitTest
    * Tests  Index creation and maintenance deadlock scenario for Persistent only disk region
    */
   @Test
-  public void testIndexCreationDeadLockForDiskOnlyRegion()
-  {
+  public void testIndexCreationDeadLockForDiskOnlyRegion() {
     this.region.destroyRegion();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -132,14 +119,11 @@ public class IndexCreationDeadLockJUnitTest
     assertFalse("Index creation failed", this.exceptionInCreatingIndex);
   }
 
-
   /**
    * Tests  Index creation and maintenance deadlock scenario for a region with stats enabled
-   *
    */
   @Test
-  public void testIndexCreationDeadLockForStatsEnabledRegion()
-  {
+  public void testIndexCreationDeadLockForStatsEnabledRegion() {
     this.region.destroyRegion();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -157,8 +141,7 @@ public class IndexCreationDeadLockJUnitTest
    * Tests inability to create index on a region which overflows to disk   *
    */
   @Test
-  public void testIndexCreationDeadLockForOverflowToDiskRegion()
-  {
+  public void testIndexCreationDeadLockForOverflowToDiskRegion() {
     this.region.destroyRegion();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -181,7 +164,6 @@ public class IndexCreationDeadLockJUnitTest
   }
 
   private void simulateDeadlockScenario() {
-
     Thread th = new IndexCreationDeadLockJUnitTest.PutThread("put thread");
     th.start();
     ThreadUtils.join(th, 60 * 1000);
@@ -190,8 +172,7 @@ public class IndexCreationDeadLockJUnitTest
   /**
    * following thread will perform the operations of data population and index creation.
    */
-  public class HelperThread extends Thread
-  {
+  private class HelperThread extends Thread {
 
     public HelperThread(String thName) {
       super(thName);
@@ -201,8 +182,8 @@ public class IndexCreationDeadLockJUnitTest
               + thName);
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       try {
 
         System.out
@@ -227,19 +208,17 @@ public class IndexCreationDeadLockJUnitTest
   /**
    * thread to put the entries in region
    */
-  public class PutThread extends Thread
-  {
+  private class PutThread extends Thread {
 
     public PutThread(String thName) {
       super(thName);
       System.out
           .println("--------------------- Thread started ------------------------- "
               + thName);
-
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       try {
         System.out
             .println("--------------------- Populating Data -------------------------");
@@ -275,12 +254,12 @@ public class IndexCreationDeadLockJUnitTest
   /**
    *  make the update to wait for a while before updatation to simulate the deadlock condiction
    */
-  public class BeforeUpdateCallBack extends CacheWriterAdapter
-  {
+  private class BeforeUpdateCallBack extends CacheWriterAdapter {
+
     int cnt = 0;
 
-    public void beforeCreate(EntryEvent event) throws CacheWriterException
-    {
+    @Override
+    public void beforeCreate(EntryEvent event) throws CacheWriterException {
       cnt++;
       if (cnt == 10) {
         System.out


[34/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
index 90fc87c..b24673d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
@@ -19,177 +19,78 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskAccessException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.persistence.UninterruptibleFileChannel;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests that if a node doing GII experiences DiskAccessException, it should
  * also not try to recover from the disk
- *
  */
-public class Bug39079DUnitTest extends CacheTestCase {
-
-  protected static String regionName = "IGNORE_EXCEPTION_Bug39079";
+@Category(DistributedTest.class)
+public class Bug39079DUnitTest extends JUnit4CacheTestCase {
 
-  static Properties props = new Properties();
-  
-
-  private VM vm0 = null;
-
-  private static VM vm1 = null;
-
-  private static  String REGION_NAME = "IGNORE_EXCEPTION_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase";  
-  
-  private static Cache gemfirecache = null;
-
-  private static Region region;
-  
-  protected static File[] dirs = null;
+  private static final String REGION_NAME_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase = "IGNORE_EXCEPTION_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase";
+  private static final String REGION_NAME_testGIIDiskAccessException = "IGNORE_EXCEPTION_testGIIDiskAccessException";
 
-  private static final int maxEntries = 10000;
-
-  /**
-   * Constructor
-   * 
-   * @param name
-   */
-  public Bug39079DUnitTest(String name) {
-    super(name);
-    File file1 = new File(name + "1");
-    file1.mkdir();
-    file1.deleteOnExit();
-    File file2 = new File(name + "2");
-    file2.mkdir();
-    file2.deleteOnExit();
-    dirs = new File[2];
-    dirs[0] = file1;
-    dirs[1] = file2;
-  }
+  private VM vm0;
+  private VM vm1;
 
   @Override
   public final void postSetUp() throws Exception {
+    disconnectAllFromDS();
+
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
 
-    vm0.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.TRUE ));
-    vm1.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.TRUE ));
-  }
-
-  /**
-   * This method is used to create Cache in VM0
-   * 
-   * @return CacheSerializableRunnable
-   */
-
-  private CacheSerializableRunnable createCacheForVM0() {
-    SerializableRunnable createCache = new CacheSerializableRunnable(
-        "createCache") {
-      public void run2() {
-        try {
-
-          (new Bug39079DUnitTest("vm0_diskReg"))
-              .getSystem();         
-          
-          assertTrue(getCache() != null);
-          AttributesFactory factory = new AttributesFactory();
-          factory.setScope(Scope.DISTRIBUTED_ACK);
-          factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);         
-          factory.setDiskSynchronous(false);
-          factory.setDiskStoreName(getCache().createDiskStoreFactory()
-                                   .setDiskDirs(dirs)
-                                   .create("Bug39079DUnitTest")
-                                   .getName());
-          RegionAttributes attr = factory.create();
-          getCache().createRegion(regionName, attr);
-        }
-        catch (Exception ex) {
-          ex.printStackTrace();
-          fail("Error Creating cache / region ");
-        }
-      }
-    };
-    return (CacheSerializableRunnable)createCache;
-  }
-
-  /**
-   * This method is used to create Cache in VM1
-   * 
-   * @return CacheSerializableRunnable
-   */
-  private CacheSerializableRunnable createCacheForVM1() {
-    SerializableRunnable createCache = new CacheSerializableRunnable(
-        "createCache") {
-      public void run2() {
-        try {
-          (new Bug39079DUnitTest("vm1_diskReg"))
-              .getSystem();
-          
-          
-          assertTrue("cache found null", getCache() != null);
-
-          AttributesFactory factory = new AttributesFactory();
-          factory.setScope(Scope.DISTRIBUTED_ACK);
-          factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);          
-          factory.setDiskSynchronous(false);
-          factory.setDiskStoreName(getCache().createDiskStoreFactory()
-                                   .setDiskDirs(dirs)
-                                   .create("Bug39079DUnitTest")
-                                   .getName());
-          RegionAttributes attr = factory.create();
-          getCache().createRegion(regionName, attr);
-
-        }
-        catch (Exception ex) {
-          ex.printStackTrace();
-          fail("Error Creating cache / region " + ex);
-        }
-      }
-    };
-    return (CacheSerializableRunnable)createCache;
+    vm0.invoke(() -> ignorePreAllocate(true));
+    vm1.invoke(() -> ignorePreAllocate(true));
   }
 
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
 
-    vm0.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.FALSE ));
-    vm1.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.FALSE ));
-  }
-  
-  static void ignorePreAllocate(boolean flag) throws Exception {
-    DiskStoreImpl.SET_IGNORE_PREALLOCATE = flag;
+    vm0.invoke(() -> ignorePreAllocate(false));
+    vm1.invoke(() -> ignorePreAllocate(false));
   }
 
-  
   /**
-   * If the node expreriences disk access exception during GII, it should
+   * If the node experiences disk access exception during GII, it should
    * get destroyed & not attempt to recover from the disk
-   * 
    */
-
-  public void testGIIDiskAccessException() {
-
+  @Test
+  public void testGIIDiskAccessException() throws Exception {
     vm0.invoke(createCacheForVM0());
     vm1.invoke(createCacheForVM1());
+
     //Create DiskRegion locally in controller VM also
-    this.getSystem();
+    getSystem();
     
     
     assertTrue(getCache() != null);
@@ -197,172 +98,114 @@ public class Bug39079DUnitTest extends CacheTestCase {
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);    
     factory.setDiskSynchronous(false);
-    factory.setDiskStoreName(getCache().createDiskStoreFactory()
-                             .setDiskDirs(dirs)
-                             .create("Bug39079DUnitTest")
-                             .getName());
+    factory.setDiskStoreName(getCache().createDiskStoreFactory().setDiskDirs(getDiskDirs()).create(getClass().getSimpleName()).getName());
     RegionAttributes attr = factory.create();
-    Region rgn = getCache().createRegion(regionName, attr);
+    Region region = getCache().createRegion(REGION_NAME_testGIIDiskAccessException, attr);
+
     //Now put entries in the disk region
     for (int i = 0; i < 100; ++i) {
-      rgn.put(new Integer(i), new Integer(i));
+      region.put(new Integer(i), new Integer(i));
     }
+
     //Now close the  region in the controller VM
-    rgn.close();
+    region.close();
 
     //Now recreate the region but set the factory such that disk region entry object
     //used is customized by us to throw exception while writing to disk
 
-    DistributedRegion distRegion = new DistributedRegion(regionName, attr,
-        null, (GemFireCacheImpl)getCache(), new InternalRegionArguments()
-            .setDestroyLockFlag(true).setRecreateFlag(false)
-            .setSnapshotInputStream(null).setImageTarget(null));
-//    assertTrue("Distributed Region is null", distRegion != null); (cannot be null)
+    DistributedRegion distRegion = new DistributedRegion(
+      REGION_NAME_testGIIDiskAccessException,
+      attr,
+      null,
+      (GemFireCacheImpl)getCache(),
+      new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false).setSnapshotInputStream(null).setImageTarget(null));
+
+    distRegion.entries.setEntryFactory(TestAbstractDiskRegionEntry.getEntryFactory());
+    region = null;
 
-    ((AbstractRegionMap)distRegion.entries)
-        .setEntryFactory(Bug39079DUnitTest.TestAbstractDiskRegionEntry.getEntryFactory());
-    rgn = null;
     try {
-      rgn = ((GemFireCacheImpl)getCache()).createVMRegion(regionName, attr,
-          new InternalRegionArguments().setInternalMetaRegion(distRegion)
-              .setDestroyLockFlag(true).setSnapshotInputStream(null)
-              .setImageTarget(null));
-    }
-    catch (DiskAccessException dae) {
-      //Ok
+      region = ((GemFireCacheImpl)getCache()).createVMRegion(
+        REGION_NAME_testGIIDiskAccessException,
+        attr,
+        new InternalRegionArguments().setInternalMetaRegion(distRegion).setDestroyLockFlag(true).setSnapshotInputStream(null).setImageTarget(null));
+      fail("Expected DiskAccessException");
+    } catch (DiskAccessException expected) {
     }
-    catch (Exception e) {
-      fail(" test failed because of exception =" + e.toString());
-    }
-
-    assertTrue(rgn == null || rgn.isDestroyed());
 
+    assertTrue(region == null || region.isDestroyed()); // TODO: why is this an OR instead of deterministic?
   }
 
-  static class TestAbstractDiskRegionEntry extends VMThinDiskRegionEntryHeapObjectKey {
-    protected TestAbstractDiskRegionEntry(RegionEntryContext r, Object key,
-        Object value) {
-      super(r, key, value);
-    }
-
-    private static RegionEntryFactory factory = new RegionEntryFactory() {
-      public final RegionEntry createEntry(RegionEntryContext r, Object key,
-          Object value) {
-
-        throw new DiskAccessException(new IOException("Test Exception"));
-        //return new Bug39079DUnitTest.TestAbstractDiskRegionEntry(r, key, value);
-      }
-
-      public final Class getEntryClass() {
-
-        return Bug39079DUnitTest.TestAbstractDiskRegionEntry.class;
-      }
-
-      @Override
-      public RegionEntryFactory makeVersioned() {
-        return this;
-      }
-      
-      public RegionEntryFactory makeOnHeap() {
-        return this;
-      }
-    };
-
-    /**
-     * Overridden setValue method to throw exception
-     */
-    @Override
-    protected void setValueField(Object v) {
-      throw new DiskAccessException(new IOException("Test Exception"));
-    }
-
-    public static RegionEntryFactory getEntryFactory() {
-      return factory;
-    }
-  }
-  
   /**
    * If IOException occurs while updating an entry in an already initialized
    * DiskRegion ,then the bridge servers should be stopped , if any running 
-   * 
-   * @throws Exception
    */
-  public void testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase()
-      throws Exception {    
-   // create server cache 
-   Integer port = (Integer)vm0.invoke(() -> Bug39079DUnitTest.createServerCache());
-   //create cache client
-   vm1.invoke(() -> Bug39079DUnitTest.createClientCache( NetworkUtils.getServerHostName(vm0.getHost()), port));
+  @Test
+  public void testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase() throws Exception {
+    // create server cache
+    Integer port = vm0.invoke(() -> createServerCache());
+
+    //create cache client
+    vm1.invoke(() -> createClientCache(NetworkUtils.getServerHostName(vm0.getHost()), port));
    
-   // validate 
-   vm0.invoke(() -> Bug39079DUnitTest.validateRuningBridgeServerList());
+    // validate
+    vm0.invoke(() -> validateRunningBridgeServerList());
    
-   // close server cache
-   vm0.invoke(() -> Bug39079DUnitTest.closeCacheAndDisconnect());
-   // close client cache
-   vm1.invoke(() -> Bug39079DUnitTest.closeCacheAndDisconnect());
+    // close server cache
+    vm0.invoke(() -> closeCacheAndDisconnect());
+
+    // close client cache
+    vm1.invoke(() -> closeCacheAndDisconnect());
   }
-  
-  public static Integer createServerCache() throws Exception
-  {
-    new Bug39079DUnitTest("temp").createCache(new Properties());
+
+  private int createServerCache() throws IOException {
+    createCache(new Properties());
     DiskRegionProperties props = new DiskRegionProperties();
-    props.setRegionName(REGION_NAME);
+    props.setRegionName(REGION_NAME_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase);
     props.setOverflow(true);
     props.setRolling(true);
-    props.setDiskDirs(dirs);
+    props.setDiskDirs(getDiskDirs());
     props.setPersistBackup(true);
     
-    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(gemfirecache, props, Scope.DISTRIBUTED_ACK);
+    Region region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(getCache(), props, Scope.DISTRIBUTED_ACK);
     assertNotNull(region);
-    CacheServer bs1 = gemfirecache.addCacheServer();
+    CacheServer bs1 = getCache().addCacheServer();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     bs1.setPort(port);
     bs1.start();
-    return new Integer(bs1.getPort());
+    return bs1.getPort();
   }
 
-  public static void closeCacheAndDisconnect()
-  {
-    if (gemfirecache != null && !gemfirecache.isClosed()) {
-      gemfirecache.close();
-      gemfirecache.getDistributedSystem().disconnect();
-    }
+  private void closeCacheAndDisconnect() {
+    closeCache();
+    disconnectFromDS();
   }
   
-  private void createCache(Properties props) throws Exception
-  {
-    DistributedSystem ds = getSystem(props);
-    assertNotNull(ds);
-    ds.disconnect();
-    ds = getSystem(props);
-    gemfirecache = CacheFactory.create(ds);
-    assertNotNull(gemfirecache);
+  private void createCache(Properties props) {
+    getSystem(props);
+    assertNotNull(getCache());
   }
   
-  private static void validateRuningBridgeServerList(){
-    /*Region region = gemfirecache.getRegion(Region.SEPARATOR + REGION_NAME);
-    assertNotNull(region);*/
-    try {        
+  private  void validateRunningBridgeServerList() throws IOException {
+    Region region = getCache().getRegion(REGION_NAME_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase);
+    try {
       region.create("key1", new byte[16]);
       region.create("key2", new byte[16]);
-//    Get the oplog handle & hence the underlying file & close it
-      UninterruptibleFileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion()
-          .testHook_getChild().getFileChannel();
+
+      // Get the oplog handle & hence the underlying file & close it
+      UninterruptibleFileChannel oplogFileChannel = ((LocalRegion)region).getDiskRegion().testHook_getChild().getFileChannel();
+
       try {
         oplogFileChannel.close();
         region.put("key2", new byte[16]);
-      }catch(DiskAccessException dae) {
-        //OK expected
-      }catch (IOException e) {
-        Assert.fail("test failed due to ", e);
+        fail("Expected DiskAccessException");
+      } catch(DiskAccessException expected) {
       }
-      
+
       ((LocalRegion) region).getDiskStore().waitForClose();
       assertTrue(region.getRegionService().isClosed());
       
       region = null;
-      List bsRunning = gemfirecache.getCacheServers();
+      List bsRunning = getCache().getCacheServers();
       assertTrue(bsRunning.isEmpty());
     }
     finally {
@@ -371,27 +214,123 @@ public class Bug39079DUnitTest extends CacheTestCase {
       }
     }
   }
-  
-  public static void createClientCache(String host, Integer port1)
-      throws Exception {
-    new Bug39079DUnitTest("temp");
+
+  private void createClientCache(String host, Integer port1) {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new Bug39079DUnitTest("temp").createCache(props);
-    PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host,
-        port1.intValue())
-        .setSubscriptionEnabled(true).setSubscriptionRedundancy(0)
-        .setThreadLocalConnections(true).setMinConnections(0).setReadTimeout(
-            20000).setRetryAttempts(1).create("Bug39079DUnitTest");
+    createCache(props);
+
+    PoolImpl pool = (PoolImpl)PoolManager.createFactory()
+      .addServer(host, port1.intValue())
+      .setSubscriptionEnabled(true).setSubscriptionRedundancy(0).setThreadLocalConnections(true).setMinConnections(0).setReadTimeout(20000).setRetryAttempts(1).create(getClass().getSimpleName());
 
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
-    factory.setPoolName(p.getName());
+    factory.setPoolName(pool.getName());
 
     RegionAttributes attrs = factory.create();
-    Region r = gemfirecache.createRegion(REGION_NAME, attrs);
-    //getRegion(Region.SEPARATOR + REGION_NAME);
-    r.registerInterest("ALL_KEYS");
+    Region region = getCache().createRegion(REGION_NAME_testBridgeServerStoppingInSynchPersistOnlyForIOExceptionCase, attrs);
+    region.registerInterest("ALL_KEYS");
+  }
+
+  /**
+   * This method is used to create Cache in VM0
+   */
+  private CacheSerializableRunnable createCacheForVM0() {
+    return new CacheSerializableRunnable("createCache") {
+      @Override
+      public void run2() {
+        try {
+          getSystem();
+          assertNotNull(getCache());
+
+          AttributesFactory factory = new AttributesFactory();
+          factory.setScope(Scope.DISTRIBUTED_ACK);
+          factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
+          factory.setDiskSynchronous(false);
+          factory.setDiskStoreName(getCache().createDiskStoreFactory().setDiskDirs(getDiskDirs()).create(getClass().getSimpleName()).getName());
+
+          RegionAttributes attr = factory.create();
+          getCache().createRegion(REGION_NAME_testGIIDiskAccessException, attr);
+        }
+        catch (Exception ex) {
+          fail("Error Creating cache / region ", ex);
+        }
+      }
+    };
+  }
+
+  /**
+   * This method is used to create Cache in VM1
+   */
+  private CacheSerializableRunnable createCacheForVM1() {
+    return new CacheSerializableRunnable("createCache") {
+      @Override
+      public void run2() {
+        try {
+          getSystem();
+          assertNotNull(getCache());
+
+          AttributesFactory factory = new AttributesFactory();
+          factory.setScope(Scope.DISTRIBUTED_ACK);
+          factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
+          factory.setDiskSynchronous(false);
+          factory.setDiskStoreName(getCache().createDiskStoreFactory().setDiskDirs(getDiskDirs()).create(getClass().getSimpleName()).getName());
+
+          RegionAttributes attr = factory.create();
+          getCache().createRegion(REGION_NAME_testGIIDiskAccessException, attr);
+        }
+        catch (Exception ex) {
+          fail("Error Creating cache / region ", ex);
+        }
+      }
+    };
+  }
+
+  private void ignorePreAllocate(boolean flag) throws Exception {
+    DiskStoreImpl.SET_IGNORE_PREALLOCATE = flag;
+  }
+
+  private static class TestAbstractDiskRegionEntry extends VMThinDiskRegionEntryHeapObjectKey {
+
+    protected TestAbstractDiskRegionEntry(RegionEntryContext r, Object key, Object value) {
+      super(r, key, value);
+    }
+
+    private static RegionEntryFactory factory = new RegionEntryFactory() {
+
+      @Override
+      public final RegionEntry createEntry(RegionEntryContext r, Object key, Object value) {
+        throw new DiskAccessException(new IOException("Test Exception"));
+      }
+
+      @Override
+      public final Class getEntryClass() {
+        return getClass();
+      }
+
+      @Override
+      public RegionEntryFactory makeVersioned() {
+        return this;
+      }
+
+      @Override
+      public RegionEntryFactory makeOnHeap() {
+        return this;
+      }
+    };
+
+    /**
+     * Overridden setValue method to throw exception
+     */
+    @Override
+    protected void setValueField(Object v) {
+      throw new DiskAccessException(new IOException("Test Exception"));
+    }
+
+    public static RegionEntryFactory getEntryFactory() {
+      return factory;
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
index ccf2311..2c3951a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
@@ -16,9 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.util.Properties;
 
+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.CacheFactory;
@@ -30,31 +35,22 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
-import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
-import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
-import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.internal.cache.SearchLoadAndWriteProcessor;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Bug40299 DUNIT Test: The Clear operation during a NetSearchMessage.doGet() in progress can 
  * cause DiskAccessException by accessing cleared oplogs and
  * eventually destroy region.
  * The Test verifies that fix prevents this.
- * 
  */
-
-public class Bug40299DUnitTest extends CacheTestCase
-{
+@Category(DistributedTest.class)
+public class Bug40299DUnitTest extends JUnit4CacheTestCase {
 
   protected static String regionName = "TestRegion";
 
@@ -66,16 +62,6 @@ public class Bug40299DUnitTest extends CacheTestCase
 
   protected static Cache cache = null;
 
-
-  /**
-   * Constructor
-   * 
-   * @param name
-   */
-  public Bug40299DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -101,7 +87,7 @@ public class Bug40299DUnitTest extends CacheTestCase
       {
         try {
 
-          distributedSystem = (new Bug40299DUnitTest("vm0_diskReg"))
+          distributedSystem = (new Bug40299DUnitTest())
               .getSystem(props);
           assertTrue(distributedSystem != null);
           cache = CacheFactory.create(distributedSystem);
@@ -286,6 +272,7 @@ public class Bug40299DUnitTest extends CacheTestCase
    * The Test verifies that fix prevents this.
    */
 
+  @Test
   public void testQueryGetWithClear()
   {
     IgnoredException.addIgnoredException("Entry has been cleared and is not present on disk");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40632DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40632DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40632DUnitTest.java
index 80d5ce4..e35a357 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40632DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40632DUnitTest.java
@@ -16,60 +16,25 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.util.Collections;
-import java.util.Set;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
+import static org.junit.Assert.*;
 
-import junit.framework.TestCase;
+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.CacheLoader;
-import com.gemstone.gemfire.cache.CacheLoaderException;
-import com.gemstone.gemfire.cache.CacheWriterException;
-import com.gemstone.gemfire.cache.EntryEvent;
 import com.gemstone.gemfire.cache.ExpirationAction;
 import com.gemstone.gemfire.cache.ExpirationAttributes;
-import com.gemstone.gemfire.cache.LoaderHelper;
 import com.gemstone.gemfire.cache.PartitionAttributes;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.control.RebalanceOperation;
-import com.gemstone.gemfire.cache.control.RebalanceResults;
-import com.gemstone.gemfire.cache.control.ResourceManager;
-import com.gemstone.gemfire.cache.partition.PartitionMemberInfo;
-import com.gemstone.gemfire.cache.partition.PartitionRebalanceInfo;
-import com.gemstone.gemfire.cache.partition.PartitionRegionInfo;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.PRHARedundancyProvider;
-import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
-import com.gemstone.gemfire.internal.cache.control.ResourceManagerStats;
-import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.SerializableCallable;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class Bug40632DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug40632DUnitTest extends JUnit4CacheTestCase {
 
-  /**
-   * @param name
-   */
-  public Bug40632DUnitTest(String name) {
-    super(name);
-  }
-  
-  public void testLocalDestroyIdleTimeout() {
+  @Test
+  public void testLocalDestroyIdleTimeout() throws Exception {
     Cache cache = getCache();
     AttributesFactory attr = new AttributesFactory();
     PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -84,11 +49,11 @@ public class Bug40632DUnitTest extends CacheTestCase {
       cache.createRegion("region1", attr.create());
       fail("We should not have been able to create the region");
     } catch(IllegalStateException expected) {
-      
     }
   }
   
-  public void testLocalDestroyTimeToLive() {
+  @Test
+  public void testLocalDestroyTimeToLive() throws Exception {
     Cache cache = getCache();
     AttributesFactory attr = new AttributesFactory();
     PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -100,14 +65,14 @@ public class Bug40632DUnitTest extends CacheTestCase {
     attr.setEntryTimeToLive(new ExpirationAttributes(1000, ExpirationAction.LOCAL_DESTROY));
     attr.setPartitionAttributes(prAttr);
     try {
-    cache.createRegion("region1", attr.create());
-    fail("We should not have been able to create the region");
+      cache.createRegion("region1", attr.create());
+      fail("We should not have been able to create the region");
     } catch(IllegalStateException expected) {
-      
     }
   }
   
-  public void testLocalInvalidateIdleTimeout() {
+  @Test
+  public void testLocalInvalidateIdleTimeout() throws Exception {
     Cache cache = getCache();
     AttributesFactory attr = new AttributesFactory();
     PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -119,14 +84,14 @@ public class Bug40632DUnitTest extends CacheTestCase {
     attr.setEntryIdleTimeout(new ExpirationAttributes(1000, ExpirationAction.LOCAL_INVALIDATE));
     attr.setPartitionAttributes(prAttr);
     try {
-    cache.createRegion("region1", attr.create());
-    fail("We should not have been able to create the region");
+      cache.createRegion("region1", attr.create());
+      fail("We should not have been able to create the region");
     } catch(IllegalStateException expected) {
-      
     }
   }
   
-  public void testLocalInvalidateTimeToLive() {
+  @Test
+  public void testLocalInvalidateTimeToLive() throws Exception {
     Cache cache = getCache();
     AttributesFactory attr = new AttributesFactory();
     PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -138,10 +103,9 @@ public class Bug40632DUnitTest extends CacheTestCase {
     attr.setEntryTimeToLive(new ExpirationAttributes(1000, ExpirationAction.LOCAL_INVALIDATE));
     attr.setPartitionAttributes(prAttr);
     try {
-    cache.createRegion("region1", attr.create());
-    fail("We should not have been able to create the region");
+      cache.createRegion("region1", attr.create());
+      fail("We should not have been able to create the region");
     } catch(IllegalStateException expected) {
-      
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
index bb2faf0..dfe502e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
@@ -16,47 +16,50 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Properties;
+
+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.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMessage;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * This class tests that bucket regions can handle
  * a failure of the GII target during GII.
- *
  */
-public class Bug41091DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug41091DUnitTest extends JUnit4CacheTestCase {
 
-  /**
-   * @param name
-   */
-  public Bug41091DUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
   }
   
+  @Test
   public void test() {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -82,9 +85,9 @@ public class Bug41091DUnitTest extends CacheTestCase {
               RequestImageMessage rim = (RequestImageMessage) message;
               Region region = getCache().getRegion(rim.regionPath);
               if(region instanceof BucketRegion) {
-//We can no longer do any puts until the bucket is completely created,
-//so this will hang
-//                getCache().getRegion("region").put(113, "b");
+                //We can no longer do any puts until the bucket is completely created,
+                //so this will hang
+                // getCache().getRegion("region").put(113, "b");
                 getCache().close();
               }
             }
@@ -135,7 +138,6 @@ public class Bug41091DUnitTest extends CacheTestCase {
             }
           };
       vm3.invoke(stopLocator);
-      
     }
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
index 2607711..d768b59 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
@@ -16,57 +16,51 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.Collections;
 import java.util.Set;
 import java.util.TreeSet;
 
+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.CacheClosedException;
 import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.DiskStore;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
 import com.gemstone.gemfire.internal.cache.partitioned.ManageBucketMessage;
 import com.gemstone.gemfire.internal.cache.partitioned.ManageBucketMessage.ManageBucketReplyMessage;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
- * Test to make sure that we can handle 
+ * Test to make sure that we can handle
  * a crash of the member directing bucket creation.
  */
-public class Bug41733DUnitTest extends CacheTestCase {
-  
-  
-  public Bug41733DUnitTest(String name) {
-    super(name);
-  }
-  
+@Category(DistributedTest.class)
+public class Bug41733DUnitTest extends JUnit4CacheTestCase {
   
-
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
   }
 
-
-
   /** 
    * Test the we can handle a member departing after creating
    * a bucket on the remote node but before we choose a primary
    */
+  @Test
   public void testCrashAfterBucketCreation() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -82,7 +76,7 @@ public class Bug41733DUnitTest extends CacheTestCase {
           public void beforeProcessMessage(DistributionManager dm,
               DistributionMessage message) {
             if(message instanceof ManageBucketReplyMessage) {
-              DistributedTestCase.disconnectFromDS();
+              disconnectFromDS();
             }
           }
         });
@@ -117,6 +111,7 @@ public class Bug41733DUnitTest extends CacheTestCase {
    * Test the we can handle a member departing while we are 
    *  in the process of creating the bucket on the remote node.
    */
+  @Test
   public void testCrashDuringBucketCreation() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -132,7 +127,7 @@ public class Bug41733DUnitTest extends CacheTestCase {
           public void beforeProcessMessage(DistributionManager dm,
               DistributionMessage message) {
             if(message instanceof ManageBucketMessage) {
-              vm0.invoke(() -> DistributedTestCase.disconnectFromDS());
+              vm0.invoke(() -> disconnectFromDS());
             }
           }
         });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
index fc7b443..05966b3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
@@ -16,18 +16,35 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test for bug 41957.
@@ -37,17 +54,15 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 6.5
  */
- public class Bug41957DUnitTest extends ClientServerTestCase {
-
-  public Bug41957DUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class Bug41957DUnitTest extends ClientServerTestCase {
 
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
   }
 
+  @Test
   public void testBug41957() {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug42055DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug42055DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug42055DUnitTest.java
index c68c5eb..43164d9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug42055DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug42055DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -35,16 +44,18 @@ import com.gemstone.gemfire.test.dunit.VM;
  * we fault out and in a delta object.
  *
  */
-public class Bug42055DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug42055DUnitTest extends JUnit4CacheTestCase {
   
 
   /**
    * @param name
    */
-  public Bug42055DUnitTest(String name) {
-    super(name);
+  public Bug42055DUnitTest() {
+    super();
   }
 
+  @Test
   public void testPROverflow() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
index 7a6ff90..9cb0eb9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Map.Entry;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -28,14 +37,16 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
-public class Bug45164DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug45164DUnitTest extends JUnit4CacheTestCase {
   private static final int count = 10000;
   private static final int stride = 3;
   
-  public Bug45164DUnitTest(String name) {
-    super(name);
+  public Bug45164DUnitTest() {
+    super();
   }
 
+  @Test
   public void testIterateWhileDestroy() throws Throwable {
     SerializableRunnable destroy = new SerializableRunnable() {
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java
index eb4faf6..6702a64 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java
@@ -16,23 +16,33 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.util.DelayedAction;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+@Category(DistributedTest.class)
+public class Bug45934DUnitTest extends JUnit4CacheTestCase {
 
-public class Bug45934DUnitTest extends CacheTestCase {
-  public Bug45934DUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testNormal() throws Exception {
     int count = 1000;
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
index d3b3963..4575670 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.CacheTransactionManager;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.ClientCache;
@@ -28,12 +37,13 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class Bug47667DUnitTest extends LocatorTestBase {
 
   private static final long serialVersionUID = 2859534245283086765L;
 
-  public Bug47667DUnitTest(String name) {
-    super(name);
+  public Bug47667DUnitTest() {
+    super();
   }
 
   @Override
@@ -46,6 +56,7 @@ public class Bug47667DUnitTest extends LocatorTestBase {
     disconnectAllFromDS();
   }
 
+  @Test
   public void testbug47667() {
     Host host = Host.getHost(0);
     VM locator = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
index 777ef66..19064c2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 java.util.Arrays;
 import java.util.HashSet;
@@ -48,13 +57,14 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  *
  */
-public class CacheAdvisorDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CacheAdvisorDUnitTest extends JUnit4CacheTestCase {
   private transient VM[] vms;
   private transient InternalDistributedMember[] ids;
   
   /** Creates a new instance of CacheAdvisorDUnitTest */
-  public CacheAdvisorDUnitTest(String name) {
-    super(name);
+  public CacheAdvisorDUnitTest() {
+    super();
   }
 
   /**
@@ -82,6 +92,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
     this.ids = (InternalDistributedMember[])idList.toArray(new InternalDistributedMember[idList.size()]);
   }
   
+  @Test
   public void testGenericAdvice() throws Exception {
     final RegionAttributes attrs = new AttributesFactory().create();
     assertTrue(attrs.getScope().isDistributedNoAck());
@@ -108,6 +119,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
     assertEquals("Unexpected advice for subregion=" + rgn, expected, actual);
   }
       
+  @Test
   public void testNetWriteAdvice() throws Exception {
     final String rgnName = getUniqueName();
     Set expected = new HashSet();
@@ -134,6 +146,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
     assertEquals(expected, rgn.getCacheDistributionAdvisor().adviseNetWrite());    
   }
   
+  @Test
   public void testNetLoadAdvice() throws Exception {
     final String rgnName = getUniqueName();
     Set expected = new HashSet();
@@ -166,6 +179,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
     assertEquals(expected, rgn.getCacheDistributionAdvisor().adviseNetLoad());    
   }
   
+  @Test
   public void testNetLoadAdviceWithAttributesMutator() throws Exception {
     final String rgnName = getUniqueName();
 
@@ -263,17 +277,20 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
   /** coverage for bug 34255
    * @since GemFire 5.0
    */
- public void testRegionClose() throws Exception {
+  @Test
+  public void testRegionClose() throws Exception {
     basicTestClose(Operation.REGION_CLOSE);
   }
 
   /** coverage for bug 34255
    * @since GemFire 5.0
    */
+  @Test
   public void testRegionLocalDestroy() throws Exception {
     basicTestClose(Operation.REGION_LOCAL_DESTROY);
   }
 
+  @Test
   public void testCacheClose() throws Exception {
     basicTestClose(Operation.CACHE_CLOSE);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java
index 4656b91..6f70a27 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java
@@ -16,34 +16,33 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Tests notifications of CacheLifecycleListener from GemFireCacheImpl.
- * 
  */
 @Category(IntegrationTest.class)
 public class CacheLifecycleListenerJUnitTest  {
 
   @Test
-  public void testAddAndRemoveNull() {
+  public void testAddAndRemoveNull() throws Exception {
     GemFireCacheImpl.addCacheLifecycleListener(null);
     GemFireCacheImpl.removeCacheLifecycleListener(null);
   }
   
   @Test
-  public void testRemoveNonExistent() {
+  public void testRemoveNonExistent() throws Exception {
     final List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final TestCacheLifecycleListener listener = new TestCacheLifecycleListener(cacheCreatedCallbacks, cacheClosedCallbacks);
@@ -51,7 +50,7 @@ public class CacheLifecycleListenerJUnitTest  {
   }
   
   @Test
-  public void testCallbacks() {
+  public void testCallbacks() throws Exception {
     final List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<CacheLifecycleCallback>();
 
@@ -94,7 +93,7 @@ public class CacheLifecycleListenerJUnitTest  {
   }
 
   @Test
-  public void testRemoveBeforeCreate() {
+  public void testRemoveBeforeCreate() throws Exception {
     final List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<CacheLifecycleCallback>();
 
@@ -132,7 +131,7 @@ public class CacheLifecycleListenerJUnitTest  {
   }
   
   @Test
-  public void testRemoveBeforeClose() {
+  public void testRemoveBeforeClose() throws Exception {
     final List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<CacheLifecycleCallback>();
 
@@ -174,7 +173,7 @@ public class CacheLifecycleListenerJUnitTest  {
   }
 
   @Test
-  public void testCallbacksRepeat() {
+  public void testCallbacksRepeat() throws Exception {
     final List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<CacheLifecycleCallback>();
 
@@ -243,7 +242,7 @@ public class CacheLifecycleListenerJUnitTest  {
   }
 
   @Test
-  public void testAddAfterCreate() {
+  public void testAddAfterCreate() throws Exception {
     final List<CacheLifecycleCallback> cacheCreatedCallbacks = new ArrayList<CacheLifecycleCallback>();
     final List<CacheLifecycleCallback> cacheClosedCallbacks = new ArrayList<CacheLifecycleCallback>();
 
@@ -281,7 +280,7 @@ public class CacheLifecycleListenerJUnitTest  {
     }
   }
 
-  static final class CacheLifecycleCallback {
+  private static final class CacheLifecycleCallback {
     
     private final GemFireCacheImpl cache;
     private final long timeStamp;
@@ -296,7 +295,7 @@ public class CacheLifecycleListenerJUnitTest  {
     }
   }
   
-  static final class TestCacheLifecycleListener implements CacheLifecycleListener {
+  private static final class TestCacheLifecycleListener implements CacheLifecycleListener {
 
     private final List<CacheLifecycleCallback> cacheCreatedCallbacks;
     private final List<CacheLifecycleCallback> cacheClosedCallbacks;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
index bb0e02d..94aa4fd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
@@ -21,23 +21,36 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.versions.VersionSource;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class ClearDAckDUnitTest extends DistributedTestCase {
-    
-    /** Creates a new instance of ClearDAckDUnitTest */
-    public ClearDAckDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class ClearDAckDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
     static Cache cache;
     static Properties props = new Properties();
@@ -90,7 +103,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase {
           //            props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
             //            ds = DistributedSystem.connect(props);
             LogWriterUtils.getLogWriter().info("I am vm0");
-            ds = (new ClearDAckDUnitTest("temp")).getSystem(props);
+            ds = (new ClearDAckDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             
             AttributesFactory factory  = new AttributesFactory();
@@ -115,7 +128,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase {
           //   props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
             //   ds = DistributedSystem.connect(props);
             LogWriterUtils.getLogWriter().info("I am vm1");
-            ds = (new ClearDAckDUnitTest("temp")).getSystem(props);
+            ds = (new ClearDAckDUnitTest()).getSystem(props);
             //DistributedSystem.setThreadsSocketPolicy(false);
             CacheObserverImpl observer = new CacheObserverImpl();
             origObserver = CacheObserverHolder.setInstance(observer);
@@ -144,7 +157,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase {
         //   props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
           //   ds = DistributedSystem.connect(props);
           LogWriterUtils.getLogWriter().info("I am vm2");
-          ds = (new ClearDAckDUnitTest("temp")).getSystem(props);
+          ds = (new ClearDAckDUnitTest()).getSystem(props);
           //DistributedSystem.setThreadsSocketPolicy(false);
           CacheObserverImpl observer = new CacheObserverImpl();
           origObserver = CacheObserverHolder.setInstance(observer);
@@ -182,7 +195,8 @@ public class ClearDAckDUnitTest extends DistributedTestCase {
     //test methods
     
     
-    public void testClearMultiVM(){
+  @Test
+  public void testClearMultiVM(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
index b7795c2..7e54283 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
@@ -22,6 +22,13 @@
 
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
@@ -31,28 +38,20 @@ import com.gemstone.gemfire.cache.RegionEvent;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.TimeoutException;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
-import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * For the Global region subsequent puts should be blocked until the clear
  * operation is completely done
- *
  */
-public class ClearGlobalDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class ClearGlobalDUnitTest extends JUnit4DistributedTestCase {
 
-  /** Creates a new instance of ClearGlobalDUnitTest */
-  public ClearGlobalDUnitTest(String name) {
-    super(name);
-  }
   static VM server1 = null;
   
   static Cache cache;
@@ -106,6 +105,7 @@ public class ClearGlobalDUnitTest extends DistributedTestCase
      }  
    }
 
+  @Test
   public void testClearGlobalMultiVM() throws Exception
   {
     Object[] objArr = new Object[1];
@@ -120,7 +120,7 @@ public class ClearGlobalDUnitTest extends DistributedTestCase
 
    public static void createCacheServer1() throws Exception
    {      
-      ds = (new ClearGlobalDUnitTest("temp")).getSystem(props);
+      ds = (new ClearGlobalDUnitTest()).getSystem(props);
       cache = CacheFactory.create(ds);
       AttributesFactory factory  = new AttributesFactory();
       factory.setScope(Scope.GLOBAL);
@@ -131,7 +131,7 @@ public class ClearGlobalDUnitTest extends DistributedTestCase
 
   public static void createCacheServer2() throws Exception
   { 
-    ds = (new ClearGlobalDUnitTest("temp")).getSystem(props);
+    ds = (new ClearGlobalDUnitTest()).getSystem(props);
     CacheObserverImpl observer = new CacheObserverImpl();
     origObserver = CacheObserverHolder.setInstance(observer);
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER=true;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
index bc1c8af..84445b8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
@@ -16,7 +16,27 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -25,28 +45,29 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.offheap.MemoryAllocatorImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Class <code>ClientServerGetAllDUnitTest</code> test client/server getAll.
  *
  * @since GemFire 5.7
  */
- public class ClientServerGetAllDUnitTest extends ClientServerTestCase {
-
-  public ClientServerGetAllDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class ClientServerGetAllDUnitTest extends ClientServerTestCase {
 
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
   }
 
+  @Test
   public void testGetAllFromServer() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -99,6 +120,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
     stopBridgeServer(server);
   }
 
+  @Test
   public void testOffHeapGetAllFromServer() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -151,6 +173,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
     stopBridgeServer(server);
   }
 
+  @Test
   public void testLargeOffHeapGetAllFromServer() throws Throwable {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -261,7 +284,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
 
     stopBridgeServer(server);
   }
-  
+
+  @Test
   public void testLargeGetAllFromServer() throws Throwable {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -374,6 +398,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
     stopBridgeServer(server);
   }
 
+  @Test
   public void testGetAllWithCallbackFromServer() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -425,14 +450,17 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
     stopBridgeServer(server);
   }
 
+  @Test
   public void testGetSomeFromServer() throws Exception {
     testGetFromServer(2);
   }
 
+  @Test
   public void testGetAllFromClient() throws Exception {
     testGetFromServer(5);
   }
 
+  @Test
   public void testGetAllFromServerWithPR() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -563,7 +591,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
     IgnoredException.addIgnoredException("Server unreachable", client);
     stopBridgeServer(server);
   }
-  
+
+  @Test
   public void testGetAllWithExtraKeyFromServer() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
index d46172b..35b1162 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
@@ -16,58 +16,76 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Operation;
+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.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.tier.InterestType;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableCallableIF;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This tests the fix for bug #43407 under a variety of configurations and
  * also tests that tombstones are treated in a similar manner.  The ticket
  * complains that a client that does a get(K) does not end up with the entry
  * in its cache if K is invalid on the server.
- *
  */
-public class ClientServerInvalidAndDestroyedEntryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClientServerInvalidAndDestroyedEntryDUnitTest extends JUnit4CacheTestCase {
   
-  public ClientServerInvalidAndDestroyedEntryDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
   }
   
+  @Test
   public void testClientGetsInvalidEntry() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsInvalidEntry(regionName, false, false);
   }
   
+  @Test
   public void testClientGetsInvalidEntryPR() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsInvalidEntry(regionName, true, false);
   }
 
+  @Test
   public void testClientGetsTombstone() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsTombstone(regionName, false, false);
   }
   
+  @Test
   public void testClientGetsTombstonePR() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsTombstone(regionName, true, false);
@@ -79,21 +97,25 @@ public class ClientServerInvalidAndDestroyedEntryDUnitTest extends CacheTestCase
   
   
 
+  @Test
   public void testClientGetsInvalidEntryTX() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsInvalidEntry(regionName, false, true);
   }
   
+  @Test
   public void testClientGetsInvalidEntryPRTX() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsInvalidEntry(regionName, true, true);
   }
 
+  @Test
   public void testClientGetsTombstoneTX() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsTombstone(regionName, false, true);
   }
 
+  @Test
   public void testClientGetsTombstonePRTX() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestClientGetsTombstone(regionName, true, true);
@@ -102,11 +124,13 @@ public class ClientServerInvalidAndDestroyedEntryDUnitTest extends CacheTestCase
   
   // tests for bug #46780, tombstones left in client after RI
   
+  @Test
   public void testRegisterInterestRemovesOldEntry() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestRegisterInterestRemovesOldEntry(regionName, false);
   }
   
+  @Test
   public void testRegisterInterestRemovesOldEntryPR() throws Exception {
     final String regionName = getUniqueName()+"Region";
     doTestRegisterInterestRemovesOldEntry(regionName, true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
index f9a0ea8..d7b5827 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -32,6 +41,7 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  * test client initiated transactions with concurrency checks enabled.
  */
+@Category(DistributedTest.class)
 public class ClientServerTransactionCCEDUnitTest extends
     ClientServerTransactionDUnitTest {
 
@@ -48,8 +58,8 @@ public class ClientServerTransactionCCEDUnitTest extends
    */
   private static final long serialVersionUID = -6785438240204988439L;
 
-  public ClientServerTransactionCCEDUnitTest(String name) {
-    super(name);
+  public ClientServerTransactionCCEDUnitTest() {
+    super();
   }
 
   @Override


[38/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
index dd49966..18d08c5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
@@ -16,16 +16,19 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
 import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the basic functionality of the lru eviction 
@@ -33,11 +36,12 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * 
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 public class OffHeapLRUEvictionControllerDUnitTest extends
     LRUEvictionControllerDUnitTest {
 
-  public OffHeapLRUEvictionControllerDUnitTest(String name) {
-    super(name);
+  public OffHeapLRUEvictionControllerDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java
index 3a202c6..8fb4487 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java
@@ -15,6 +15,15 @@
  * limitations under the License.
  */
 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.util.HashSet;
@@ -54,7 +63,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  *
  */
-public class PRBucketSynchronizationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PRBucketSynchronizationDUnitTest extends JUnit4CacheTestCase {
   static enum TestType {
     IN_MEMORY,
     OVERFLOW,
@@ -63,18 +73,21 @@ public class PRBucketSynchronizationDUnitTest extends CacheTestCase {
   
   public static LocalRegion TestRegion;
 
-  public PRBucketSynchronizationDUnitTest(String name) {
-    super(name);
+  public PRBucketSynchronizationDUnitTest() {
+    super();
   }
 
+  @Test
   public void testThatBucketSyncOnPrimaryLoss() {
     doBucketsSyncOnPrimaryLoss(TestType.IN_MEMORY);
   }
   
+  @Test
   public void testThatBucketsSyncOnPrimaryLossWithPersistence() {
     doBucketsSyncOnPrimaryLoss(TestType.PERSISTENT);
   }
   
+  @Test
   public void testThatBucketsSyncOnPrimaryLossWithOverflow() {
     doBucketsSyncOnPrimaryLoss(TestType.OVERFLOW);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java
index d099761..78d7db9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.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.RegionAttributes;
 import com.gemstone.gemfire.compression.Compressor;
@@ -26,11 +35,12 @@ import com.gemstone.gemfire.compression.SnappyCompressor;
  * 
  * @since GemFire 8.0
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionCompressionDUnitTest extends
     PartitionedRegionDUnitTest {
   
-  public PartitionedRegionCompressionDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionCompressionDUnitTest() {
+    super();
   }
 
   @SuppressWarnings({ "rawtypes", "unchecked" })

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
index 09084be..9896110 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
@@ -16,12 +16,16 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Random;
 import java.util.Set;
 
+import org.junit.Ignore;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.LogWriter;
@@ -48,6 +52,7 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 /**
@@ -57,63 +62,65 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  *
  * @since GemFire 5.1
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
-  
+
+  public static boolean InvalidateInvoked = false;
+
   static int oldLogLevel;
 
-  public PartitionedRegionDUnitTest(String name) {
-    super(name);
+  @Override
+  protected boolean supportsSubregions() {
+    return false;
   }
   
-  /*
-   * (non-Javadoc)
-   * @see com.gemstone.gemfire.cache30.RegionTestCase#supportsSubregions()
-   */
-  protected boolean supportsSubregions() { return false; }
-  
-  /*
-   * (non-Javadoc)
-   * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsNetLoad()
-   */
-  protected boolean supportsNetLoad() { return false; }
+  @Override
+  protected boolean supportsNetLoad() {
+    return false;
+  }
 
-  /*
-   * (non-Javadoc)
-   * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsReplication()
-   */
-  protected boolean supportsReplication() { return false; }
+  @Override
+  protected boolean supportsReplication() {
+    return false;
+  }
   
-  /*
-   * (non-Javadoc)
-   * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsTransactions()
-   */
-  protected boolean supportsTransactions() { return false; }
+  @Override
+  protected boolean supportsTransactions() {
+    return false;
+  }
   
-  /*
-   * (non-Javadoc)
-   * @see com.gemstone.gemfire.cache30.RegionTestCase#supportsLocalDestroyAndLocalInvalidate()
-   */
-  protected boolean supportsLocalDestroyAndLocalInvalidate() { return false; }
+  protected boolean supportsLocalDestroyAndLocalInvalidate() {
+    return false;
+  }
   
+  @Ignore("TODO: test is not implemented for partioned regions")
+  @Override
+  @Test
   public void testCacheLoaderModifyingArgument() throws InterruptedException {
     // TODO, implement a specific PR related test that properly reflects primary allocation
     // and event deliver based on that allocation
   }
 
+  @Ignore("TODO: test is not implemented for partioned regions")
+  @Override
+  @Test
   public void testLocalAndRemoteCacheWriters() throws InterruptedException {
     // TODO, implement a specific PR related test that properly reflects primary allocation
     // and event deliver based on that allocation
   }
 
+  @Ignore("TODO: test is not implemented for partioned regions")
+  @Override
+  @Test
   public void testLocalCacheLoader() {
     // TODO, implement a specific PR related test that properly reflects primary allocation
     // and event deliver based on that allocation
   }
-  
 
   /**
    * Returns region attributes for a partitioned region with distributed-ack scope
    */
+  @Override
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setEarlyAck(false);
@@ -163,17 +170,12 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
     }
   }
     
-  //////////////////////  Test Methods  //////////////////////
-
-  public static boolean InvalidateInvoked = false;
-  
   /**
    * Bug #47235 concerns assertion failures being thrown when there is a
    * member that receives adjunct messages (as in a WAN gateway, a peer
    * with clients, etc).
-   * 
-   * @throws Exception
    */
+  @Test
   public void testRegionInvalidationWithAdjunctMessages() throws Exception {
     final String name = getUniqueName();
     VM vm1 = Host.getHost(0).getVM(1);
@@ -213,12 +215,9 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
   /**
    * Tests the compatibility of creating certain kinds of subregions
    * of a local region.
-   *
-   * @see Region#createSubregion
    */
-  public void testIncompatibleSubregions()
-    throws CacheException, InterruptedException {
-
+  @Test
+  public void testIncompatibleSubregions() throws CacheException, InterruptedException {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -253,7 +252,6 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
         }
       });
   } 
-  
 
   private void setupExtendedTest(final String regionName, final int numVals) {
     Host host = Host.getHost(0);
@@ -313,6 +311,7 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
    * test with multiple vms and a decent spread of keys
    */
   @Category(FlakyTest.class) // GEODE-555: retry loops, use of Random
+  @Test
   public void testExtendedKeysValues() {
     final String regionName = getUniqueName();
     final int numEntries = 20000;
@@ -375,76 +374,59 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
   }
   
   // these tests make no sense for partitioned regions
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testDefinedEntryUpdated() {
-    unimplemented();
   }
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testRemoteCacheListener() {
-    unimplemented();
   }
   
-  
-  // these tests require getEntry support - need an alternative way of checking
-  // the results that can be overridden here
-//  public void testDistributedUpdate() {
-//    unimplemented();
-//  }
-//  public void testDistributedPutNoUpdate() {
-//    unimplemented();
-//  }
-//  public void testDistributedInvalidate() {
-//    unimplemented();
-//  }
-//  public void testDistributedInvalidate4() {
-//    unimplemented();
-//  }
-//  public void testContainsKey() {
-//    unimplemented();
-//  }
-//  public void testBadRegionAccess() {
-//    unimplemented();
-//  }
-//  public void testPutNonExistentEntry() {
-//    unimplemented();
-//  }
-//  public void testDestroyEntry() {
-//    unimplemented();
-//  }
-//  public void testInvalidateEntry() {
-//    unimplemented();
-//  }
-//  public void testDistributedDestroy() {
-//    unimplemented();
-//  }
-  
-
   // user attributes aren't supported in partitioned regions at this time (5.1)
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testEntryUserAttribute() {
-    unimplemented();
   }
-
   
   // these tests require misc Region operations not currently supported by PRs
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testInvalidateRegion() {
-    unimplemented();
   }
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testLocalDestroyRegion() {
-    unimplemented();
   }
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testLocalInvalidateRegion() {
-    unimplemented();
   }
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testSnapshot() {
-    unimplemented();
   }
+
+  @Ignore("Not implemented for partitioned regions")
+  @Override
+  @Test
   public void testRootSnapshot() {
-    unimplemented();
   }
 
-  private void unimplemented() {
-//    StackTraceElement stack[] = new Exception("dummy").getStackTrace();
-//    getLogWriter().info(stack[1].getClassName() + "." + stack[1].getMethodName()
-//        + ": this test is not implemented for PartitionedRegions at this time");
-  }
   static class PoisonedKey implements Serializable {
     static volatile boolean poisoned = false;
     static volatile boolean poisonDetected = false;
@@ -458,7 +440,8 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
       poisonDetected = false; // restore default static value
       return result;
     }
-    
+
+    @Override
     public int hashCode() {
       int result = k.hashCode();
       synchronized (PoisonedKey.class) {
@@ -474,7 +457,8 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
     PoisonedKey(String s) {
       this.k = s;
     }
-    
+
+    @Override
     public boolean equals(Object o) {
       if (o == null) {
         return false;
@@ -490,6 +474,7 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
     }
   }
   
+  @Test
   public void testBadHash() {
     final String regionName = getUniqueName();
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
index f4b5f12..573d62e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
@@ -20,6 +20,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.util.Arrays;
 import java.util.List;
 
@@ -36,14 +45,15 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  * @since GemFire 6.0
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionMembershipListenerDUnitTest extends
     RegionMembershipListenerDUnitTest {
   
   private transient MyRML myPRListener;
   private transient Region prr; // root region
 
-  public PartitionedRegionMembershipListenerDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionMembershipListenerDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
index b487ac7..97856d2 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
@@ -16,27 +16,27 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Partitioned Region with OffHeap memory.
  * 
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTest {
 
-  public PartitionedRegionOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
@@ -59,8 +59,8 @@ public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTes
     return props;
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
+  @SuppressWarnings({ "rawtypes", "unchecked" })
   protected RegionAttributes getRegionAttributes() {
     RegionAttributes attrs = super.getRegionAttributes();
     AttributesFactory factory = new AttributesFactory(attrs);
@@ -68,8 +68,8 @@ public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTes
     return factory.create();
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
+  @SuppressWarnings({ "rawtypes", "unchecked" })
   protected RegionAttributes getRegionAttributes(String type) {
     RegionAttributes ra = super.getRegionAttributes(type);
     AttributesFactory factory = new AttributesFactory(ra);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 3508e7c..b897603 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 GemFire 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();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
index 3f66b32..9d63376 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.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.util.HashMap;
 import java.util.Map;
 
@@ -50,15 +59,16 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 5.0
  */
-public class ProxyDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ProxyDUnitTest extends JUnit4CacheTestCase {
 
   private transient Region r;
   private transient DistributedMember otherId;
   protected transient int clInvokeCount;
   protected transient CacheEvent clLastEvent;
   
-  public ProxyDUnitTest(String name) {
-    super(name);
+  public ProxyDUnitTest() {
+    super();
   }
 
   private VM getOtherVm() {
@@ -532,13 +542,16 @@ public class ProxyDUnitTest extends CacheTestCase {
     assertTrue(r.isDestroyed());
   }
   
+  @Test
   public void testDistributedOpsPROXY() throws CacheException {
     distributedOps(DataPolicy.EMPTY, InterestPolicy.CACHE_CONTENT);
   }
 
+  @Test
   public void testRemoteOriginOpsPROXY() throws CacheException {
     remoteOriginOps(DataPolicy.EMPTY, InterestPolicy.CACHE_CONTENT);
   }
+  @Test
   public void testRemoteOriginOpsPROXY_ALL() throws CacheException {
     remoteOriginOps(DataPolicy.EMPTY, InterestPolicy.ALL);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
index a2019bf..0be9153 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
@@ -22,10 +22,15 @@
 */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+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.CacheException;
@@ -40,22 +45,16 @@ import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase {
-    
-    /** Creates a new instance of PutAllCallBkRemoteVMDUnitTest */
-    public PutAllCallBkRemoteVMDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class PutAllCallBkRemoteVMDUnitTest extends JUnit4DistributedTestCase {
     
     static volatile Cache cache;
     static Properties props = new Properties();
@@ -96,7 +95,7 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase {
     
     public static synchronized void createCacheForVM0(){
         try{
-            ds = (new PutAllCallBkRemoteVMDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllCallBkRemoteVMDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -116,7 +115,7 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase {
             CacheListener aListener = new AfterCreateCallback();
             CacheWriter aWriter = new BeforeCreateCallback();
             
-            ds = (new PutAllCallBkRemoteVMDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllCallBkRemoteVMDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -148,7 +147,8 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase {
     
     //test methods
     
-    public void testputAllRemoteVM(){
+  @Test
+  public void testputAllRemoteVM(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
@@ -214,7 +214,8 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase {
         
     }
     
-    public void testPutAllAfterUpdateCallbacks(){
+  @Test
+  public void testPutAllAfterUpdateCallbacks(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
index faeb8b3..db3e9e9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
@@ -22,10 +22,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+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.CacheException;
@@ -40,17 +45,14 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{
-    
-    /** Creates a new instance of PutAllCallBkSingleVMDUnitTest */
-    public PutAllCallBkSingleVMDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class PutAllCallBkSingleVMDUnitTest extends JUnit4DistributedTestCase {
     
     static volatile Cache cache;
     static Properties props = new Properties();
@@ -89,7 +91,7 @@ public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{
         try{
             CacheListener aListener = new AfterCreateCallback();
             CacheWriter aWriter = new BeforeCreateCallback();            
-            ds = (new PutAllCallBkSingleVMDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllCallBkSingleVMDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -118,7 +120,8 @@ public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{
     }
 
     //test methods
-    public void testputAllSingleVM(){
+  @Test
+  public void testputAllSingleVM(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 cee7263..f6f2198 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
@@ -22,11 +22,16 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 import java.util.TreeMap;
 
+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.CacheException;
@@ -38,21 +43,15 @@ import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.RegionDestroyedException;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class PutAllMultiVmDUnitTest extends DistributedTestCase{
-    
-    /** Creates a new instance of PutAllMultiVmDUnitTest */
-    public PutAllMultiVmDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class PutAllMultiVmDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
     static Cache cache;
     static Properties props = new Properties();
@@ -84,7 +83,7 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
     
     public static void createCache(){
         try{
-            ds = (new PutAllMultiVmDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllMultiVmDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -122,7 +121,8 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
     
     //tests methods
     
-    public void testSimplePutAll(){
+  @Test
+  public void testSimplePutAll(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -226,7 +226,8 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
         
     }//end of testSimplePutAll
     
-    public void testPutAllExceptions(){
+  @Test
+  public void testPutAllExceptions(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -326,7 +327,8 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
         
     }//end of testPutAllExceptions
     
-    public void testPutAllExceptionHandling(){
+  @Test
+  public void testPutAllExceptionHandling(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
 //        VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 7a98188..590166b 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
@@ -16,39 +16,54 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.internal.cache.CachePerfStats;
-import com.gemstone.gemfire.internal.cache.DistributedRegion;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.TreeMap;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheEvent;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
+import com.gemstone.gemfire.internal.cache.CachePerfStats;
+import com.gemstone.gemfire.internal.cache.DistributedRegion;
+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.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test to make sure message queuing works.
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class QueueMsgDUnitTest extends ReliabilityTestCase {
 
-  public QueueMsgDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Make sure that cache operations are queued when a required role is missing
    */
-  public void disabled_testQueueWhenRoleMissing() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testQueueWhenRoleMissing() throws Exception {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
-//     factory.setMembershipAttributes(
-//       new MembershipAttributes(new String[]{"missing"},
-//                                 LossAction.FULL_ACCESS_WITH_QUEUING,
-//                                 ResumptionAction.NONE));
     DistributedRegion r = (DistributedRegion)createRootRegion(factory.create());
     final CachePerfStats stats = r.getCachePerfStats();
     int queuedOps = stats.getReliableQueuedOps();
@@ -207,13 +222,11 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase {
   /**
    * Make sure a queued region does not allow non-queued subscribers
    */
-  public void disabled_testIllegalConfigQueueExists() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testIllegalConfigQueueExists() throws Exception {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
-//     factory.setMembershipAttributes(
-//       new MembershipAttributes(new String[]{"pubFirst"},
-//                                 LossAction.FULL_ACCESS_WITH_QUEUING,
-//                                 ResumptionAction.NONE));
     createRootRegion(factory.create());
 
     VM vm = Host.getHost(0).getVM(0);
@@ -247,11 +260,14 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase {
         }
       });
   }
+
   /**
    * Make sure a subscriber that does not allow queued messages causes a
    * queued publisher to fail creation
    */
-  public void disable_testIllegalConfigSubscriberExists() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testIllegalConfigSubscriberExists() throws Exception {
     final String expectedExceptions = "does not allow queued messages";
 
     VM vm = Host.getHost(0).getVM(0);
@@ -277,11 +293,7 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase {
 
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
-//     factory.setMembershipAttributes(
-//       new MembershipAttributes(new String[]{"subFirst"},
-//                                 LossAction.FULL_ACCESS_WITH_QUEUING,
-//                                 ResumptionAction.NONE));
-    getCache().getLogger().info("<ExpectedException action=add>" + 
+    getCache().getLogger().info("<ExpectedException action=add>" +
                                 expectedExceptions + "</ExpectedException>");
     try {
       createRootRegion(factory.create());
@@ -292,7 +304,4 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase {
                                   expectedExceptions + "</ExpectedException>");
     }
   }
-  public void testEmpty() {
-    // just to dunit happy
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
index fc69bda..a46bbab 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
@@ -15,6 +15,15 @@
  * limitations under the License.
  */
 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.*;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
@@ -29,7 +38,8 @@ import com.gemstone.gemfire.test.dunit.*;
  * 
  *
  */
-public class RRSynchronizationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RRSynchronizationDUnitTest extends JUnit4CacheTestCase {
   static enum TestType {
     IN_MEMORY,
     OVERFLOW,
@@ -38,18 +48,21 @@ public class RRSynchronizationDUnitTest extends CacheTestCase {
   
   public static LocalRegion TestRegion;
 
-  public RRSynchronizationDUnitTest(String name) {
-    super(name);
+  public RRSynchronizationDUnitTest() {
+    super();
   }
 
+  @Test
   public void testThatRegionsSyncOnPeerLoss() {
     doRegionsSyncOnPeerLoss(TestType.IN_MEMORY);
   }
   
+  @Test
   public void testThatRegionsSyncOnPeerLossWithPersistence() {
     doRegionsSyncOnPeerLoss(TestType.PERSISTENT);
   }
   
+  @Test
   public void testThatRegionsSyncOnPeerLossWithOverflow() {
     doRegionsSyncOnPeerLoss(TestType.OVERFLOW);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
index a3ad8f5..f7a9830 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.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.CancelException;
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.*;
@@ -50,7 +59,8 @@ import java.util.concurrent.TimeUnit;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 @SuppressWarnings("serial")
-public class ReconnectDUnitTest extends CacheTestCase
+@Category(DistributedTest.class)
+public class ReconnectDUnitTest extends JUnit4CacheTestCase
 {
   static int locatorPort;
   static Locator locator;
@@ -62,8 +72,8 @@ public class ReconnectDUnitTest extends CacheTestCase
   static Properties dsProperties;
   static String fileSeparator = File.separator;
 
-  public ReconnectDUnitTest(String name) {
-    super(name);
+  public ReconnectDUnitTest() {
+    super();
   }
   
   @Override
@@ -169,6 +179,7 @@ public class ReconnectDUnitTest extends CacheTestCase
   }
 
 
+  @Test
   public void testReconnectWithQuorum() throws Exception {
     // quorum check fails, then succeeds
     IgnoredException.addIgnoredException("killing member's ds");
@@ -230,6 +241,7 @@ public class ReconnectDUnitTest extends CacheTestCase
 
   }
   
+  @Test
   public void testReconnectOnForcedDisconnect() throws Exception  {
     doTestReconnectOnForcedDisconnect(false);
   }
@@ -237,6 +249,7 @@ public class ReconnectDUnitTest extends CacheTestCase
   /** bug #51335 - customer is also trying to recreate the cache */
   // this test is disabled due to a high failure rate during CI test runs.
   // see bug #52160
+  @Test
   public void testReconnectCollidesWithApplication() throws Exception  {
     doTestReconnectOnForcedDisconnect(true);
   }
@@ -457,6 +470,7 @@ public class ReconnectDUnitTest extends CacheTestCase
   
 
   @Category(FlakyTest.class) // GEODE-1407
+  @Test
   public void testReconnectALocator() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -611,6 +625,7 @@ public class ReconnectDUnitTest extends CacheTestCase
    * see if the reconnect is triggered for the configured number of times
    */
   
+  @Test
   public void testReconnectWithRoleLoss() throws TimeoutException,
       RegionExistsException  {
 
@@ -1027,6 +1042,7 @@ public class ReconnectDUnitTest extends CacheTestCase
    * listener to crash the reconnecting distributed system during cache
    * creation and asserts that it then reconnects and rebuilds the cache.
    */
+  @Test
   public void testReconnectFailsInCacheCreation() throws Exception {
 
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
index df2699e..3735e13 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
@@ -15,6 +15,15 @@
  * limitations under the License.
  */
 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.Cache;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -25,10 +34,11 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershi
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 
 
-public class ReconnectedCacheServerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ReconnectedCacheServerDUnitTest extends JUnit4CacheTestCase {
 
-  public ReconnectedCacheServerDUnitTest(String name) {
-    super(name);
+  public ReconnectedCacheServerDUnitTest() {
+    super();
   }
 
   private static final long serialVersionUID = 1L;
@@ -56,6 +66,7 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testCacheServerConfigRetained() {
     // make sure the environment isn't polluted
     assertFalse(Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile"));
@@ -72,6 +83,7 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase {
     assertNotNull(gc.getCacheConfig().getCacheServerCreation());
   }
 
+  @Test
   public void testDefaultCacheServerNotCreatedOnReconnect() {
 
     assertFalse(Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile"));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java
index 588ed82..8e2782e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.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.*;
 import com.gemstone.gemfire.cache.Region.Entry;
 
@@ -37,8 +46,8 @@ import java.util.Properties;
 public abstract class RegionAttributesTestCase
   extends RegionTestCase {
 
-  public RegionAttributesTestCase(String name) {
-    super(name);
+  public RegionAttributesTestCase() {
+    super();
   }
 
   protected static class TestExpiry implements CustomExpiry, Declarable {
@@ -76,6 +85,7 @@ public abstract class RegionAttributesTestCase
    * region's attributes.  Also tests the return values of the mutator
    * methods.
    */
+  @Test
   public void testAttributesMutator() throws CacheException {
     String name = this.getUniqueName();
     AttributesFactory fac = new AttributesFactory(getRegionAttributes());
@@ -160,6 +170,7 @@ public abstract class RegionAttributesTestCase
    * Tests sending <code>null</code> or bogus values to an {@link
    * AttributesMutator}.
    */
+  @Test
   public void testAttributesMutatorBogus() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -233,6 +244,7 @@ public abstract class RegionAttributesTestCase
   }
 
   /** Test to make sure region attributes take */
+  @Test
   public void testRegionAttributes() throws CacheException {
     // @todo for now just test concurrencyLevel, add tests for the rest
     AttributesFactory factory = new AttributesFactory();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
index c471ddf..1acc802 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.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.ExpirationAction;
@@ -38,10 +47,11 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  *
  * @since GemFire 3.0
  */
-public class RegionExpirationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RegionExpirationDUnitTest extends JUnit4CacheTestCase {
 
-  public RegionExpirationDUnitTest(String name) {
-    super(name);
+  public RegionExpirationDUnitTest() {
+    super();
   }
 
 //  /**
@@ -58,6 +68,7 @@ public class RegionExpirationDUnitTest extends CacheTestCase {
    * Test internal methods that encode & decode time
    */
   /* The encode and decode time methods are now private in MetaMap
+  @Test
   public void testTimeEncoding() throws CacheException {
     Region r = createRegion(getUniqueName(), getRegionAttributes());
     long start = ((InternalDistributedSystem)getCache().getDistributedSystem()).getStartTime();
@@ -74,30 +85,35 @@ public class RegionExpirationDUnitTest extends CacheTestCase {
   }
    */
 
+  @Test
   public void testRegionTTLLocalDestroy()
   throws CacheException, InterruptedException
   {
     _testRegionTTL(getUniqueName(), ExpirationAction.LOCAL_DESTROY);
   }
 
+  @Test
   public void testRegionTTLDestroy()
   throws CacheException, InterruptedException
   {
     _testRegionTTL(getUniqueName(), ExpirationAction.DESTROY);
   }
 
+  @Test
   public void testRegionTTLLocalInvalidate()
   throws CacheException, InterruptedException
   {
     _testRegionTTL(getUniqueName(), ExpirationAction.LOCAL_INVALIDATE);
   }
 
+  @Test
   public void testRegionTTLInvalidate()
   throws CacheException, InterruptedException
   {
     _testRegionTTL(getUniqueName(), ExpirationAction.INVALIDATE);
   }
 
+  @Test
   public void testRegionTTLAfterMutating()
   throws InterruptedException, CacheException
   {
@@ -129,6 +145,7 @@ public class RegionExpirationDUnitTest extends CacheTestCase {
     Wait.waitForCriterion(wc, 30 * 1000, 1000, true);
   }
 
+  @Test
   public void testWhenBothTtlAndIdleAreSet() 
   throws InterruptedException, CacheException
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 8485d52..156577a 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
@@ -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.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -48,7 +57,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  *
  * @since GemFire 5.0
  */
-public class RegionMembershipListenerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RegionMembershipListenerDUnitTest extends JUnit4CacheTestCase {
 
   private transient MyRML myListener;
   private transient MyRML mySRListener;
@@ -56,8 +66,8 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
   private transient Region sr; // subregion
   protected transient DistributedMember otherId;
   
-  public RegionMembershipListenerDUnitTest(String name) {
-    super(name);
+  public RegionMembershipListenerDUnitTest() {
+    super();
   }
   
   @Override
@@ -163,6 +173,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
   /**
    * tests {@link RegionMembershipListener#initialMembers}
    */
+  @Test
   public void testInitialMembers() throws CacheException {
     final String rName = getUniqueName();
     initOtherId();
@@ -204,6 +215,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
   /**
    * tests {@link RegionMembershipListener#afterRemoteRegionCreate}
    */
+  @Test
   public void testCreate() throws CacheException {
     final String rName = getUniqueName();
     initOtherId();
@@ -237,6 +249,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
   /**
    * tests {@link RegionMembershipListener#afterRemoteRegionDeparture}
    */
+  @Test
   public void testDeparture() throws CacheException {
     final String rName = getUniqueName();
     initOtherId();
@@ -281,6 +294,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
   /**
    * tests {@link RegionMembershipListener#afterRemoteRegionCrash}
    */
+  @Test
   public void testCrash() throws CacheException {
     final String rName = getUniqueName();
     initOtherId();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
index e639ce0..ec8b1af 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.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.*;
 
 /**
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.cache.*;
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class RegionReliabilityDistAckDUnitTest extends RegionReliabilityTestCase {
 
-  public RegionReliabilityDistAckDUnitTest(String name) {
-    super(name);
+  public RegionReliabilityDistAckDUnitTest() {
+    super();
   }
   
   protected Scope getRegionScope() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
index 46b3f2e..b2b6e09 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.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.*;
 
 /**
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.cache.*;
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class RegionReliabilityDistNoAckDUnitTest extends RegionReliabilityTestCase {
 
-  public RegionReliabilityDistNoAckDUnitTest(String name) {
-    super(name);
+  public RegionReliabilityDistNoAckDUnitTest() {
+    super();
   }
   
   protected Scope getRegionScope() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
index 3e44012..5ca3761 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.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.*;
 
 /**
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.cache.*;
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class RegionReliabilityGlobalDUnitTest extends RegionReliabilityTestCase {
 
-  public RegionReliabilityGlobalDUnitTest(String name) {
-    super(name);
+  public RegionReliabilityGlobalDUnitTest() {
+    super();
   }
   
   protected Scope getRegionScope() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
index fc088ee..614e541 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
@@ -16,34 +16,51 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionRoleListener;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.RoleEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.RegionRoleListenerAdapter;
 import com.gemstone.gemfire.distributed.Role;
 import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 /**
  * Tests the functionality of the {@link RegionRoleListener} class.
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class RegionReliabilityListenerDUnitTest extends ReliabilityTestCase {
 
   protected static transient Set rolesGain = null;
   protected static transient Set rolesLoss = null;
   
-  public RegionReliabilityListenerDUnitTest(String name) {
-    super(name);
+  public RegionReliabilityListenerDUnitTest() {
+    super();
   }
   
   /**
    * Tests the notification of afterRoleGain and afterRoleLoss
    */
+  @Test
   public void testRoleGainAndLoss() throws Exception {
     final String name = this.getUniqueName();
     final int vm0 = 0;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
index bf5c2c8..ea369eb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
@@ -16,7 +16,44 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CommitDistributionException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAccessException;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionDistributionException;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionMembershipListener;
+import com.gemstone.gemfire.cache.RegionReinitializedException;
+import com.gemstone.gemfire.cache.RequiredRoles;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.query.Query;
 import com.gemstone.gemfire.cache.query.QueryService;
 import com.gemstone.gemfire.cache.util.RegionMembershipListenerAdapter;
@@ -25,17 +62,21 @@ import com.gemstone.gemfire.distributed.internal.DM;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
-import com.gemstone.gemfire.internal.cache.*;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.internal.cache.AbstractRegion;
+import com.gemstone.gemfire.internal.cache.DistributedCacheOperation;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.TXManagerImpl;
+import com.gemstone.gemfire.internal.cache.TXState;
+import com.gemstone.gemfire.internal.cache.TXStateInterface;
+import com.gemstone.gemfire.internal.cache.TXStateProxyImpl;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.*;
-import java.util.concurrent.locks.Lock;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 /**
  * Tests region reliability defined by MembershipAttributes.
@@ -44,19 +85,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  */
 public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
 
-  public RegionReliabilityTestCase(String name) {
-    super(name);
-  }
-
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     DistributedCacheOperation.setBeforePutOutgoing(null);
   }
 
-  // -------------------------------------------------------------------------
-  // Configuration and setup methods
-  // -------------------------------------------------------------------------
-  
   /** Returns scope to execute tests under. */
   protected abstract Scope getRegionScope();
   
@@ -416,6 +449,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of NO_ACCESS on region operations.
    */
+  @Test
   public void testNoAccess() throws Exception {
     final String name = this.getUniqueName();
     
@@ -502,6 +536,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of NO_ACCESS on local entry expiration actions.
    */
+  @Test
   public void testNoAccessWithLocalEntryExpiration() throws Exception {
     final String name = this.getUniqueName();
     
@@ -583,6 +618,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of NO_ACCESS on local region expiration actions.
    */
+  @Test
   public void testNoAccessWithLocalRegionExpiration() throws Exception {
     final String name = this.getUniqueName();
     
@@ -641,6 +677,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of LIMITED_ACCESS on region operations.
    */
+  @Test
   public void testLimitedAccess() throws Exception {
     final String name = this.getUniqueName();
     
@@ -724,6 +761,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of LIMITED_ACCESS on local entry expiration actions.
    */
+  @Test
   public void testLimitedAccessWithLocalEntryExpiration() throws Exception {
     final String name = this.getUniqueName();
     
@@ -812,6 +850,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of LIMITED_ACCESS on local region expiration actions.
    */
+  @Test
   public void testLimitedAccessWithLocalRegionExpiration() throws Exception {
     final String name = this.getUniqueName();
     
@@ -855,6 +894,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of FULL_ACCESS on region operations.
    */
+  @Test
   public void testFullAccess() throws Exception {
     final String name = this.getUniqueName();
     
@@ -919,6 +959,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
    * Tests affect of FULL_ACCESS on local entry expiration actions.
    */
   @Category(FlakyTest.class) // GEODE-447: time sensitive, expiration, waitForMemberTimeout is unimplemented
+  @Test
   public void testFullAccessWithLocalEntryExpiration() throws Exception {
     final String name = this.getUniqueName();
     
@@ -992,6 +1033,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   /**
    * Tests affect of FULL_ACCESS on local region expiration actions.
    */
+  @Test
   public void testFullAccessWithLocalRegionExpiration() throws Exception {
     final String name = this.getUniqueName();
     
@@ -1033,6 +1075,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   
   protected static Boolean[] detectedDeparture_testCommitDistributionException = 
     { Boolean.FALSE };
+  @Test
   public void testCommitDistributionException() throws Exception {
     if (getRegionScope().isGlobal()) return; // skip test under Global
     if (getRegionScope().isDistributedNoAck()) return; // skip test under DistributedNoAck
@@ -1156,6 +1199,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
   
   protected static Boolean[] detectedDeparture_testRegionDistributionException = 
     { Boolean.FALSE };
+  @Test
   public void testRegionDistributionException() throws Exception {
     if (getRegionScope().isDistributedNoAck()) return; // skip test under DistributedNoAck
     
@@ -1323,6 +1367,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
     }
   }
 
+  @Test
   public void testReinitialization() throws Exception {
     final String name = this.getUniqueName();
     final String roleA = name+"-A";


[05/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
index a4842de..d8fff8b 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
@@ -16,16 +16,51 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.CqAttributes;
+import com.gemstone.gemfire.cache.query.CqAttributesFactory;
+import com.gemstone.gemfire.cache.query.CqAttributesMutator;
+import com.gemstone.gemfire.cache.query.CqExistsException;
+import com.gemstone.gemfire.cache.query.CqListener;
+import com.gemstone.gemfire.cache.query.CqQuery;
+import com.gemstone.gemfire.cache.query.IndexType;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.Struct;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.CqStateImpl;
 import com.gemstone.gemfire.cache.query.internal.DefaultQueryService;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
@@ -35,22 +70,27 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * This class tests the ContiunousQuery mechanism in GemFire.
+ * This class tests the ContinuousQuery mechanism in GemFire.
  * It does so by creating a cache server with a cache and a pre-defined region and
  * a data loader. The client creates the same region and attaches the connection pool.
- * 
- *
  */
-public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqQueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
   
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
@@ -113,7 +153,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       "SELECT ALL * FROM /root/" + regions[0] + " p where p.ID > 0 and p.status='active'",
       //11 - Test for "No Alias" 
       "SELECT ALL * FROM /root/" + regions[0] + " where ID > 0",
-      
   };
   
   private String[] invalidCQs = new String [] {
@@ -121,10 +160,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       "SELECT ALL * FROM /root/invalidRegion p where p.ID > 0"
   };
   
-  public CqQueryUsingPoolDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     //We're seeing this on the server when the client
@@ -138,6 +173,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // system before creating connection pools
     getSystem();
     Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
+      @Override
       public void run() {
         getSystem();
       }
@@ -173,6 +209,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   {
     SerializableRunnable createServer = new CacheSerializableRunnable(
         "Create Cache Server") {
+      @Override
       public void run2() throws CacheException
       {
         LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
@@ -198,7 +235,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         catch (Exception ex) {
           Assert.fail("While starting CacheServer", ex);
         }
-        
       }
     };
 
@@ -216,46 +252,40 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   {
     SerializableRunnable createServer = new CacheSerializableRunnable(
         "Create Cache Server") {
+      @Override
       public void run2() throws CacheException
       {
-          LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
-          //AttributesFactory factory = new AttributesFactory();
-          //factory.setScope(Scope.DISTRIBUTED_ACK);
-          //factory.setMirrorType(MirrorType.KEYS_VALUES);
-          
-          //int maxMem = 0;
-          AttributesFactory attr = new AttributesFactory();
-          //attr.setValueConstraint(valueConstraint);
-          PartitionAttributesFactory paf = new PartitionAttributesFactory();
-          if (isAccessor){
-            paf.setLocalMaxMemory(0);
-          }
-          PartitionAttributes prAttr = paf.setTotalNumBuckets(197).setRedundantCopies(redundantCopies).create();
-          attr.setPartitionAttributes(prAttr);
-          
-          assertFalse(getSystem().isLoner());
-          //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
-          for (int i = 0; i < regions.length; i++) {
-            Region r = createRegion(regions[i], attr.create());
-            LogWriterUtils.getLogWriter().info("Server created the region: "+r);
-          }
-          try {
-            startBridgeServer(port, true);
-          }
-          catch (Exception ex) {
-            Assert.fail("While starting CacheServer", ex);
-          }
-       
+        LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
+
+        AttributesFactory attr = new AttributesFactory();
+        PartitionAttributesFactory paf = new PartitionAttributesFactory();
+        if (isAccessor){
+          paf.setLocalMaxMemory(0);
+        }
+        PartitionAttributes prAttr = paf.setTotalNumBuckets(197).setRedundantCopies(redundantCopies).create();
+        attr.setPartitionAttributes(prAttr);
+
+        assertFalse(getSystem().isLoner());
+        for (int i = 0; i < regions.length; i++) {
+          Region r = createRegion(regions[i], attr.create());
+          LogWriterUtils.getLogWriter().info("Server created the region: "+r);
+        }
+        try {
+          startBridgeServer(port, true);
+        }
+        catch (Exception ex) {
+          Assert.fail("While starting CacheServer", ex);
+        }
       }
     };
 
     server.invoke(createServer);
   }
-  
-  
+
   /* Close Cache Server */
   public void closeServer(VM server) {
     server.invoke(new SerializableRunnable("Close CacheServer") {
+      @Override
       public void run() {
         LogWriterUtils.getLogWriter().info("### Close CacheServer. ###");
         stopBridgeServer(getCache());
@@ -274,6 +304,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       final String poolName) {
     SerializableRunnable createQService =
       new CacheSerializableRunnable("Create Client") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Create Client. ###");
         //Region region1 = null;
@@ -308,19 +339,19 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     client.invoke(createQService);
   }
 
-
   /* Close Client */
   public void closeClient(VM client) {
     SerializableRunnable closeCQService =
       new CacheSerializableRunnable("Close Client") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Close Client. ###");
         try {
           ((DefaultQueryService)getCache().getQueryService()).closeCqService();
         } catch (Exception ex) {
           LogWriterUtils.getLogWriter().info("### Failed to get CqService during ClientClose() ###");
+          //TODO: fix eaten exception
         }
-        
       }
     };
     
@@ -330,17 +361,20 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
 
   public void createFunctionalIndex(VM vm, final String indexName, final String indexedExpression, final String fromClause) {
     vm.invoke(new CacheSerializableRunnable("Create Functional Index") {
+      @Override
       public void run2() throws CacheException {
         QueryService qs = null;
         try {
           qs = getCache().getQueryService();
         }catch (Exception ex) {
           LogWriterUtils.getLogWriter().info("### Failed to get CqService during ClientClose() ###");
+          //TODO: fix eaten exception
         }
         try {
           qs.createIndex(indexName, IndexType.FUNCTIONAL, indexedExpression, fromClause);
         } catch (Exception ex) {
           LogWriterUtils.getLogWriter().info("### Failed to create Index :" + indexName);
+          //TODO: fix eaten exception
         }
       }
     });
@@ -349,6 +383,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Create/Init values */
   public void createValues(VM vm, final String regionName, final int size) {
     vm.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regionName);
         for (int i = 1; i <= size; i++) {
@@ -362,6 +397,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Create/Init values */
   public void createValuesWithTime(VM vm, final String regionName, final int size) {
     vm.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regionName);
         for (int i = 1; i <= size; i++) {
@@ -377,6 +413,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* delete values */
   public void deleteValues(VM vm, final String regionName, final int size) {
     vm.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regionName);
         for (int i = 1; i <= size; i++) {
@@ -393,6 +430,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
    */  
   public void invalidateValues(VM vm, final String regionName, final int size) {
     vm.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regionName);
         for (int i = 1; i <= size; i++) {
@@ -414,6 +452,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   public void createPool(VM vm, final String poolName, final String[] servers, final int[] ports, final String redundancyLevel) {
     vm.invoke(new CacheSerializableRunnable("createPool :" + poolName) {
+      @Override
       public void run2() throws CacheException {
         // Create Cache.
         getCache();
@@ -440,11 +479,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Register CQs */
   public void createCQ(VM vm, final String poolName, final String cqName, final String queryStr) {
     vm.invoke(new CacheSerializableRunnable("Create CQ :" + cqName) {
+      @Override
       public void run2() throws CacheException {
-        //pause(60 * 1000);
-        //getLogWriter().info("### DEBUG CREATE CQ START ####");
-        //pause(20 * 1000);
-        
         LogWriterUtils.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService qService = null;
@@ -476,6 +512,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   // REMOVE..........
   public void createCQ(VM vm, final String cqName, final String queryStr) {
     vm.invoke(new CacheSerializableRunnable("Create CQ :" + cqName) {
+      @Override
       public void run2() throws CacheException {
         //pause(60 * 1000);
         //getLogWriter().info("### DEBUG CREATE CQ START ####");
@@ -512,6 +549,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Register CQs  with no name, execute, and close*/
   public void createAndExecCQNoName(VM vm, final String poolName,  final String queryStr) {
     vm.invoke(new CacheSerializableRunnable("Create CQ with no name:" ) {
+      @Override
       public void run2() throws CacheException {
         //pause(60 * 1000);
         LogWriterUtils.getLogWriter().info("### DEBUG CREATE CQ START ####");
@@ -607,91 +645,79 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       final int expectedResultsSize,
       final String[] expectedKeys,
       final String expectedErr) {
+
     vm.invoke(new CacheSerializableRunnable("Execute CQ :" + cqName) {
 
       private void work() throws CacheException {
-      //pause(60 * 1000);
-      LogWriterUtils.getLogWriter().info("### DEBUG EXECUTE CQ START ####");
-      //pause(20 * 1000);
-      
-      // Get CQ Service.
-      QueryService cqService = null;
-      CqQuery cq1 = null;
-//    try {
-      cqService = getCache().getQueryService();
-//    } catch (Exception cqe) {
-//    getLogWriter().error(cqe);
-//    AssertionError err = new AssertionError("Failed to get QueryService" + cqName);
-//    err.initCause(ex);
-//    throw err;
-//    fail("Failed to getCQService.");
-//    }
-      
-      // Get CqQuery object.
-      try {
-        cq1 = cqService.getCq(cqName);
-        if (cq1 == null) {
-          LogWriterUtils.getLogWriter().info("Failed to get CqQuery object for CQ name: " + cqName);
-          fail("Failed to get CQ " + cqName);
-        }
-        else {
-          LogWriterUtils.getLogWriter().info("Obtained CQ, CQ name: " + cq1.getName());
-          assertTrue("newCq() state mismatch", cq1.getState().isStopped());
-        }
-      } catch (Exception ex){
-        LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
-        LogWriterUtils.getLogWriter().error(ex);
-        Assert.fail("Failed to execute  CQ " + cqName, ex);
-      }
-      
-      if (initialResults) {
-        SelectResults cqResults = null;
-        
+        LogWriterUtils.getLogWriter().info("### DEBUG EXECUTE CQ START ####");
+
+        // Get CQ Service.
+        QueryService cqService = null;
+        CqQuery cq1 = null;
+        cqService = getCache().getQueryService();
+
+        // Get CqQuery object.
         try {
-          cqResults = cq1.executeWithInitialResults();
+          cq1 = cqService.getCq(cqName);
+          if (cq1 == null) {
+            LogWriterUtils.getLogWriter().info("Failed to get CqQuery object for CQ name: " + cqName);
+            fail("Failed to get CQ " + cqName);
+          }
+          else {
+            LogWriterUtils.getLogWriter().info("Obtained CQ, CQ name: " + cq1.getName());
+            assertTrue("newCq() state mismatch", cq1.getState().isStopped());
+          }
         } catch (Exception ex){
           LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
-          ex.printStackTrace();
-          AssertionError err = new AssertionError("Failed to execute  CQ " + cqName);
-          err.initCause(ex);
-          throw err;
-        }
-        LogWriterUtils.getLogWriter().info("initial result size = " + cqResults.size());
-        assertTrue("executeWithInitialResults() state mismatch", cq1.getState().isRunning());
-        if (expectedResultsSize >= 0) {
-          assertEquals("Unexpected results size for CQ: " + cqName + 
-              " CQ Query :" + cq1.getQueryString(), 
-              expectedResultsSize, cqResults.size());
-        }
-        
-        if (expectedKeys != null) {
-          HashSet resultKeys = new HashSet();
-          for (Object o : cqResults.asList()) {
-            Struct s = (Struct)o;
-            resultKeys.add(s.get("key"));
+          LogWriterUtils.getLogWriter().error(ex);
+          Assert.fail("Failed to execute  CQ " + cqName, ex);
+        }
+
+        if (initialResults) {
+          SelectResults cqResults = null;
+
+          try {
+            cqResults = cq1.executeWithInitialResults();
+          } catch (Exception ex){
+            fail("Failed to execute  CQ " + cqName, ex);
           }
-          for (int i =0; i < expectedKeys.length; i++){
-            assertTrue("Expected key :" +  expectedKeys[i] + 
-                " Not found in CqResults for CQ: " + cqName + 
-              " CQ Query :" + cq1.getQueryString() + 
-              " Keys in CqResults :" + resultKeys,
-              resultKeys.contains(expectedKeys[i]));
+          LogWriterUtils.getLogWriter().info("initial result size = " + cqResults.size());
+          assertTrue("executeWithInitialResults() state mismatch", cq1.getState().isRunning());
+          if (expectedResultsSize >= 0) {
+            assertEquals("Unexpected results size for CQ: " + cqName +
+                " CQ Query :" + cq1.getQueryString(),
+                expectedResultsSize, cqResults.size());
+          }
+
+          if (expectedKeys != null) {
+            HashSet resultKeys = new HashSet();
+            for (Object o : cqResults.asList()) {
+              Struct s = (Struct)o;
+              resultKeys.add(s.get("key"));
+            }
+            for (int i =0; i < expectedKeys.length; i++){
+              assertTrue("Expected key :" +  expectedKeys[i] +
+                  " Not found in CqResults for CQ: " + cqName +
+                " CQ Query :" + cq1.getQueryString() +
+                " Keys in CqResults :" + resultKeys,
+                resultKeys.contains(expectedKeys[i]));
+            }
           }
         }
-      } 
-      else {
-        try {
-          cq1.execute();
-        } catch (Exception ex){
-          if (expectedErr == null) {
-            LogWriterUtils.getLogWriter().info("CqService is :" + cqService, ex);
+        else {
+          try {
+            cq1.execute();
+          } catch (Exception ex){
+            if (expectedErr == null) {
+              LogWriterUtils.getLogWriter().info("CqService is :" + cqService, ex);
+            }
+            Assert.fail("Failed to execute  CQ " + cqName, ex);
           }
-          Assert.fail("Failed to execute  CQ " + cqName, ex);
+          assertTrue("execute() state mismatch", cq1.getState().isRunning());
         }
-        assertTrue("execute() state mismatch", cq1.getState().isRunning());
       }
-    }
-      
+
+      @Override
       public void run2() throws CacheException {
         if (expectedErr != null) {
           getCache().getLogger().info("<ExpectedException action=add>"
@@ -699,7 +725,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         }
         try {
           work();
-        } 
+        }
         finally {
           if (expectedErr != null) {
             getCache().getLogger().info("<ExpectedException action=remove>"
@@ -707,12 +733,13 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
           }
         }
       }
-      });   
+    });
   }
   
   /* Stop/pause CQ */
   public void stopCQ(VM vm, final String cqName) throws Exception {
     vm.invoke(new CacheSerializableRunnable("Stop CQ :" + cqName) {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Stop CQ. ###" + cqName);
         // Get CQ Service.
@@ -740,6 +767,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Stop/pause CQ */
   private void stopExecCQ(VM vm, final String cqName, final int count) throws Exception {
     vm.invoke(new CacheSerializableRunnable("Stop CQ :" + cqName) {
+      @Override
       public void run2() throws CacheException {
         CqQuery cq1 = null;
         LogWriterUtils.getLogWriter().info("### Stop and Exec CQ. ###" + cqName);
@@ -782,11 +810,11 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       }
     });
   }
-  
-  
+
   /* UnRegister CQs */
   public void closeCQ(VM vm, final String cqName) throws Exception {
     vm.invoke(new CacheSerializableRunnable("Close CQ :" + cqName) {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Close CQ. ###" + cqName);
         // Get CQ Service.
@@ -813,6 +841,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Register CQs */
   public void registerInterestListCQ(VM vm, final String regionName, final int keySize, final boolean all) {
     vm.invoke(new CacheSerializableRunnable("Register InterestList and CQ") {
+      @Override
       public void run2() throws CacheException {
         
         // Get CQ Service.
@@ -821,10 +850,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
           region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         } catch (Exception cqe) {
-          AssertionError err = new AssertionError("Failed to get Region.");
-          err.initCause(cqe);
-          throw err;
-
+          fail("Failed to get Region.", cqe);
         }
         
         try {
@@ -838,9 +864,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
             region.registerInterest(list);
           }
         } catch (Exception ex) {
-          AssertionError err = new AssertionError("Failed to Register InterestList");
-          err.initCause(ex);
-          throw err;
+          fail("Failed to Register InterestList", ex);
         }
       }
     });   
@@ -849,6 +873,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /* Validate CQ Count */
   public void validateCQCount(VM vm, final int cqCnt) throws Exception {
     vm.invoke(new CacheSerializableRunnable("validate cq count") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         
@@ -863,20 +888,20 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         try {
           numCqs = cqService.getCqs().length;
         } catch (Exception ex) {
-          Assert.fail ("Failed to get the CQ Count.", ex);
+          Assert.fail("Failed to get the CQ Count.", ex);
         }
         assertEquals("Number of cqs mismatch.", cqCnt, numCqs);
       }
     });
   }
   
-  
-  /** 
+  /**
    * Throws AssertionError if the CQ can be found or if any other
    * error occurs
    */
   private void failIfCQExists(VM vm, final String cqName) {
     vm.invoke(new CacheSerializableRunnable("Fail if CQ exists") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Fail if CQ Exists. ### " + cqName);
         // Get CQ Service.
@@ -898,6 +923,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   private void validateCQError(VM vm, final String cqName,
       final int numError) {
     vm.invoke(new CacheSerializableRunnable("Validate CQs") {
+      @Override
       public void run2() throws CacheException {
         
         LogWriterUtils.getLogWriter().info("### Validating CQ. ### " + cqName);
@@ -948,6 +974,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       final int queryDeletes,
       final int totalEvents) {
     vm.invoke(new CacheSerializableRunnable("Validate CQs") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Validating CQ. ### " + cqName);
         // Get CQ Service.
@@ -985,7 +1012,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
           // Since ResultSet is not maintained for this release.
           // Instead of resultSize its been validated with total number of events.
           fail("test for event counts instead of results size");
-//        assertIndexDetailsEquals("Result Size mismatch", resultSize, listener.getTotalEventCount());
         }
         
         // Check for create count.
@@ -1063,6 +1089,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
 
   private void waitForEvent(VM vm, final int event, final String cqName, final String key) {
     vm.invoke(new CacheSerializableRunnable("validate cq count") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -1109,7 +1136,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
           case REGION_INVALIDATE :
             listener.waitForRegionInvalidate();
             break;            
-
         }
       }
     });
@@ -1122,6 +1148,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
    */
   public void waitForCqState(VM vm, final String cqName, final int state) {
     vm.invoke(new CacheSerializableRunnable("Wait For cq State") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -1141,7 +1168,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         // Wait max time, till the CQ state is as expected.
         final long start = System.currentTimeMillis();
         while (cqState.getState() != state) {
-          junit.framework.Assert.assertTrue("Waited over " + MAX_TIME 
+          assertTrue("Waited over " + MAX_TIME
               + "ms for Cq State to be changed to " + state
               + "; consider raising " + WAIT_PROPERTY, 
               (System.currentTimeMillis() - start) < MAX_TIME);
@@ -1153,6 +1180,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
 
   public void clearCQListenerEvents(VM vm, final String cqName) {
     vm.invoke(new CacheSerializableRunnable("validate cq count") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         
@@ -1178,6 +1206,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   public void validateQuery(VM vm, final String query, final int resultSize) {
     vm.invoke(new CacheSerializableRunnable("Validate Query") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Validating Query. ###");
         QueryService qs = getCache().getQueryService();
@@ -1217,10 +1246,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     props.setProperty("endpoints", endPoints);
     props.setProperty("retryAttempts", "1");
-    //props.setProperty("establishCallbackConnection", "true");
-    //props.setProperty("LBPolicy", "Sticky");
-    //props.setProperty("readTimeout", "120000");
-    
+
     // Add other property elements.
     if (newProps != null) {
       Enumeration e = newProps.keys();
@@ -1232,10 +1258,10 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     return props;
   }
   
-  
   // Exercise CQ attributes mutator functions
   private void mutateCQAttributes(VM vm, final String cqName, final int mutator_function) throws Exception {
     vm.invoke(new CacheSerializableRunnable("Stop CQ :" + cqName) {
+      @Override
       public void run2() throws CacheException {
         CqQuery cq1 = null;
         LogWriterUtils.getLogWriter().info("### CQ attributes mutator for ###" + cqName);
@@ -1292,14 +1318,11 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       }
     });
   }
-  
-  
-  
-  
+
   /**
    * Test for InterestList and CQ registered from same clients.
-   * @throws Exception
    */
+  @Test
   public void testInterestListAndCQs() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -1344,20 +1367,18 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    
     // Validate InterestList.
     // CREATE
     client.invoke(new CacheSerializableRunnable("validate updates") {
+      @Override
       public void run2() throws CacheException {
         final Region region = getRootRegion().getSubregion(regions[0]);
         assertNotNull(region);
         
-//        Set keys = region.entrySet();
-//        assertIndexDetailsEquals("Mismatch, number of keys in local region is not equal to the interest list size",
-//            size, keys.size());
         // TODO does this WaitCriterion actually help?
         WaitCriterion wc = new WaitCriterion() {
           String excuse;
+          @Override
           public boolean done() {
             int sz = region.entrySet().size();
             if (sz == size) {
@@ -1368,6 +1389,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
                 size + ")";
             return false;
           }
+          @Override
           public String description() {
             return excuse;
           }
@@ -1388,9 +1410,9 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     for (int i=1; i <=10; i++){
       waitForUpdated(client, "testInterestListAndCQs_0", KEY + i);
     }
-    
-    
+
     client.invoke(new CacheSerializableRunnable("validate updates") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regions[0]);
         assertNotNull(region);
@@ -1409,6 +1431,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     // INVALIDATE
     server.invoke(new CacheSerializableRunnable("Invalidate values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         for (int i = 1; i <= size; i++) {
@@ -1416,12 +1439,11 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         }
       }
     });
-    
-    
+
     waitForInvalidated(client, "testInterestListAndCQs_0", KEY + 10);
-    
-    
+
     client.invoke(new CacheSerializableRunnable("validate invalidates") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regions[0]);
         assertNotNull(region);
@@ -1451,6 +1473,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // DESTROY - this should not have any effect on CQ, as the events are
     // already destroyed from invalidate events.
     server.invoke(new CacheSerializableRunnable("Invalidate values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         for (int i = 1; i <= size; i++) {
@@ -1461,6 +1484,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
 
     // Wait for destroyed.
     client.invoke(new CacheSerializableRunnable("validate destroys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regions[0]);
         assertNotNull(region);
@@ -1485,14 +1509,12 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     closeClient(client);
     closeServer(server);
   }
-  
-  
+
   /**
    * Test for CQ register and UnRegister.
-   * @throws Exception
    */
+  @Test
   public void testCQStopExecute() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client = host.getVM(1);
@@ -1505,8 +1527,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     String poolName = "testCQStopExecute";
     createPool(client, poolName, host0, thePort);
     
-    //createClient(client, thePort, host0);
-    
     /* Create CQs. */
     createCQ(client, poolName, "testCQStopExecute_0", cqs[0]); 
     validateCQCount(client, 1);
@@ -1519,13 +1539,10 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Wait for client to Synch.
     
     waitForCreated(client, "testCQStopExecute_0", KEY+size);
-    
-    
+
     // Check if Client and Server in sync.
-    //validateServerClientRegionEntries(server, client, regions[0]);
-    validateQuery(server, cqs[0], 10);    
+    validateQuery(server, cqs[0], 10);
     // validate CQs.
-    //validateCQ(client, "testCQStopExecute_0", size, noTest, noTest, noTest);
     validateCQ(client, "testCQStopExecute_0",
         /* resultSize: */ noTest,
         /* creates: */ size,
@@ -1549,10 +1566,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     size = 30;
     
     // Check if Client and Server in sync.
-    //validateServerClientRegionEntries(server, client, regions[0]);
-    validateQuery(server, cqs[0], 20);    
+    validateQuery(server, cqs[0], 20);
     // validate CQs.
-    //validateCQ(client, "testCQStopExecute_0", size, noTest, noTest, noTest);
     validateCQ(client, "testCQStopExecute_0",
         /* resultSize: */ noTest,
         /* creates: */ 20,
@@ -1562,8 +1577,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 10,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    
-    
+
     // Stop and execute CQ 20 times
     stopExecCQ(client, "testCQStopExecute_0", 20);
     
@@ -1577,8 +1591,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test for CQ Attributes Mutator functions
-   * @throws Exception
    */
+  @Test
   public void testCQAttributesMutator() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -1591,8 +1605,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     String poolName = "testCQAttributesMutator";
     createPool(client, poolName, host0, thePort);
-    //createClient(client, thePort, host0);
-    
+
     /* Create CQs. */
     String cqName = new String("testCQAttributesMutator_0");
     createCQ(client, poolName, cqName, cqs[0]); 
@@ -1674,10 +1687,9 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test for CQ register and UnRegister.
-   * @throws Exception
    */
+  @Test
   public void testCQCreateClose() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client = host.getVM(1);
@@ -1691,13 +1703,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     System.out.println("##### Pool Name :" + poolName + " host :" + host0 + " port :" + thePort);
     createPool(client, poolName, host0, thePort);
 
-    // createClient(client, thePort, host0);
-    
-    /* debug */
-    //getLogWriter().info("### DEBUG STOP ####");
-    //pause(60 * 1000);
-    //getLogWriter().info("### DEBUG START ####");
-    
     /* Create CQs. */
     createCQ(client, poolName, "testCQCreateClose_0", cqs[0]); 
     validateCQCount(client, 1);
@@ -1750,7 +1755,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     try {
       createCQ(client, poolName, "testCQCreateClose_0", cqs[0]);
       fail("Trying to create CQ with same name. Should have thrown CQExistsException");
-    } catch (com.gemstone.gemfire.test.dunit.RMIException rmiExc) {
+    } catch (RMIException rmiExc) {
       Throwable cause = rmiExc.getCause();
       assertTrue("unexpected cause: " + cause.getClass().getName(), cause instanceof AssertionError);
       Throwable causeCause = cause.getCause(); // should be a CQExistsException
@@ -1765,7 +1770,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     try {
       createCQ(server, "testCQCreateClose_1", cqs[0]);
       fail("Trying to create CQ on Cache Server. Should have thrown Exception.");
-    } catch (com.gemstone.gemfire.test.dunit.RMIException rmiExc) {
+    } catch (RMIException rmiExc) {
       Throwable cause = rmiExc.getCause();
       assertTrue("unexpected cause: " + cause.getClass().getName(), 
           cause instanceof AssertionError);
@@ -1783,6 +1788,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     /* Test for closeAllCQs() */
     
     client.invoke(new CacheSerializableRunnable("CloseAll CQ :") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Close All CQ. ###");
         // Get CQ Service.
@@ -1817,6 +1823,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     // Call close all CQ.
     client.invoke(new CacheSerializableRunnable("CloseAll CQ 2 :") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Close All CQ 2. ###");
         // Get CQ Service.
@@ -1844,8 +1851,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * This will test the events after region destory.
    * The CQs on the destroy region needs to be closed.
-   *
    */
+  @Test
   public void testRegionDestroy() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -1878,8 +1885,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Wait for client to Synch.
     
     waitForCreated(client, "testRegionDestroy_0", KEY + 10);
-    
-    
+
     // validate CQs.
     validateCQ(client, "testRegionDestroy_0",
         /* resultSize: */ noTest,
@@ -1894,10 +1900,12 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Validate InterestList.
     // CREATE
     client.invoke(new CacheSerializableRunnable("validate updates") {
+      @Override
       public void run2() throws CacheException {
         // Wait for the region to become the correct size
         WaitCriterion wc = new WaitCriterion() {
           String excuse;
+          @Override
           public boolean done() {
             Region region = getRootRegion().getSubregion(regions[0]);
             if (region == null) {
@@ -1911,6 +1919,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
             }
             return true;
           }
+          @Override
           public String description() {
             return excuse;
           }
@@ -1931,6 +1940,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     // Destroy Region.
     server.invoke(new CacheSerializableRunnable("Destroy Region") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         region1.destroyRegion();
@@ -1942,14 +1952,13 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     closeClient(client);
     closeServer(server);
-    
   }
   
   /**
    * Test for CQ with multiple clients.
    */
+  @Test
   public void testCQWithMultipleClients() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client1 = host.getVM(1);
@@ -2004,8 +2013,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    
-    
+
     /* Close test */
     closeCQ(client1, "testCQWithMultipleClients_0");
     
@@ -2030,10 +2038,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Update values on Server. This will be updated on new Client CQs.
     createValues(server, regions[0], size);
     
-    
     waitForUpdated(client3, "testCQWithMultipleClients_0", KEY + 10);
     
-    
     validateCQ(client3, "testCQWithMultipleClients_0",
         /* resultSize: */ noTest,
         /* creates: */ 0,
@@ -2068,10 +2074,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Update values on server, update again.
     createValues(server, regions[0], size);
     
-    
     waitForUpdated(client2, "testCQWithMultipleClients_0", KEY + 10);
     
-    
     validateCQ(client2, "testCQWithMultipleClients_0",
         /* resultSize: */ noTest,
         /* creates: */ size,
@@ -2103,8 +2107,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Test for CQ ResultSet.
    */
+  @Test
   public void testCQResultSet() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client = host.getVM(1);
@@ -2117,9 +2121,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     String poolName = "testCQResultSet";
     createPool(client, poolName, host0, thePort);
     
-    // Create client.
-    // createClient(client, thePort, host0);
-    
     /* CQ Test with initial Values. */
     int size = 10;
     createValues(server, regions[0], size);
@@ -2143,31 +2144,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     executeCQ(client, "testCQResultSet_1", true, 2, null, null);
     
-    /* compare values...
-     Disabled since we don't currently maintain results on the client
-     
-     validateCQ(client, "testCQResultSet_1", 2, noTest, noTest, noTest);
-     Portfolio[] values = new Portfolio[] {new Portfolio(2), new Portfolio(4)}; 
-     Hashtable t = new Hashtable();
-     String[] keys = new String[] {"key-2", "key-4"};
-     t.put(keys[0], values[0]);
-     t.put(keys[1], values[1]);
-     
-     compareValues(client, "testCQResultSet_1", t);
-     
-     deleteValues(server, regions[1], 3);
-     t.remove("key-4");
-     pause(2 * 1000);
-     
-     try {
-     compareValues(client, "testCQResultSet_1", t);
-     fail("Should have thrown Exception. The value should not be present in cq results region");
-     }
-     catch (Exception ex) { // @todo check for specific exception type
-     }
-     
-     */
-    
     // Close.
     closeClient(client);    
     closeServer(server);
@@ -2175,10 +2151,9 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test for CQ Listener events.
-   *
    */
+  @Test
   public void testCQEvents() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client = host.getVM(1);
@@ -2250,6 +2225,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     // Insert invalid Events.
     server.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         for (int i = -1; i >= -5; i--) {
@@ -2279,11 +2255,9 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test query execution multiple times on server without ALIAS.
-   * @throws Exception
    */
+  @Test
   public void testCqEventsWithoutAlias() throws Exception {
-
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client = host.getVM(1);
@@ -2296,9 +2270,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     String poolName = "testCQEvents";
     createPool(client, poolName, host0, thePort);
 
-    // Create client.
-    //createClient(client, thePort, host0);
-    
     // Create CQs.
     createCQ(client, poolName, "testCQEvents_0", cqs[11]);
     
@@ -2355,6 +2326,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     // Insert invalid Events.
     server.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         for (int i = -1; i >= -5; i--) {
@@ -2381,10 +2353,11 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     closeClient(client);
     closeServer(server);
   }
+
   /**
    * Test for stopping and restarting CQs.
-   * @throws Exception
    */
+  @Test
   public void testEnableDisableCQ() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2407,6 +2380,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Test for disableCQ */
     client.invoke(new CacheSerializableRunnable("Client disableCQs()") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -2437,6 +2411,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Test for enable CQ */
     client.invoke(new CacheSerializableRunnable("Client enableCQs()") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -2464,6 +2439,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Test for disableCQ on Region*/
     client.invoke(new CacheSerializableRunnable("Client disableCQs()") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -2492,6 +2468,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     /* Test for enable CQ on region */
     client.invoke(new CacheSerializableRunnable("Client enableCQs()") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -2524,8 +2501,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test for Complex queries.
-   * @throws Exception
    */
+  @Test
   public void testQuery() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2568,8 +2545,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test for CQ Fail over.
-   * @throws Exception
    */
+  @Test
   public void testCQFailOver() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2580,10 +2557,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
-    // Create client.
-//    Properties props = new Properties();
-    // Create client with redundancyLevel -1
-    
+
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
     
     //createClient(client, new int[] {port1, ports[0]}, host0, "-1");
@@ -2657,8 +2631,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   
   /**
    * Test for CQ Fail over/HA with redundancy level set.
-   * @throws Exception
    */
+  @Test
   public void testCQHA() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2685,8 +2659,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     System.out.println("### Port on which server1 running : " + port1 + 
         " server2 running : " + thePort2 + 
         " Server3 running : " + port3);
-    
-    
+
     // Create client - With 3 server endpoints and redundancy level set to 2.
     
     String poolName = "testCQStopExecute";
@@ -2709,10 +2682,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     createValues(server1, regions[0], 10);
     createValues(server1, regions[1], 10);
     
-    
     waitForCreated(client, "testCQHA_0", KEY + 10);
     
-    
     // Clients expected initial result.
     int[] resultsCnt = new int[] {10, 1, 2};
     
@@ -2725,10 +2696,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     createValues(server2, regions[0], 10);
     createValues(server2, regions[1], 10);
     
-    
     waitForUpdated(client, "testCQHA_0", KEY + 10);
     
-    
     // Validate CQ.
     for (int i=0; i < numCQs; i++) {
       validateCQ(client, "testCQHA_" + i, noTest, resultsCnt[i], resultsCnt[i], noTest);
@@ -2748,7 +2717,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     waitForUpdated(client, "testCQHA_0", KEY + 10);
     
-    
     for (int i=0; i < numCQs; i++) {
       validateCQ(client, "testCQHA_" + i, noTest, resultsCnt[i], resultsCnt[i] * 2, noTest);
     }    
@@ -2761,8 +2729,8 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Test Filter registration during GII. 
    * Bug fix 39014
-   * @throws Exception
    */
+  @Test
   public void testFilterRegistrationDuringGII() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2810,6 +2778,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
 
     // Create server2.
     server2.invoke(new CacheSerializableRunnable("Create Cache Server") {
+      @Override
       public void run2() throws CacheException
       {
         LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
@@ -2848,10 +2817,10 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     );
 
     Wait.pause(3 * 1000);
-    
-    
+
     // Check if CQs are registered as part of GII.
     server2.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         DefaultQueryService qs = (DefaultQueryService)getCache().getQueryService();
         Collection<CacheClientProxy> proxies = CacheClientNotifier.getInstance().getClientProxies();
@@ -2879,7 +2848,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
             }
           }
         } catch (Exception ex) {
-          fail("Exception while validating filter count. " + ex.getMessage());
+          fail("Exception while validating filter count. ", ex);
         }
       }
     });
@@ -2894,9 +2863,9 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Test without CQs.
    * This was added after an exception encountered with CQService, when there was
-   * no CQService intiated.
-   * @throws Exception
+   * no CQService initiated.
    */
+  @Test
   public void testWithoutCQs() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2913,6 +2882,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     SerializableRunnable createConnectionPool =
       new CacheSerializableRunnable("Create region") {
+      @Override
       public void run2() throws CacheException {
         getCache();
         IgnoredException.addIgnoredException("java.net.ConnectException||java.net.SocketException");
@@ -2924,12 +2894,12 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
         createRegion(regions[0], regionFactory.createRegionAttributes());
       }
     };
-    
-    
+
     // Create client.
     client.invoke(createConnectionPool);
     
     server1.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         for (int i = 0; i < 20; i++) {
@@ -2940,6 +2910,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     
     // Put some values on the client.
     client.invoke(new CacheSerializableRunnable("Put values client") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getRootRegion().getSubregion(regions[0]);
         
@@ -2949,16 +2920,15 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
       }
     });
     
-    
     Wait.pause(2 * 1000);
     closeServer(server1);
     closeServer(server2);
   }
-  
-  
+
   /**
    * Test getCQs for a regions
    */
+  @Test
   public void testGetCQsForARegionName() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2969,9 +2939,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     final int thePort = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
-    // Create client.
-    // createClient(client, thePort, host0);
-    
     String poolName = "testGetCQsForARegionName";
     createPool(client, poolName, host0, thePort);
     
@@ -2995,6 +2962,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     executeCQ(client, "testQuery_8", true, null);
     
     client.invoke(new CacheSerializableRunnable("Client disableCQs()") {
+      @Override
       public void run2() throws CacheException {
         // Get CQ Service.
         QueryService cqService = null;
@@ -3022,15 +2990,13 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Close.
     closeClient(client);
     closeServer(server);
-    
   }
   
   /**
    * Tests execution of queries with NULL in where clause like where ID = NULL
    * etc.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testQueryWithNULLInWhereClause() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -3075,15 +3041,13 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Close.
     closeClient(client);
     closeServer(server);
-    
   }
   
   /**
    * Tests execution of queries with NULL in where clause like where ID = NULL
    * etc.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testForSupportedRegionAttributes() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -3094,6 +3058,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     // Create server with Global scope.
     SerializableRunnable createServer = new CacheSerializableRunnable(
     "Create Cache Server") {
+      @Override
       public void run2() throws CacheException
       {
         LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
@@ -3136,9 +3101,6 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     String poolName = "testForSupportedRegionAttributes";
     createPool(client, poolName, new String[] {host0, host0}, new int[] {port1, thePort2});
     
-    // Create client.
-    //createClient(client, new int[] {port1, thePort2}, host0, "-1");
-
     // Create CQ on region with GLOBAL SCOPE.
     createCQ(client, poolName, "testForSupportedRegionAttributes_0", cqs[0]);
     executeCQ(client, "testForSupportedRegionAttributes_0", false, null);
@@ -3159,6 +3121,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
        " The CQ supported scopes are DISTRIBUTED_ACK and GLOBAL.";
     final String expectedErr = "Cq not registered on primary";
     client.invoke(new CacheSerializableRunnable("Set expect") {
+      @Override
       public void run2() {
         getCache().getLogger().info("<ExpectedException action=add>"
             + expectedErr + "</ExpectedException>");
@@ -3168,10 +3131,11 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     try {
       executeCQ(client, "testForSupportedRegionAttributes_1", false, "CqException");
       fail("The test should have failed with exception, " + errMsg);
-    } catch (Exception ex){
+    } catch (Exception expected){
       // Expected.
     } finally {
       client.invoke(new CacheSerializableRunnable("Remove expect") {
+        @Override
         public void run2() {
           getCache().getLogger().info("<ExpectedException action=remove>"
               + expectedErr + "</ExpectedException>");
@@ -3183,16 +3147,12 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     closeClient(client);
     closeServer(server1);
     closeServer(server2);
-
   }
-    
-  
-  // HELPER METHODS....
-  
-  /* For debug purpose - Compares entries in the region */
+
+  /** For debug purpose - Compares entries in the region */
   private void validateServerClientRegionEntries(VM server, VM client, final String regionName) {
-    
     server.invoke(new CacheSerializableRunnable("Server Region Entries") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         LogWriterUtils.getLogWriter().info("### Entries in Server :" + region.keys().size());
@@ -3200,6 +3160,7 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     });
     
     client.invoke(new CacheSerializableRunnable("Client Region Entries") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         LogWriterUtils.getLogWriter().info("### Entries in Client :" + region.keys().size()); 
@@ -3284,6 +3245,4 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
     factory.setScope(Scope.LOCAL);
     return factory.createRegionAttributes();
   }
-  
-  
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
index 993dd42..df5bf16 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  *
  */
+@Category(DistributedTest.class)
 public class CqQueryUsingPoolOptimizedExecuteDUnitTest extends CqQueryUsingPoolDUnitTest{
 
-  public CqQueryUsingPoolOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqQueryUsingPoolOptimizedExecuteDUnitTest() {
+    super();
    }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
index a94b72b..632673b 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.Collection;
 import java.util.HashSet;
 import java.util.Set;
@@ -44,9 +53,10 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * This class tests the ContinuousQuery mechanism in GemFire.
  *
  */
-public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqResultSetUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
-  protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqResultSetUsingPoolDUnitTest");
+  protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
   
   private final String selStr = "SELECT * FROM /root/regionA";
   
@@ -125,8 +135,8 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
   };
   
 
-  public CqResultSetUsingPoolDUnitTest(String name) {
-    super(name);
+  public CqResultSetUsingPoolDUnitTest() {
+    super();
   }
 
   @Override
@@ -150,6 +160,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResults() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -204,6 +215,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsWithCompactRangeIndex() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -247,6 +259,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsWithRangeIndex() throws Exception
   {
     
@@ -304,6 +317,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsOnPR() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -360,6 +374,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsWithCompactRangeIndexOnPR() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -407,6 +422,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsWithRangeIndexOnPR() throws Exception
   {
     
@@ -478,6 +494,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsCaching() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -600,6 +617,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsCachingForMultipleCQs() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -727,6 +745,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsCachingForPR() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -823,6 +842,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsCachingForDestroyEventsOnPR() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -941,6 +961,7 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCqResultsCachingWithFailOver() throws Exception
   {
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
index d4e40fa..79ed0e0 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.Collection;
 import java.util.HashSet;
 import java.util.Set;
@@ -39,10 +48,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 
+@Category(DistributedTest.class)
 public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUsingPoolDUnitTest {
 
-  public CqResultSetUsingPoolOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqResultSetUsingPoolOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override
@@ -70,6 +80,7 @@ public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUs
    * @throws Exception
    */
   @Override
+  @Test
   public void testCqResultsCachingWithFailOver() throws Exception
   {
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStateDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStateDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStateDUnitTest.java
index b69d9ae..6ba1e14 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStateDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStateDUnitTest.java
@@ -16,32 +16,40 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.query.CqQuery;
 import com.gemstone.gemfire.cache.query.dunit.CloseCacheAuthorization;
 import com.gemstone.gemfire.cache.query.dunit.HelperTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.security.templates.DummyAuthenticator;
 import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 public class CqStateDUnitTest extends HelperTestCase {
 
-  
-  public CqStateDUnitTest(String name) {
-    super(name);
-  }
-  
-  public void testNothingBecauseBug51953() {
-    // remove when bug #51953 is fixed
-  }
-  
   // this test is disabled due to a 25% failure rate in
   // CI testing.  See internal ticket #52229
-  public void disabledtestBug51222() throws Exception {
+  @Ignore("TODO: test is disabled due to flickering")
+  @Test
+  public void testBug51222() throws Exception {
     //The client can log this when the server shuts down.
     IgnoredException.addIgnoredException("Could not find any server");
     IgnoredException.addIgnoredException("java.net.ConnectException");
@@ -97,7 +105,6 @@ public class CqStateDUnitTest extends HelperTestCase {
         CqQuery cq = getCache().getQueryService().getCqs()[0];
         return cq.getState().isRunning();
       }
-      
     });
     
     assertTrue("Cq was not running on server" , isRunning);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
index fcd8160..a42a61b 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.Collection;
 
 import com.gemstone.gemfire.cache.CacheException;
@@ -47,12 +56,13 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * This includes the test with different data activities.
  *
  */
-public class CqStatsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqStatsDUnitTest extends JUnit4CacheTestCase {
 
-  private CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest("CqStatsDUnitTest");
+  private CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest();
   
-  public CqStatsDUnitTest(String name) {
-    super(name);
+  public CqStatsDUnitTest() {
+    super();
   }
 
   @Override
@@ -241,6 +251,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
    * Test for CQ and CQ Service Statistics
    * @throws Exception
    */
+  @Test
   public void testCQStatistics() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -330,6 +341,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
    * Test for CQ Service Statistics
    * @throws Exception
    */
+  @Test
   public void testCQServiceStatistics() throws Exception {
     
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
index 7d4a74e..72e2e7f 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.query.internal.cq.CqService;
 import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.test.dunit.Invoke;
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 /**
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  */
+@Category(DistributedTest.class)
 public class CqStatsOptimizedExecuteDUnitTest extends CqStatsDUnitTest {
 
-  public CqStatsOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqStatsOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
index 71b11d8..ddec1ba 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.Collection;
 
 import com.gemstone.gemfire.cache.CacheException;
@@ -47,12 +56,13 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * This includes the test with different data activities.
  *
  */
-public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqStatsUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
-  private CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqStatsUsingPoolDUnitTest");
+  private CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
   
-  public CqStatsUsingPoolDUnitTest(String name) {
-    super(name);
+  public CqStatsUsingPoolDUnitTest() {
+    super();
   }
 
   @Override
@@ -241,6 +251,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
    * Test for CQ and CQ Service Statistics
    * @throws Exception
    */
+  @Test
   public void testCQStatistics() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -334,6 +345,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
    * Test for CQ Service Statistics
    * @throws Exception
    */
+  @Test
   public void testCQServiceStatistics() throws Exception {
     
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
index 5ccb735..4e84a4a 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.query.internal.cq.CqService;
 import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.test.dunit.Invoke;
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 /**
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  */
+@Category(DistributedTest.class)
 public class CqStatsUsingPoolOptimizedExecuteDUnitTest extends CqStatsUsingPoolDUnitTest {
 
-  public CqStatsUsingPoolOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqStatsUsingPoolOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override


[44/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
index 839f81b..7e84eb8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/DeclarativeIndexCreationJUnitTest.java
@@ -20,6 +20,17 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -28,22 +39,7 @@ import com.gemstone.gemfire.cache.query.CacheUtils;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import junit.framework.Assert;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Collection;
-import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- * 
- *         To change the template for this generated type comment go to Window -
- *         Preferences - Java - Code Generation - Code and Comments
- */
 @Category(IntegrationTest.class)
 public class DeclarativeIndexCreationJUnitTest {
 
@@ -76,13 +72,12 @@ public class DeclarativeIndexCreationJUnitTest {
     IndexManager im = IndexUtils.getIndexManager(root, true);
     Collection coll = im.getIndexes();
     if (coll.size() > 0) {
-      Assert.assertTrue(true);
+      assertTrue(true);
       CacheUtils.log("List of indexes= " + im.toString());
       RegionAttributes ra = root.getAttributes();
-      Assert.assertTrue(!ra.getIndexMaintenanceSynchronous());
+      assertTrue(!ra.getIndexMaintenanceSynchronous());
     } else
-      Assert
-          .fail("DeclarativeIndexCreationJUnitTest::testAsynchronousIndexCreatedOnRoot_PortfoliosRegion:No index found in the root region");
+      fail("DeclarativeIndexCreationJUnitTest::testAsynchronousIndexCreatedOnRoot_PortfoliosRegion:No index found in the root region");
   }
 
   @Test
@@ -91,18 +86,16 @@ public class DeclarativeIndexCreationJUnitTest {
     IndexManager im = IndexUtils.getIndexManager(root, true);
     Collection coll = im.getIndexes();
     if (coll.size() > 0) {
-      Assert.assertTrue(true);
+      assertTrue(true);
       CacheUtils.log("List of indexes= " + im.toString());
       RegionAttributes ra = root.getAttributes();
-      Assert.assertTrue(ra.getIndexMaintenanceSynchronous());
+      assertTrue(ra.getIndexMaintenanceSynchronous());
     } else
-      Assert
-          .fail("DeclarativeIndexCreationJUnitTest::testSynchronousIndexCreatedOnRoot_StringRegion Region:No index found in the root region");
+      fail("DeclarativeIndexCreationJUnitTest::testSynchronousIndexCreatedOnRoot_StringRegion Region:No index found in the root region");
     root = cache.getRegion("/root/string1");
     im = IndexUtils.getIndexManager(root, true);
     if (!im.isIndexMaintenanceTypeSynchronous())
-      Assert
-          .fail("DeclarativeIndexCreationJUnitTest::testSynchronousIndexCreatedOnRoot_StringRegion: The index update type not synchronous if no index-update-type attribuet specified in cache.cml");
+      fail("DeclarativeIndexCreationJUnitTest::testSynchronousIndexCreatedOnRoot_StringRegion: The index update type not synchronous if no index-update-type attribuet specified in cache.cml");
   }
 
   @Test
@@ -111,12 +104,11 @@ public class DeclarativeIndexCreationJUnitTest {
     IndexManager im = IndexUtils.getIndexManager(root, true);
     Collection coll = im.getIndexes();
     if (coll.size() > 0) {
-      Assert.assertTrue(true);
+      assertTrue(true);
       CacheUtils.log("List of indexes= " + im.toString());
       RegionAttributes ra = root.getAttributes();
-      Assert.assertTrue(ra.getIndexMaintenanceSynchronous());
+      assertTrue(ra.getIndexMaintenanceSynchronous());
     } else
-      Assert
-          .fail("DeclarativeIndexCreationJUnitTest::testAsynchronousIndexCreatedOnRoot_PortfoliosRegion:No index found in the root region");
+      fail("DeclarativeIndexCreationJUnitTest::testAsynchronousIndexCreatedOnRoot_PortfoliosRegion:No index found in the root region");
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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/b914df23/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 5718fce..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/EquijoinDUnitTest.java
+++ /dev/null
@@ -1,437 +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 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)
-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
-  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/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java
index 02a6f07..4e4d76a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java
@@ -19,6 +19,15 @@
  */
 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.Collection;
 import java.util.Map;
 
@@ -54,17 +63,19 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
 /**
  *
  */
-public class IndexTrackingQueryObserverDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class IndexTrackingQueryObserverDUnitTest extends JUnit4CacheTestCase {
 
   private final int NUM_BKTS = 10;
   private static final String queryStr = "select * from /portfolio where ID >= 0";
   protected static final int TOTAL_OBJECTS = 1000;
   public static final String INDEX_NAME = "keyIndex1"; 
 
-  public IndexTrackingQueryObserverDUnitTest(String name) {
-    super(name);
+  public IndexTrackingQueryObserverDUnitTest() {
+    super();
   }
   
+  @Test
   public void testNothing() {
     
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java
index 6e064f1..83e718d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 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 static com.gemstone.gemfire.cache.query.Utils.createPortfolioData;
 
 import java.util.Arrays;
@@ -52,7 +61,8 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * Then destroys and puts back entries in separated thread in the same region and runs
  * query parallely and checks for UNDEFINED values in result set of the query.
  */
-public class InitializeIndexEntryDestroyQueryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class InitializeIndexEntryDestroyQueryDUnitTest extends JUnit4CacheTestCase {
 
   PRQueryDUnitHelper PRQHelp = new PRQueryDUnitHelper();
 
@@ -70,14 +80,15 @@ public class InitializeIndexEntryDestroyQueryDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public InitializeIndexEntryDestroyQueryDUnitTest(String name) {
-    super(name);
+  public InitializeIndexEntryDestroyQueryDUnitTest() {
+    super();
   }
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
       vm.invoke(() -> PRQueryDUnitHelper.setCache(getCache()));
     }
   }
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQuery() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -210,6 +221,7 @@ public class InitializeIndexEntryDestroyQueryDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-1036: uses PRQueryDUnitHelper, time sensitive, async actions, overly long joins (16+ minutes), eats exceptions (fixed 1), thread sleeps
+  @Test
   public void testAsyncIndexInitDuringEntryDestroyAndQueryOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -334,6 +346,7 @@ public class InitializeIndexEntryDestroyQueryDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testConcurrentRemoveIndexAndQueryOnPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
index e18e720..f4e57be 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
@@ -16,6 +16,15 @@
  */
 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.Collection;
 import java.util.List;
 
@@ -39,15 +48,17 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 
-public class MultiIndexCreationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class MultiIndexCreationDUnitTest extends JUnit4CacheTestCase {
 
   private final String regionName = "MultiIndexCreationDUnitTest";
   public static volatile boolean hooked = false;
 
-  public MultiIndexCreationDUnitTest(String name) {
-    super(name);
+  public MultiIndexCreationDUnitTest() {
+    super();
   }
 
+  @Test
   public void testConcurrentMultiIndexCreationAndQuery() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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/b914df23/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 3fa6848..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PartitionedRegionEquijoinDUnitTest.java
+++ /dev/null
@@ -1,130 +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 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 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
-  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/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PdxCopyOnReadQueryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PdxCopyOnReadQueryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PdxCopyOnReadQueryJUnitTest.java
index e14df54..6f151bd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PdxCopyOnReadQueryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PdxCopyOnReadQueryJUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -26,14 +35,6 @@ import com.gemstone.gemfire.cache.query.SelectResults;
 import com.gemstone.gemfire.cache.query.data.PortfolioPdx;
 import com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
 
 @Category(IntegrationTest.class)
 public class PdxCopyOnReadQueryJUnitTest {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 0929567..a6ff920 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
@@ -16,43 +16,46 @@
  */
 package com.gemstone.gemfire.cache.query.internal.index;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.query.data.PortfolioPdx;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
 
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-/**
- *
- */
 @Category(DistributedTest.class)
-@Ignore("Test was disabled by renaming to DisabledTest")
-public class PutAllWithIndexPerfDUnitTest extends CacheTestCase {
+public class PutAllWithIndexPerfDUnitTest extends JUnit4CacheTestCase {
 
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
   static long timeWithoutStructTypeIndex = 0;
   static long timeWithStructTypeIndex = 0;
   
-  public PutAllWithIndexPerfDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -63,6 +66,8 @@ public class PutAllWithIndexPerfDUnitTest extends CacheTestCase {
     disconnectAllFromDS();
   }
 
+  @Ignore("TODO: test is disabled")
+  @Test
   public void testPutAllWithIndexes() {
     final String name = "testRegion";
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 bc901f4..4f33afe 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
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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 static com.gemstone.gemfire.cache.query.Utils.*;
 
 import java.util.Collection;
@@ -38,10 +47,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCase {
 
-  public PRBasicIndexCreationDUnitTest(String name) {
-    super(name);
+  public PRBasicIndexCreationDUnitTest() {
+    super();
   }
 
   public void setCacheInVMsUsingXML(String xmlFile, VM... vms) {
@@ -75,6 +85,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * 
    * @throws Exception  if an exception is generated
    */
+  @Test
   public void testPRBasicIndexCreate() throws Exception
   {
     Host host = Host.getHost(0);
@@ -121,6 +132,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * Tests creation of multiple index creation on a partitioned region system.
    * @throws Exception if any excpetion are generated
    */
+  @Test
   public void testPRMultiIndexCreation() throws Exception
   {
     Host host = Host.getHost(0);
@@ -163,6 +175,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    *
    * @throws Exception if any exception are generated
    */
+  @Test
   public void testPRMultiIndexCreationAndGetIndex() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -240,6 +253,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
   /**
    * Creats partitioned index from an xml discription.
    */
+  @Test
   public void testCreatePartitionedIndexThroughXML() throws Exception
   {
     IgnoredException ie = IgnoredException.addIgnoredException(IndexNameConflictException.class.getName());
@@ -284,6 +298,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * in the sytem.
    * 
    */ 
+  @Test
   public void testCreatePartitionedRegionThroughXMLAndAPI()
   {
     Host host = Host.getHost(0);
@@ -331,6 +346,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * serialQueryEntry.conf hydra test before putting the data in the partitioned
    * region.
    */ 
+  @Test
   public void testCreatePartitionedIndexWithNoAliasBeforePuts () throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -363,6 +379,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * Test creating index on partitioned region like created in test
    * serialQueryEntry.conf but after putting some data in.
    */
+  @Test
   public void testCreatePartitionedIndexWithNoAliasAfterPuts () throws Exception { 
     
     Host host = Host.getHost(0);
@@ -397,6 +414,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
   /**
    * Test index usage with query on a partitioned region with bucket indexes.
    */
+  @Test
   public void testPartitionedIndexUsageWithPRQuery () throws Exception { 
     
     Host host = Host.getHost(0);
@@ -442,6 +460,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * Test index usage with query on a partitioned region with bucket indexes.
    * @throws Throwable 
    */
+  @Test
   public void testPartitionedIndexCreationDuringPersistentRecovery() throws Throwable { 
     
     Host host = Host.getHost(0);
@@ -494,6 +513,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * Test for bug 37089 where if there is an index on one attribute
    * (CompiledComparision) of the where clause query produces wrong results.
    */
+  @Test
   public void testPartitionedQueryWithIndexOnIdBug37089 () throws Exception { 
     
     Host host = Host.getHost(0);
@@ -534,6 +554,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
   /**
    * Creats partitioned index on keys and values of a bucket regions.
    */
+  @Test
   public void testCreatePartitionedIndexWithKeysValuesAndFunction() throws Exception
   {
 
@@ -576,6 +597,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
   /**
    * Bug Fix 37201, creating index from a data accessor.
    */
+  @Test
   public void testCreateIndexFromAccessor() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -617,6 +639,7 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    * accessor VM.
    */
   
+  @Test
   public void testCreateIndexAndAddAnAccessor() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -656,7 +679,8 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
    *
    * @throws Exception
    */
- public void testIndexQueryingWithOrderBy() throws Exception
+  @Test
+  public void testIndexQueryingWithOrderBy() throws Exception
  {
    int dataSize = 10;
    int step = 2;
@@ -754,7 +778,8 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
   *
   * @throws Exception
   */
- public void testIndexQueryingWithOrderAndVerify() throws Exception
+  @Test
+  public void testIndexQueryingWithOrderAndVerify() throws Exception
  {
    int dataSize = 10;
    int step = 2;
@@ -842,7 +867,8 @@ public class PRBasicIndexCreationDUnitTest extends PartitionedRegionDUnitTestCas
        "PRQueryDUnitTest#testPRDAckCreationAndQuerying : *Querying PR's with DACK Test ENDED*****");
  }
 
-public void testIndexQueryingWithOrderByLimit() throws Exception
+  @Test
+  public void testIndexQueryingWithOrderByLimit() throws Exception
  {
    int dataSize = 10;
    int step = 2;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDeadlockDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDeadlockDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDeadlockDUnitTest.java
index ecfbfae..20041bd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDeadlockDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicIndexCreationDeadlockDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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 static com.gemstone.gemfire.cache.query.Utils.createPortfoliosAndPositions;
 
 import java.io.File;
@@ -36,6 +45,7 @@ import com.gemstone.gemfire.test.dunit.Wait;
 /**
  * 
  */
+@Category(DistributedTest.class)
 public class PRBasicIndexCreationDeadlockDUnitTest extends
     PartitionedRegionDUnitTestCase
 
@@ -46,8 +56,8 @@ public class PRBasicIndexCreationDeadlockDUnitTest extends
    * @param name
    */
 
-  public PRBasicIndexCreationDeadlockDUnitTest(String name) {
-    super(name);
+  public PRBasicIndexCreationDeadlockDUnitTest() {
+    super();
   }
   public void setCacheInVMs(VM... vms) {
     for (VM vm : vms) {
@@ -74,6 +84,7 @@ public class PRBasicIndexCreationDeadlockDUnitTest extends
   public static volatile boolean hook_vm1, hook_vm2;
 
   //Dummy test method to be removed when test is fixed
+  @Test
   public void testIndexCreationMessageDiskRecoveryDeadLock() {
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 fcc5c49..c83626e 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
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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 static com.gemstone.gemfire.cache.query.Utils.*;
 
 import java.util.ArrayList;
@@ -34,10 +43,11 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTestCase {
 
-  public PRBasicMultiIndexCreationDUnitTest(String name) {
-    super(name);
+  public PRBasicMultiIndexCreationDUnitTest() {
+    super();
   }
 
   public void setCacheInVMs(VM... vms) {
@@ -61,6 +71,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * 
    * @throws Exception  if an exception is generated
    */
+  @Test
   public void testPRBasicIndexCreate() throws Exception
   {
     Host host = Host.getHost(0);
@@ -123,6 +134,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    *
    * @throws Exception if any exception are generated
    */
+  @Test
   public void testPRMultiIndexCreationAndGetIndex() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -209,6 +221,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * in the system.
    * 
    */ 
+  @Test
   public void testCreatePartitionedRegionThroughXMLAndAPI()
   {
     Host host = Host.getHost(0);
@@ -264,6 +277,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * serialQueryEntry.conf hydra test before putting the data in the partitioned
    * region.
    */ 
+  @Test
   public void testCreatePartitionedIndexWithNoAliasBeforePuts () throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -311,6 +325,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * Test creating index on partitioned region like created in test
    * serialQueryEntry.conf but after putting some data in.
    */
+  @Test
   public void testCreatePartitionedIndexWithNoAliasAfterPuts () throws Exception { 
     
     Host host = Host.getHost(0);
@@ -355,6 +370,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
   /**
    * Test index usage with query on a partitioned region with bucket indexes.
    */
+  @Test
   public void testPartitionedIndexUsageWithPRQuery () throws Exception { 
     
     Host host = Host.getHost(0);
@@ -406,6 +422,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * Test index usage with query on a partitioned region with bucket indexes.
    * @throws Throwable 
    */
+  @Test
   public void testPartitionedIndexCreationDuringPersistentRecovery() throws Throwable { 
     
     Host host = Host.getHost(0);
@@ -465,6 +482,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * Test for bug 37089 where if there is an index on one attribute
    * (CompiledComparision) of the where clause query produces wrong results.
    */
+  @Test
   public void testPartitionedQueryWithIndexOnIdBug37089 () throws Exception { 
     
     Host host = Host.getHost(0);
@@ -511,6 +529,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
   /**
    * Creats partitioned index on keys and values of a bucket regions.
    */
+  @Test
   public void testCreatePartitionedIndexWithKeysValuesAndFunction() throws Exception
   {
 
@@ -561,6 +580,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
   /**
    * Bug Fix 37201, creating index from a data accessor.
    */
+  @Test
   public void testCreateIndexFromAccessor() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -604,6 +624,7 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    * accessor VM.
    */
   
+  @Test
   public void testCreateIndexAndAddAnAccessor() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -646,7 +667,8 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
    *
    * @throws Exception
    */
- public void testIndexQueryingWithOrderBy() throws Exception
+  @Test
+  public void testIndexQueryingWithOrderBy() throws Exception
  {
    int dataSize = 10;
    int step = 2;
@@ -747,7 +769,8 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
   *
   * @throws Exception
   */
- public void testIndexQueryingWithOrderAndVerify() throws Exception
+  @Test
+  public void testIndexQueryingWithOrderAndVerify() throws Exception
  {
    int dataSize = 10;
    int step = 2;
@@ -838,7 +861,8 @@ public class PRBasicMultiIndexCreationDUnitTest extends PartitionedRegionDUnitTe
        "PRQueryDUnitTest#testPRDAckCreationAndQuerying : *Querying PR's with DACK Test ENDED*****");
  }
 
-public void testIndexQueryingWithOrderByLimit() throws Exception
+  @Test
+  public void testIndexQueryingWithOrderByLimit() throws Exception
  {
   int step = 2;
   int totalDataSize = 90;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicQueryDUnitTest.java
index bbe3c90..0d8f48a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicQueryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
+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 static com.gemstone.gemfire.cache.query.Utils.*;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -38,6 +47,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  * firing a simple query and validating the ResultSet size and Contents. 
  * 
  */
+@Category(DistributedTest.class)
 public class PRBasicQueryDUnitTest extends PartitionedRegionDUnitTestCase
 
 {
@@ -47,8 +57,8 @@ public class PRBasicQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * @param name
    */
 
-  public PRBasicQueryDUnitTest(String name) {
-    super(name);
+  public PRBasicQueryDUnitTest() {
+    super();
   }
 
   public void setCacheInVMs(VM... vms) {
@@ -74,6 +84,7 @@ public class PRBasicQueryDUnitTest extends PartitionedRegionDUnitTestCase
    * 3. Fires a query on accessor VM and verifies the result. 
    * @throws Exception
    */
+  @Test
   public void testPRBasicQuerying() throws Exception
   {
     Host host = Host.getHost(0);
@@ -142,6 +153,7 @@ public class PRBasicQueryDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
   }
   
+  @Test
   public void testPRCountStarQuery() throws Exception
   {
     Host host = Host.getHost(0);
@@ -221,6 +233,7 @@ public class PRBasicQueryDUnitTest extends PartitionedRegionDUnitTestCase
             "PRQBasicQueryDUnitTest#testPRCountStarQuery: Querying PR's Test ENDED");
   }
   
+  @Test
   public void testPROrderBy() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicRemoveIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicRemoveIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicRemoveIndexDUnitTest.java
index bdbaeb3..9f07f6e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicRemoveIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/partitioned/PRBasicRemoveIndexDUnitTest.java
@@ -16,60 +16,51 @@
  */
 package com.gemstone.gemfire.cache.query.partitioned;
 
-import static com.gemstone.gemfire.cache.query.Utils.createPortfolioData;
+import static com.gemstone.gemfire.cache.query.Utils.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.query.data.PortfolioData;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDUnitTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * Basic funtional test for removing index from a partitioned region system.
- * 
+ * Basic functional test for removing index from a partitioned region system.
  */
-public class PRBasicRemoveIndexDUnitTest extends PartitionedRegionDUnitTestCase
-{
-  /**
-   * Constructor
-   * @param name
-   */  
-  public PRBasicRemoveIndexDUnitTest (String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class PRBasicRemoveIndexDUnitTest extends PartitionedRegionDUnitTestCase {
+
+  private final PRQueryDUnitHelper PRQHelp = new PRQueryDUnitHelper();
+
+  private final int start = 0;
+
+  private final int end = 1003;
 
-  public void setCacheInVMs(VM... vms) {
-    for (VM vm : vms) {
-      vm.invoke(() -> PRQueryDUnitHelper.setCache(getCache()));
-    }
-  }
-  
-  PRQueryDUnitHelper PRQHelp = new PRQueryDUnitHelper();
-  
   /**
    * Name of the partitioned region for the test.
    */
-  final String name = "PartionedPortfolios";
-  
-  
-  final int start = 0;
-  
-  final int end = 1003;
+  private final String name = "PartitionedPortfolios";
 
   /**
-   * Reduncancy level for the pr.
+   * Redundancy level for the pr.
    */
-  final int redundancy = 0;
+  private final int redundancy = 0;
 
+  public void setCacheInVMs(VM... vms) {
+    for (VM vm : vms) {
+      vm.invoke(() -> PRQueryDUnitHelper.setCache(getCache()));
+    }
+  }
   
   /**
    * Remove index test to remove all the indexes in a given partitioned region
-   * 
-   * @throws Exception
-   *           if the test fails
    */
-  public void testPRBasicIndexRemove() throws Exception
-  {
+  @Test
+  public void testPRBasicIndexRemove() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -106,12 +97,12 @@ public class PRBasicRemoveIndexDUnitTest extends PartitionedRegionDUnitTestCase
     
     LogWriterUtils.getLogWriter().info(
     "PRBasicRemoveIndexDUnitTest.testPRBasicRemoveIndex test now  ends sucessfully");
-
   }
   
   /**
    * Test removing single index on a pr.
    */
+  @Test
   public void testPRBasicRemoveParticularIndex() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);



[37/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 ac3d721..e31e97b 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
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -32,6 +34,7 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.TreeSet;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.LogWriter;
@@ -65,6 +68,7 @@ import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 /**
@@ -80,7 +84,7 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  *
  * @since GemFire 3.0
  */
-public abstract class RegionTestCase extends CacheTestCase {
+public abstract class RegionTestCase extends JUnit4CacheTestCase {
   
   /** A <code>CacheListener</code> used by a test */
   static TestCacheListener listener;
@@ -106,10 +110,6 @@ public abstract class RegionTestCase extends CacheTestCase {
     subrgnWriter = null;
   }
   
-  public RegionTestCase(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     cleanup();
@@ -120,8 +120,6 @@ public abstract class RegionTestCase extends CacheTestCase {
   protected void postTearDownRegionTestCase() throws Exception {
   }
   
-  ////////  Helper methods
-  
   /**
    * Returns a region with the given name and the attributes for this
    * test.
@@ -146,7 +144,6 @@ public abstract class RegionTestCase extends CacheTestCase {
    */
   protected abstract RegionAttributes getRegionAttributes();
   
-  
   /** pauses only if no ack */
   protected void pauseIfNecessary() {
   }
@@ -162,14 +159,13 @@ public abstract class RegionTestCase extends CacheTestCase {
     // Only needed for no-ack regions
   }
   
-  //////////////////////  Test Methods  //////////////////////
-  
   /**
    * Tests that creating an entry in a region actually creates it
    *
    * @see Region#containsKey
    * @see Region#containsValueForKey
    */
+  @Test
   public void testContainsKey() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -204,6 +200,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * @see Region#getEntry
    * @see Region#create
    */
+  @Test
   public void testBadRegionAccess() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -238,6 +235,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that {@link Region#put} on a previously non-existent region
    * entry creates it.
    */
+  @Test
   public void testPutNonExistentEntry() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -284,6 +282,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that sending <code>null</code> to various APIs throws the
    * appropriate exception.
    */
+  @Test
   public void testNulls() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -388,6 +387,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Region's {@link Region#getStatistics statistics}, so the region
    * must have been created with statistics enabled.
    */
+  @Test
   public void testCreateSubregions() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -441,6 +441,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests {@link Region#destroy destroying} an entry and attempting
    * to access it afterwards.
    */
+  @Test
   public void testDestroyEntry() throws CacheException {
     String name = this.getUniqueName();
     Object key = name;
@@ -529,6 +530,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    *
    * @see Region#destroyRegion
    */
+  @Test
   public void testDestroyRegion() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -828,6 +830,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#entries} method without recursion
    */
+  @Test
   public void testEntries() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -908,6 +911,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#entries} method with recursion
    */
+  @Test
   public void testEntriesRecursive() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -972,6 +976,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#getCache} method (for what it's worth)
    */
+  @Test
   public void testGetCache() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -981,6 +986,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#getName} method
    */
+  @Test
   public void testGetName() throws CacheException {
     String name = this.getUniqueName();
     Region region = createRegion(name);
@@ -992,6 +998,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#getFullPath} method
    */
+  @Test
   public void testGetPathFromRoot() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -1011,6 +1018,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#getParentRegion} method
    */
+  @Test
   public void testGetParentRegion() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -1033,6 +1041,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    *
    * @see Region#setUserAttribute
    */
+  @Test
   public void testRegionUserAttribute() throws CacheException {
     String name = this.getUniqueName();
     Object value = "USER_ATTRIBUTE";
@@ -1047,6 +1056,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests a region entry's user attribute
    */
+  @Test
   public void testEntryUserAttribute() throws CacheException {
     String name = this.getUniqueName();
     String key = "KEY";
@@ -1067,6 +1077,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests invalidating a region entry
    */
+  @Test
   public void testInvalidateEntry() throws CacheException {
     String name = this.getUniqueName();
     Object key = "KEY";
@@ -1094,6 +1105,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests invalidating an entire region
    */
+  @Test
   public void testInvalidateRegion() throws CacheException {
     String name = this.getUniqueName();
     
@@ -1131,6 +1143,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#keys} method.
    */
+  @Test
   public void testKeys() throws CacheException {
     String name = this.getUniqueName();
     
@@ -1186,6 +1199,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * attempting to access it afterwards.  (Not too useful with a
    * <code>LOCAL</code> region.)
    */
+  @Test
   public void testLocalDestroyEntry() throws CacheException {
     if (!supportsLocalDestroyAndLocalInvalidate()) {
       return;
@@ -1278,6 +1292,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    *
    * @see Region#localDestroyRegion
    */
+  @Test
   public void testLocalDestroyRegion() throws CacheException {
     String name = this.getUniqueName();
     Object key = "KEY";
@@ -1574,6 +1589,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests closing a region, and checks different behavior when this is a disk
    * region with persistBackup.
    */
+  @Test
   public void testCloseRegion() throws CacheException {
     // @todo added a remote region to make sure close just does a localDestroy
     
@@ -1663,6 +1679,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests locally invalidating a region entry
    */
+  @Test
   public void testLocalInvalidateEntry() throws CacheException {
     if (!supportsLocalDestroyAndLocalInvalidate()) {
       return;
@@ -1692,6 +1709,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests locally invalidating an entire region
    */
+  @Test
   public void testLocalInvalidateRegion() throws CacheException {
     String name = this.getUniqueName();
     
@@ -1729,6 +1747,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#subregions} method without recursion
    */
+  @Test
   public void testSubregions() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -1788,6 +1807,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#subregions} method with recursion
    */
+  @Test
   public void testSubregionsRecursive() throws CacheException {
     if (!supportsSubregions()) {
       return;
@@ -1856,6 +1876,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Tests the {@link Region#values} method without recursion
    */
+  @Test
   public void testValues() throws CacheException {
     String name = this.getUniqueName();
     System.err.println("testValues region name is " +  name);
@@ -2116,6 +2137,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that an entry in a region expires with an
    * invalidation after a given time to live.
    */
+  @Test
   public void testEntryTtlInvalidate()
   throws CacheException {
     
@@ -2162,6 +2184,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Verify that special entries expire but other entries in the region don't
    */
+  @Test
   public void testCustomEntryTtl1() {
 
     final String name = this.getUniqueName();
@@ -2218,6 +2241,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Verify that special entries don't expire but other entries in the region do
    */
+  @Test
   public void testCustomEntryTtl2() {
 
     final String name = this.getUniqueName();
@@ -2299,6 +2323,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Expire an entry with a custom expiration.  Set a new custom expiration, create the
    * same entry again, make sure it observes the <em>new</em> expiration
    */
+  @Test
   public void testCustomEntryTtl3() {
 
     final String name = this.getUniqueName();
@@ -2418,6 +2443,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Then mutate the region expiration configuration and confirm
    * that the entry's expiration time is rescheduled.
    */
+  @Test
   public void testEntryTtl3() {
     final String name = this.getUniqueName();
     // test no longer waits for this expiration to happen
@@ -2601,6 +2627,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that an entry whose value is loaded into a region
    * expires with an invalidation after a given time to live.
    */
+  @Test
   public void testEntryFromLoadTtlInvalidate()
   throws CacheException, InterruptedException {
 
@@ -2650,6 +2677,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that an entry in a region expires with a destroy
    * after a given time to live.
    */
+  @Test
   public void testEntryTtlDestroy()
   throws CacheException, InterruptedException {
 
@@ -2693,6 +2721,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that a region expires with an invalidation after a
    * given time to live.
    */
+  @Test
   public void testRegionTtlInvalidate()
   throws CacheException, InterruptedException {
 
@@ -2747,6 +2776,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that a region expires with a destruction after a
    * given time to live.
    */
+  @Test
   public void testRegionTtlDestroy()
   throws CacheException, InterruptedException {
 
@@ -2792,6 +2822,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that an entry in a local region that remains idle for a
    * given amount of time is invalidated.
    */
+  @Test
   public void testEntryIdleInvalidate()
   throws CacheException, InterruptedException {
 
@@ -2891,6 +2922,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Verify that special entries expire but other entries in the region don't
    */
+  @Test
   public void testCustomEntryIdleTimeout1() {
 
     final String name = this.getUniqueName();
@@ -2969,6 +3001,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Verify that special entries don't expire but other entries in the region do
    */
+  @Test
   public void testCustomEntryIdleTimeout2() {
 
     final String name = this.getUniqueName();
@@ -3052,6 +3085,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Then mutate the region expiration configuration and confirm
    * that the entry's expiration time is rescheduled.
    */
+  @Test
   public void testCustomEntryIdleTimeout3() {
     final String name = this.getUniqueName();
     // test no longer waits for this expiration to happen
@@ -3139,6 +3173,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Then mutate the region expiration configuration and confirm
    * that the entry's expiration time is rescheduled.
    */
+  @Test
   public void testEntryIdleTimeout3() {
     final String name = this.getUniqueName();
     // test no longer waits for this expiration to happen
@@ -3370,6 +3405,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Verify that expiry is calculatod only once on an entry
    */
+  @Test
   public void testCustomIdleOnce() {
 
     final String name = this.getUniqueName();
@@ -3445,6 +3481,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   /**
    * Verify that a get or put resets the idle time on an entry
    */
+  @Test
   public void testCustomEntryIdleReset() {
 
     final String name = this.getUniqueName();
@@ -3508,6 +3545,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * given amount of time is destroyed.
    */
   @Category(FlakyTest.class) // GEODE-706: time sensitive, expiration, waitForDestroy, EXPIRY_MS_PROPERTY, short timeout
+  @Test
   public void testEntryIdleDestroy() throws Exception {
 
     final String name = this.getUniqueName();
@@ -3569,6 +3607,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Verify that accessing an entry resets its idle time
    * @throws Exception
    */
+  @Test
   public void testEntryIdleReset() throws Exception {
 
     final String name = this.getUniqueName();
@@ -3624,6 +3663,7 @@ public abstract class RegionTestCase extends CacheTestCase {
     }
   }
   
+  @Test
   public void testEntryExpirationAfterMutate()
   throws CacheException, InterruptedException {
 
@@ -3681,6 +3721,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Verify that accessing an entry does not delay expiration due
    * to TTL
    */
+  @Test
   public void testEntryIdleTtl() {
 
     final String name = this.getUniqueName();
@@ -3720,6 +3761,7 @@ public abstract class RegionTestCase extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRegionExpirationAfterMutate()
   throws CacheException, InterruptedException {
 
@@ -3780,6 +3822,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * time is invalidated.  Also tests that accessing an entry of a
    * region or a subregion counts as an access.
    */
+  @Test
   public void testRegionIdleInvalidate()
   throws InterruptedException, CacheException {
 
@@ -3888,6 +3931,7 @@ public abstract class RegionTestCase extends CacheTestCase {
    * Tests that a region expires with a destruction after a
    * given idle time.
    */
+  @Test
   public void testRegionIdleDestroy()
   throws CacheException, InterruptedException {
 
@@ -3933,6 +3977,7 @@ public abstract class RegionTestCase extends CacheTestCase {
   public static Region preSnapshotRegion = null;
   private final static int MAX_KEYS = 10;
 
+  @Test
   public void testSnapshot() throws IOException, CacheException, ClassNotFoundException {
     final String name = this.getUniqueName();
     
@@ -3997,6 +4042,7 @@ public abstract class RegionTestCase extends CacheTestCase {
     }
   }
 
+  @Test
   public void testRootSnapshot() throws IOException, CacheException, ClassNotFoundException {
     final String name = this.getUniqueName();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
index 4ebde70..e89b760 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
@@ -16,20 +16,22 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.*;
-import java.util.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RequiredRoles;
+import com.gemstone.gemfire.distributed.Role;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
 /**
  * Provides functionality helpful to testing Reliability and RequiredRoles.
  *
  * @since GemFire 5.0
  */
-public abstract class ReliabilityTestCase extends CacheTestCase {
-
-  public ReliabilityTestCase(String name) {
-    super(name);
-  }
+public abstract class ReliabilityTestCase extends JUnit4CacheTestCase {
 
   /** Asserts that the specified roles are missing */
   protected void assertMissingRoles(String regionName, String[] roles) {
@@ -49,10 +51,7 @@ public abstract class ReliabilityTestCase extends CacheTestCase {
       assertTrue("Unexpected missing role: " + role.getName(), found);
     }
   }
-  
+
   protected void waitForMemberTimeout() {
-    // TODO implement me
   }
-  
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
index c1b5e48..74c66ef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
@@ -22,10 +22,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Properties;
 
+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.CacheException;
@@ -36,21 +41,18 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  *
  */
-public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
-    
-    /** Creates a new instance of RemoveAllMultiVmDUnitTest */
-    public RemoveAllMultiVmDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class RemoveAllMultiVmDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
     static Cache cache;
     static Properties props = new Properties();
@@ -82,7 +84,7 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
     
     public static void createCache(){
         try{
-            ds = (new RemoveAllMultiVmDUnitTest("temp")).getSystem(props);
+            ds = (new RemoveAllMultiVmDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -120,7 +122,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
     
     //tests methods
     
-    public void testLocalRemoveAll(){
+  @Test
+  public void testLocalRemoveAll(){
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
     
@@ -151,7 +154,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
       } );
     }
     
-    public void testLocalTxRemoveAll(){
+  @Test
+  public void testLocalTxRemoveAll(){
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
     
@@ -187,7 +191,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
     } );
     }
 
-    public void testDistributedRemoveAll(){
+  @Test
+  public void testDistributedRemoveAll(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -236,7 +241,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
           }
         } );
     }
-    public void testDistributedTxRemoveAll(){
+  @Test
+  public void testDistributedTxRemoveAll(){
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
       VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
index 3163fd3..e73481d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
@@ -16,24 +16,43 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.Role;
-import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Properties;
 import java.util.Set;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RequiredRoles;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.distributed.Role;
+import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the functionality of the {@link RequiredRoles} class.
  *
  * @since GemFire 5.0
  */
+@Category(DistributedTest.class)
 public class RequiredRolesDUnitTest extends ReliabilityTestCase {
 
   protected transient volatile boolean startTestWaitForRequiredRoles = false;
@@ -41,13 +60,10 @@ public class RequiredRolesDUnitTest extends ReliabilityTestCase {
   protected transient volatile boolean failTestWaitForRequiredRoles = false;
   protected transient Set rolesTestWaitForRequiredRoles = new HashSet();
   
-  public RequiredRolesDUnitTest(String name) {
-    super(name);
-  }
-  
   /**
    * Tests that RequiredRoles detects missing roles.
    */
+  @Test
   public void testRequiredRolesInLoss() throws Exception {
     String name = this.getUniqueName();
     
@@ -107,6 +123,7 @@ public class RequiredRolesDUnitTest extends ReliabilityTestCase {
   /**
    * Tests RequiredRoles.waitForRequiredRoles().
    */
+  @Test
   public void testWaitForRequiredRoles() throws Exception {
     final String name = this.getUniqueName();
     final int vm0 = 0;
@@ -285,6 +302,7 @@ public class RequiredRolesDUnitTest extends ReliabilityTestCase {
   /**
    * Tests RequiredRoles.isRoleInRegionMembership().
    */
+  @Test
   public void testIsRoleInRegionMembership() throws Exception {
     final String name = this.getUniqueName();
     final int vm0 = 0;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
index 06e25d0..3e66792 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
@@ -16,25 +16,33 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the performance of Regions when Roles are assigned.
  *
  * @since GemFire 5.0
  */
-public class RolePerformanceDUnitTest extends CacheTestCase {
-
-  public RolePerformanceDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class RolePerformanceDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * Compares times required for series of puts with Roles assigned to
@@ -42,6 +50,7 @@ public class RolePerformanceDUnitTest extends CacheTestCase {
    * <p>
    * Up to 10 attempts will be made before failing.
    */
+  @Test
   public void testRolePerformance() {
     int maxAttempts = 10;
     for (int i = 1; i <= maxAttempts; i++) {
@@ -54,7 +63,7 @@ public class RolePerformanceDUnitTest extends CacheTestCase {
         break;
       }
       // only catch assertion failures...
-      catch (junit.framework.AssertionFailedError e) {
+      catch (AssertionError e) {
         if (i == maxAttempts) {
           throw e;
         }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
index d564fca..f8e2172 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
@@ -16,9 +16,14 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CacheLoader;
@@ -35,19 +40,20 @@ import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.TimeoutException;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests various search load and write scenarios for distributed regions
  */
+@Category(DistributedTest.class)
 @SuppressWarnings({"deprecation", "unchecked", "rawtypes", "serial"})
-public class SearchAndLoadDUnitTest extends CacheTestCase {
+public class SearchAndLoadDUnitTest extends JUnit4CacheTestCase {
 
   static boolean loaderInvoked;
   static boolean  remoteLoaderInvoked;
@@ -72,10 +78,6 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
   static final CountDownLatch readyForExceptionLatch = new CountDownLatch(1);
   static final CountDownLatch loaderInvokedLatch = new CountDownLatch(1);
 
-  public SearchAndLoadDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     for (int h = 0; h < Host.getHostCount(); h++) {
@@ -110,6 +112,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
     return factory.create();
   }
 
+  @Test
   public void testNetSearch()
   throws CacheException, InterruptedException {
 
@@ -209,6 +212,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
    * return a value.  Both threads then validate that they received the expected
    * result.
    */
+  @Test
   public void testConcurrentLoad() throws Throwable {
 
     Host host = Host.getHost(0);
@@ -352,6 +356,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
   }
   
   
+  @Test
   public void testNetLoadNoLoaders() throws CacheException, InterruptedException {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -392,10 +397,10 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
 
   }
 
+  @Test
   public void testNetLoad()
   throws CacheException, InterruptedException {
-    Invoke.invokeInEveryVM(DistributedTestCase.class,
-        "disconnectFromDS");
+    disconnectAllFromDS();
 
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -487,10 +492,10 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
    * Confirm that a netLoad that returns null will NOT allow other netLoad methods
    * to be called.
    */
+  @Test
   public void testEmptyNetLoad()
   throws CacheException, InterruptedException {
-    Invoke.invokeInEveryVM(DistributedTestCase.class,
-        "disconnectFromDS");
+    disconnectAllFromDS();
 
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -607,6 +612,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
     return new Integer(remoteLoaderInvokedCount);
   }
   
+  @Test
   public void testLocalLoad()
   throws CacheException, InterruptedException {
 
@@ -691,6 +697,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
   }
 
 
+  @Test
   public void testNetWrite()
   throws CacheException, InterruptedException {
 
@@ -783,6 +790,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
   }
 
   
+  @Test
   public void testOneHopNetWrite() throws CacheException, InterruptedException {
 
     Host host = Host.getHost(0);
@@ -892,6 +900,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
 
 
   /** same as the previous test but the cache writer is in a third, non-replicated, vm */
+  @Test
   public void testOneHopNetWriteRemoteWriter() throws CacheException, InterruptedException {
 
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 2453c85..241bfae 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
@@ -16,17 +16,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.Region.Entry;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.distributed.internal.DM;
-import com.gemstone.gemfire.distributed.internal.DMStats;
-import com.gemstone.gemfire.internal.tcp.Connection;
-import com.gemstone.gemfire.test.dunit.*;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.Serializable;
 import java.util.Iterator;
@@ -34,7 +25,32 @@ import java.util.LinkedList;
 import java.util.Properties;
 import java.util.Set;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.distributed.internal.DM;
+import com.gemstone.gemfire.distributed.internal.DMStats;
+import com.gemstone.gemfire.internal.tcp.Connection;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test to make sure slow receiver queuing is working
@@ -43,11 +59,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  */
 @Category(DistributedTest.class)
 @Ignore("Test was disabled by renaming to DisabledTest")
-public class SlowRecDUnitTest extends CacheTestCase {
+public class SlowRecDUnitTest extends JUnit4CacheTestCase {
 
-  public SlowRecDUnitTest(String name) {
-    super(name);
-  }
+  protected static Object lastCallback = null;
 
   // this test has special config of its distributed system so
   // the setUp and tearDown methods need to make sure we don't
@@ -63,16 +77,12 @@ public class SlowRecDUnitTest extends CacheTestCase {
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
   }
-  
-  //////////////////////  Test Methods  //////////////////////
 
   private VM getOtherVm() {
     Host host = Host.getHost(0);
     return host.getVM(0);
   }
 
-  static protected Object lastCallback = null;
-
   private void doCreateOtherVm(final Properties p, final boolean addListener) {
     VM vm = getOtherVm();
     vm.invoke(new CacheSerializableRunnable("create root") {
@@ -93,24 +103,20 @@ public class SlowRecDUnitTest extends CacheTestCase {
           } else {
             CacheListener cl = new CacheListenerAdapter() {
                 public void afterCreate(EntryEvent event) {
-//                   getLogWriter().info("afterCreate " + event.getKey());
                   if (event.getCallbackArgument() != null) {
                     lastCallback = event.getCallbackArgument();
                   }
                   if (event.getKey().equals("sleepkey")) {
                     int sleepMs = ((Integer)event.getNewValue()).intValue();
-//                     getLogWriter().info("sleepkey sleeping for " + sleepMs);
                     try {Thread.sleep(sleepMs);} catch (InterruptedException ignore) {fail("interrupted");}
                   }
                 }
                 public void afterUpdate(EntryEvent event) {
-//                   getLogWriter().info("afterUpdate " + event.getKey());
                   if (event.getCallbackArgument() != null) {
                     lastCallback = event.getCallbackArgument();
                   }
                   if (event.getKey().equals("sleepkey")) {
                     int sleepMs = ((Integer)event.getNewValue()).intValue();
-//                     getLogWriter().info("sleepkey sleeping for " + sleepMs);
                     try {Thread.sleep(sleepMs);} catch (InterruptedException ignore) {fail("interrupted");}
                   }
                 }
@@ -133,7 +139,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
         }
       });
   }
-  static protected final String CHECK_INVALID = "CHECK_INVALID";
+
+  protected static final String CHECK_INVALID = "CHECK_INVALID";
   
   private void checkLastValueInOtherVm(final String lastValue, final Object lcb) {
     VM vm = getOtherVm();
@@ -181,8 +188,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
                 }
               };
               Wait.waitForCriterion(ev, 50 * 1000, 200, true);
-//              assertNotNull(re);
-//              assertIndexDetailsEquals(null, value);
             }
           } else {
             {
@@ -243,7 +248,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
    * Make sure that noack puts to a receiver
    * will eventually queue and then catch up.
    */
-  public void testNoAck() throws CacheException {
+  @Test
+  public void testNoAck() throws Exception {
     final AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_NO_ACK);
     final Region r = createRootRegion("slowrec", factory.create());
@@ -261,7 +267,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
       final Object key = "key";
       long queuedMsgs = stats.getAsyncQueuedMsgs();
       long dequeuedMsgs = stats.getAsyncDequeuedMsgs();
-//      long conflatedMsgs = stats.getAsyncConflatedMsgs();
       long queueSize = stats.getAsyncQueueSize();
       String lastValue = "";
       final long intialQueuedMsgs = queuedMsgs;
@@ -299,6 +304,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
       checkLastValueInOtherVm(lastValue, null);
     }
   }
+
   /**
    * Create a region named AckRegion with ACK scope
    */
@@ -314,11 +320,13 @@ public class SlowRecDUnitTest extends CacheTestCase {
     final Region r = createRootRegion("AckRegion", factory.create());
     return r;
   }
+
   /**
    * Make sure that noack puts to a receiver
    * will eventually queue and then catch up with conflation
    */
-  public void testNoAckConflation() throws CacheException {
+  @Test
+  public void testNoAckConflation() throws Exception {
     final AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_NO_ACK);
     factory.setEnableAsyncConflation(true);
@@ -333,10 +341,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
     forceQueuing(r);
     final Object key = "key";
     int count = 0;
-//    long queuedMsgs = stats.getAsyncQueuedMsgs();
-//    long dequeuedMsgs = stats.getAsyncDequeuedMsgs();
     final long initialConflatedMsgs = stats.getAsyncConflatedMsgs();
-//    long queueSize = stats.getAsyncQueueSize();
     String lastValue = "";
     final long intialDeQueuedMsgs = stats.getAsyncDequeuedMsgs();
     long start = 0;
@@ -346,46 +351,23 @@ public class SlowRecDUnitTest extends CacheTestCase {
         lastValue = value;
         r.put(key, value);
         count ++;
-        //       getLogWriter().info("After " + count + " "
-        //                           + " puts queueSize=" + queueSize
-        //                           + "    queuedMsgs=" + queuedMsgs
-        //                           + "  dequeuedMsgs=" + dequeuedMsgs
-        //                           + " conflatedMsgs=" + conflatedMsgs);
       }
       start = System.currentTimeMillis();
     } finally {
       forceQueueFlush();
     }
-//     queueSize = stats.getAsyncQueueSize();
-//     queuedMsgs = stats.getAsyncQueuedMsgs();
-
-//     getLogWriter().info("After " + count + " "
-//                         + " puts slowrec mode kicked in by queuing "
-//                         + queuedMsgs + " for a total size of " + queueSize
-//                         + " conflatedMsgs=" + conflatedMsgs
-//                         + " dequeuedMsgs=" + dequeuedMsgs);
-//     final long start = System.currentTimeMillis();
-//     while (stats.getAsyncQueuedMsgs() > stats.getAsyncDequeuedMsgs()) {
-//       try {Thread.sleep(100);} catch (InterruptedException ignore) {}
-//       queueSize = stats.getAsyncQueueSize();
-//       queuedMsgs = stats.getAsyncQueuedMsgs();
-//       dequeuedMsgs = stats.getAsyncDequeuedMsgs();
-//       conflatedMsgs = stats.getAsyncConflatedMsgs();
-//       getLogWriter().info("After sleeping"
-//                           + "     queueSize=" + queueSize
-//                           + "    queuedMsgs=" + queuedMsgs
-//                           + "  dequeuedMsgs=" + dequeuedMsgs
-//                           + " conflatedMsgs=" + conflatedMsgs);
     final long finish = System.currentTimeMillis();
     LogWriterUtils.getLogWriter().info("After " + (finish - start) + " ms async msgs where flushed. A total of " + (stats.getAsyncDequeuedMsgs()-intialDeQueuedMsgs) + " were flushed. Leaving a queue size of " + stats.getAsyncQueueSize() + ". The lastValue was " + lastValue);
     
     checkLastValueInOtherVm(lastValue, null);
   }
+
   /**
    * make sure ack does not hang
    * make sure two ack updates do not conflate but are both queued
    */
-  public void testAckConflation() throws CacheException {
+  @Test
+  public void testAckConflation() throws Exception {
     final AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_NO_ACK);
     factory.setEnableAsyncConflation(true);
@@ -431,6 +413,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
       assertEquals(startQueuedMsgs+2, endQueuedMsgs);
     }
   }
+
   /**
    * Make sure that only sequences of updates are conflated
    * Also checks that sending to a conflating region and non-conflating region
@@ -438,7 +421,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
    * Test disabled because it intermittently fails due to race conditions
    * in test. This has been fixed in congo's tests. See bug 35357.
    */
-  public void _disabled_testConflationSequence() throws CacheException {
+  @Test
+  public void testConflationSequence() throws Exception {
     final AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_NO_ACK);
     factory.setEnableAsyncConflation(true);
@@ -473,8 +457,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
     String lastValue = value;
     Object mylcb = null;
     long initialConflatedMsgs = stats.getAsyncConflatedMsgs();
-//    long initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
-//    long dequeuedMsgs = stats.getAsyncDequeuedMsgs();
     int endCount = count+60;
 
     LogWriterUtils.getLogWriter().info("[testConflationSequence] about to build up queue");
@@ -492,7 +474,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
       r.destroy(key, mylcb);
       count ++;
       lastValue = null;
-//      dequeuedMsgs = stats.getAsyncDequeuedMsgs();
       assertTrue(System.currentTimeMillis() < begin+1000*60*2);
     }
     assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@ -503,8 +484,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
     LogWriterUtils.getLogWriter().info("[testConflationSequence] force queuing create-update-destroy");
     forceQueuing(r);
     initialConflatedMsgs = stats.getAsyncConflatedMsgs();
-//    initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
-//    dequeuedMsgs = stats.getAsyncDequeuedMsgs();
     endCount = count + 40;
     
     LogWriterUtils.getLogWriter().info("[testConflationSequence] create-update-destroy");
@@ -519,7 +498,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
       r.put(key, value);
       count ++;
       r.localDestroy(key);
-//      dequeuedMsgs = stats.getAsyncDequeuedMsgs();
       assertTrue(System.currentTimeMillis() < begin+1000*60*2);
     }
     assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@ -530,12 +508,10 @@ public class SlowRecDUnitTest extends CacheTestCase {
     LogWriterUtils.getLogWriter().info("[testConflationSequence] force queuing update-invalidate");
     forceQueuing(r);
     initialConflatedMsgs = stats.getAsyncConflatedMsgs();
-//    initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
     value = "count=" + count;
     lastValue = value;
     r.create(key, value);
     count++;
-//    dequeuedMsgs = stats.getAsyncDequeuedMsgs();
     endCount = count + 40;
 
     LogWriterUtils.getLogWriter().info("[testConflationSequence] update-invalidate");
@@ -548,7 +524,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
       r.invalidate(key);
       count ++;
       lastValue = CHECK_INVALID;
-//      dequeuedMsgs = stats.getAsyncDequeuedMsgs();
       assertTrue(System.currentTimeMillis() < begin+1000*60*2);
     }
     assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@ -563,8 +538,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
     LogWriterUtils.getLogWriter().info("[testConflationSequence] conflate & no-conflate regions");
     forceQueuing(r);
     final int initialAsyncSocketWrites = stats.getAsyncSocketWrites();
-//    initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
-    
+
     value = "count=" + count;
     lastValue = value;
     long conflatedMsgs = stats.getAsyncConflatedMsgs();
@@ -586,7 +560,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
     assertEquals(queuedMsgs, stats.getAsyncQueuedMsgs());
     assertEquals(conflatedMsgs, stats.getAsyncConflatedMsgs());
     count++;
-//    dequeuedMsgs = stats.getAsyncDequeuedMsgs();
     endCount = count + 80;
 
     begin = System.currentTimeMillis();
@@ -616,7 +589,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
       queuedMsgs++;
       assertEquals(queuedMsgs, stats.getAsyncQueuedMsgs());
       assertEquals(conflatedMsgs, stats.getAsyncConflatedMsgs());
-//      dequeuedMsgs = stats.getAsyncDequeuedMsgs();
       assertTrue(System.currentTimeMillis() < begin+1000*60*2);
     }
 
@@ -624,10 +596,12 @@ public class SlowRecDUnitTest extends CacheTestCase {
     LogWriterUtils.getLogWriter().info("[testConflationSequence] assert other vm");
     checkLastValueInOtherVm(lastValue, null);
   }
+
   /**
    * Make sure that exceeding the queue size limit causes a disconnect.
    */
-  public void testSizeDisconnect() throws CacheException {
+  @Test
+  public void testSizeDisconnect() throws Exception {
     final String expected = 
       "com.gemstone.gemfire.internal.tcp.ConnectionException: Forced disconnect sent to" +
       "||java.io.IOException: Broken pipe";
@@ -650,7 +624,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
     p.setProperty(ASYNC_MAX_QUEUE_SIZE, "1"); // 1 meg
     doCreateOtherVm(p, false);
 
-    
     final Object key = "key";
     final int VALUE_SIZE = 1024 * 100; // .1M async-max-queue-size should give us 10 of these 100K msgs before queue full
     final byte[] value = new byte[VALUE_SIZE];
@@ -692,6 +665,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
     assertEquals(others, dm.getOtherDistributionManagerIds());
     assertEquals(0, stats.getAsyncQueueSize());
   }
+
   /**
    * Make sure that exceeding the async-queue-timeout causes a disconnect.<p>
    * [bruce] This test was disabled when the SlowRecDUnitTest was re-enabled
@@ -699,7 +673,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
    * June 2006 due to hangs.  Some of the tests, like this one, still need
    * work because the periodically (some quite often) fail.
    */
-  public void donottestTimeoutDisconnect() throws CacheException {
+  @Test
+  public void testTimeoutDisconnect() throws Exception {
     final String expected = 
       "com.gemstone.gemfire.internal.tcp.ConnectionException: Forced disconnect sent to" +
       "||java.io.IOException: Broken pipe";
@@ -766,8 +741,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
     assertEquals(0, stats.getAsyncQueueSize());
   }
 
-  // static helper methods ---------------------------------------------------
-  
   private static final String KEY_SLEEP = "KEY_SLEEP";
   private static final String KEY_WAIT = "KEY_WAIT";
   private static final String KEY_DISCONNECT = "KEY_DISCONNECT";
@@ -895,18 +868,11 @@ public class SlowRecDUnitTest extends CacheTestCase {
    * June 2006 r13222 in the trunk.  This test is failing because conflation
    * isn't kicking in for some reason.
    */
-  public void donottestMultipleRegionConflation() throws Throwable {
+  @Test
+  public void testMultipleRegionConflation() throws Exception {
     try {
       doTestMultipleRegionConflation();
     }
-    catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    }
-    catch (Throwable t) {
-      LogWriterUtils.getLogWriter().error("Encountered exception: ", t);
-      throw t;
-    }
     finally {
       // make sure other vm was notified even if test failed
       getOtherVm().invoke(new SerializableRunnable("Wake up other vm") {
@@ -918,6 +884,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
       });
     }
   }
+
   protected static ControlListener doTestMultipleRegionConflation_R1_Listener;
   protected static ControlListener doTestMultipleRegionConflation_R2_Listener;
   private void doTestMultipleRegionConflation() throws Exception {
@@ -1117,18 +1084,11 @@ public class SlowRecDUnitTest extends CacheTestCase {
   /**
    * Make sure a disconnect causes queue memory to be released.
    */
-  public void testDisconnectCleanup() throws Throwable {
+  @Test
+  public void testDisconnectCleanup() throws Exception {
     try {
       doTestDisconnectCleanup();
     }
-    catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    }
-    catch (Throwable t) {
-      LogWriterUtils.getLogWriter().error("Encountered exception: ", t);
-      throw t;
-    }
     finally {
       // make sure other vm was notified even if test failed
       getOtherVm().invoke(new SerializableRunnable("Wake up other vm") {
@@ -1140,6 +1100,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
       });
     }
   }
+
   protected static ControlListener doTestDisconnectCleanup_Listener;
   private void doTestDisconnectCleanup() throws Exception {
     final AttributesFactory factory = new AttributesFactory();
@@ -1259,30 +1220,21 @@ public class SlowRecDUnitTest extends CacheTestCase {
       }
     };
     Wait.waitForCriterion(ev, 2 * 1000, 200, true);
-//    getLogWriter().info("[testDisconnectCleanup] initialQueues=" + 
-//      initialQueues + " asyncQueues=" + stats.getAsyncQueues());
     assertEquals(initialQueues, stats.getAsyncQueues());
   }
 
   /**
    * Make sure a disconnect causes queue memory to be released.<p>
-     * [bruce] This test was disabled when the SlowRecDUnitTest was re-enabled
+   * [bruce] This test was disabled when the SlowRecDUnitTest was re-enabled
    * in build.xml in the splitbrainNov07 branch.  It had been disabled since
    * June 2006 due to hangs.  Some of the tests, like this one, still need
    * work because the periodically (some quite often) fail.
- */
-  public void donottestPartialMessage() throws Throwable {
+   */
+  @Test
+  public void testPartialMessage() throws Exception {
     try {
       doTestPartialMessage();
     }
-    catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    }
-    catch (Throwable t) {
-      LogWriterUtils.getLogWriter().error("Encountered exception: ", t);
-      throw t;
-    }
     finally {
       // make sure other vm was notified even if test failed
       getOtherVm().invoke(new SerializableRunnable("Wake up other vm") {
@@ -1294,6 +1246,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
       });
     }
   }
+
   protected static ControlListener doTestPartialMessage_Listener;
   private void doTestPartialMessage() throws Exception {
     final AttributesFactory factory = new AttributesFactory();
@@ -1304,9 +1257,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
     final DMStats stats = dm.getStats();
     
     // set others before vm0 connects
-//    final Set others = dm.getOtherDistributionManagerIds();
     long initialQueuedMsgs = stats.getAsyncQueuedMsgs();
-//    int initialQueues = stats.getAsyncQueues();
 
     // create receiver in vm0 with queuing enabled
     final Properties p = new Properties();
@@ -1360,11 +1311,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
       count++;
       r.put(key, value, new Integer(count));
       if (count == partialId+1) {
-//        long begin = System.currentTimeMillis();
-//        while (stats.getAsyncQueues() < 1) {
-//          pause(100);
-//          assertFalse(System.currentTimeMillis() > begin+1000*10);
-//        }
         assertEquals(initialQueuedMsgs+2, stats.getAsyncQueuedMsgs());
         assertEquals(0, stats.getAsyncConflatedMsgs());
       } else if (count == partialId+2) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
index 8909511..de813ae 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
@@ -26,42 +26,73 @@
  * @see MultiVMRegionTestCase
  *
  */
-
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.CommitIncompleteException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskAccessException;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.TimeoutException;
 import com.gemstone.gemfire.distributed.internal.ResourceEvent;
 import com.gemstone.gemfire.distributed.internal.ResourceEventsListener;
 import com.gemstone.gemfire.distributed.internal.locks.DLockBatch;
 import com.gemstone.gemfire.distributed.internal.locks.DLockService;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.CommitReplyException;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
+import com.gemstone.gemfire.internal.cache.TXManagerImpl;
+import com.gemstone.gemfire.internal.cache.TXState;
+import com.gemstone.gemfire.internal.cache.TXStateInterface;
+import com.gemstone.gemfire.internal.cache.TXStateProxyImpl;
 import com.gemstone.gemfire.internal.cache.locks.TXLockBatch;
 import com.gemstone.gemfire.internal.cache.locks.TXLockService;
 import com.gemstone.gemfire.internal.cache.locks.TXLockServiceImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import junit.framework.AssertionFailedError;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
 
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-//import com.gemstone.gemfire.internal.cache.locks.TXLockId;
-
-public class TXDistributedDUnitTest extends CacheTestCase {
-  public TXDistributedDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class TXDistributedDUnitTest extends JUnit4CacheTestCase {
 
   protected RegionAttributes getRegionAttributes() {
     return this.getRegionAttributes(Scope.DISTRIBUTED_ACK);
@@ -79,6 +110,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
   /**
    * Test a remote grantor
    */
+  @Test
   public void testRemoteGrantor() throws Exception {
     IgnoredException.addIgnoredException("killing members ds");
     final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
@@ -178,6 +210,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
   /**
    * Test the internal callbacks used for what else... testing
    */
+  @Test
   public void testInternalCallbacks() throws Exception {
     final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
     final String rgnName1 = getUniqueName() + "_1";
@@ -420,6 +453,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
    * Test distributed ack transactions that consist only of 
    * data from loaded values
    */
+  @Test
   public void testDACKLoadedMessage() throws Exception {
     final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
     final String rgnName = getUniqueName();
@@ -499,10 +533,9 @@ public class TXDistributedDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-635: eats and logs exceptions, retry loops
+  @Test
   public void testHighAvailabilityFeatures() throws Exception {
     IgnoredException.addIgnoredException("DistributedSystemDisconnectedException");
-//    final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
-//    final TXManagerImpl txMgrImpl = (TXManagerImpl) txMgr;
     final String rgnName = getUniqueName();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -714,7 +747,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
               assertNotNull(re);
               assertEquals("val1_3", re.getValue());
               break;
-            } catch (AssertionFailedError e) {
+            } catch (AssertionError e) {
               if (giveUp > System.currentTimeMillis()) {
                 throw e;
               }
@@ -1067,8 +1100,8 @@ public class TXDistributedDUnitTest extends CacheTestCase {
    * discovered between a commit's locking phase and the applicatoin of the
    * Region's data. See bug 32999
    */
+  @Test
   public void testLockBatchParticipantsUpdate() throws Exception {
-//    final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
     final String rgnName = getUniqueName();
     Region rgn = getCache().createRegion(rgnName, getRegionAttributes());
     rgn.create("key", null);
@@ -1282,8 +1315,9 @@ public class TXDistributedDUnitTest extends CacheTestCase {
     }
   }
   
-  @Ignore("Disabled for 51260")
-  public void DISABLED_testRemoteCommitFailure() {
+  @Ignore("TODO: Disabled for #51260")
+  @Test
+  public void testRemoteCommitFailure() throws Exception {
     try {
     disconnectAllFromDS();
     final String rgnName1= getUniqueName()  + "_1";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
index 4236dc8..6d0fa35 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
@@ -16,14 +16,19 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
-
 import javax.naming.Context;
 import javax.transaction.UserTransaction;
 
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.CopyHelper;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheEvent;
@@ -55,21 +60,27 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test the order of operations done on the farside of a tx.
  *
  * @since GemFire 5.0
  */
-public class TXOrderDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class TXOrderDUnitTest extends JUnit4CacheTestCase {
+
+  private final int TEST_PUT = 0;
+  private final int TEST_INVALIDATE = 1;
+  private final int TEST_DESTROY = 2;
 
   private transient Region r;
   private transient DistributedMember otherId;
   protected transient int invokeCount;
-  
-  public TXOrderDUnitTest(String name) {
-    super(name);
-  }
+
+  List expectedKeys;
+  int clCount = 0;
 
   private VM getOtherVm() {
     Host host = Host.getHost(0);
@@ -85,6 +96,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
       });
     this.otherId = (DistributedMember)vm.invoke(() -> TXOrderDUnitTest.getVMDistributedMember());
   }
+
   private void doCommitOtherVm() {
     VM vm = getOtherVm();
     vm.invoke(new CacheSerializableRunnable("create root") {
@@ -111,19 +123,16 @@ public class TXOrderDUnitTest extends CacheTestCase {
     return InternalDistributedSystem.getAnyInstance().getDistributedMember();
   }
   
-  //////////////////////  Test Methods  //////////////////////
-
-  List expectedKeys;
-  int clCount = 0;
-
   Object getCurrentExpectedKey() {
     Object result = this.expectedKeys.get(this.clCount);
     this.clCount += 1;
     return result;
   }
+
   /**
    * make sure listeners get invoked in correct order on far side of tx
    */
+  @Test
   public void testFarSideOrder() throws CacheException {
     initOtherId();
     AttributesFactory af = new AttributesFactory();
@@ -166,10 +175,11 @@ public class TXOrderDUnitTest extends CacheTestCase {
   }
 
   /**
-   * test bug#40870
-   * @throws Exception
+   * Tests fix for #40870 Remote CacheListeners invoke afterCreate with Operation.LOCAL_LOAD_CREATE when create executed transactionally"
    */
-  public void _testFarSideOpForLoad() throws Exception {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testFarSideOpForLoad() throws Exception {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
     VM vm2 = host.getVM(1);
@@ -226,6 +236,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testInternalRegionNotExposed() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -279,9 +290,11 @@ public class TXOrderDUnitTest extends CacheTestCase {
     vm1.invoke(verifyListener);
     vm2.invoke(verifyListener);
   }
-  
-  class ExposedRegionTransactionListener extends TransactionListenerAdapter {
+
+  private static class ExposedRegionTransactionListener extends TransactionListenerAdapter {
+
     private boolean exceptionOccurred = false;
+
     @Override
     public void afterCommit(TransactionEvent event) {
       List<CacheEvent<?, ?>> events = event.getEvents();
@@ -292,8 +305,11 @@ public class TXOrderDUnitTest extends CacheTestCase {
       }
     }
   }
-  class ExposedRegionCacheListener extends CacheListenerAdapter {
+
+  private static class ExposedRegionCacheListener extends CacheListenerAdapter {
+
     private boolean exceptionOccurred = false;
+
     @Override
     public void afterCreate(EntryEvent event) {
       verifyRegion(event);
@@ -309,21 +325,20 @@ public class TXOrderDUnitTest extends CacheTestCase {
     }
   }
   
-  private final int TEST_PUT = 0;
-  private final int TEST_INVALIDATE = 1;
-  private final int TEST_DESTROY = 2;
   /**
    * verify that queries on indexes work with transaction
-   * @throws Exception
    */
+  @Test
   public void testFarSideIndexOnPut() throws Exception {
     doTest(TEST_PUT);
   }
 
+  @Test
   public void testFarSideIndexOnInvalidate() throws Exception {
     doTest(TEST_INVALIDATE);
   }
 
+  @Test
   public void testFarSideIndexOnDestroy() throws Exception {
     doTest(TEST_DESTROY);
   }
@@ -392,6 +407,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testBug43353() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
index b4bff79..e4ccc34 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
@@ -26,8 +26,13 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CacheTransactionManager;
@@ -39,11 +44,11 @@ import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class TXRestrictionsDUnitTest extends CacheTestCase {
-  public TXRestrictionsDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class TXRestrictionsDUnitTest extends JUnit4CacheTestCase {
 
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
@@ -69,6 +74,7 @@ public class TXRestrictionsDUnitTest extends CacheTestCase {
   /** 
    * Check that remote persistent regions cause conflicts
    */
+  @Test
   public void testPersistentRestriction() throws Exception {
     final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
     final String misConfigRegionName = getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java b/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
index a5dfb12..7e87621 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
@@ -1,20 +1,21 @@
-/*
- * 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.
- */
+/*
+ * 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.codeAnalysis;
+
 import java.io.IOException;
 import java.io.LineNumberReader;
 import java.util.ArrayList;
@@ -23,21 +24,18 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.Assert;
-
 import com.gemstone.gemfire.codeAnalysis.decode.CompiledClass;
 import com.gemstone.gemfire.codeAnalysis.decode.CompiledCode;
 import com.gemstone.gemfire.codeAnalysis.decode.CompiledMethod;
 
-
 /**
  * A class used to store the names of dataserializable classes and the sizes
  * of their toData/fromData methods.
- * 
- *
  */
 public class ClassAndMethodDetails implements Comparable {
+
   static String[] hexChars;
+
   public String className;
   public Map<String, byte[]> methodCode = new HashMap<String, byte[]>();
   
@@ -150,4 +148,4 @@ public class ClassAndMethodDetails implements Comparable {
   public int compareTo(Object other) {
     return this.className.compareTo(((ClassAndMethodDetails)other).className);
   }
-}
+}


[32/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
index cf42b9b..8815318 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
@@ -19,10 +19,33 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DeltaTestImpl;
 import com.gemstone.gemfire.InvalidDeltaException;
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -42,18 +65,21 @@ import com.gemstone.gemfire.internal.cache.lru.EnableLRU;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
 import com.gemstone.gemfire.internal.tcp.ConnectionTable;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * @since GemFire 6.1
  */
-public class DeltaPropagationDUnitTest extends DistributedTestCase {
-  private final static Compressor compressor = SnappyCompressor.getDefaultInstance();
+@Category(DistributedTest.class)
+public class DeltaPropagationDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final Compressor compressor = SnappyCompressor.getDefaultInstance();
   
   protected static Cache cache = null;
 
@@ -71,7 +97,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
   private int PORT2;
 
-  private static final String regionName = "DeltaPropagationDUnitTest";
+  private static final String regionName = DeltaPropagationDUnitTest.class.getSimpleName();
 
   private static LogWriter logger = null;
 
@@ -125,13 +151,6 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
   public static final String DESTROY = "DESTROY";
 
-  /**
-   * @param name
-   */
-  public DeltaPropagationDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -162,6 +181,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     disconnectAllFromDS();
   }
 
+  @Test
   public void testS2CSuccessfulDeltaPropagationWithCompression() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
             HARegionQueue.HA_EVICTION_POLICY_NONE, new Integer(1),
@@ -194,6 +214,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertTrue(listenerError.toString(), areListenerResultsValid);
   }
   
+  @Test
   public void testS2CSuccessfulDeltaPropagation() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -219,6 +240,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertTrue(listenerError.toString(), areListenerResultsValid);
   }
 
+  @Test
   public void testS2CFailureInToDeltaMethod() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -253,6 +275,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertTrue(listenerError.toString(), areListenerResultsValid);
   }
 
+  @Test
   public void testS2CFailureInFromDeltaMethod() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -281,6 +304,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertTrue(listenerError.toString(), areListenerResultsValid);
   }
 
+  @Test
   public void testS2CWithOldValueAtClientOverflownToDisk() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -315,6 +339,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertTrue(listenerError.toString(), areListenerResultsValid);
   }
 
+  @Test
   public void testS2CWithLocallyDestroyedOldValueAtClient() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -349,6 +374,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     verifyData(4, EVENTS_SIZE - 2);
   }
 
+  @Test
   public void testS2CWithInvalidatedOldValueAtClient() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -378,6 +404,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     assertTrue(listenerError.toString(), areListenerResultsValid);
   }
 
+  @Test
   public void testS2CDeltaPropagationWithClientConflationON() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -397,6 +424,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
         .getFromDeltaInvokations().longValue() == 0);
   }
 
+  @Test
   public void testS2CDeltaPropagationWithServerConflationON() throws Exception {
     VM0.invoke(() -> DeltaPropagationDUnitTest.closeCache());
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache(
@@ -429,6 +457,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
         (fromDeltaInvocations == (EVENTS_SIZE - 1)));
   }
 
+  @Test
   public void testS2CDeltaPropagationWithOnlyCreateEvents() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -451,6 +480,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testC2S2SDeltaPropagation() throws Exception {
     prepareDeltas();
     VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
@@ -498,6 +528,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
         .deltaFeatureUsed());
   }
 
+  @Test
   public void testS2S2CDeltaPropagationWithHAOverflow() throws Exception {
     prepareDeltas();
     VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
@@ -545,6 +576,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
         + fromDeltasOnClient, fromDeltasOnClient == (EVENTS_SIZE - 1));
   }
 
+  @Test
   public void testS2CDeltaPropagationWithGIIAndFailover() throws Exception {
     prepareDeltas();
     VM0.invoke(() -> DeltaPropagationDUnitTest.prepareDeltas());
@@ -613,6 +645,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testBug40165ClientReconnects() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -683,6 +716,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
   }
 
+  @Test
   public void testBug40165ClientFailsOver() throws Exception {
     PORT1 = ((Integer)VM0.invoke(() -> DeltaPropagationDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
     
@@ -1063,7 +1097,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
   public static Integer createServerCache(String ePolicy, Integer cap,
       Integer listenerCode, Boolean conflate, Compressor compressor) throws Exception {
     ConnectionTable.threadWantsSharedResources();
-    new DeltaPropagationDUnitTest("temp").createCache(new Properties());
+    new DeltaPropagationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setEnableSubscriptionConflation(conflate);
     if (listenerCode.intValue() != 0) {
@@ -1314,7 +1348,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(CONFLATE_EVENTS, conflate);
-    new DeltaPropagationDUnitTest("temp").createCache(props);
+    new DeltaPropagationDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     pool = ClientServerTestCase.configureConnectionPool(factory, "localhost", ports,
         true, Integer.parseInt(rLevel), 2, null, 1000, 250, false, -2);
@@ -1377,7 +1411,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
 
   public static void createDurableCacheClient(Pool poolAttr, String regionName,
       Properties dsProperties, Integer listenerCode, Boolean close) throws Exception {
-    new DeltaPropagationDUnitTest("temp").createCache(dsProperties);
+    new DeltaPropagationDUnitTest().createCache(dsProperties);
     PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
     pf.init(poolAttr);
     PoolImpl p = (PoolImpl)pf.create("DeltaPropagationDUnitTest");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
index 390d1c2..20deab0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
@@ -19,9 +19,25 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DeltaTestImpl;
 import com.gemstone.gemfire.InvalidDeltaException;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -32,16 +48,16 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.tcp.ConnectionTable;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- * 
- */
-public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DeltaPropagationStatsDUnitTest extends JUnit4DistributedTestCase {
 
   protected static VM vm0 = null;
 
@@ -69,10 +85,6 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
 
   private static final int CLIENT_TO_SERVER = 3;
 
-  public DeltaPropagationStatsDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -112,6 +124,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testS2CDeltaPropagationCleanStats() throws Exception {
     int numOfKeys = 50;
     long updates = 50;
@@ -137,6 +150,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testS2CDeltaPropagationFailedStats1() throws Exception {
     int numOfKeys = 25;
     long updates = 50;
@@ -167,7 +181,9 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
-  public void _testS2CDeltaPropagationFailedStats2() throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testS2CDeltaPropagationFailedStats2() throws Exception {
   }
 
   /**
@@ -175,6 +191,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testP2PDeltaPropagationCleanStats() throws Exception {
     int numOfKeys = 50;
     long updates = 50;
@@ -203,6 +220,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testP2PDeltaPropagationFailedStats1() throws Exception {
     int numOfKeys = 50, numOfkeys2 = 10;
     long updates = 50, updates2 = 50;
@@ -239,7 +257,9 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
-  public void _testP2PDeltaPropagationFailedStats2() throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testP2PDeltaPropagationFailedStats2() throws Exception {
   }
 
   /**
@@ -247,6 +267,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testC2SDeltaPropagationCleanStats() throws Exception {
     int numOfKeys = 50;
     long updates = 50;
@@ -279,6 +300,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testC2SDeltaPropagationFailedStats1() throws Exception {
     int numOfKeys = 50;
     long updates = 50;
@@ -310,7 +332,9 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
    * 
    * @throws Exception
    */
-  public void _testC2SDeltaPropagationFailedStats2() throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testC2SDeltaPropagationFailedStats2() throws Exception {
   }
 
   public static void waitForLastKey() {
@@ -513,7 +537,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    cache = new DeltaPropagationStatsDUnitTest("temp").createCache(props);
+    cache = new DeltaPropagationStatsDUnitTest().createCache(props);
     pool = PoolManager.createFactory().addServer(host, port)
         .setThreadLocalConnections(true).setMinConnections(1)
         .setSubscriptionEnabled(true).setSubscriptionRedundancy(0)
@@ -546,8 +570,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
   public static Integer createServerCache(Boolean flag, DataPolicy policy,
       Scope scope, Boolean listener) throws Exception {
     ConnectionTable.threadWantsSharedResources();
-    DeltaPropagationStatsDUnitTest test = new DeltaPropagationStatsDUnitTest(
-        "temp");
+    DeltaPropagationStatsDUnitTest test = new DeltaPropagationStatsDUnitTest();
     Properties props = new Properties();
     if (!flag) {
       props

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaSizingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaSizingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaSizingDUnitTest.java
index 7d53098..664c3b2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaSizingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaSizingDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 com.gemstone.gemfire.cache.AttributesFactory;
@@ -39,43 +48,52 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *
  */
-public class DeltaSizingDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DeltaSizingDUnitTest extends JUnit4CacheTestCase {
   
   /**
    * @param name
    */
-  public DeltaSizingDUnitTest(String name) {
-    super(name);
+  public DeltaSizingDUnitTest() {
+    super();
   }
   
+  @Test
   public void testPeerWithoutCloning() throws Exception {
     doPeerTest(false, false);
   }
   
+  @Test
   public void testPeerWithCloning() throws Exception {
     doPeerTest(true, false);
   }
   
+  @Test
   public void testPeerWithCopyOnRead() throws Exception {
     doPeerTest(false, true);
   }
   
+  @Test
   public void testPeerWithCopyOnAndClone() throws Exception {
     doPeerTest(true, true);
   }
   
+  @Test
   public void testClientWithoutCloning() throws Exception {
     doClientTest(false, false);
   }
   
+  @Test
   public void testClientWithCloning() throws Exception {
     doClientTest(true, false);
   }
   
+  @Test
   public void testClientWithCopyOnRead() throws Exception {
     doClientTest(false, true);
   }
   
+  @Test
   public void testClientWithCopyOnAndClone() throws Exception {
     doClientTest(true, true);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java
index 5819060..56f533a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java
@@ -16,43 +16,44 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.HeapDataOutputStream;
 import com.gemstone.gemfire.internal.InternalDataSerializer;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.cache.versions.RegionVersionHolder;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Tests offline compaction
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskOfflineCompactionJUnitTest
-{
-
-  protected static Cache cache = null;
-
-  protected static DistributedSystem ds = null;
+public class DiskOfflineCompactionJUnitTest {
 
   // In this test, entry version, region version, member id, each will be 1 byte
-  final static int versionsize = 3;
+  private static final int versionsize = 3;
 
-  static {
-  }
+  private static Cache cache = null;
+
+  private static DistributedSystem ds = null;
 
   private int getDSID(LocalRegion lr) {
     return lr.getDistributionManager().getDistributedSystemId();    
@@ -217,8 +218,7 @@ public class DiskOfflineCompactionJUnitTest
   }
 
   @Test
-  public void testTwoEntriesWithUpdateAndDestroy()
-      throws Exception {
+  public void testTwoEntriesWithUpdateAndDestroy() throws Exception {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
     dsf.setAutoCompact(false);
     String name = "testTwoEntriesWithUpdateAndDestroy";
@@ -553,8 +553,7 @@ public class DiskOfflineCompactionJUnitTest
   }
 
   @Test
-  public void testForceRollTwoEntriesWithUpdates()
-      throws Exception {
+  public void testForceRollTwoEntriesWithUpdates() throws Exception {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
     dsf.setAutoCompact(false);
     String name = "testForceRollTwoEntriesWithUpdates";
@@ -639,8 +638,7 @@ public class DiskOfflineCompactionJUnitTest
   }
 
   @Test
-  public void testForceRollTwoEntriesWithUpdateAndDestroy()
-      throws Exception {
+  public void testForceRollTwoEntriesWithUpdateAndDestroy() throws Exception {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
     dsf.setAutoCompact(false);
     String name = "testForceRollTwoEntriesWithUpdateAndDestroy";
@@ -733,7 +731,7 @@ public class DiskOfflineCompactionJUnitTest
   }
   
   // uitl methods for calculation
-  public static int getValueSizeInOplog(Object value) {
+  private  static int getValueSizeInOplog(Object value) {
     if (value instanceof String) {
       return getStrSizeInOplog((String)value);
     } else if (value instanceof byte[]) {
@@ -742,33 +740,40 @@ public class DiskOfflineCompactionJUnitTest
     }
     return -1;
   }
-  public static int getStrSizeInOplog(String str) {
+
+  private static int getStrSizeInOplog(String str) {
     // string saved in UTF format will use 3 bytes extra.
     // 4 is hard-coded overhead in Oplog for each string
     return str.length()+3+4;
   }
-  public static int getSize4Create(int extra_byte_num_per_entry, String key, Object value) {
+
+  static int getSize4Create(int extra_byte_num_per_entry, String key, Object value) {
     int createsize = 1 /* opcode */ + 1 /* userbits */ + versionsize + extra_byte_num_per_entry
       + getStrSizeInOplog(key) + 1 /* drid */ + getValueSizeInOplog(value) + 1 /* END_OF_RECORD_ID */;
     return createsize;
   }
-  public static int getSize4UpdateWithKey(int extra_byte_num_per_entry, String key, Object value) {
+
+  private static int getSize4UpdateWithKey(int extra_byte_num_per_entry, String key, Object value) {
     return getSize4UpdateWithoutKey(extra_byte_num_per_entry, value) + getStrSizeInOplog(key);
   }
-  public static int getSize4UpdateWithoutKey(int extra_byte_num_per_entry, Object value) {
+
+  private static int getSize4UpdateWithoutKey(int extra_byte_num_per_entry, Object value) {
     int updatesize = 1 /* opcode */ + 1 /* userbits */ + versionsize + extra_byte_num_per_entry
     + 1 /* drid */ + getValueSizeInOplog(value) +1 /* delta */ + 1 /* END_OF_RECORD_ID */;
     return updatesize;
   }
-  public static int getSize4TombstoneWithKey(int extra_byte_num_per_entry, String key) {
+
+  static int getSize4TombstoneWithKey(int extra_byte_num_per_entry, String key) {
     return getSize4TombstoneWithoutKey(extra_byte_num_per_entry) + getStrSizeInOplog(key);
   }
-  public static int getSize4TombstoneWithoutKey(int extra_byte_num_per_entry) {
+
+  private static int getSize4TombstoneWithoutKey(int extra_byte_num_per_entry) {
     int tombstonesize = 1 /* opcode */ + 1 /* userbits */ + versionsize + extra_byte_num_per_entry
     + 1 /* drid */ +1 /* delta */ + 1 /* END_OF_RECORD_ID */;
     return tombstonesize;
   }
-  public static int getRVVSize(int drMapSize, int[] numOfMemberPerDR, boolean gcRVV) {
+
+  static int getRVVSize(int drMapSize, int[] numOfMemberPerDR, boolean gcRVV) {
     // if there's one member in rvv, total size is 9 bytes: 
     // 0: OPLOG_RVV. 1: drMap.size()==1, 2: disRegionId, 3: getRVVTrusted 
     // 4: memberToVersion.size()==1, 5: memberid, 6-7: versionHolder 8: END_OF_RECORD_ID

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java
index ccf6c87..1b78dae 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java
@@ -16,6 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Properties;
+import java.util.Set;
+
 import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
@@ -24,6 +30,17 @@ 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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskWriteAttributesFactory;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
 import java.io.File;
 import java.util.Properties;
 import java.util.Set;
@@ -34,29 +51,24 @@ import static org.junit.Assert.*;
 /**
  * Tests the old disk apis to make sure they do the correct thing.
  * Once we drop these old deprecated disk apis then this unit test can be removed.
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskOldAPIsJUnitTest
-{
+public class DiskOldAPIsJUnitTest {
 
   protected static Cache cache = null;
 
   protected static DistributedSystem ds = null;
-  protected static Properties props = new Properties();
 
-  static {
+  @Before
+  public void setUp() throws Exception {
+    Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(LOG_LEVEL, "config"); // to keep diskPerf logs smaller
     props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
     props.setProperty(ENABLE_TIME_STATISTICS, "true");
     props.setProperty(STATISTIC_ARCHIVE_FILE, "stats.gfs");
-  }
 
-  @Before
-  public void setUp() throws Exception {
     cache = new CacheFactory(props).create();
     ds = cache.getDistributedSystem();
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = true;
@@ -72,11 +84,12 @@ public class DiskOldAPIsJUnitTest
    * Make sure that if diskWriteAttributes sets sync then it shows up in the new apis.
    */
   @Test
-  public void testSyncBit() {
+  public void testSyncBit() throws Exception {
     doSyncBitTest(true);
     doSyncBitTest(false);
     doSyncBitTest(true);
   }
+
   private void doSyncBitTest(boolean destroyRegion) {
     DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
     dwaf.setSynchronous(true);
@@ -200,7 +213,7 @@ public class DiskOldAPIsJUnitTest
    * Note that the isSync bit is tested by another method.
    */
   @Test
-  public void testDWA_1() {
+  public void testDWA_1() throws Exception {
     DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
     dwaf.setMaxOplogSize(1);
     dwaf.setTimeInterval(333);
@@ -250,7 +263,7 @@ public class DiskOldAPIsJUnitTest
   }
   
   @Test
-  public void testDWA_2() {
+  public void testDWA_2() throws Exception {
     DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
     dwaf.setMaxOplogSize(2);
     dwaf.setTimeInterval(1);
@@ -300,7 +313,7 @@ public class DiskOldAPIsJUnitTest
    * Make sure the old diskDirs apis get mapped onto the diskStore.
    */
   @Test
-  public void testDiskDirs() {
+  public void testDiskDirs() throws Exception {
     File f1 = new File("testDiskDir1");
     f1.mkdir();
     File f2 = new File("testDiskDir2");
@@ -358,7 +371,7 @@ public class DiskOldAPIsJUnitTest
    * Make sure the old diskDirs apis get mapped onto the diskStore.
    */
   @Test
-  public void testDiskDirsAndSizes() {
+  public void testDiskDirsAndSizes() throws Exception {
     File f1 = new File("testDiskDir1");
     f1.mkdir();
     File f2 = new File("testDiskDir2");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRandomOperationsAndRecoveryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRandomOperationsAndRecoveryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRandomOperationsAndRecoveryJUnitTest.java
index 93e8731..43fe7b0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRandomOperationsAndRecoveryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRandomOperationsAndRecoveryJUnitTest.java
@@ -38,39 +38,29 @@ import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-/**
- * 
- *
- */
-@Category(IntegrationTest.class)
-public class DiskRandomOperationsAndRecoveryJUnitTest extends DiskRegionTestingBase
-{
-  DiskRegionProperties diskProps = new DiskRegionProperties();
-  private static int ENTRY_SIZE = 1024;
-  final static byte[] valueBytes = new byte[ENTRY_SIZE];
+@
+  Category(IntegrationTest.class)
+public class DiskRandomOperationsAndRecoveryJUnitTest extends DiskRegionTestingBase {
+
+  private static final int ENTRY_SIZE = 1024;
+
+  private static final byte[] valueBytes = new byte[ENTRY_SIZE];
   static {
     Arrays.fill(valueBytes, (byte)32);
   }
-  final static private Object value = new String(valueBytes);
 
-  // private static final boolean debug = false;
+  private static final Object value = new String(valueBytes);
 
-  private static int testId=0;
-  
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  private static int testId = 0;
+
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
+
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     testId++;
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
-
   private final static int ITERATIONS = 4;
   private final static long MAX_OPLOG_SIZE_IN_BYTES = 1024*16;
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
index 84771b0..2fe634b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.util.Arrays;
 import java.util.Properties;
@@ -44,7 +53,8 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  */
 
-public class DiskRegByteArrayDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DiskRegByteArrayDUnitTest extends JUnit4CacheTestCase {
   static Cache cache;
   static Properties props = new Properties();
   static Properties propsWork = new Properties();
@@ -53,27 +63,26 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
   static CacheTransactionManager cacheTxnMgr;
   protected static File[] dirs = null;
   final static byte[] value = new byte[1024];
-  
-   
-    public DiskRegByteArrayDUnitTest(String name) {
-        super(name);
-        File file1 = new File( name + "1");
-        file1.mkdir();
-        file1.deleteOnExit();
-        File file2 = new File( name + "2");
-        file2.mkdir();
-        file2.deleteOnExit();
-        File file3 = new File( name + "3");
-        file3.mkdir();
-        file3.deleteOnExit();
-        File file4 = new File( name + "4");
-        file4.mkdir();
-        file4.deleteOnExit();
-        dirs = new File[4];
-        dirs[0] = file1;
-        dirs[1] = file2;
-        dirs[2] = file3;
-        dirs[3] = file4;
+
+    public DiskRegByteArrayDUnitTest() {
+      super();
+      File file1 = new File( getTestMethodName() + "1");
+      file1.mkdir();
+      file1.deleteOnExit();
+      File file2 = new File( getTestMethodName() + "2");
+      file2.mkdir();
+      file2.deleteOnExit();
+      File file3 = new File( getTestMethodName() + "3");
+      file3.mkdir();
+      file3.deleteOnExit();
+      File file4 = new File( getTestMethodName() + "4");
+      file4.mkdir();
+      file4.deleteOnExit();
+      dirs = new File[4];
+      dirs[0] = file1;
+      dirs[1] = file2;
+      dirs[2] = file3;
+      dirs[3] = file4;
     }
 
     @Override
@@ -103,7 +112,7 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
     
     public static void createCacheForVM0(){
         try{
-            ds = (new DiskRegByteArrayDUnitTest("vm0_diskReg")).getSystem(props);
+            ds = (new DiskRegByteArrayDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -124,7 +133,7 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
     public static void createCacheForVM1(){
         try{
             
-            ds = (new DiskRegByteArrayDUnitTest("vm1_diskReg")).getSystem(props);
+            ds = (new DiskRegByteArrayDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -154,7 +163,8 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
     
     //test methods
  
-    public void testPutGetByteArray(){
+  @Test
+  public void testPutGetByteArray(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java
index 840cb67..3849be3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java
@@ -16,23 +16,28 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import com.gemstone.gemfire.util.test.TestUtil;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
 /**
  * This test is for testing Disk attributes set via xml.
@@ -43,16 +48,15 @@ import static org.junit.Assert.fail;
  * @since GemFire 5.1
  */
 @Category(IntegrationTest.class)
-public class DiskRegCacheXmlJUnitTest
-{
-  Cache cache = null;
+public class DiskRegCacheXmlJUnitTest {
 
-  DistributedSystem ds = null;
+  private Cache cache = null;
 
-  protected static File[] dirs = null;
+  private DistributedSystem ds = null;
 
-  public void mkDirAndConnectDs()
-  {
+  private static File[] dirs = null;
+
+  private void mkDirAndConnectDs() {
     File file1 = new File("d1");
     file1.mkdir();
     file1.deleteOnExit();
@@ -73,19 +77,12 @@ public class DiskRegCacheXmlJUnitTest
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(CACHE_XML_FILE, path);
     ds = DistributedSystem.connect(props);
-    try {
-      // Create the cache which causes the cache-xml-file to be parsed
-      cache = CacheFactory.create(ds);
-    }
-    catch (Exception ex) {
-      ds.getLogWriter().error("Exception occured",ex);
-      fail("failed to create cache due to "+ex);
-    }
+    // Create the cache which causes the cache-xml-file to be parsed
+    cache = CacheFactory.create(ds);
   }
 
   @Test
-  public void testDiskRegCacheXml()
-  {
+  public void testDiskRegCacheXml() throws Exception {
     mkDirAndConnectDs();
     // Get the region1 which is a subregion of /root
     Region region1 = cache.getRegion("/root1/PersistSynchRollingOplog1");
@@ -218,30 +215,21 @@ public class DiskRegCacheXmlJUnitTest
     deleteFiles();
   }
 
-  private static void deleteFiles()
-  {
+  private static void deleteFiles() {
     for (int i = 0; i < dirs.length; i++) {
       File[] files = dirs[i].listFiles();
       for (int j = 0; j < files.length; j++) {
         files[j].delete();
       }
     }
-
   }
-  
-  
-  @After
-  public void tearDown() throws Exception
-  {
 
-    /*if (cache != null && !cache.isClosed()) {
-      cache.close();
-    }*/
+  @After
+  public void tearDown() throws Exception {
     try {
       if (cache != null && !cache.isClosed()) {
         for (Iterator itr = cache.rootRegions().iterator(); itr.hasNext();) {
           Region root = (Region)itr.next();
-//          String name = root.getName();
 					if(root.isDestroyed() || root instanceof HARegion) {
             continue;
         	}
@@ -259,21 +247,10 @@ public class DiskRegCacheXmlJUnitTest
       }
     }
     finally {
-      try {
-        closeCache();
-      }
-      catch (VirtualMachineError e) {
-        SystemFailure.initiateFailure(e);
-        throw e;
-      }
-      catch (Throwable t) {
-        ds.getLogWriter().error("Error in closing the cache ", t);
-        
-      }
+      closeCache();
     }
   }
-  
-  
+
   /** Close the cache */
   private  synchronized final void closeCache() {
     if (cache != null) {
@@ -294,4 +271,3 @@ public class DiskRegCacheXmlJUnitTest
     }
   }
 }// end of DiskRegCacheXmlJUnitTest
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java
index 76eaab8..591046f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java
@@ -16,46 +16,38 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import java.io.File;
 import java.io.FileWriter;
+import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.fail;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * This test is for testing Disk attributes set programmatically
  * The generated cacheXml is used to create a cache and teh region
  * properties retested.
- * 
  */
 @Category(IntegrationTest.class)
-public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase
-{
-  PrintWriter pw;
-
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase {
 
-  DiskRegionProperties[] diskRegionProperties = new DiskRegionProperties[12];
+  private DiskRegionProperties[] diskRegionProperties = new DiskRegionProperties[12];
 
-  Region[] regions = new Region[12];
+  private Region[] regions = new Region[12];
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskDirSize = new int[4];
     diskDirSize[0] = Integer.MAX_VALUE;
     diskDirSize[1] = Integer.MAX_VALUE;
@@ -74,54 +66,46 @@ public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase
     }
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-
-  }
-
-  public void createCacheXML()
-  {
+  public void createCacheXML() throws IOException {
     // create the regions[0] which is SyncPersistOnly and set DiskWriteAttibutes
     diskRegionProperties[0].setRolling(true);
     diskRegionProperties[0].setMaxOplogSize(1073741824L);
     diskRegionProperties[0].setRegionName("regions1");
     regions[0] = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
-        diskRegionProperties[0], Scope.LOCAL);
+      diskRegionProperties[0], Scope.LOCAL);
 
     // create the regions[1] which is SyncPersistOnly and set DiskWriteAttibutes
 
     diskRegionProperties[1].setRolling(false);
     diskRegionProperties[1].setRegionName("regions2");
     regions[1] = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
-        diskRegionProperties[1], Scope.LOCAL);
+      diskRegionProperties[1], Scope.LOCAL);
 
     // create the regions[2] which AsyncPersistOnly, No buffer and Rolling oplog
     diskRegionProperties[2].setRolling(true);
     diskRegionProperties[2].setMaxOplogSize(1073741824L);
     diskRegionProperties[2].setRegionName("regions3");
     regions[2] = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache,
-        diskRegionProperties[2]);
+      diskRegionProperties[2]);
 
     // create the regions[3] which is AsynchPersistonly, No buffer and fixed oplog
     diskRegionProperties[3].setRolling(false);
     diskRegionProperties[3].setRegionName("regions4");
     regions[3] = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache,
-        diskRegionProperties[3]);
+      diskRegionProperties[3]);
 
     // create the regions[4] which is SynchOverflowOnly, Rolling oplog
     diskRegionProperties[4].setRolling(true);
     diskRegionProperties[4].setMaxOplogSize(1073741824L);
     diskRegionProperties[4].setRegionName("regions5");
     regions[4] = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache,
-        diskRegionProperties[4]);
+      diskRegionProperties[4]);
 
     // create the regions[5] which is SyncOverflowOnly, Fixed oplog
     diskRegionProperties[5].setRolling(false);
     diskRegionProperties[5].setRegionName("regions6");
     regions[5] = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache,
-        diskRegionProperties[5]);
+      diskRegionProperties[5]);
 
     // create the regions[6] which is AsyncOverflow, with Buffer and rolling oplog
     diskRegionProperties[6].setRolling(true);
@@ -130,7 +114,7 @@ public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase
     diskRegionProperties[6].setTimeInterval(15l);
     diskRegionProperties[6].setRegionName("regions7");
     regions[6] = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
-        diskRegionProperties[6]);
+      diskRegionProperties[6]);
 
     // create the regions[7] which is AsyncOverflow ,Time base buffer-zero byte
     // buffer
@@ -140,20 +124,20 @@ public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase
     diskRegionProperties[7].setBytesThreshold(0l);
     diskRegionProperties[7].setRegionName("regions8");
     regions[7] = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
-        diskRegionProperties[7]);
+      diskRegionProperties[7]);
 
     // create the regions[8] which is SyncPersistOverflow, Rolling oplog
     diskRegionProperties[8].setRolling(true);
     diskRegionProperties[8].setMaxOplogSize(1073741824L);
     diskRegionProperties[8].setRegionName("regions9");
     regions[8] = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,
-        diskRegionProperties[8]);
+      diskRegionProperties[8]);
 
     // create the regions[9] which is Sync PersistOverflow, fixed oplog
     diskRegionProperties[9].setRolling(false);
     diskRegionProperties[9].setRegionName("regions10");
     regions[9] = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,
-        diskRegionProperties[9]);
+      diskRegionProperties[9]);
     // create the regions[10] which is Async Overflow Persist ,with buffer and
     // rollong
     // oplog
@@ -163,7 +147,7 @@ public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase
     diskRegionProperties[10].setTimeInterval(15l);
     diskRegionProperties[10].setRegionName("regions11");
     regions[10] = DiskRegionHelperFactory.getAsyncOverFlowAndPersistRegion(cache,
-        diskRegionProperties[10]);
+      diskRegionProperties[10]);
 
     // create the regions[11] which is Async Persist Overflow with time based
     // buffer
@@ -173,73 +157,63 @@ public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase
     diskRegionProperties[11].setTimeInterval(15l);
     diskRegionProperties[11].setRegionName("regions12");
     regions[11] = DiskRegionHelperFactory.getAsyncOverFlowAndPersistRegion(cache,
-        diskRegionProperties[11]);
-
+      diskRegionProperties[11]);
 
     //cacheXmlGenerator: generates cacheXml file
-    try {
-      FileWriter fw = new FileWriter(new File("DiskRegCachexmlGeneratorJUnitTest.xml"));
-      PrintWriter pw = new PrintWriter(fw);
-      CacheXmlGenerator.generate(cache, pw);
-    }
-    catch (Exception ex) {
-      logWriter.error("Exception occured",ex);
-      fail("FAILED While cache xml generation");
-    }
-
+    FileWriter fw = new FileWriter(new File(getClass().getSimpleName() + ".xml"));
+    PrintWriter pw = new PrintWriter(fw);
+    CacheXmlGenerator.generate(cache, pw);
   }
-  
+
   @Test
-  public void testVerifyCacheXml() throws Exception
-  {
+  public void testVerifyCacheXml() throws Exception {
     createCacheXML();
     ds.disconnect();
     // Connect to the GemFire distributed system
     Properties props = new Properties();
-    props.setProperty(NAME, "DiskRegCachexmlGeneratorJUnitTest");
+    props.setProperty(NAME, getClass().getSimpleName());
     props.setProperty(MCAST_PORT, "0");
-    String path = "DiskRegCachexmlGeneratorJUnitTest.xml";
+    String path = getClass().getSimpleName() + ".xml";
     props.setProperty(CACHE_XML_FILE, path);
     ds = DistributedSystem.connect(props);
     // Create the cache which causes the cache-xml-file to be parsed
     cache = CacheFactory.create(ds);
 
-    // Get the regions[0] 
+    // Get the regions[0]
     verify((LocalRegion) cache.getRegion("regions1"), diskRegionProperties[0]);
 
     // Get the regions[1]
     verify((LocalRegion) cache.getRegion("regions2"), diskRegionProperties[1]);
 
-    // Get the regions[2] 
+    // Get the regions[2]
     verify((LocalRegion) cache.getRegion("regions3"), diskRegionProperties[2]);
 
-    // Get the regions[3] 
+    // Get the regions[3]
     verify((LocalRegion) cache.getRegion("regions4"), diskRegionProperties[3]);
-    
-    // Get the regions[4] 
+
+    // Get the regions[4]
     verify((LocalRegion) cache.getRegion("regions5"), diskRegionProperties[4]);
 
-    // Get the regions[5] 
+    // Get the regions[5]
     verify((LocalRegion) cache.getRegion("regions6"), diskRegionProperties[5]);
-    
-    // Get the regions[6] 
+
+    // Get the regions[6]
     verify((LocalRegion) cache.getRegion("regions7"), diskRegionProperties[6]);
 
-    // Get the regions[7] 
+    // Get the regions[7]
     verify((LocalRegion) cache.getRegion("regions8"), diskRegionProperties[7]);
 
-    // Get the regions[8] 
+    // Get the regions[8]
     verify((LocalRegion) cache.getRegion("regions9"), diskRegionProperties[8]);
 
-    // Get the regions[9] 
+    // Get the regions[9]
     verify((LocalRegion) cache.getRegion("regions10"), diskRegionProperties[9]);
 
     // Get the regions[10]
     verify((LocalRegion) cache.getRegion("regions11"), diskRegionProperties[10]);
 
-    // Get the regions[11] 
+    // Get the regions[11]
     verify((LocalRegion) cache.getRegion("regions12"), diskRegionProperties[11]);
   }
 
-}// end of DiskRegCachexmlGeneratorJUnitTest
-
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCbkChkJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCbkChkJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCbkChkJUnitTest.java
index 34d540d..75701e1 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCbkChkJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCbkChkJUnitTest.java
@@ -16,10 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -30,30 +28,16 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
- *  * Tests if callbacks are getting invoked correctly 
- *   * for 'create', 'update' and 'destroy' of disk region entries
- *    * with concurrent 'clear' 
- *      *
+ * Tests if callbacks are getting invoked correctly
+ * for 'create', 'update' and 'destroy' of disk region entries
+ * with concurrent 'clear'
  */
 @Category(IntegrationTest.class)
-public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase 
-{
+public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase {
 
-  volatile static boolean intoCreateAfterCbk = false;
-  volatile static boolean intoUpdateAfterCbk = false;
-  volatile static boolean intoDestroyAfterCbk = false;
-  
-  @Before
-  public void setUp() throws Exception
-  {  
-    super.setUp();
-  }
-
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
+  private static volatile boolean intoCreateAfterCbk = false;
+  private static volatile boolean intoUpdateAfterCbk = false;
+  private static volatile boolean intoDestroyAfterCbk = false;
   
   private DiskRegionProperties getDiskRegionProperties(){
     DiskRegionProperties diskProperties = new DiskRegionProperties();
@@ -64,8 +48,7 @@ public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase
   }
     
   @Test
-  public void testAfterCallbacks()
-  {
+  public void testAfterCallbacks() {
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
       getDiskRegionProperties(), Scope.LOCAL);
 
@@ -112,6 +95,5 @@ public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase
     region.create("key3", "createValue");
     region.destroy("key3");
     assertTrue("Destroy callback not called", intoDestroyAfterCbk);
-	
-  }  
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java
index ba3af6a..99ab7e6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java
@@ -16,16 +16,11 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-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 java.io.File;
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -39,44 +34,31 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Miscellaneous disk tests
- * 
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegOplogSwtchingAndRollerJUnitTest extends
-    DiskRegionTestingBase
-{
+public class DiskRegOplogSwtchingAndRollerJUnitTest extends DiskRegionTestingBase {
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private static File[] dirs1 = null;
 
-  protected boolean encounteredException = false;
+  private static int[] diskDirSize1 = null;
 
-  protected volatile boolean hasBeenNotified = false;
+  private volatile boolean hasBeenNotified = false;
 
-  protected static File[] dirs1 = null;
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  protected static int[] diskDirSize1 = null;
+  private boolean encounteredException = false;
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
-  }
+  private Object forWaitNotify = new Object();
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
+  private boolean gotNotification = false;
+
+  private Object getValOnDsk = null;
 
   /**
-   * tests non occurence of DiskAccessException
-   *  
+   * tests non occurrence of DiskAccessException
    */
   @Test
-  public void testSyncPersistRegionDAExp()
-  {
+  public void testSyncPersistRegionDAExp() {
     File testingDirectory1 = new File("testingDirectory1");
     testingDirectory1.mkdir();
     testingDirectory1.deleteOnExit();
@@ -114,8 +96,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
   }// end of testSyncPersistRegionDAExp
 
   @Test
-  public void testAsyncPersistRegionDAExp()
-  {
+  public void testAsyncPersistRegionDAExp() {
     File testingDirectory1 = new File("testingDirectory1");
     testingDirectory1.mkdir();
     testingDirectory1.deleteOnExit();
@@ -151,8 +132,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
   }// end of testAsyncPersistRegionDAExp
 
-  private void diskAccessExpHelpermethod(final Region region)
-  {
+  private void diskAccessExpHelpermethod(final Region region) {
     final byte[] value = new byte[990];
     Arrays.fill(value, (byte)77);
     try {
@@ -172,18 +152,11 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
     }
   }
 
-  protected Object forWaitNotify = new Object();
-
-  protected boolean gotNotification = false;
-
   /**
    * DiskRegionRollingJUnitTest :
-   * 
-   *  
    */
   @Test
-  public void testSyncRollingHappening()
-  {
+  public void testSyncRollingHappening() {
     try {
       DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
       diskRegionProperties.setDiskDirs(dirs);
@@ -235,8 +208,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
   }
 
   @Test
-  public void testSyncRollingNotHappening()
-  {
+  public void testSyncRollingNotHappening() {
     try {
       DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
       diskRegionProperties.setDiskDirs(dirs);
@@ -277,8 +249,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
   }
 
   @Test
-  public void testAsyncRollingHappening()
-  {
+  public void testAsyncRollingHappening() {
     try {
       DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
       diskRegionProperties.setDiskDirs(dirs);
@@ -334,8 +305,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
   }
 
   @Test
-  public void testAsyncRollingNotHappening()
-  {
+  public void testAsyncRollingNotHappening() {
     try {
       DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
       diskRegionProperties.setDiskDirs(dirs);
@@ -374,8 +344,6 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
   }
 
-  protected Object getValOnDsk = null;
-
   /**
    * DiskRegOplog1OverridingOplog2JUnitTest: Disk Region test : oplog1 flush
    * overriding oplog2 flush
@@ -383,11 +351,9 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
    * This test will hold the flush of oplog1 and flush oplog2 before it. After
    * that oplog1 is allowed to flush. A get of an entry which was first put in
    * oplog1 and then in oplog2 should result in the get being done from oplog2.
-   *  
    */
   @Test
-  public void testOplog1FlushOverridingOplog2Flush()
-  {
+  public void testOplog1FlushOverridingOplog2Flush() {
     hasBeenNotified = false;
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(true);
@@ -468,8 +434,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
 
   }// end of testOplog1FlushOverridingOplog2Flush
 
-  class DoesFlush implements Runnable
-  {
+  private class DoesFlush implements Runnable {
 
     private Region region;
 
@@ -477,15 +442,14 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
       this.region = region;
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       ((LocalRegion)region).getDiskRegion().flushForTesting();
       synchronized (region) {
         region.notify();
         hasBeenNotified = true;
       }
     }
-
   }
 
   /**
@@ -493,8 +457,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
    * the time rolling has started , the entry exists in the current oplog
    */
   @Test
-  public void testEntryExistsinCurrentOplog()
-  {
+  public void testEntryExistsinCurrentOplog() {
     hasBeenNotified = false;
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(true);
@@ -585,11 +548,9 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
   /**
    * Entries deleted in current Oplog are recorded correctly during the rolling
    * of that oplog
-   *  
    */
   @Test
-  public void testEntryDeletedinCurrentOplog()
-  {
+  public void testEntryDeletedinCurrentOplog() {
     hasBeenNotified = false;
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(true);
@@ -690,28 +651,15 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
    // region.close();
   }// end of testEntryDeletedinCurrentOplog
 
-
-  /**
-   * 
-   * @param region
-   *          get LRU statistics
-   */
-  protected LRUStatistics getLRUStats(Region region)
-  {
+  private LRUStatistics getLRUStats(Region region) {
     return ((LocalRegion)region).getEvictionController().getLRUHelper()
         .getStats();
   }
 
   /**
    * to validate the get operation performed on a byte array.
-   * 
-   * @param key
-   * @param region
-   * @return
    */
-
-  private boolean getByteArrVal(Long key, Region region)
-  {
+  private boolean getByteArrVal(Long key, Region region) {
     Object val = null;
     byte[] val2 = new byte[1024];
     Arrays.fill(val2, (byte)77);
@@ -742,12 +690,10 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
    * Roller should wait for asynch writer to terminate if asynch flush is going
    * on , before deleting the oplog
    */
-  protected boolean afterWritingBytes = false;
+  private boolean afterWritingBytes = false;
 
   @Test
-  public void testOplogRollerWaitingForAsyncWriter()
-  {
-
+  public void testOplogRollerWaitingForAsyncWriter() {
     hasBeenNotified = false;
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(true);
@@ -838,8 +784,7 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
 
   }// end of testOplogRollerWaitingForAsyncWriter
 
-  class DoesFlush1 implements Runnable
-  {
+  private class DoesFlush1 implements Runnable {
 
     private Region region;
 
@@ -847,27 +792,22 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
       this.region = region;
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       ((LocalRegion)region).getDiskRegion().flushForTesting();
       synchronized (region) {
         region.notify();
         hasBeenNotified = true;
       }
     }
-
   }
 
   /**
    * Task 125: Ensuring that retrieval of evicted entry data for rolling
    * purposes is correct & does not cause any eviction sort of things
-   * 
-   * @throws EntryNotFoundException
-   *  
    */
   @Test
-  public void testGetEvictedEntry() throws EntryNotFoundException
-  {
+  public void testGetEvictedEntry() throws EntryNotFoundException {
     hasBeenNotified = false;
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(false);
@@ -969,10 +909,8 @@ public class DiskRegOplogSwtchingAndRollerJUnitTest extends
    * DiskAccessException doesn't occur even when amount of put data exceeds the
    * max dir sizes.
    */
-
   @Test
-  public void testDiskFullExcep()
-  {
+  public void testDiskFullExcep() {
     boolean exceptionOccured = false;
     int[] diskDirSize1 = new int[4];
     diskDirSize1[0] = 1048576;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegRecoveryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegRecoveryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegRecoveryJUnitTest.java
index 4e3beaa..792f07e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegRecoveryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegRecoveryJUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.BufferedInputStream;
 import java.io.DataInputStream;
 import java.io.File;
@@ -25,13 +27,9 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.cache.DiskStore;
 import com.gemstone.gemfire.cache.EntryNotFoundException;
 import com.gemstone.gemfire.cache.Region;
@@ -45,33 +43,24 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * @since GemFire 5.1
  */
 @Category(IntegrationTest.class)
-public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
-{
-  DiskRegionProperties diskProps = new DiskRegionProperties();
-  
-  private static int EMPTY_RVV_SIZE = 6;
-
-//  private static final boolean debug = false;
-
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
-    diskProps.setDiskDirs(dirs);
-  }
-
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
+public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase {
 
+  private static int EMPTY_RVV_SIZE = 6;
   private static int ENTRY_SIZE = 1024;
 
   private static boolean oplogsIDsNotifiedToRoll;
+
+  private boolean proceedWithRolling;
+  private boolean rollingDone;
+  private boolean verifiedOplogs;
+  private final Object verifiedSync = new Object();
+
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
   
-  boolean proceedWithRolling, rollingDone, verifiedOplogs;
-  final Object verifiedSync = new Object();
+  @Override
+  protected final void postSetUp() throws Exception {
+    diskProps.setDiskDirs(dirs);
+  }
 
   /**
    * Disk region recovery test for Persist only with sync writes. Test has four
@@ -82,11 +71,9 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
    * 1. Get and verify the entries put in STEP 1 and STEP 2. STEP 4: Create
    * cache. Create Region with the same name as that of in STEP 1. Get and
    * verify the entries put in STEP 1 and STEP 2.
-   * 
    */
   @Test
-  public void testDiskRegRecovery()
-  {
+  public void testDiskRegRecovery() {
     /**
      * STEP 1
      */
@@ -310,21 +297,18 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
     getByteArrValZeroLnth("119", region);
 
     closeDown();  // closes disk file which will flush all buffers
-
   }
 
-/**
+  /**
    * Disk region recovery test for Persist only with sync writes. Test has four
    * steps : STEP 1: Create cache. Create Region. Put entries. Close cache. STEP
    * 2: Create cache. Create Region with the same name as that of in STEP 1. Delete some entries.
    * Close the Cache   * 
    * 3: Again Create cache. Create Region with the same name as that of in STEP
    * 4) Verify that the entries got deleted
-   * 
    */
   @Test
-  public void testBug39989_1()
-  {
+  public void testBug39989_1() {
     /**
      * STEP 1
      */
@@ -409,9 +393,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
     }   
 
     closeDown();  // closes disk file which will flush all buffers
-
   }
-  
 
   /**
    * Disk region recovery test for Persist only with sync writes. Test has four
@@ -421,11 +403,9 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
    * Close the Cache   * 
    * 3: Again Create cache.
    * 4) check if the region creation is successful
-   * 
    */
   @Test
-  public void testBug39989_2()
-  {
+  public void testBug39989_2() {
     /**
      * STEP 1
      */
@@ -516,16 +496,12 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
     }   
 
     closeDown();  // closes disk file which will flush all buffers
-
   }
 
   /**
    * To validate the get operation performed on a byte array.
-   *  
    */
-
-  private void getByteArrVal(String key, Region region)
-  {
+  private void getByteArrVal(String key, Region region) {
     byte[] val = (byte[])region.get(key);
     //verify that the retrieved byte[] equals to the value put initially.
     // val should be an unitialized array of bytes of length 1024
@@ -537,10 +513,8 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
 
   /**
    * to validate the get operation performed on a byte array of length zero
-   *  
    */
-  private boolean getByteArrValZeroLnth(String key, Region region)
-  {
+  private boolean getByteArrValZeroLnth(String key, Region region) {
     Object val0 = null;
     byte[] val2 = new byte[0];
     try {
@@ -567,14 +541,12 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
     return result;
   }
 
-  public void verifyOplogSizeZeroAfterRecovery(Region region)
-  {
+  private void verifyOplogSizeZeroAfterRecovery(Region region) {
     assertEquals(Oplog.OPLOG_MAGIC_SEQ_REC_SIZE*2 + Oplog.OPLOG_DISK_STORE_REC_SIZE*2 + EMPTY_RVV_SIZE + Oplog.OPLOG_GEMFIRE_VERSION_REC_SIZE*2, ((LocalRegion)region).getDiskRegion().testHook_getChild().getOplogSize());
   }
 
   @Test
-  public void testNoEvictionDuringRecoveryIfNoGIIRecoverValuesTrue()
-  {
+  public void testNoEvictionDuringRecoveryIfNoGIIRecoverValuesTrue() {
     String oldValue = System.getProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "true");
     try {
@@ -628,8 +600,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testNoEvictionDuringRecoveryIfNoGIIRecoverValuesFalse()
-  {
+  public void testNoEvictionDuringRecoveryIfNoGIIRecoverValuesFalse() {
     String oldValue = System.getProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "false");
     try {
@@ -688,8 +659,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testEmptyRegionRecover()
-  {
+  public void testEmptyRegionRecover() {
     diskProps.setDiskDirs(dirs);
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
     Assert.assertTrue(region.size() == 0);
@@ -714,8 +684,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testReadCorruptedFile()
-  {
+  public void testReadCorruptedFile() {
     diskProps.setDiskDirs(dirs);
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
 
@@ -765,8 +734,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
   
   @Test
-  public void testForceCompactionForRegionWithRollingDisabled()
-      throws Exception {
+  public void testForceCompactionForRegionWithRollingDisabled() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setMaxOplogSize(2048+(18*2)+15*7);
     diskProps.setRolling(false);
@@ -837,12 +805,9 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
    * leaves it in created set & so when the compactor processes the created Set it 
    * thinks that the entry is now referenced in the any of the subsequent oplogs & thus
    * overwrites it with a byte[].
-   * @throws Exception
    */
-  
   @Test
-  public void testVestigialCreatesInOplog() throws Exception
-  {
+  public void testVestigialCreatesInOplog() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setMaxOplogSize(40);
     diskProps.setPersistBackup(true);
@@ -907,9 +872,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
   
   @Test
-  public void testDiskIDFieldsForPersistOnlyRecoverValuesTrue()
-      throws Exception
-  {
+  public void testDiskIDFieldsForPersistOnlyRecoverValuesTrue() throws Exception {
     String oldValue = System.getProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "true");
     try {
@@ -985,13 +948,10 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
         System.clearProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
       }
     }
-
   }
   
   @Test
-  public void testDiskIDFieldsForPersistOverFlowRecoverValuesTrue()
-      throws Exception
-  {
+  public void testDiskIDFieldsForPersistOverFlowRecoverValuesTrue() throws Exception {
     String oldValue = System.getProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "true");
     try {
@@ -1067,8 +1027,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
   
   @Test
-  public void testDiskIDFieldsForPersistOnlyRecoverValuesFalse()
-      throws Exception {
+  public void testDiskIDFieldsForPersistOnlyRecoverValuesFalse() throws Exception {
     String oldValue = System.getProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "false");
     try {
@@ -1145,8 +1104,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
   }
  
   @Test
-  public void testDiskIDFieldsForPersistOverFlowRecoverValuesFalse()
-      throws Exception {
+  public void testDiskIDFieldsForPersistOverFlowRecoverValuesFalse() throws Exception {
     String oldValue = System.getProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "false");
     try {
@@ -1224,7 +1182,7 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
 
   @Test
   public void testBug40375() throws Exception {
-      try {
+    try {
       diskProps.setDiskDirs(dirs);
       diskProps.setPersistBackup(true);
       diskProps.setSynchronous(true);
@@ -1249,66 +1207,65 @@ public class DiskRegRecoveryJUnitTest extends DiskRegionTestingBase
       region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
       assertEquals(4, region.size());
       region.close();
-      }finally {
-
+    } finally {
       System.setProperty(DiskStoreImpl.COMPLETE_COMPACTION_BEFORE_TERMINATION_PROPERTY_NAME,"");
-        }
+    }
   }
      
   @Test
   public void testBug41340() throws Exception {
-       diskProps.setDiskDirs(dirs);
-       diskProps.setPersistBackup(true);
-       diskProps.setSynchronous(true);
-       diskProps.setRolling(true);
-       diskProps.setRegionName("testBug41340");
-       region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
-       assertEquals(0, region.size());
-       //put some entries
-       region.put("0","0");
-       region.put("1","1");
-       region.put("2","2");
-       region.put("3","3");
-       
-       
-       //Create another oplog
-       DiskStore store = cache.findDiskStore(region.getAttributes().getDiskStoreName());
-       store.forceRoll();
-       
-       //Now create and destroy all of the entries in the new
-       //oplog. This should cause us to remove the CRF but leave
-       //the DRF, which has creates in reverse order. Now we have
-       //garbage destroys which have higher IDs than any crate
-       region.put("4","1");
-       region.put("5","2");
-       region.put("6","3");
-       region.destroy("0");
-       region.destroy("6");
-       region.destroy("5");
-       region.destroy("4");
-       
-       store.forceRoll();
-       
-       //Force a recovery
-       GemFireCacheImpl.getInstance().close();
-       cache = createCache();
-       region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
-       assertEquals(3, region.size());
-       
-       //With bug 41340, this is reusing an oplog id.
-       region.put("7","7");
+     diskProps.setDiskDirs(dirs);
+     diskProps.setPersistBackup(true);
+     diskProps.setSynchronous(true);
+     diskProps.setRolling(true);
+     diskProps.setRegionName("testBug41340");
+     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
+     assertEquals(0, region.size());
+     //put some entries
+     region.put("0","0");
+     region.put("1","1");
+     region.put("2","2");
+     region.put("3","3");
+
+
+     //Create another oplog
+     DiskStore store = cache.findDiskStore(region.getAttributes().getDiskStoreName());
+     store.forceRoll();
+
+     //Now create and destroy all of the entries in the new
+     //oplog. This should cause us to remove the CRF but leave
+     //the DRF, which has creates in reverse order. Now we have
+     //garbage destroys which have higher IDs than any crate
+     region.put("4","1");
+     region.put("5","2");
+     region.put("6","3");
+     region.destroy("0");
+     region.destroy("6");
+     region.destroy("5");
+     region.destroy("4");
+
+     store.forceRoll();
+
+     //Force a recovery
+     GemFireCacheImpl.getInstance().close();
+     cache = createCache();
+     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
+     assertEquals(3, region.size());
+
+     //With bug 41340, this is reusing an oplog id.
+     region.put("7","7");
 //       region.close();
-       
-       //Force another recovery
-       GemFireCacheImpl.getInstance().close();
-       cache = createCache();
-       region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
-       
-       //Make sure we didn't lose the entry
-       assertEquals(4, region.size());
-       assertEquals("7", region.get("7"));
-       region.close();
-     }
+
+     //Force another recovery
+     GemFireCacheImpl.getInstance().close();
+     cache = createCache();
+     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
+
+     //Make sure we didn't lose the entry
+     assertEquals(4, region.size());
+     assertEquals("7", region.get("7"));
+     region.close();
+   }
   
   @Test
   public void testRecoverValuesFalse() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
index 350a588..84c8500 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
@@ -16,10 +16,7 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.IOException;
@@ -28,7 +25,6 @@ import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.junit.After;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -37,15 +33,11 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.internal.FileUtil;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class DiskRegionAsyncRecoveryJUnitTest extends DiskRegionTestingBase {
 
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     DiskStoreObserver.setInstance(null);
     System.setProperty(DiskStoreImpl.RECOVER_VALUE_PROPERTY_NAME, "true");
     System.setProperty(DiskStoreImpl.RECOVER_VALUES_SYNC_PROPERTY_NAME, "false");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionChangingRegionAttributesJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionChangingRegionAttributesJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionChangingRegionAttributesJUnitTest.java
index 07bd273..51352d1 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionChangingRegionAttributesJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionChangingRegionAttributesJUnitTest.java
@@ -16,11 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -32,47 +29,33 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * if the the region attributes are changed after starting it again.
  * 
  * The behaviour should be predictable
- * 
- *
  */
 @Category(IntegrationTest.class)
-public class DiskRegionChangingRegionAttributesJUnitTest extends
-    DiskRegionTestingBase
-{
+public class DiskRegionChangingRegionAttributesJUnitTest extends DiskRegionTestingBase {
+
+  private DiskRegionProperties props;
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     props = new DiskRegionProperties();
     props.setDiskDirs(dirs);
-    
-  }
-
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
   }
-  
 
-  private DiskRegionProperties props;
-  
-  private void createOverflowOnly(){
+  private void createOverflowOnly() {
     props.setOverFlowCapacity(1);
     region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache,props);
   }
   
-  private void createPersistOnly(){
+  private void createPersistOnly() {
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,props, Scope.LOCAL);
   }
   
-  private void createPersistAndOverflow(){
+  private void createPersistAndOverflow() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,props); 
   }
   
   @Test
-  public void testOverflowOnlyAndThenPersistOnly(){
+  public void testOverflowOnlyAndThenPersistOnly() {
     createOverflowOnly();
     put100Int();
     region.close();
@@ -81,7 +64,7 @@ public class DiskRegionChangingRegionAttributesJUnitTest extends
   }
   
   @Test
-  public void testPersistOnlyAndThenOverflowOnly(){
+  public void testPersistOnlyAndThenOverflowOnly() {
     createPersistOnly();
     put100Int();
     region.close();
@@ -97,7 +80,7 @@ public class DiskRegionChangingRegionAttributesJUnitTest extends
   }
   
   @Test
-  public void testOverflowOnlyAndThenPeristAndOverflow(){
+  public void testOverflowOnlyAndThenPeristAndOverflow() {
     createOverflowOnly();
     put100Int();
     region.close();
@@ -106,7 +89,7 @@ public class DiskRegionChangingRegionAttributesJUnitTest extends
   }
   
   @Test
-  public void testPersistAndOverflowAndThenOverflowOnly(){
+  public void testPersistAndOverflowAndThenOverflowOnly() {
     createPersistAndOverflow();
     put100Int();
     region.close();
@@ -119,7 +102,7 @@ public class DiskRegionChangingRegionAttributesJUnitTest extends
   }
   
  @Test
-  public void testPersistOnlyAndThenPeristAndOverflow(){
+  public void testPersistOnlyAndThenPeristAndOverflow() {
    createPersistOnly();
    put100Int();
    region.close();
@@ -128,15 +111,11 @@ public class DiskRegionChangingRegionAttributesJUnitTest extends
   }
   
   @Test
-  public void testPersistAndOverflowAndThenPersistOnly(){
+  public void testPersistAndOverflowAndThenPersistOnly() {
     createPersistAndOverflow();
     put100Int();
     region.close();
     createPersistOnly();
     assertTrue(region.size()==100);
   }
-  
-  
-  
 }
-



[28/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
index abfb7d2..d0b5832 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Iterator;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -43,14 +52,15 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * 
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionDestroyDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
 
   //////constructor //////////
-  public PartitionedRegionDestroyDUnitTest(String name) {
+  public PartitionedRegionDestroyDUnitTest() {
 
-    super(name);
+    super();
   }//end of constructor
 
   public static final String PR_PREFIX = "PR";
@@ -61,6 +71,7 @@ public class PartitionedRegionDestroyDUnitTest extends
   
   VM vm0, vm1,vm2,vm3;
   
+  @Test
   public void testDestroyRegion() throws Exception, Throwable
   {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
index 0f0583f..ff5413c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.EvictionAction;
@@ -34,13 +43,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  * 
  */
-public class PartitionedRegionEntryCountDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionEntryCountDUnitTest extends JUnit4CacheTestCase {
   private static final long serialVersionUID = 19808034671087558L;
 
-  public PartitionedRegionEntryCountDUnitTest(final String name) {
-    super(name);
-  }
-
+  @Test
   public void testTotalEntryCountAfterLocalDestroyEviction() {
     final Host host = Host.getHost(0);
     final VM vm1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
index 4e36ea8..c960332 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
@@ -16,30 +16,55 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.ObjectSizerImpl;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
 import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
 import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
-  public PartitionedRegionEvictionDUnitTest(final String name) {
-    super(name);
-  }
-
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class PartitionedRegionEvictionDUnitTest extends JUnit4CacheTestCase {
+
+  @Test
   public void testHeapLRUWithOverflowToDisk() {
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -186,6 +211,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
     System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance");
   }
   
+  @Test
   public void testHeapLRUWithLocalDestroy() {
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -305,6 +331,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
     assertEquals((3 * bucketsToCreate * (redundantCopies + 1)), totalEvicted);
   }
 
+  @Test
   public void testMemoryLRUWithOverflowToDisk() {
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -413,6 +440,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testMemoryLRUWithLocalDestroy() {
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -491,6 +519,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
     assertTrue(2 *extraEntries<= totalEvicted);
   }
 
+  @Test
   public void testEntryLRUWithOverflowToDisk() {
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -583,6 +612,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
      public boolean verify(long expectedEvictions) { return false; }
   };
   
+  @Test
   public void testEntryLRUWithLocalDestroy() {
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -719,6 +749,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
   // Test to validate the Eviction Attribute : LRU Check
+  @Test
   public void testEvictionValidationForLRUEntry() {
     final Host host = Host.getHost(0);
     final VM testAccessor = host.getVM(1);
@@ -863,6 +894,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
   // Test to validate the Eviction Attribute : LRU Action
+  @Test
   public void testEvictionValidationForLRUAction() {
     final Host host = Host.getHost(0);
     final VM testDatastore = host.getVM(2);
@@ -953,6 +985,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
   // Test to validate the Eviction Attribute : LRU Maximum
+  @Test
   public void testEvictionValidationForLRUMaximum() {
     final Host host = Host.getHost(0);
     final VM testDatastore = host.getVM(2);
@@ -1000,6 +1033,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
   // Test to validate the Eviction Attribute for LRUHeap
+  @Test
   public void testEvictionValidationForLRUHeap() {
     final Host host = Host.getHost(0);
     final VM testDatastore = host.getVM(2);
@@ -1122,6 +1156,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
   // Test to validate an accessor can set the initial attributes
+  @Test
   public void testEvictionValidationWhenInitializedByAccessor() {
     final Host host = Host.getHost(0);
     final VM testDatastore = host.getVM(2);
@@ -1173,6 +1208,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
   // Test to validate the Eviction Attribute : HeapLRU Interval
+  @Test
   public void testEvictionValidationForLRUMemory() {
     final Host host = Host.getHost(0);
     final VM firstDatastore = host.getVM(1);
@@ -1416,6 +1452,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
   }
 
 
+  @Test
   public void testEvictionValidationForLRUEntry_AccessorFirst() {
     final Host host = Host.getHost(0);
     final VM firstAccessor = host.getVM(0);
@@ -1491,6 +1528,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
     testDatastore.invoke(createSecondDataStore);
   }
   
+  @Test
   public void testEvictionValidationForLRUEntry_DatastoreFirst() {
     final Host host = Host.getHost(0);
     final VM firstAccessor = host.getVM(0);
@@ -1566,6 +1604,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
     testAccessor.invoke(createSecondAccessor);
   }
   
+  @Test
   public void testEvictionValidationForLRUEntry_TwoAccessors() {
     final Host host = Host.getHost(0);
     final VM firstAccessor = host.getVM(0);
@@ -1644,6 +1683,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
    * Test that gets do  not need to acquire a lock on the region
    * entry when LRU is enabled. This is bug 42265
    */
+  @Test
   public void testEntryLRUDeadlock() {
     final Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
index 1676177..3621a4a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Properties;
@@ -48,13 +57,14 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
 {
 
   //////constructor //////////
-  public PartitionedRegionHADUnitTest(String name) {
+  public PartitionedRegionHADUnitTest() {
 
-    super(name);
+    super();
   }//end of constructor
 
   public static final String PR_PREFIX = "PR";
@@ -72,6 +82,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
    * of sequential cache.close() events.
    * @throws Exception
    */
+  @Test
   public void testBucketFailOverDuringCacheClose() throws Exception {
     
     final String regionName = getUniqueName();
@@ -184,6 +195,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
   }
 
   //////////test methods ////////////////
+  @Test
   public void testGrabBackupBuckets() throws Throwable
   {
 
@@ -390,6 +402,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
    * @see PartitionedRegionSingleNodeOperationsJUnitTest#test018BucketScope()
    * @throws Exception
    */
+  @Test
   public void testBucketsScope() throws Exception
   {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
index f024ebb..ad88b90 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -51,6 +60,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  * cleanup for multiple failed nodes.</br>
  *
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
@@ -63,9 +73,9 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
    *
    * @param name
    */
-  public PartitionedRegionHAFailureAndRecoveryDUnitTest(String name) {
+  public PartitionedRegionHAFailureAndRecoveryDUnitTest() {
 
-    super(name);
+    super();
   }
 
   /**
@@ -78,6 +88,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
    * (5) Validate Failed node's bucket2Node Region metadata. </br>
    */
 
+  @Test
   public void testMetaDataCleanupOnSinglePRNodeFail() throws Throwable
   {
     // create the VM's
@@ -187,6 +198,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
    * (4) Validate all Failed node's config metadata </br> <br>
    * (5) Validate all Failed node's bucket2Node Region metadata. </br>
    */
+  @Test
   public void testMetaDataCleanupOnMultiplePRNodeFail() throws Throwable
   {
     // create the VM's
@@ -412,6 +424,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
    * Test for peer recovery of buckets when a member is removed from the distributed system 
    * @throws Throwable
    */
+  @Test
   public void testRecoveryOfSingleMemberFailure() throws Throwable
   {
     final String uniqName = getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionInvalidateDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionInvalidateDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionInvalidateDUnitTest.java
index 6cd4f6a..364a4ee 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionInvalidateDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionInvalidateDUnitTest.java
@@ -19,6 +19,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.CacheWriterException;
 import com.gemstone.gemfire.cache.EntryEvent;
@@ -36,11 +45,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  * This tests invalidateRegion functionality on partitioned regions
  *
  */
-public class PartitionedRegionInvalidateDUnitTest extends
-    CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionInvalidateDUnitTest extends JUnit4CacheTestCase {
 
-  public PartitionedRegionInvalidateDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionInvalidateDUnitTest() {
+    super();
   }
 
   void createRegion(String name, boolean accessor, int redundantCopies) {
@@ -51,6 +60,7 @@ public class PartitionedRegionInvalidateDUnitTest extends
     getCache().createRegion(name, af.create());
   }
     
+  @Test
   public void testSingleVMInvalidate() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
@@ -85,6 +95,7 @@ public class PartitionedRegionInvalidateDUnitTest extends
     });
   }
   
+  @Test
   public void testMultiVMInvalidate() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryDUnitTest.java
index d6693de..43401af 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryDUnitTest.java
@@ -14,9 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -25,6 +26,9 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.Cache;
@@ -37,15 +41,14 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class is to test localMaxMemory property of partition region while
  * creation of bucket.
- * 
  */
-public class PartitionedRegionLocalMaxMemoryDUnitTest extends
-    PartitionedRegionDUnitTestCase
-{
+@Category(DistributedTest.class)
+public class PartitionedRegionLocalMaxMemoryDUnitTest extends PartitionedRegionDUnitTestCase {
 
   /** Prefix is used in name of Partition Region */
   private static String prPrefix = null;
@@ -59,10 +62,6 @@ public class PartitionedRegionLocalMaxMemoryDUnitTest extends
   /** to store references of 4 vms */
   VM vm[] = new VM[4];
 
-  public PartitionedRegionLocalMaxMemoryDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * This test performs following operations 
    * <br>1.Create Partition region with localMaxMemory 
@@ -73,6 +72,7 @@ public class PartitionedRegionLocalMaxMemoryDUnitTest extends
    * <br>4.Test should throw PartitionedRegionStorageException
    * when it tries to create new bucket</br>
    */
+  @Test
   public void testLocalMaxMemoryInPartitionedRegion()
   {
     Host host = Host.getHost(0);
@@ -107,6 +107,7 @@ public class PartitionedRegionLocalMaxMemoryDUnitTest extends
    * This test makes sure that we don't enforce the localMaxMemory setting
    * when eviction is enabled.
    */
+  @Test
   public void testLocalMaxMemoryInPartitionedRegionWithEviction()
   {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
index e0a87b0..d43e87d 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
@@ -16,15 +16,18 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.EvictionAttributes;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests PartitionedRegion localMaxMemory with Off-Heap memory.
@@ -32,12 +35,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * @since Geode 1.0
  */
 @SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
 public class PartitionedRegionLocalMaxMemoryOffHeapDUnitTest extends PartitionedRegionLocalMaxMemoryDUnitTest {
 
-  public PartitionedRegionLocalMaxMemoryOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
index aca9ff1..6ed7dcf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
@@ -32,6 +41,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionMultipleDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
@@ -61,8 +71,8 @@ public class PartitionedRegionMultipleDUnitTest extends
   int localMaxMemory = 200;
 
   /** constructor */
-  public PartitionedRegionMultipleDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionMultipleDUnitTest() {
+    super();
   }
 
   /**
@@ -75,6 +85,7 @@ public class PartitionedRegionMultipleDUnitTest extends
    * 4. Performs get() operations on all partitioned region and check the
    * returned values.</br>
    */
+  @Test
   public void testPartitionedRegionPutAndGet() throws Throwable
   {
     Host host = Host.getHost(0);
@@ -129,6 +140,7 @@ public class PartitionedRegionMultipleDUnitTest extends
    * 4. Performs get() operations for destroyed keys on all partitioned region
    * and checks the returned values is not null .</br>
    */
+  @Test
   public void testPartitionedRegionDestroyKeys() throws Throwable
   {
 
@@ -195,6 +207,7 @@ public class PartitionedRegionMultipleDUnitTest extends
    * partitioned region from all the VM's</br><br>
    * 4. Chekcs containsKey and ContainsValueForKey APIs</br>
    */
+  @Test
   public void testPartitionedRegionDestroyAndContainsAPI() throws Throwable
   {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
index 0b6c259..40d4c49 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
@@ -16,23 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
 import com.gemstone.gemfire.internal.cache.control.OffHeapMemoryMonitor;
 import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class PartitionedRegionOffHeapEvictionDUnitTest extends
-    PartitionedRegionEvictionDUnitTest {
-  
-  public PartitionedRegionOffHeapEvictionDUnitTest(String name) {
-    super(name);
-  }  
+@Category(DistributedTest.class)
+public class PartitionedRegionOffHeapEvictionDUnitTest extends PartitionedRegionEvictionDUnitTest {
   
   @Override
   public final void preTearDownAssertions() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
index b24e660..a4b21a9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 java.util.Iterator;
 import java.util.List;
@@ -35,6 +44,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  *         This class tests PRID generation in multiple partiton
  *         regions on 4 VMs
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionPRIDDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
@@ -51,8 +61,8 @@ public class PartitionedRegionPRIDDUnitTest extends
   /** to store references of 4 vms */
   VM vm[] = new VM[4];
 
-  public PartitionedRegionPRIDDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionPRIDDUnitTest() {
+    super();
   }
   
   /**
@@ -61,6 +71,7 @@ public class PartitionedRegionPRIDDUnitTest extends
    * generation
    * 
    */
+  @Test
   public void testPRIDGenerationInMultiplePartitionRegion() throws Exception
   {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
index 4c284da..1160d4b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.sql.Date;
 import java.util.Arrays;
@@ -69,18 +78,20 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *
  */
-public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
   
   /**
    * @param name
    */
-  public PartitionedRegionQueryDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionQueryDUnitTest() {
+    super();
     // TODO Auto-generated constructor stub
   }
   
   private static final AtomicReference<RebalanceResults> rebalanceResults = new AtomicReference<RebalanceResults>();
 
+  @Test
   public void testReevaluationDueToUpdateInProgress() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -148,6 +159,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * 3. While the query is executing, several buckets are
    * moved.
    */
+  @Test
   public void testRebalanceDuringQueryEvaluation() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -206,6 +218,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * 2. Buckets are moved
    * 3. Check to make sure we don't have lingering bucket indexes with bucket regions already destroyed
    */
+  @Test
   public void testRebalanceWithIndex() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -256,6 +269,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
   /**
    * tests trace for pr queries when <trace> is used and query verbose is set to true on local and remote servers
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOnBothServers() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -329,6 +343,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * tests trace for pr queries when <trace> is used and query verbose is set to true on local but false on remote servers
    * All flags should be true still as the <trace> is OR'd with query verbose flag
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOnLocalServerOnly() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -400,6 +415,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * tests trace for pr queries when <trace> is NOT used and query verbose is set to true on local but false on remote
    * The remote should not send a pr query trace info back because trace was not requested
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOffLocalServerVerboseOn() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -472,6 +488,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * We don't output the string or do anything on the local side, but we still pull off the object due to the remote server
    * generating and sending it over
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOffRemoteServerOnly() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -544,6 +561,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * tests trace for pr queries when <trace> is used and query verbose is set to false on local and remote servers
    * trace is OR'd so the entire trace process should be invoked
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOnRemoteServerOnly() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -617,6 +635,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * The local node still receives the pr trace info from the remote node due to query verbose being on
    * however nothing is used on the local side
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOffRemoteServerOn() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -689,6 +708,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * tests trace for pr queries when <trace> is NOT used and query verbose is set to false on local and remote servers
    * None of our hooks should have triggered
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOffQueryVerboseOff() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -760,6 +780,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
    * tests trace for pr queries when <trace> is used and query verbose is set to false on local and remote servers
    * All hooks should have triggered due to trace being used
    */
+  @Test
   public void testPartitionRegionDebugMessageQueryTraceOnQueryVerboseOff() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -827,6 +848,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
   }
   
 
+  @Test
   public void testOrderByOnPRWithReservedKeywords() throws Exception {
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
index 1d06545..e6be8d4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
@@ -16,20 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionRedundancyZoneDUnitTest extends JUnit4CacheTestCase {
 
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
@@ -40,15 +50,12 @@ public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
     disconnectAllFromDS();
   }
   
-  public PartitionedRegionRedundancyZoneDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Test that we don't try to put buckets in the same
    * zone when we don't have enough zones.
    */
-  public void testNotEnoughZones() throws Throwable {
+  @Test
+  public void testNotEnoughZones() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -80,10 +87,6 @@ public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
     //buckets on vm0 or vm1. At that point we will add another bucket to that
     //member to bring it's primary count up to two.
     assertTrue(counts, vm0Count >= 2 && vm1Count >=2);
-    
-//    assertIndexDetailsEquals(counts, 3, vm0Count);
-//    assertIndexDetailsEquals(counts, 3, vm1Count);
-//    assertIndexDetailsEquals(counts, 6, vm2Count);
   }
   
   protected void checkBucketCount(VM vm0, final int numLocalBuckets) {
@@ -108,7 +111,7 @@ public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
     });
   }
   
-  protected DistributedMember createPR(VM vm, int redundancy) throws Throwable {
+  protected DistributedMember createPR(VM vm, int redundancy) throws Exception {
     SerializableCallable createPrRegion = new SerializableCallable("createRegion") {
       public Object call()
       {
@@ -135,27 +138,24 @@ public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
         
       }
     });
-    
   }
   
-  protected void createData(VM vm, final int startKey, final int endKey,
-      final String value) {
-        createData(vm, startKey, endKey,value, "region1");
-      }
+  protected void createData(VM vm, final int startKey, final int endKey, final String value) {
+    createData(vm, startKey, endKey,value, "region1");
+  }
+
+  protected void createData(VM vm, final int startKey, final int endKey, final String value, final String regionName) {
+    SerializableRunnable createData = new SerializableRunnable("createData") {
 
-  protected void createData(VM vm, final int startKey, final int endKey,
-      final String value, final String regionName) {
-        SerializableRunnable createData = new SerializableRunnable("createData") {
-          
-          public void run() {
-            Cache cache = getCache();
-            Region region = cache.getRegion(regionName);
-            
-            for(int i =startKey; i < endKey; i++) {
-              region.put(i, value);
-            }
-          }
-        };
-        vm.invoke(createData);
+      public void run() {
+        Cache cache = getCache();
+        Region region = cache.getRegion(regionName);
+
+        for(int i =startKey; i < endKey; i++) {
+          region.put(i, value);
+        }
       }
+    };
+    vm.invoke(createData);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
index 1b2205e..5a50487 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
@@ -23,51 +23,47 @@ package com.gemstone.gemfire.internal.cache;
  * 
  */
 
-import java.util.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-import junit.framework.TestCase;
-
 @Category(IntegrationTest.class)
-public class PartitionedRegionSerializableObjectJUnitTest
-{
-  String regionName = "SerizableRegion";
+public class PartitionedRegionSerializableObjectJUnitTest {
+
+  private String regionName = "SerizableRegion";
 
   /** It is common region for all the threads */
-  Region root;
+  private Region root;
 
   /**
    * It is map to store thread name and list of objects which are created by
    * that thread.
    */
-  static Map thread2List = new HashMap();
+  private static Map thread2List = new HashMap();
 
-  static int MAX_COUNT = 10;
+  private static int MAX_COUNT = 10;
 
-  static int MAX_THREADS = 10;
+  private static int MAX_THREADS = 10;
 
   /**
    * This test creates a region and threads. This Region is common to all the
    * threads which perform get, put operations on that region. Object used
    * during these operations are serializable. key and value in the partition
    * region are same.
-   * 
    */
   @Test
-  public void testOperationsWithSerializableObject()
-  {
-
+  public void testOperationsWithSerializableObject() {
     int localMaxMemory = 50;
     Thread threadArr[] = new Thread[10];
     root = PartitionedRegionTestHelper.createPartitionedRegion(regionName,
@@ -103,16 +99,15 @@ public class PartitionedRegionSerializableObjectJUnitTest
    * This class creates thread that take list of the objects from thread2List
    * Map and performs get operation with these objects as key and verifying
    * result with itself because key and values are same in the partition Region
-   * 
    */
-  public class getThread extends Thread
-  {
+  private  class getThread extends Thread {
+
     getThread(String threadName) {
       super(threadName);
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       Region pr = PartitionedRegionTestHelper
           .getExistingRegion(Region.SEPARATOR + regionName);
       assertNotNull(pr);
@@ -141,17 +136,15 @@ public class PartitionedRegionSerializableObjectJUnitTest
    * This class create threads that put the serializable objects in the partion
    * region and also add the the list of the serializable objects to the
    * thread2List map
-   * 
    */
+  private class putThread extends Thread {
 
-  public class putThread extends Thread
-  {
     putThread(String threadName) {
       super(threadName);
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       Region pr = PartitionedRegionTestHelper
           .getExistingRegion(Region.SEPARATOR + regionName);
       assertNotNull(pr);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
index 18ca858..bf57a20 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
@@ -16,9 +16,41 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.ClientMetadataService;
@@ -29,7 +61,6 @@ import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
@@ -39,26 +70,22 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
 
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
-
-  private static final long serialVersionUID = 1L;
+@Category(DistributedTest.class)
+public class PartitionedRegionSingleHopDUnitTest extends JUnit4CacheTestCase {
 
   private static final String PR_NAME = "single_hop_pr";
 
@@ -84,10 +111,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
 
   private static Locator locator = null;
 
-  public PartitionedRegionSingleHopDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     IgnoredException.addIgnoredException("Connection refused");
@@ -138,7 +161,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
       locator = Locator.startLocatorAndDS(locatorPort, logFile, null, props);
     }
     catch (IOException e) {
-      e.printStackTrace();
+      fail("failed to startLocatorInVM", e);
     }
   }
 
@@ -150,10 +173,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
       int redundantCopies, int totalNoofBuckets) {
 
     Properties props = new Properties();
-    props = new Properties();
     props.setProperty(LOCATORS, locString);
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
 
@@ -229,7 +250,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     cms.getClientPRMetadata_TEST_ONLY().clear();
   }
 
-  // 2 peers 2 servers 1 accessor.No client.Should work without any exceptions.
+  /**
+   * 2 peers 2 servers 1 accessor.No client.Should work without any exceptions.
+   */
+  @Test
   public void test_NoClient() {
     member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
     member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
@@ -269,9 +293,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     verifyEmptyStaticData();
   }
 
-  // 2 AccessorServers, 2 Peers
-  // 1 Client connected to 2 AccessorServers. Hence metadata should not be
-  // fetched.
+  /**
+   * 2 AccessorServers, 2 Peers
+   * 1 Client connected to 2 AccessorServers. Hence metadata should not be
+   * fetched.
+   */
+  @Test
   public void test_ClientConnectedToAccessors() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createAccessorServer());
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createAccessorServer());
@@ -291,8 +318,11 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     verifyEmptyStaticData();
   }
 
-  // 1 server 2 accesorservers 2 peers.i client connected to the server
-  // Since only 1 server hence Metadata should not be fetched.
+  /**
+   * 1 server 2 accesorservers 2 peers.i client connected to the server
+   * Since only 1 server hence Metadata should not be fetched.
+   */
+  @Test
   public void test_ClientConnectedTo1Server() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
 
@@ -312,10 +342,13 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     verifyEmptyStaticData();
   }
 
-  // 4 servers, 1 client connected to all 4 servers.
-  // Put data, get data and make the metadata stable.
-  // Now verify that metadata has all 8 buckets info.
-  // Now update and ensure the fetch service is never called.
+  /**
+   * 4 servers, 1 client connected to all 4 servers.
+   * Put data, get data and make the metadata stable.
+   * Now verify that metadata has all 8 buckets info.
+   * Now update and ensure the fetch service is never called.
+   */
+  @Test
   public void test_MetadataContents() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
@@ -336,11 +369,14 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     updateIntoSinglePR();
   }
 
-  // 2 servers, 2 clients.One client to one server.
-  // Put from c1 to s1. Now put from c2. So since there will be a hop atleast
-  // once,
-  // fetchservice has to be triggered.
-  // Now put again from c2.There should be no hop at all.
+  /**
+   * 2 servers, 2 clients.One client to one server.
+   * Put from c1 to s1. Now put from c2. So since there will be a hop at least
+   * once,
+   * fetchservice has to be triggered.
+   * Now put again from c2.There should be no hop at all.
+   */
+  @Test
   public void test_MetadataServiceCallAccuracy() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
@@ -375,6 +411,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> cms.isRefreshMetadataTestOnly() == false);
   }
 
+  @Test
   public void test_MetadataServiceCallAccuracy_FromDestroyOp() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
@@ -398,6 +435,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> cms.isRefreshMetadataTestOnly() == true);
   }
 
+  @Test
   public void test_MetadataServiceCallAccuracy_FromGetOp() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
@@ -412,8 +450,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     final ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.satisfyRefreshMetadata_TEST_ONLY(false);
 
-
-
     region.get(new Integer(0));
     region.get(new Integer(1));
     region.get(new Integer(2));
@@ -429,9 +465,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     region.get(new Integer(3));
     Wait.pause(5000);
     assertFalse(cms.isRefreshMetadataTestOnly());
-
   }
 
+  @Test
   public void test_SingleHopWithHA() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 8 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 8 ));
@@ -462,6 +498,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void test_SingleHopWithHAWithLocator() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -498,7 +535,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
   }
 
-
+  @Test
   public void test_NoMetadataServiceCall_ForGetOp() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
@@ -529,8 +566,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     assertFalse(cms.isRefreshMetadataTestOnly());
   }
 
-
- public void test_NoMetadataServiceCall() {
+  @Test
+  public void test_NoMetadataServiceCall() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 1, 4 ));
 
@@ -545,7 +582,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
     member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.printView());
 
-
     region.put(new Integer(0), "create0");
     final boolean metadataRefreshed_get1 = cms
         .isRefreshMetadataTestOnly();
@@ -576,9 +612,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     region.put(new Integer(3), "create3");
     Wait.pause(5000);
     assertFalse(cms.isRefreshMetadataTestOnly());
-
   }
 
+  @Test
   public void test_NoMetadataServiceCall_ForDestroyOp() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 0, 4 ));
@@ -602,6 +638,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-853: random ports, pause sleeps, time sensitive, 5 second thread sleeps
+  @Test
   public void testServerLocationRemovalThroughPing() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
@@ -633,7 +670,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     verifyDeadServer(regionMetaData, region, port0, port1);
   }
 
-  public void testMetadataFetchOnlyThroughFunctions() {
+  @Test
+  public void testMetadataFetchOnlyThroughFunctions() throws Exception {
     //Workaround for 52004
     IgnoredException.addIgnoredException("InternalFunctionInvocationTargetException");
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
@@ -659,11 +697,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     do {
       if ((prMetaData.getBucketServerLocationsMap_TEST_ONLY().size() !=4)) {
         //waiting if there is another thread holding the lock
-        try {
-          Thread.sleep(1000);
-        } catch (InterruptedException e) {
-          //ignored.
-        }
+        Thread.sleep(1000);
         cms.getClientPRMetadata((LocalRegion)region);
       } else {
         break;
@@ -674,6 +708,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
 //    assertIndexDetailsEquals(4/*numBuckets*/, prMetaData.getBucketServerLocationsMap_TEST_ONLY().size());
   }
 
+  @Test
   public void testMetadataFetchOnlyThroughputAll() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
@@ -692,10 +727,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     Awaitility.waitAtMost(60, TimeUnit.SECONDS).until(() -> (prMetaData.getBucketServerLocationsMap_TEST_ONLY().size() == 4));
   }
 
-
-
-  @Ignore("Bug 47950")
-  public void DISABLED_testMetadataIsSameOnAllServersAndClients() {
+  @Ignore("TODO: test disabled due to Bug 47950")
+  @Test
+  public void testMetadataIsSameOnAllServersAndClients() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
     Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 3, 4 ));
@@ -707,7 +741,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
     member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.waitForLocalBucketsCreation(4));
 
-
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     cms.getClientPRMetadata((LocalRegion)region);
 
@@ -864,9 +897,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
       }
 
     }, 20000, 2000, true);
-
   }
 
+  @Test
   public void testMetadataIsSameOnAllServersAndClientsHA() {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 2, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServer( 2, 4 ));
@@ -948,11 +981,15 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     });
   }
 
-  //TODO This is failing in WAN_Dev_Dec11 branch after downmerge from trunk revision 34709
-
-  // This test is disabled due to intermittent failures in unit test runs
-  // Please see ticket #52203
-  public void disabledtestClientMetadataForPersistentPrs() throws Exception {
+  /**
+   * TODO This is failing in WAN_Dev_Dec11 branch after downmerge from trunk revision 34709
+   *
+   * This test is disabled due to intermittent failures in unit test runs
+   * Please see ticket #52203
+   */
+  @Ignore("TODO: test is disabled due to #52203")
+  @Test
+  public void testClientMetadataForPersistentPrs() throws Exception {
     Integer port0 = (Integer)member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
     Integer port1 = (Integer)member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
     Integer port2 = (Integer)member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServer( 3, 4 ));
@@ -983,7 +1020,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     fetchAndValidateMetadata();
   }
 
-
   private void fetchAndValidateMetadata() {
     ClientMetadataService service = ((GemFireCacheImpl)this.cache)
         .getClientMetadataService();
@@ -1079,8 +1115,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1101,8 +1136,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public static int createAccessorServer() {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -1171,8 +1205,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public static int createServer(int redundantCopies, int totalNoofBuckets) {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -1245,8 +1278,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public static int createPersistentPrsAndServer(int redundantCopies, int totalNoofBuckets) {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
     DiskStore disk = cache.findDiskStore("disk");
     if(disk == null) {
@@ -1328,9 +1360,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
     return port;
   }
+
   public static int createPersistentPrsAndServerOnPort(int redundantCopies, int totalNoofBuckets, int port) {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
     DiskStore disk = cache.findDiskStore("disk");
     if(disk == null) {
@@ -1411,9 +1443,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
     return port;
   }
+
   public static void createServerOnPort(int redundantCopies, int totalNoofBuckets, int port) {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     server.setPort(port);
@@ -1480,12 +1512,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
             + shipmentRegion.toString());
 
     replicatedRegion = cache.createRegion("rr", new AttributesFactory().create());
-
   }
 
   public static void startServerOnPort(int port) {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     server.setPort(port);
@@ -1498,10 +1528,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     }
   }
 
-
   public static void createPeer() {
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     cache = test.getCache();
 
     PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -1561,8 +1589,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1587,8 +1614,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1613,8 +1639,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1638,8 +1663,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopDUnitTest(
-        "PartitionedRegionSingleHopDUnitTest");
+    PartitionedRegionSingleHopDUnitTest test = new PartitionedRegionSingleHopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1748,10 +1772,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   static class MyFunctionAdapter extends FunctionAdapter {
+    @Override
     public String getId() {
       return "fid";
     }
 
+    @Override
     public void execute(FunctionContext context) {
       System.out.println("YOGS function called");
       RegionFunctionContext rc = (RegionFunctionContext)context;
@@ -1806,7 +1832,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 
   public static void put() {
-
     region.put(new Integer(0), "create0");
     region.put(new Integer(1), "create1");
     region.put(new Integer(2), "create2");
@@ -1843,7 +1868,6 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
           shipmentRegion.get(shipmentId, shipment);
         }
       }
-
     }
 
     region.get(new Integer(0), "create0");
@@ -1961,13 +1985,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
   }
 }
 
-class Customer implements DataSerializable {
+class Customer implements DataSerializable { // TODO: move this to be an inner class and make it static
   String name;
 
   String address;
 
   public Customer() {
-
   }
 
   public Customer(String name, String address) {
@@ -1975,21 +1998,25 @@ class Customer implements DataSerializable {
     this.address = address;
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.name = DataSerializer.readString(in);
     this.address = DataSerializer.readString(in);
 
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     DataSerializer.writeString(this.name, out);
     DataSerializer.writeString(this.address, out);
   }
 
+  @Override
   public String toString() {
     return "Customer { name=" + this.name + " address=" + this.address + "}";
   }
 
+  @Override
   public boolean equals(Object o) {
     if (this == o)
       return true;
@@ -2006,25 +2033,28 @@ class Order implements DataSerializable {
   String orderName;
 
   public Order() {
-
   }
 
   public Order(String orderName) {
     this.orderName = orderName;
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.orderName = DataSerializer.readString(in);
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     DataSerializer.writeString(this.orderName, out);
   }
 
+  @Override
   public String toString() {
     return this.orderName;
   }
 
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;
@@ -2043,25 +2073,28 @@ class Shipment implements DataSerializable {
   String shipmentName;
 
   public Shipment() {
-
   }
 
   public Shipment(String shipmentName) {
     this.shipmentName = shipmentName;
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.shipmentName = DataSerializer.readString(in);
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     DataSerializer.writeString(this.shipmentName, out);
   }
 
+  @Override
   public String toString() {
     return this.shipmentName;
   }
 
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;


[20/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
index 59bdcaa..1942c75 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
@@ -17,10 +17,33 @@
 package com.gemstone.gemfire.internal.cache.ha;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CyclicBarrier;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.Conflatable;
@@ -28,31 +51,13 @@ import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.RegionQueue;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CyclicBarrier;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
 
 /**
  * This is a test for the APIs of a HARegionQueue and verifies that the head,
  * tail and size counters are updated properly.
- * 
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class HARegionQueueJUnitTest
-{
+public class HARegionQueueJUnitTest {
 
   /** The cache instance */
   protected Cache cache = null;
@@ -72,71 +77,37 @@ public class HARegionQueueJUnitTest
   boolean allowExpiryToProceed = false;
   boolean complete = false;
 
-  /**
-   * Create the cache in setup
-   * 
-   * @throws Exception -
-   *           thrown if any exception occurs in setUp
-   */
   @Before
-  public void setUp() throws Exception
-  {
+  public void setUp() throws Exception {
     cache = createCache();
     logger = cache.getLogger();
     encounteredException = false;
   }
 
-  /**
-   * Close the cache in tear down *
-   * 
-   * @throws Exception -
-   *           thrown if any exception occurs in tearDown
-   */
   @After
-  public void tearDown() throws Exception
-  {
+  public void tearDown() throws Exception {
     cache.close();
   }
 
   /**
    * Creates the cache instance for the test
-   * 
-   * @return the cache instance
-   * @throws CacheException -
-   *           thrown if any exception occurs in cache creation
    */
-  private Cache createCache() throws CacheException
-  {
+  private Cache createCache() throws CacheException {
     return new CacheFactory().set(MCAST_PORT, "0").create();
   }
 
   /**
    * Creates HA region-queue object
-   * 
-   * @return HA region-queue object
-   * @throws IOException
-   * @throws ClassNotFoundException
-   * @throws CacheException
-   * @throws InterruptedException
    */
-  protected HARegionQueue createHARegionQueue(String name) throws IOException, ClassNotFoundException, CacheException, InterruptedException
-  {
+  private HARegionQueue createHARegionQueue(String name) throws IOException, ClassNotFoundException, CacheException, InterruptedException {
     HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name,cache,HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
     return regionqueue;
   }
   
   /**
    * Creates region-queue object
-   * 
-   * @return region-queue object
-   * @throws IOException
-   * @throws ClassNotFoundException
-   * @throws CacheException
-   * @throws InterruptedException
    */
-  protected HARegionQueue createHARegionQueue(String name,
-      HARegionQueueAttributes attrs) throws IOException, ClassNotFoundException, CacheException, InterruptedException
-  {   
+  private HARegionQueue createHARegionQueue(String name, HARegionQueueAttributes attrs) throws IOException, ClassNotFoundException, CacheException, InterruptedException {
     HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name, cache, attrs,HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
     return regionqueue;
   }
@@ -148,13 +119,9 @@ public class HARegionQueueJUnitTest
    * 3)Wait till all put-threads complete their job <br>
    * 4)verify that the size of the queue is equal to the total number of puts
    * done by all producers
-   * 
-   * @throws Exception -
-   *           thrown if any problem occurs in test execution
    */
   @Test
-  public void testQueuePutWithoutConflation() throws Exception
-  {
+  public void testQueuePutWithoutConflation() throws Exception {
     logger.info("HARegionQueueJUnitTest : testQueuePutWithoutConflation BEGIN");
 
     rq = createHARegionQueue("testOfferNoConflation");
@@ -173,13 +140,9 @@ public class HARegionQueueJUnitTest
    * 3)Wait till all put-threads complete their job <br>
    * 4)verify that the size of the queue is equal to the total number of puts
    * done by one thread (as rest of them will conflate)
-   * 
-   * @throws Exception -
-   *           thrown if any problem occurs in test execution
    */
   @Test
-  public void testQueuePutWithConflation() throws Exception
-  {
+  public void testQueuePutWithConflation() throws Exception {
     logger.info("HARegionQueueJUnitTest : testQueuePutWithConflation BEGIN");
 
     rq = createHARegionQueue("testOfferConflation");
@@ -199,15 +162,11 @@ public class HARegionQueueJUnitTest
    * 4)verify that the size of the queue is equal to the total number of puts
    * done by one thread (as rest of them will be duplicates and hence will be
    * replaced)
-   * 
-   * @throws Exception -
-   *           thrown if any problem occurs in test execution
+   *
+   * TODO:Dinesh : Work on optimizing the handling of receiving duplicate events
    */
-
-  //TODO:Dinesh : Work on optmizing the handling of receiving duplicate events
   @Test
-  public void testQueuePutWithDuplicates() throws Exception //dp
-  {
+  public void testQueuePutWithDuplicates() throws Exception {
     logger.info("HARegionQueueJUnitTest : testQueuePutWithDuplicates BEGIN");
 
     rq = createHARegionQueue("testQueuePutWithDuplicates");
@@ -238,10 +197,7 @@ public class HARegionQueueJUnitTest
    * @throws Exception -
    *           thrown if any problem occurs in test execution
    */
-  private void createAndRunProducers(boolean generateSameKeys,
-      boolean generateSameIds, boolean conflationEnabled, int putPerProducer)
-      throws Exception
-  {
+  private void createAndRunProducers(boolean generateSameKeys, boolean generateSameIds, boolean conflationEnabled, int putPerProducer) throws Exception {
     Producer[] putThreads = new Producer[TOTAL_PUT_THREADS];
 
     int i = 0;
@@ -278,7 +234,6 @@ public class HARegionQueueJUnitTest
       ThreadUtils.join(putThreads[i], 30 * 1000);
     }
     assertFalse(encounteredException);
-
   }
 
   /*
@@ -286,12 +241,11 @@ public class HARegionQueueJUnitTest
    * 'com.gemstone.gemfire.internal.cache.ha.HARegionQueue.addDispatchedMessage(Object)'
    */
   @Test
-  public void testAddDispatchedMessageObject()
-  {
+  public void testAddDispatchedMessageObject() {
     try {
       //HARegionQueue haRegionQueue = new HARegionQueue("testing", cache);
       HARegionQueue haRegionQueue = createHARegionQueue("testing");
-      Assert.assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting()
+      assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting()
           .isEmpty());
       //TODO:
 
@@ -300,25 +254,21 @@ public class HARegionQueueJUnitTest
       haRegionQueue.addDispatchedMessage(new ThreadIdentifier(new byte[1], 2),
           2);
 
-      Assert.assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting()
+      assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting()
           .isEmpty());
       // HARegionQueue.getDispatchedMessagesMapForTesting().clear();
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Test encountered an exception due to " + e);
+      throw new AssertionError("Test encountered an exception due to ", e);
     }
-
   }
 
   /**
    * tests the blocking peek functionality of BlockingHARegionQueue
-   *  
    */
   @Test
-  public void testBlockQueue()
-  {    
+  public void testBlockQueue() {
     exceptionInThread = false;
     testFailed = false;
     try {
@@ -382,11 +332,8 @@ public class HARegionQueueJUnitTest
       
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" Test failed due to " + e);
-
+      throw new AssertionError(" Test failed due to ", e);
     }
-
   }
 
   private static volatile int counter = 0;
@@ -397,81 +344,16 @@ public class HARegionQueueJUnitTest
 
   protected StringBuffer message = new StringBuffer();
 
-//  private int totalMessages = 0;
-
   protected Exception exception = null;
 
-  private synchronized int getCounter()
-  {
+  private synchronized int getCounter() {
     return ++counter;
   }
 
   /**
-   * This test concurrently adds dispatched message to the linked list and a
-   * removal thread is concurrently removing the messages
-   *  
-   */
-  /*
-   * commenting this out since there are four special cases of this test which
-   * have been covered and this test is buggy - Mitul public void
-   * _testConcurrentAddingToDispatcher()//mitul { exceptionInThread = false;
-   * 
-   * try { createHARegionQueue("dummy"); } catch (Exception e1) { fail("test
-   * failed due to "+e1); }
-   * 
-   * 
-   * Thread[] threads = new Thread[10]; for (int i = 0; i < 10; i++) {
-   * threads[i] = new Thread() { public void run() {
-   * 
-   * try { HARegionQueue haRegionQueue = new HARegionQueue("testing" +
-   * (getCounter()), cache); for (long j = 0; j < 10000; j++) { Thread.sleep(1);
-   * haRegionQueue.addDispatchedMessage(new ThreadIdentifier( new byte[1], j),
-   * j); System.out.println(""+j);
-   *  } } catch (Exception e) { exceptionInThread = true; exception = e; } } }; }
-   * 
-   * Thread qrmSimulatorThread = new Thread() { public void run() { Map.Entry
-   * entry = null; MapWrapper dispatchedMessages = null; List
-   * queueRemovalMessageList = null; String REGION_NAME = null; Iterator iterator =
-   * null; boolean shutdown = false; int messagesSofar = 0; while (!shutdown) {
-   * if (messagesSofar == 100000) { shutdown = true; } iterator =
-   * HARegionQueue.getDispatchedMessagesMapForTesting() .entrySet().iterator();
-   * queueRemovalMessageList = new LinkedList(); while (iterator.hasNext()) {
-   * System.out.println(" here "+messagesSofar); entry =
-   * (Map.Entry)iterator.next(); REGION_NAME = (String)entry.getKey();
-   * queueRemovalMessageList.add(REGION_NAME); dispatchedMessages =
-   * (MapWrapper)entry.getValue(); String[] messages = null; synchronized
-   * (dispatchedMessages) { messagesSofar = messagesSofar +
-   * dispatchedMessages.map.size(); if (messagesSofar == 100000) { shutdown =
-   * true; totalMessages = 100000;
-   * 
-   * try { Thread.sleep(1); } catch (InterruptedException e) { } } else { try {
-   * Thread.sleep(1); } catch (InterruptedException e) { } } iterator.remove();
-   * dispatchedMessages.map.clear(); } queueRemovalMessageList.add(messages); }
-   * if (!queueRemovalMessageList.isEmpty()) { QueueRemovalMessage qrm = new
-   * QueueRemovalMessage(); qrm.setMessagesList(queueRemovalMessageList); } } } };
-   * 
-   * qrmSimulatorThread.start(); for (int k = 0; k < 10; k++) {
-   * threads[k].start(); } for (int k = 0; k < 10; k++) { try {
-   * threads[k].join(60000); } catch (InterruptedException e) { } }
-   * System.out.println("joining simulator"); try {
-   * qrmSimulatorThread.join(60000); } catch (InterruptedException e) { }
-   * 
-   * if (exceptionInThread) { fail("Exception occured " + exception);
-   * exception.printStackTrace(); }
-   * 
-   * if (totalMessages != 100000) { fail("Expected total messages to be 10000
-   * but it is not so !"); }
-   *  }
-   *  
-   */
-
-  /**
    * Thread to perform PUTs into the queue
-   * 
-   *  
    */
-  class Producer extends Thread
-  {
+  class Producer extends Thread {
     /** total number of puts by this thread */
     long totalPuts = 0;
 
@@ -508,8 +390,7 @@ public class HARegionQueueJUnitTest
      *          boolean to indicate whether this thread should create conflation
      *          enabled entries
      */
-    Producer(String name, String keyPrefix, long startingId, long totalPuts,
-        boolean createConflatableEvents) {
+    Producer(String name, String keyPrefix, long startingId, long totalPuts, boolean createConflatableEvents) {
       super(name);
       this.producerName = name;
       this.keyPrefix = keyPrefix;
@@ -520,8 +401,8 @@ public class HARegionQueueJUnitTest
     }
 
     /** Create Conflatable objects and put them into the Queue. */
-    public void run()
-    {
+    @Override
+    public void run() {
       if (producerName == null) {
         producerName = Thread.currentThread().getName();
       }
@@ -553,11 +434,9 @@ public class HARegionQueueJUnitTest
 
   /**
    * tests whether expiry of entry in the regin queue occurs as expected
-   *  
    */
   @Test
-  public void testExpiryPositive()
-  {
+  public void testExpiryPositive() {
     try {     
       HARegionQueueAttributes haa = new HARegionQueueAttributes();
       haa.setExpiryTime(1);
@@ -566,29 +445,24 @@ public class HARegionQueueJUnitTest
       regionqueue.put(new ConflatableObject("key", "value", new EventID(
           new byte[] { 1 }, 1, 1), true, "testing"));
       Map map = (Map)regionqueue.getConflationMapForTesting().get("testing");
-      Assert.assertTrue(!map.isEmpty());
+      assertTrue(!map.isEmpty());
       Thread.sleep(3000);
-      Assert
-          .assertTrue(
-              " Expected region size to be zero since expiry time has been exceeded but it is  "
+      assertTrue(" Expected region size to be zero since expiry time has been exceeded but it is  "
                   + regionqueue.getRegion().keys().size(), regionqueue
                   .getRegion().keys().size() == 0);
 
-      Assert.assertTrue(map.isEmpty());      
+      assertTrue(map.isEmpty());      
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
+      throw new AssertionError(" test failed due to ", e);
     }
   }
 
   /**
    * tests whether things are not deleted before expiry
-   *  
    */
   @Test
-  public void testExpiryNegative()
-  {
+  public void testExpiryNegative() {
     try {
       HARegionQueueAttributes haa = new HARegionQueueAttributes();
       haa.setExpiryTime(100);
@@ -597,27 +471,22 @@ public class HARegionQueueJUnitTest
       regionqueue.put(new ConflatableObject("key", "value", new EventID(
           new byte[] { 1 }, 1, 1), false, "testing"));
       Thread.sleep(1200);
-      Assert
-          .assertTrue(
-              " Expected region size to be 2, since expiry time has not been exceeded but it is : "
+      assertTrue(" Expected region size to be 2, since expiry time has not been exceeded but it is : "
                   + regionqueue.getRegion().keys().size(), regionqueue
                   .getRegion().keys().size() == 2);
 
     }
     catch (Exception e) {
-      fail(" test failed due to " + e);
+      throw new AssertionError(" test failed due to ", e);
     }
-
   }
 
   /**
-   * tests whether expiry of a conflated entry in the regin queue occurs as
+   * tests whether expiry of a conflated entry in the region queue occurs as
    * expected
-   *  
    */
   @Test
-  public void testExpiryPositiveWithConflation()
-  {
+  public void testExpiryPositiveWithConflation() {
     try {
       HARegionQueueAttributes haa = new HARegionQueueAttributes();
       haa.setExpiryTime(2);
@@ -627,64 +496,44 @@ public class HARegionQueueJUnitTest
           new byte[] { 1 }, 1, 1), true, "testing"));
       regionqueue.put(new ConflatableObject("key", "newValue", new EventID(
           new byte[] { 1 }, 1, 2), true, "testing"));
-      Assert
-          .assertTrue(
-              " Expected region size not to be zero since expiry time has not been exceeded but it is not so ",
+      assertTrue(" Expected region size not to be zero since expiry time has not been exceeded but it is not so ",
               !(regionqueue.size() == 0));
-      Assert
-          .assertTrue(
-              " Expected the available id's size not  to be zero since expiry time has not  been exceeded but it is not so ",
+      assertTrue(" Expected the available id's size not  to be zero since expiry time has not  been exceeded but it is not so ",
               !(regionqueue.getAvalaibleIds().size() == 0));
-      Assert
-          .assertTrue(
-              " Expected conflation map size not  to be zero since expiry time has not been exceeded but it is not so "
+      assertTrue(" Expected conflation map size not  to be zero since expiry time has not been exceeded but it is not so "
                   + ((((Map)(regionqueue.getConflationMapForTesting()
                       .get("testing"))).get("key"))),
               !((((Map)(regionqueue.getConflationMapForTesting().get("testing")))
                   .get("key")) == null));
-      Assert
-          .assertTrue(
-              " Expected eventID map size not to be zero since expiry time has not been exceeded but it is not so ",
+      assertTrue(" Expected eventID map size not to be zero since expiry time has not been exceeded but it is not so ",
               !(regionqueue.getEventsMapForTesting().size() == 0));
       Thread.sleep(5000);
 
       ThreadIdentifier tid = new ThreadIdentifier(new byte[] { 1 }, 1);
       System.out.println(" it still contains thread id : "
           + regionqueue.getRegion().containsKey(tid));
-      Assert
-          .assertTrue(
-              " Expected region size to be zero since expiry time has been exceeded but it is not so ",
+      assertTrue(" Expected region size to be zero since expiry time has been exceeded but it is not so ",
               regionqueue.getRegion().keys().size() == 0);
-      Assert
-          .assertTrue(
-              " Expected the available id's size to be zero since expiry time has been exceeded but it is not so ",
+      assertTrue(" Expected the available id's size to be zero since expiry time has been exceeded but it is not so ",
               regionqueue.getAvalaibleIds().size() == 0);
       System.out.println((((Map)(regionqueue.getConflationMapForTesting()
           .get("testing"))).get("key")));
-      Assert
-          .assertTrue(
-              " Expected conflation map size to be zero since expiry time has been exceeded but it is not so ",
+      assertTrue(" Expected conflation map size to be zero since expiry time has been exceeded but it is not so ",
               ((((Map)(regionqueue.getConflationMapForTesting().get("testing")))
                   .get("key")) == null));
-      Assert
-          .assertTrue(
-              " Expected eventID to be zero since expiry time has been exceeded but it is not so ",
+      assertTrue(" Expected eventID to be zero since expiry time has been exceeded but it is not so ",
               (regionqueue.getEventsMapForTesting().size() == 0));
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
+      throw new AssertionError("test failed due to ", e);
     }
-
   }
 
   /**
    * test no expiry of events or data if expiry time not exceeded
-   *  
    */
   @Test
-  public void testExpiryNegativeWithConflation()
-  {
+  public void testExpiryNegativeWithConflation() {
     try {
       HARegionQueueAttributes haa = new HARegionQueueAttributes();
       haa.setExpiryTime(100);
@@ -695,40 +544,31 @@ public class HARegionQueueJUnitTest
       regionqueue.put(new ConflatableObject("key", "newValue", new EventID(
           new byte[] { 1 }, 1, 2), true, "testing"));
       Thread.sleep(1200);
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected region size not to be zero since expiry time has not been exceeded but it is not so ",
               !(regionqueue.size() == 0));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected the available id's size not  to be zero since expiry time has not  been exceeded but it is not so ",
               !(regionqueue.getAvalaibleIds().size() == 0));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected conflation map size not  to be zero since expiry time has not been exceeded but it is not so ",
               !(((Map)(regionqueue
                   .getConflationMapForTesting().get("testing"))).size() == 0));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected eventID map size not to be zero since expiry time has not been exceeded but it is not so ",
               !(regionqueue.getEventsMapForTesting().size() == 0));
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
+      throw new AssertionError("test failed due to ", e);
     }
-
   }
 
   /**
    * tests a ThreadId not being expired if it was updated
-   *  
    */
-
   @Test
-  public void testNoExpiryOfThreadId()
-  {
+  public void testNoExpiryOfThreadId() {
     try {
       HARegionQueueAttributes haa = new HARegionQueueAttributes();
       haa.setExpiryTime(3);
@@ -744,44 +584,38 @@ public class HARegionQueueJUnitTest
       Thread.sleep(2000);
       regionqueue.put(cf2);
       Thread.sleep(1500);
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected region size not to be zero since expiry time has not been exceeded but it is not so ",
               !(regionqueue.size() == 0));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected the available id's size not  to have counter 1 but it has ",
               !(regionqueue.getAvalaibleIds()
                   .contains(new Long(1))));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected the available id's size to have counter 2 but it does not have ",
               (regionqueue.getAvalaibleIds()
                   .contains(new Long(2))));
-      Assert.assertTrue(
+      assertTrue(
           " Expected eventID map not to have the first event, but it has",
           !(regionqueue.getCurrentCounterSet(ev1)
               .contains(new Long(1))));
-      Assert.assertTrue(
+      assertTrue(
           " Expected eventID map to have the second event, but it does not",
           (regionqueue.getCurrentCounterSet(ev2)
               .contains(new Long(2))));
     }
 
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
+      throw new AssertionError("test failed due to ", e);
     }
   }
 
   /**
    * Tests a QueueRemovalMessage coming before a localPut(). The localPut()
    * should result in no data being put in the queue
-   *  
    */
   @Test
-  public void testQRMComingBeforeLocalPut()
-  {
+  public void testQRMComingBeforeLocalPut() {
     try {
       //RegionQueue regionqueue = new HARegionQueue("testing", cache);
       HARegionQueue regionqueue = createHARegionQueue("testing");
@@ -789,26 +623,21 @@ public class HARegionQueueJUnitTest
       regionqueue.removeDispatchedEvents(id);
       regionqueue
           .put(new ConflatableObject("key", "value", id, true, "testing"));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected key to be null since QRM for the message id had already arrived ",
               !regionqueue.getRegion().containsKey(new Long(1)));
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
-
+      throw new AssertionError("test failed due to ", e);
     }
   }
 
   /**
    * test verifies correct expiry of ThreadIdentifier in the HARQ if no
    * corresponding put comes
-   *  
    */
   @Test
-  public void testOnlyQRMComing()
-  {
+  public void testOnlyQRMComing() {
     try {
       HARegionQueueAttributes harqAttr = new HARegionQueueAttributes();
       harqAttr.setExpiryTime(1);
@@ -816,56 +645,47 @@ public class HARegionQueueJUnitTest
       HARegionQueue regionqueue = createHARegionQueue("testing",harqAttr);
       EventID id = new EventID(new byte[] { 1 }, 1, 1);
       regionqueue.removeDispatchedEvents(id);
-      Assert.assertTrue(
+      assertTrue(
           " Expected testingID to be present since only QRM achieved ",
           regionqueue.getRegion().containsKey(
               new ThreadIdentifier(new byte[] { 1 }, 1)));
       Thread.sleep(2500);
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected testingID not to be present since it should have expired after 2.5 seconds",
               !regionqueue.getRegion().containsKey(
                   new ThreadIdentifier(new byte[] { 1 }, 1)));
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
-
+      throw new AssertionError("test failed due to ", e);
     }
   }
 
   /**
    * test all relevant data structures are updated on a local put
-   *  
    */
   @Test
-  public void testPutPath()
-  {
+  public void testPutPath() {
     try {
       HARegionQueue regionqueue = createHARegionQueue("testing");
       Conflatable cf = new ConflatableObject("key", "value", new EventID(
           new byte[] { 1 }, 1, 1), true, "testing");
       regionqueue.put(cf);
-      Assert.assertTrue(" Expected region peek to return cf but it is not so ",
+      assertTrue(" Expected region peek to return cf but it is not so ",
           (regionqueue.peek().equals(cf)));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected the available id's size not  to be zero since expiry time has not  been exceeded but it is not so ",
               !(regionqueue.getAvalaibleIds().size() == 0));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected conflation map to have entry for this key since expiry time has not been exceeded but it is not so ",
               ((((Map)(regionqueue.getConflationMapForTesting().get("testing")))
                   .get("key")).equals(new Long(1))));
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected eventID map size not to be zero since expiry time has not been exceeded but it is not so ",
               !(regionqueue.getEventsMapForTesting().size() == 0));
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test due to " + e);
+      throw new AssertionError("Exception occured in test due to ", e);
     }
   }
 
@@ -873,11 +693,9 @@ public class HARegionQueueJUnitTest
    * - adds 10 items - sets last dispatched as 5th - verify no data pertaining
    * to the first five is there - verify the next five entries and their
    * relevant data is present
-   *  
    */
   @Test
-  public void testQRMDispatch()
-  {
+  public void testQRMDispatch() {
     try {
       HARegionQueue regionqueue = createHARegionQueue("testing");
       Conflatable[] cf = new Conflatable[10];
@@ -891,59 +709,56 @@ public class HARegionQueueJUnitTest
       regionqueue.removeDispatchedEvents(new EventID(new byte[] { 1 }, 1, 4));
       // verify 1-5 not in region
       for (long i = 1; i < 6; i++) {
-        Assert.assertTrue(!regionqueue.getRegion().containsKey(new Long(i)));
+        assertTrue(!regionqueue.getRegion().containsKey(new Long(i)));
       }
       // verify 6-10 still in region queue
       for (long i = 6; i < 11; i++) {
-        Assert.assertTrue(regionqueue.getRegion().containsKey(new Long(i)));
+        assertTrue(regionqueue.getRegion().containsKey(new Long(i)));
       }
       // verify 1-5 not in conflation map
       for (long i = 0; i < 5; i++) {
-        Assert.assertTrue(!((Map)regionqueue.getConflationMapForTesting().get(
+        assertTrue(!((Map)regionqueue.getConflationMapForTesting().get(
             "testing")).containsKey("key" + i));
       }
       // verify 6-10 in conflation map
       for (long i = 5; i < 10; i++) {
-        Assert.assertTrue(((Map)regionqueue.getConflationMapForTesting().get(
+        assertTrue(((Map)regionqueue.getConflationMapForTesting().get(
             "testing")).containsKey("key" + i));
       }
 
       EventID eid = new EventID(new byte[] { 1 }, 1, 6);
       // verify 1-5 not in eventMap
       for (long i = 1; i < 6; i++) {
-        Assert.assertTrue(!regionqueue.getCurrentCounterSet(eid).contains(
+        assertTrue(!regionqueue.getCurrentCounterSet(eid).contains(
             new Long(i)));
       }
       // verify 6-10 in event Map
       for (long i = 6; i < 11; i++) {
-        Assert.assertTrue(regionqueue.getCurrentCounterSet(eid).contains(
+        assertTrue(regionqueue.getCurrentCounterSet(eid).contains(
             new Long(i)));
       }
 
       // verify 1-5 not in available Id's map
       for (long i = 1; i < 6; i++) {
-        Assert.assertTrue(!regionqueue.getAvalaibleIds().contains(new Long(i)));
+        assertTrue(!regionqueue.getAvalaibleIds().contains(new Long(i)));
       }
 
       // verify 6-10 in available id's map
       for (long i = 6; i < 11; i++) {
-        Assert.assertTrue(regionqueue.getAvalaibleIds().contains(new Long(i)));
+        assertTrue(regionqueue.getAvalaibleIds().contains(new Long(i)));
       }
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test due to " + e);
+      throw new AssertionError("Exception occurred in test due to ", e);
     }
   }
 
   /**
    * - send Dispatch message for sequence id 7 - put from sequence id 1 - id 10 -
    * verify data for 1-7 not there - verify data for 8-10 is there
-   *  
    */
   @Test
-  public void testQRMBeforePut()
-  {
+  public void testQRMBeforePut() {
     try {
       HARegionQueue regionqueue = createHARegionQueue("testing");
 
@@ -967,59 +782,56 @@ public class HARegionQueueJUnitTest
       Set values = (Set)regionqueue.getRegion().values();
       for (int i = 0; i < 7; i++) {
         System.out.println(i);
-        Assert.assertTrue(!values.contains(cf[i]));
+        assertTrue(!values.contains(cf[i]));
       }
       // verify 8-10 still in region queue
       for (int i = 7; i < 10; i++) {
         System.out.println(i);
-        Assert.assertTrue(values.contains(cf[i]));
+        assertTrue(values.contains(cf[i]));
       }
       // verify 1-8 not in conflation map
       for (long i = 0; i < 7; i++) {
-        Assert.assertTrue(!((Map)regionqueue.getConflationMapForTesting().get(
+        assertTrue(!((Map)regionqueue.getConflationMapForTesting().get(
             "testing")).containsKey("key" + i));
       }
       // verify 8-10 in conflation map
       for (long i = 7; i < 10; i++) {
-        Assert.assertTrue(((Map)regionqueue.getConflationMapForTesting().get(
+        assertTrue(((Map)regionqueue.getConflationMapForTesting().get(
             "testing")).containsKey("key" + i));
       }
 
       EventID eid = new EventID(new byte[] { 1 }, 1, 6);
       // verify 1-7 not in eventMap
       for (long i = 4; i < 11; i++) {
-        Assert.assertTrue(!regionqueue.getCurrentCounterSet(eid).contains(
+        assertTrue(!regionqueue.getCurrentCounterSet(eid).contains(
             new Long(i)));
       }
       // verify 8-10 in event Map
       for (long i = 1; i < 4; i++) {
-        Assert.assertTrue(regionqueue.getCurrentCounterSet(eid).contains(
+        assertTrue(regionqueue.getCurrentCounterSet(eid).contains(
             new Long(i)));
       }
 
       // verify 1-7 not in available Id's map
       for (long i = 4; i < 11; i++) {
-        Assert.assertTrue(!regionqueue.getAvalaibleIds().contains(new Long(i)));
+        assertTrue(!regionqueue.getAvalaibleIds().contains(new Long(i)));
       }
 
       // verify 8-10 in available id's map
       for (long i = 1; i < 4; i++) {
-        Assert.assertTrue(regionqueue.getAvalaibleIds().contains(new Long(i)));
+        assertTrue(regionqueue.getAvalaibleIds().contains(new Long(i)));
       }
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test due to " + e);
+      throw new AssertionError("Exception occurred in test due to ", e);
     }
   }
 
   /**
    * test to verify conflation happens as expected
-   *  
    */
   @Test
-  public void testConflation()
-  {
+  public void testConflation() {
     try {
       HARegionQueue regionqueue = createHARegionQueue("testing");
       EventID ev1 = new EventID(new byte[] { 1 }, 1, 1);
@@ -1031,42 +843,37 @@ public class HARegionQueueJUnitTest
       regionqueue.put(cf1);
       Map conflationMap = regionqueue
           .getConflationMapForTesting();
-      Assert.assertTrue(((Map)(conflationMap.get("testing"))).get("key")
+      assertTrue(((Map)(conflationMap.get("testing"))).get("key")
           .equals(new Long(1)));
       regionqueue.put(cf2);
       //verify the conflation map has recorded the new key
-      Assert.assertTrue(((Map)(conflationMap.get("testing"))).get("key")
+      assertTrue(((Map)(conflationMap.get("testing"))).get("key")
           .equals(new Long(2)));
       //the old key should not be present
-      Assert.assertTrue(!regionqueue.getRegion().containsKey(new Long(1)));
+      assertTrue(!regionqueue.getRegion().containsKey(new Long(1)));
       //available ids should not contain the old id (the old position)
-      Assert.assertTrue(!regionqueue.getAvalaibleIds().contains(new Long(1)));
+      assertTrue(!regionqueue.getAvalaibleIds().contains(new Long(1)));
       // available id should have the new id (the new position)
-      Assert.assertTrue(regionqueue.getAvalaibleIds().contains(new Long(2)));
+      assertTrue(regionqueue.getAvalaibleIds().contains(new Long(2)));
       //    events map should not contain the old position
-      Assert.assertTrue(regionqueue.getCurrentCounterSet(ev1).isEmpty());
+      assertTrue(regionqueue.getCurrentCounterSet(ev1).isEmpty());
       //    events map should contain the new position
-      Assert.assertTrue(regionqueue.getCurrentCounterSet(ev2).contains(
+      assertTrue(regionqueue.getCurrentCounterSet(ev2).contains(
           new Long(2)));
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test due to " + e);
+      throw new AssertionError("Exception occurred in test due to ", e);
     }
-
   }
 
   /**
    * Tests whether the QRM message removes the events correctly from the DACE &
    * Conflation Map. The events which are of ID greater than that contained in
    * QRM should stay
-   * 
    */
   @Test
-  public void testQRM()
-  {
-
+  public void testQRM() {
     try {
       RegionQueue regionqueue = createHARegionQueue("testing");
       for (int i = 0; i < 10; ++i) {
@@ -1077,26 +884,25 @@ public class HARegionQueueJUnitTest
       ((HARegionQueue)regionqueue).removeDispatchedEvents(qrmID);
       Map conflationMap = ((HARegionQueue)regionqueue)
           .getConflationMapForTesting();
-      Assert.assertTrue(((Map)(conflationMap.get("testing"))).size() == 5);
+      assertTrue(((Map)(conflationMap.get("testing"))).size() == 5);
 
       Set availableIDs = ((HARegionQueue)regionqueue).getAvalaibleIds();
       Set counters = ((HARegionQueue)regionqueue).getCurrentCounterSet(qrmID);
-      Assert.assertTrue(availableIDs.size() == 5);
-      Assert.assertTrue(counters.size() == 5);
+      assertTrue(availableIDs.size() == 5);
+      assertTrue(counters.size() == 5);
       for (int i = 5; i < 10; ++i) {
-        Assert.assertTrue(((Map)(conflationMap.get("testing")))
+        assertTrue(((Map)(conflationMap.get("testing")))
             .containsKey("key" + (i + 1)));
-        Assert.assertTrue(availableIDs.contains(new Long((i + 1))));
-        Assert.assertTrue(counters.contains(new Long((i + 1))));
+        assertTrue(availableIDs.contains(new Long((i + 1))));
+        assertTrue(counters.contains(new Long((i + 1))));
       }
       Region rgn = ((HARegionQueue)regionqueue).getRegion();
-      Assert.assertTrue(rgn.keys().size() == 6);
+      assertTrue(rgn.keys().size() == 6);
 
     }
     catch (Exception e) {
-      fail("Exception occured in test due to " + e);
+      throw new AssertionError("Exception occurred in test due to ", e);
     }
-
   }
 
   protected static HARegionQueue hrqFortestSafeConflationRemoval;
@@ -1104,11 +910,9 @@ public class HARegionQueueJUnitTest
   /**
    * This test tests safe removal from the conflation map. i.e operations should
    * only remove old values and not the latest value
-   *  
    */
   @Test
-  public void testSafeConflationRemoval()
-  {
+  public void testSafeConflationRemoval() {
     try {
       hrqFortestSafeConflationRemoval = new HARQTestClass(
           "testSafeConflationRemoval",
@@ -1123,31 +927,27 @@ public class HARegionQueueJUnitTest
 
       (Map)hrqFortestSafeConflationRemoval.getConflationMapForTesting().get(
           "testSafeConflationRemoval");
-      Assert
-          .assertTrue(
+      assertTrue(
               "Expected the counter to be 2 since it should not have been deleted but it is not so ",
               map.get("key1").equals(new Long(2)));
       hrqFortestSafeConflationRemoval = null;
     }
     catch (Exception e) {
-      fail("Test failed due to " + e);
+      throw new AssertionError("Test failed due to ", e);
     }
   }
 
   /**
    * Extends HARegionQueue for testing purposes. used by
    * testSafeConflationRemoval
-   *  
    */
-  static class HARQTestClass extends HARegionQueue.TestOnlyHARegionQueue
-  {
-    public HARQTestClass(String REGION_NAME, Cache cache,
-        HARegionQueueJUnitTest test) throws IOException, ClassNotFoundException, CacheException, InterruptedException {
+  static class HARQTestClass extends HARegionQueue.TestOnlyHARegionQueue {
+
+    public HARQTestClass(String REGION_NAME, Cache cache, HARegionQueueJUnitTest test) throws IOException, ClassNotFoundException, CacheException, InterruptedException {
       super(REGION_NAME, cache);
     }
 
-    ConcurrentMap createConcurrentMap()
-    {
+    ConcurrentMap createConcurrentMap() {
       return new ConcHashMap();
     }
   }
@@ -1155,17 +955,15 @@ public class HARegionQueueJUnitTest
   /**
    * Used to override the remove method for testSafeConflationRemoval
    */
-  static class ConcHashMap extends ConcurrentHashMap implements ConcurrentMap
-  {
-    public boolean remove(Object arg0, Object arg1)
-    {
+  static class ConcHashMap extends ConcurrentHashMap implements ConcurrentMap {
+    public boolean remove(Object arg0, Object arg1) {
       Conflatable cf2 = new ConflatableObject("key1", "value2", new EventID(
           new byte[] { 1 }, 1, 2), true, "testSafeConflationRemoval");
       try {
         hrqFortestSafeConflationRemoval.put(cf2);
       }
       catch (Exception e) {
-        fail("Exception occured in trying to put ");
+        throw new AssertionError("Exception occurred in trying to put ", e);
       }
       return super.remove(arg0, arg1);
     }
@@ -1191,11 +989,9 @@ public class HARegionQueueJUnitTest
    * The data in the list is populated on a map against the threadId.
    * 
    * It is then verified to see that all the sequence should be greater than x
-   *  
    */
   @Test
-  public void testConcurrentDispatcherAndRemovalForSameRegionSameThreadId()
-  {
+  public void testConcurrentDispatcherAndRemovalForSameRegionSameThreadId() {
     try {
       final long numberOfIterations = 1000;
       final HARegionQueue hrq = createHARegionQueue("testConcurrentDispatcherAndRemoval");
@@ -1270,24 +1066,21 @@ public class HARegionQueueJUnitTest
       Long next;
       while (iterator.hasNext()) {
         next = ((Long)iterator.next());
-        Assert.assertTrue(" Expected all the sequence ID's to be greater than "
+        assertTrue(" Expected all the sequence ID's to be greater than "
             + max + " but it is not so. Got sequence id " + next, next
             .compareTo(max) >= 0);
       }
     }
     catch (Exception e) {
-      fail("Test failed due to : " + e);
+      throw new AssertionError("Test failed due to : ", e);
     }
-
   }
 
   /**
-   * 
    * This test remove operation is updating the sequence ID for a
    * ThreadIdentifier and concurrently the QRM thread is iterating over the Map
    * to form the Data Set. There should not be any DataLoss
-   * 
-   * 
+   *
    * In this test, first we add x number of events for unique thread id for the
    * same region then we start two concurrent threads. One which does add to
    * dispatched events map with sequence id's greater than x and the second one
@@ -1300,11 +1093,9 @@ public class HARegionQueueJUnitTest
    * The data in the list is populated on a map against the threadId.
    * 
    * It is then verified to see that the map size should be 2x
-   *  
    */
   @Test
-  public void testConcurrentDispatcherAndRemovalForSameRegionDifferentThreadId()
-  {
+  public void testConcurrentDispatcherAndRemovalForSameRegionDifferentThreadId() {
     try {
       final long numberOfIterations = 1000;
       final HARegionQueue hrq = createHARegionQueue("testConcurrentDispatcherAndRemoval");
@@ -1376,23 +1167,20 @@ public class HARegionQueueJUnitTest
           map.put(new Long(id.getThreadID()), new Long(id.getSequenceID()));
         }
       }
-      Assert.assertTrue(" Expected the map size to be "
+      assertTrue(" Expected the map size to be "
           + (2 * numberOfIterations) + " but it is " + map.size(),
           map.size() == (2 * numberOfIterations));
     }
     catch (Exception e) {
-      fail("Test failed due to an unexpected exception : " + e);
+      throw new AssertionError("Test failed due to an unexpected exception : ", e);
     }
   }
 
   /**
-   * 
    * This test tests remove operation is causing the insertion of a sequence ID
    * for a new HA Region and concurrently the QRM thread is iterating over the
    * Map to form the Data Set for dispatch. There should not be any Data Loss
-   * 
-   * 
-   * 
+   *
    * In this test, first we add x number of events for unique thread id for the
    * 2 regions then we start two concurrent threads. One which does add to
    * dispatched events map to 3 new regions
@@ -1406,12 +1194,9 @@ public class HARegionQueueJUnitTest
    * The data in the list is populated on a map against the threadId.
    * 
    * It is then verified to see that a total of x entries are present in the map
-   *  
    */
-
   @Test
-  public void testConcurrentDispatcherAndRemovalForMultipleRegionsSameThreadId()
-  {
+  public void testConcurrentDispatcherAndRemovalForMultipleRegionsSameThreadId() {
     try {
       final long numberOfIterations = 10000;
       final HARegionQueue hrq1 = createHARegionQueue("testConcurrentDispatcherAndRemoval1");
@@ -1507,26 +1292,22 @@ public class HARegionQueueJUnitTest
           }
         }
       }
-      Assert.assertTrue(" Expected the map size to be " + (numberOfIterations)
+      assertTrue(" Expected the map size to be " + (numberOfIterations)
           + " but it is " + map.size(), map.size() == (numberOfIterations));
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Test failed due to : " + e);
+      throw new AssertionError("Test failed due to : ", e);
     }
-
   }
 
   /**
-   * 
    * This test tests remove operation is causing the insertion of a sequence ID
    * for a new ThreadIdentifier Object ( that is the HA Regio name exists but
    * ThreadIdentifier object is appearing 1st time) and concurrently the QRM
    * thread is iterating over the Map to form the Data Set for dispatch. There
    * should not be any DataLoss
    * 
-   * 
    * In this test, first we add x number of events for unique thread id for the
    * multiples regions then we start two concurrent threads. One which does add
    * to dispatched events map with sequence id's greater than x and new
@@ -1542,11 +1323,9 @@ public class HARegionQueueJUnitTest
    * 
    * It is then verified to see that the map size should be 2x * number of
    * regions
-   *  
    */
   @Test
-  public void testConcurrentDispatcherAndRemovalForMultipleRegionsDifferentThreadId()
-  {
+  public void testConcurrentDispatcherAndRemovalForMultipleRegionsDifferentThreadId() {
     try {
       final long numberOfIterations = 1000;
       final HARegionQueue hrq1 =
@@ -1677,16 +1456,14 @@ public class HARegionQueueJUnitTest
         }
       }
 
-      Assert.assertTrue(" Expected the map size to be "
+      assertTrue(" Expected the map size to be "
           + (numberOfIterations * 2 * 5) + " but it is " + map.size(), map
           .size() == (numberOfIterations * 2 * 5));
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Test failed due to : " + e);
+      throw new AssertionError("Test failed due to : ", e);
     }
-
   }
 
   /**
@@ -1694,10 +1471,8 @@ public class HARegionQueueJUnitTest
    * take is also happening such that the object is removed first then the peek
    * should block & not return with null.
    */
-
   @Test
-  public void testBlockingQueueForConcurrentPeekAndTake()
-  {
+  public void testBlockingQueueForConcurrentPeekAndTake() {
     exceptionInThread = false;
     testFailed = false;
     try {
@@ -1765,19 +1540,16 @@ public class HARegionQueueJUnitTest
 
     }
     catch (Exception e) {
-      fail(" Test failed due to " + e);
-      e.printStackTrace();
+      throw new AssertionError(" Test failed due to ", e);
     }
-
   }
 
   /**
-   * Peek on a blokcing queueis in progress & the single element is removed
+   * Peek on a blocking queue is in progress & the single element is removed
    * either by take or by QRM thread , the peek should block correctly.
    */
   @Test
-  public void testBlockingQueueForTakeWhenPeekInProgress()
-  {
+  public void testBlockingQueueForTakeWhenPeekInProgress() {
     exceptionInThread = false;
     testFailed = false;
     try {
@@ -1844,10 +1616,8 @@ public class HARegionQueueJUnitTest
 
     }
     catch (Exception e) {
-      fail(" Test failed due to " + e);
-      e.printStackTrace();
+      throw new AssertionError(" Test failed due to ", e);
     }
-
   }
 
   /**
@@ -1856,16 +1626,13 @@ public class HARegionQueueJUnitTest
    * published by adding into the available IDs Set. Similarly if an event is to
    * be removed it should first be removed from availableIDs set & then from
    * behind the scenes. It will be the responsibility of the thread removing
-   * from availabelIDs successfully which will remove the entry from all other
+   * from available IDs successfully which will remove the entry from all other
    * places. Now if the expiry task makes the event from underlying null before
-   * removing from availabel IDs , there is a potential violation. This test
+   * removing from available IDs , there is a potential violation. This test
    * will validate that behaviour
-   * 
-   *  
    */
   @Test
-  public void testConcurrentEventExpiryAndTake()
-  {
+  public void testConcurrentEventExpiryAndTake() {
     try {
       HARegionQueueAttributes haa = new HARegionQueueAttributes();
       haa.setExpiryTime(3);  
@@ -1930,8 +1697,7 @@ public class HARegionQueueJUnitTest
         assertNull(o);
       }
       catch (Exception e) {
-        e.printStackTrace();
-        fail("Test failed due to exception " + e);
+        throw new AssertionError("Test failed due to exception ", e);
       }finally{
         synchronized (this) {
           this.allowExpiryToProceed = true;
@@ -1946,21 +1712,20 @@ public class HARegionQueueJUnitTest
       assertTrue("Test failed due to exception ", !encounteredException);
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
+      throw new AssertionError("test failed due to ", e);
     }
-
   }
   
   /**
    * This test validates that if sequence violation occurs without GII,the put
    * will throw an exception
-   * 
-   * 
+   *
    * Test is commented as assertion for sequence violation is removed in the
    * source(HARegionQueue.putObject) is removed. - Suyog
    */
-  public void _testExceptionInPutForSequenceViolationWithoutGII() {
+  @Ignore("TODO: disabled for unknown reason")
+  @Test
+  public void testExceptionInPutForSequenceViolationWithoutGII() {
     DistributedSystem ds = cache.getDistributedSystem();
     cache.close();
     ds.disconnect();
@@ -1971,9 +1736,7 @@ public class HARegionQueueJUnitTest
       cache= CacheFactory.create(DistributedSystem.connect(props));
     }
     catch (Exception e1) {
-      
-      e1.printStackTrace();
-      fail("Test failed because of exception. Exception="+e1);
+      throw new AssertionError("Test failed because of exception. Exception=", e1);
     }
     
     HARegionQueue rq= null;
@@ -1982,8 +1745,7 @@ public class HARegionQueueJUnitTest
       rq = HARegionQueue.getHARegionQueueInstance("testException",cache,HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Test failed because of exception. Exception="+e);
+      throw new AssertionError("Test failed because of exception. Exception=", e);
     }
     ConflatableObject cf1 = new ConflatableObject("key1","val1", new EventID( new byte[]{1},1,2),false,"test" );
     ConflatableObject cf2 = new ConflatableObject("key1","val1", new EventID( new byte[]{1},1,1),false,"test" );
@@ -1991,87 +1753,75 @@ public class HARegionQueueJUnitTest
     try{
       rq.put(cf1);
     }catch(Exception e) {
-      e.printStackTrace();
-      fail("Test failed because of exception. Exception="+e);
+      throw new AssertionError("Test failed because of exception. Exception=", e);
     }
     
     try{
       rq.put(cf2);
-      fail("Test failed because asertion error was expected but there was'nt any");  
+      fail("Test failed because asertion error was expected but there was'nt any"); // TODO: this is broken, the following catch will catch this or what's thrown by put
     }catch(AssertionError ignore) {
       System.out.println("Got the right assertion failure");
     }catch(Exception e) {
       e.printStackTrace();
-      fail("Test failed because of exception. Exception="+e);
+      throw new AssertionError("Test failed because of exception. Exception=", e);
     }
-    
   }
 
   /**
    * Tests the functionality of batch peek & remove with blocking & non blocking
    * HARegionQueue
-   * 
    */
   @Test
-  public void testBatchPeekWithRemoveForNonBlockingQueue()
-  {
+  public void testBatchPeekWithRemoveForNonBlockingQueue() {
     testBatchPeekWithRemove(false);
-
   }
   
   /**
    * Tests the functionality of batch peek & remove with blocking & non blocking
    * HARegionQueue
-   * 
    */
   @Test
-  public void testBatchPeekWithRemoveForBlockingQueue()
-  {
+  public void testBatchPeekWithRemoveForBlockingQueue() {
     testBatchPeekWithRemove(true);
-
   }
 
-  private void testBatchPeekWithRemove(boolean createBlockingQueue)
-  {
+  private void testBatchPeekWithRemove(boolean createBlockingQueue) {
     HARegionQueueAttributes haa = new HARegionQueueAttributes();
     haa.setExpiryTime(300);
     try {
       HARegionQueue regionqueue = createBlockingQueue ?HARegionQueue.getHARegionQueueInstance("testing", cache, haa,HARegionQueue.BLOCKING_HA_QUEUE, false)
           : HARegionQueue.getHARegionQueueInstance("testing", cache, haa,HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
-          for(int i=0; i<10;++i) {
-          EventID ev1 = new EventID(new byte[] { 1 }, 1, i);
-          Conflatable cf1 = new ConflatableObject("key", "value", ev1, false,
-              "testing");
-          regionqueue.put(cf1);
-          }
-          
-          List objs = regionqueue.peek(10,5000);
-          assertEquals(10,objs.size());
-          Iterator itr = objs.iterator();
-          int j=0;
-          while(itr.hasNext()) {
-            Conflatable conf = (Conflatable)itr.next();
-            assertNotNull(conf);
-            assertTrue("The sequence ID of the objects in the queue are not as expected",conf.getEventId().getSequenceID() == j++);
-          }
-          regionqueue.remove();
-          assertEquals(0,regionqueue.size());
+      for(int i=0; i<10;++i) {
+        EventID ev1 = new EventID(new byte[] { 1 }, 1, i);
+        Conflatable cf1 = new ConflatableObject("key", "value", ev1, false,
+            "testing");
+        regionqueue.put(cf1);
+      }
+
+      List objs = regionqueue.peek(10,5000);
+      assertEquals(10,objs.size());
+      Iterator itr = objs.iterator();
+      int j=0;
+      while(itr.hasNext()) {
+        Conflatable conf = (Conflatable)itr.next();
+        assertNotNull(conf);
+        assertTrue("The sequence ID of the objects in the queue are not as expected",conf.getEventId().getSequenceID() == j++);
+      }
+      regionqueue.remove();
+      assertEquals(0,regionqueue.size());
 
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("Test failed bcoz of exception =" + e);
+      throw new AssertionError("Test failed bcoz of exception =", e);
     }
   }
 
   /**
    * tests whether expiry of entry in the regin queue occurs as expected using
    * system property to set expiry
-   * 
    */
   @Test
-  public void testExpiryUsingSystemProperty()
-  {
+  public void testExpiryUsingSystemProperty() {
     try {      
       System.setProperty(HARegionQueue.REGION_ENTRY_EXPIRY_TIME,"1");      
       
@@ -2080,51 +1830,43 @@ public class HARegionQueueJUnitTest
       regionqueue.put(new ConflatableObject("key", "value", new EventID(
           new byte[] { 1 }, 1, 1), true, "testing"));
       Map map = (Map)regionqueue.getConflationMapForTesting().get("testing");
-      Assert.assertTrue(!map.isEmpty());
+      assertTrue(!map.isEmpty());
       Thread.sleep(3000);
-      Assert
-          .assertTrue(
+      assertTrue(
               " Expected region size to be zero since expiry time has been exceeded but it is  "
                   + regionqueue.getRegion().keys().size(), regionqueue
                   .getRegion().keys().size() == 0);
 
-      Assert.assertTrue(map.isEmpty());      
+      assertTrue(map.isEmpty());      
       // [yogi]system property set to null, to avoid using it in the subsequent tests   
       System.setProperty(HARegionQueue.REGION_ENTRY_EXPIRY_TIME,"");
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail(" test failed due to " + e);
+      throw new AssertionError(" test failed due to ", e);
     }
   }
 
   /**
    * This tests whether the messageSyncInterval for QueueRemovalThread is
    * refreshed properly when set/updated using cache's setter API
-   * @throws InterruptedException 
-   * @throws IOException 
-   * @throws ClassNotFoundException 
-   * @throws CacheException 
-   * 
    */
   @Test
-  public void testUpdationOfMessageSyncInterval() throws CacheException, ClassNotFoundException, IOException, InterruptedException
-  {
-      int initialMessageSyncInterval = 5;
-      cache.setMessageSyncInterval(initialMessageSyncInterval);
-      createHARegionQueue("testUpdationOfMessageSyncInterval");
+  public void testUpdationOfMessageSyncInterval() throws Exception {
+    int initialMessageSyncInterval = 5;
+    cache.setMessageSyncInterval(initialMessageSyncInterval);
+    createHARegionQueue("testUpdationOfMessageSyncInterval");
 
-      Assert.assertEquals("messageSyncInterval not set properly",
-          initialMessageSyncInterval, HARegionQueue.getMessageSyncInterval());
+    assertEquals("messageSyncInterval not set properly",
+        initialMessageSyncInterval, HARegionQueue.getMessageSyncInterval());
 
-      int updatedMessageSyncInterval = 10;
-      cache.setMessageSyncInterval(updatedMessageSyncInterval);
+    int updatedMessageSyncInterval = 10;
+    cache.setMessageSyncInterval(updatedMessageSyncInterval);
 
-      // sleep for a time just more the intial messageSyncInterval1 , so that
-      // the value is updated in QRM run loop.
-      Thread.sleep((initialMessageSyncInterval + 1) * 1000);
+    // sleep for a time just more the intial messageSyncInterval1 , so that
+    // the value is updated in QRM run loop.
+    Thread.sleep((initialMessageSyncInterval + 1) * 1000);
 
-      Assert.assertEquals("messageSyncInterval not updated.",
-          updatedMessageSyncInterval, HARegionQueue.getMessageSyncInterval());
+    assertEquals("messageSyncInterval not updated.",
+        updatedMessageSyncInterval, HARegionQueue.getMessageSyncInterval());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
index 46ad459..1f7e63c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
@@ -16,6 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static org.junit.Assert.*;
+
+import java.net.SocketException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -27,14 +35,20 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.net.SocketException;
-import java.util.Properties;
-
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
-public class HASlowReceiverDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class HASlowReceiverDUnitTest extends JUnit4DistributedTestCase {
+
   protected static Cache cache = null;
 
   private static VM serverVM1 = null;
@@ -57,10 +71,6 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
   
   private static boolean isUnresponsiveClientRemoved = false;
 
-  public HASlowReceiverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -107,7 +117,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
     Properties prop = new Properties();
     prop.setProperty(REMOVE_UNRESPONSIVE_CLIENT,
         "true");
-    new HASlowReceiverDUnitTest("temp").createCache(prop);
+    new HASlowReceiverDUnitTest().createCache(prop);
 
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -137,7 +147,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HASlowReceiverDUnitTest("temp").createCache(props);
+    new HASlowReceiverDUnitTest().createCache(props);
 
     AttributesFactory factory = new AttributesFactory();
     PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer("localhost",
@@ -230,6 +240,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
   }
 
   // Test slow client
+  @Test
   public void testSlowClient() throws Exception {
     setBridgeObeserverForAfterQueueDestroyMessage();
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
index eb86bd6..971ced1 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
@@ -16,77 +16,57 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.ClientServerTestCase;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
  * This test verifies that all entry operations (create,put,destroy,invalidate)
  * which propagate from one server1 to another server2 do get delivered to the
  * client connected to server2 (server2 is primary for client)
- *
  */
+@Category(DistributedTest.class)
+public class OperationsPropagationDUnitTest extends JUnit4DistributedTestCase {
 
-public class OperationsPropagationDUnitTest extends DistributedTestCase
-{
-
-  /**
-   * Server1
-   */
   VM server1 = null;
-
-  /**
-   * Server2
-   */
   VM server2 = null;
-
-  /**
-   * Client
-   */
   VM client1 = null;
 
-  /**
-   * Port of server1
-   */
   public int PORT1;
-
-  /**
-   * Port of server2
-   */
   public int PORT2;
 
-  /**
-   * Name of the region
-   */
-  private static final String REGION_NAME = "OperationsPropagationDUnitTest_Region";
+  private static final String REGION_NAME = OperationsPropagationDUnitTest.class.getSimpleName() + "_Region";
 
-  /**
-   * cache
-   */
   private static Cache cache = null;
 
   /**
-   * Constructor
-   *
-   * @param name
-   */
-  public OperationsPropagationDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Create the server1, server2 (in the same DS) and client1 (which is
    * connected only to server2
    */
@@ -119,7 +99,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
 
   /**
    * closes the cache and disconnects the vm from teh distributed system
-   *
    */
   public static void closeCache()
   {
@@ -131,9 +110,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
 
   /**
    * connect to the DS and create a cache
-   *
-   * @param props
-   * @throws Exception
    */
   private void createCache(Properties props) throws Exception
   {
@@ -152,13 +128,10 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
 
   /**
    * Create the server
-   *
-   * @return
-   * @throws Exception
    */
   public static Integer createServerCache() throws Exception
   {
-    new OperationsPropagationDUnitTest("temp").createCache(new Properties());
+    new OperationsPropagationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -172,14 +145,10 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
     server.setNotifyBySubscription(true);
     server.start();
     return new Integer(server.getPort());
-
   }
 
   /**
    * create the client and connect it to the server with the given port
-   *
-   * @param port2
-   * @throws Exception
    */
   public static void createClientCache(String host, Integer port2) throws Exception
   {
@@ -187,7 +156,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new OperationsPropagationDUnitTest("temp").createCache(props);
+    new OperationsPropagationDUnitTest().createCache(props);
     props.setProperty("retryAttempts", "2");
     props.setProperty("endpoints", "ep1="+host+":" + PORT2);
     props.setProperty("redundancyLevel", "-1");
@@ -205,7 +174,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
     region = cache.createRegion(REGION_NAME, attrs);
     assertNotNull(region);
     region.registerInterest("ALL_KEYS");
-
   }
 
   public static final String CREATE_KEY = "createKey";
@@ -235,15 +203,18 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
   public static final String PUTALL_VALUE2 = "putAllValue2";
 
   /**
-   * This test: 1) First the initial keys and values 2) Verify that the initial
-   * keys and values have reached the client 3) Do the operations which we want
-   * to propagate (create, update, invalidate and destroy) 4) Verify the
+   * This test:
+   * 1) First the initial keys and values
+   * 2) Verify that the initial
+   * keys and values have reached the client
+   * 3) Do the operations which we want
+   * to propagate (create, update, invalidate and destroy)
+   * 4) Verify the
    * operations reached the client
    * 5) Do a removeAll
    * 6) Verify it reached the client
-   *
-   * @throws Exception
    */
+  @Test
   public void testOperationsPropagation() throws Exception
   {
     server1.invoke(() -> OperationsPropagationDUnitTest.initialPutKeyValue());
@@ -256,7 +227,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
 
   /**
    * put the initial keys and values
-   *
    */
   public static void initialPutKeyValue()
   {
@@ -268,12 +238,10 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
     catch (Exception e) {
       Assert.fail(" Test failed due to " + e, e);
     }
-
   }
 
   /**
    * do the operations which you want to propagate
-   *
    */
   public static void doOperations()
   {
@@ -290,12 +258,10 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
     catch (Exception e) {
       Assert.fail(" Test failed due to " + e, e);
     }
-
   }
 
   /**
    * assert the initial key values are present
-   *
    */
   public static void assertKeyValuePresent()
   {
@@ -312,11 +278,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
-      /*
-       * if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE1))) { fail(" Expected
-       * value to be " + UPDATE_VALUE1 + " but it is " +
-       * region.get(UPDATE_KEY)); }
-       */
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -329,11 +290,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
-      /*
-       * if (!(region.get(INVALIDATE_KEY).equals(INVALIDATE_VALUE))) { fail("
-       * Expected value to be " + INVALIDATE_VALUE + " but it is " +
-       * region.get(INVALIDATE_KEY)); }
-       */
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -345,27 +301,17 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
         }
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-      
-      /*
-       * if (!(region.get(DESTROY_KEY).equals(DESTROY_VALUE))) { fail(" Expected
-       * value to be " + DESTROY_VALUE + " but it is " +
-       * region.get(DESTROY_KEY)); }
-       */
-
     }
     catch (Exception e) {
       Assert.fail(" Test failed due to " + e, e);
     }
-
   }
 
   /**
    * assert the operations reached the client successfully
-   *
    */
   public static void assertOperationsSucceeded()
   {
-
     try {
       //Thread.sleep(5000);
       WaitCriterion wc = new WaitCriterion() {
@@ -380,10 +326,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
-      /*if (!(region.get(CREATE_KEY).equals(CREATE_VALUE))) {
-       fail("CREATE operation did not propagate to client : Expected value to be "
-       + CREATE_VALUE + " but it is " + region.get(CREATE_KEY));
-       }*/
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -396,10 +338,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
-      /*if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE2))) {
-       fail(" UPDATE operation did not propagate to Client : Expected value to be "
-       + UPDATE_VALUE2 + " but it is " + region.get(UPDATE_KEY));
-       }*/
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -412,10 +350,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
 
-      /*if (region.containsKey(DESTROY_KEY)) {
-       fail(" DESTROY operation did not propagate to Client : Expected "
-       + DESTROY_KEY + " not to be present but it is ");
-       }*/
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -428,10 +362,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
-      /*if (!(region.get(INVALIDATE_KEY) == null)) {
-       fail(" INVALIDATE operation did not propagate to Client : Expected value to be null but it is "
-       + region.get(INVALIDATE_KEY));
-       }*/
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {
@@ -444,11 +374,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       };
       Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
-      /*
-       * if (!(region.get(PUTALL_KEY).equals(PUTALL_VALUE))) { fail("PUTALL
-       * operation did not propagate to client : Expected value to be " +
-       * PUTALL_VALUE + " but it is " + region.get(PUTALL_KEY)); }
-       */
       wc = new WaitCriterion() {
         String excuse;
         public boolean done() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
index 4cb1849..9868c73 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
@@ -16,7 +16,28 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
@@ -27,26 +48,20 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
  * Test to verify correct propagation of operations eventID's for put all
  *
- *
  * @since GemFire 5.1
  */
-
-public class PutAllDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class PutAllDUnitTest extends JUnit4DistributedTestCase {
 
   /** server1 VM **/
   VM server1 = null;
@@ -74,8 +89,8 @@ public class PutAllDUnitTest extends DistributedTestCase
   static CacheServerImpl server = null;
 
   /** test constructor **/
-  public PutAllDUnitTest(String name) {
-    super(name);
+  public PutAllDUnitTest() {
+    super();
   }
 
   /** get the hosts and the VMs **/
@@ -132,7 +147,7 @@ public class PutAllDUnitTest extends DistributedTestCase
   /** create the server **/
   public static Integer createServerCache() throws Exception
   {
-    new PutAllDUnitTest("temp").createCache(new Properties());
+    new PutAllDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -169,7 +184,7 @@ public class PutAllDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new PutAllDUnitTest("temp").createCache(props);
+    new PutAllDUnitTest().createCache(props);
     props.setProperty("retryAttempts", "2");
     props.setProperty("endpoints", "ep1="+host+":" + PORT1);
     props.setProperty("redundancyLevel", "-1");
@@ -200,7 +215,7 @@ public class PutAllDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new PutAllDUnitTest("temp").createCache(props);
+    new PutAllDUnitTest().createCache(props);
     props.setProperty("retryAttempts", "2");
     props.setProperty("endpoints", "ep1="+host+":" + PORT1);
     props.setProperty("redundancyLevel", "-1");
@@ -334,6 +349,7 @@ public class PutAllDUnitTest extends DistributedTestCase
    *
    * @throws Exception
    */
+  @Test
   public void testPutAll() throws Exception
   {
     setReceivedOperationToFalse();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
index 0a66e5e..b7bb6c1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
@@ -16,22 +16,35 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
 /**
  * This is Dunit test for bug 36109. This test has a cache-client having a primary
@@ -42,13 +55,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * appearing because invalidate stats was part of Endpoint which used to get
  * closed during fail over , with the failed endpoint getting closed. This bug
  * has been fixed by moving the invalidate stat to be part of our implementation.
- * 
- * 
  */
 @Category(DistributedTest.class)
 @Ignore("Test was disabled by renaming to DisabledTest")
-public class StatsBugDUnitTest extends DistributedTestCase
-{
+public class StatsBugDUnitTest extends JUnit4DistributedTestCase {
+
   /** primary cache server */
   VM primary = null;
 
@@ -68,7 +79,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
   private static int PORT2;
 
   /** name of the test region */
-  private static final String REGION_NAME = "StatsBugDUnitTest_Region";
+  private static final String REGION_NAME = StatsBugDUnitTest.class.getSimpleName() + "_Region";
 
   /** brige-writer instance( used to get connection proxy handle) */
   private static PoolImpl pool = null;
@@ -85,22 +96,6 @@ public class StatsBugDUnitTest extends DistributedTestCase
   /** prefix added to the keys of events generated on secondary */
   private static final String secondaryPrefix = "secondary_";
 
-  /**
-   * Constructor
-   * 
-   * @param name -
-   *          name for this test instance
-   */
-  public StatsBugDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
-   * Creates the primary and the secondary cache servers
-   * 
-   * @throws Exception -
-   *           thrown if any problem occurs in initializing the test
-   */
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -134,12 +129,6 @@ public class StatsBugDUnitTest extends DistributedTestCase
     return cache;
   }
 
-  /**
-   * close the cache instances in server and client during tearDown
-   * 
-   * @throws Exception
-   *           thrown if any problem occurs in closing cache
-   */
   @Override
   public final void preTearDown() throws Exception {
     // close client
@@ -159,10 +148,8 @@ public class StatsBugDUnitTest extends DistributedTestCase
    * operations from secondary<br>
    * 5)Verify that the invalidates stats at the client accounts for the
    * operations done by both, primary and secondary.
-   * 
-   * @throws Exception -
-   *           thrown if any problem occurs in test execution
    */
+  @Test
   public void testBug36109() throws Exception
   {
     LogWriterUtils.getLogWriter().info("testBug36109 : BEGIN");
@@ -200,7 +187,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
    */
   public static Integer createServerCache() throws Exception
   {
-    StatsBugDUnitTest test = new StatsBugDUnitTest("temp");
+    StatsBugDUnitTest test = new StatsBugDUnitTest();
     Properties props = new Properties();
     cache = test.createCache(props);
     AttributesFactory factory = new AttributesFactory();
@@ -233,7 +220,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
   public static void createClientCache(String host, Integer port1, Integer port2)
       throws Exception
   {
-    StatsBugDUnitTest test = new StatsBugDUnitTest("temp");
+    StatsBugDUnitTest test = new StatsBugDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -257,7 +244,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
   public static void createClientCacheForInvalidates(String host, Integer port1, Integer port2)
       throws Exception
   {
-    StatsBugDUnitTest test = new StatsBugDUnitTest("temp");
+    StatsBugDUnitTest test = new StatsBugDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/ThreadIdentifierJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/ThreadIdentifierJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/ThreadIdentifierJUnitTest.java
index 66ee622..110b64d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/ThreadIdentifierJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/ThreadIdentifierJUnitTest.java
@@ -24,8 +24,6 @@ import org.junit.experimental.categories.Category;
 import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier.WanType;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
-import junit.framework.TestCase;
-
 @Category(UnitTest.class)
 public class ThreadIdentifierJUnitTest {
 


[25/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
index 11eefd0..9de8806 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -25,6 +27,9 @@ import java.util.Iterator;
 import java.util.Properties;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -40,7 +45,6 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.partitioned.RegionAdvisor;
 import com.gemstone.gemfire.internal.logging.InternalLogWriter;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
@@ -48,8 +52,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class ColocationFailoverDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class ColocationFailoverDUnitTest extends JUnit4DistributedTestCase {
 
   private static final long serialVersionUID = 1L;
 
@@ -73,10 +80,6 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
   public static String orderPR_Name = "ColocationFailoverDUnitTest_OrderPR" ;
   public static String shipmentPR_Name = "ColocationFailoverDUnitTest_ShipmentPR" ;
 
-  public ColocationFailoverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -86,6 +89,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
     dataStore4 = host.getVM(3);
   }
 
+  @Test
   public void testPrimaryColocationFailover() throws Throwable {    
     createCacheInAllVms();
     createCustomerPR();
@@ -97,6 +101,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
     verifyPrimaryColocationAfterFailover();
   }
   
+  @Test
   public void testColocationFailover() throws Throwable {
     createCacheInAllVms();
     createCustomerPR();
@@ -362,7 +367,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
   }
 
   public static void createCacheInVm() {
-    new ColocationFailoverDUnitTest("temp").createCache();
+    new ColocationFailoverDUnitTest().createCache();
   }
 
   public void createCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
index f6f4b01..1c9f93f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
@@ -16,10 +16,37 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionInvocationTargetException;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DM;
@@ -32,17 +59,21 @@ import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
 import com.gemstone.gemfire.security.templates.DummyAuthenticator;
 import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
 
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributedRegionFunctionExecutionDUnitTest extends JUnit4DistributedTestCase {
 
   VM replicate1 = null;
 
@@ -62,10 +93,6 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
   
   public static final Function functionWithNoResultThrowsException = new MyFunctionException();
 
-  public DistributedRegionFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -82,6 +109,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     disconnectAllFromDS();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -98,6 +126,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     executeFunction();
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_SendException() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -114,6 +143,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     executeFunction_SendException();
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_NoLastResult() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -132,6 +162,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
 
 
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyNormal() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -154,6 +185,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     }
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -171,6 +203,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
   }
   
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate_SendException() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -187,6 +220,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.executeFunction_SendException());
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate_NoLastResult() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -203,6 +237,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.executeFunction_NoLastResult());
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetException() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -230,6 +265,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetException_WithoutHA() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -264,6 +300,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetExceptionForEmptyDataPolicy() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -291,6 +328,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionWithFunctionInvocationTargetExceptionForEmptyDataPolicy_WithoutHA() {
     createCacheInVm(); // Empty
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -321,6 +359,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionHACacheClosedException() {
     VM empty = normal;
 
@@ -361,6 +400,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     }
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionHANodeFailure() {
     VM empty = normal;
 
@@ -394,6 +434,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
   }
   
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer() {
     VM empty1 = replicate3;
     VM empty2 = normal;
@@ -413,6 +454,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     executeFunction();
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_SendException() {
     VM empty1 = replicate3;
     VM empty2 = normal;
@@ -433,6 +475,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
   }
 
   @Category(FlakyTest.class) // GEODE-632: random ports, eats exceptions
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_NoLastResult() {
     VM empty1 = replicate3;
     VM empty2 = normal;
@@ -466,6 +509,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerFailoverWithTwoServerAliveHA()
       throws InterruptedException {
 
@@ -501,6 +545,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
 
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyNormal_ClientServer() {
     VM normal1 = normal;
     VM normal2 = replicate3;
@@ -534,6 +579,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     }
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate_ClientServer() {
     VM empty = replicate3;
     
@@ -554,6 +600,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     executeUnregisteredFunction();
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate_ClientServer_WithoutRegister() {
     VM empty = replicate3;
     
@@ -574,6 +621,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     executeFunction();
   }
   
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate_ClientServer_FunctionInvocationTargetException() {
     VM empty = replicate3;
 
@@ -603,6 +651,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyReplicate_ClientServer_FunctionInvocationTargetException_WithoutHA() {
     VM empty = replicate3;
 
@@ -640,6 +689,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_FunctionInvocationTargetException() {
     VM empty1 = replicate3;
     VM empty2 = normal;
@@ -668,6 +718,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testDistributedRegionFunctionExecutionOnDataPolicyEmpty_ClientServer_FunctionInvocationTargetException_WithoutHA() {
     VM empty1 = replicate3;
     VM empty2 = normal;
@@ -704,6 +755,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     ex.remove();
   }
 
+  @Test
   public void testBug40714() {
     VM empty = replicate3;
     normal.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -734,6 +786,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
    * lonerDistribuedSystem
    */
 
+  @Test
   public void testBug41118() {
     replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.bug41118());
   }
@@ -743,6 +796,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
    * is not thrown. We have to grep for this exception in logs for any
    * occerence.
    */
+  @Test
   public void testBug41367() {
     VM client = replicate1;
     VM server = replicate2;
@@ -767,6 +821,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     }
   }
   
+  @Test
   public void testFunctionWithNoResultThrowsException(){
     IgnoredException.addIgnoredException("RuntimeException");
     replicate1.invoke(() -> DistributedRegionFunctionExecutionDUnitTest.createCacheInVm());
@@ -794,7 +849,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
   }
 
   public static void bug41118(){
-    InternalDistributedSystem ds = new DistributedRegionFunctionExecutionDUnitTest("temp").getSystem();
+    InternalDistributedSystem ds = new DistributedRegionFunctionExecutionDUnitTest().getSystem();
     assertNotNull(ds);
     ds.disconnect();
     Properties props = new Properties();
@@ -880,7 +935,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
   }
   
   public static void createCacheInVm() {
-    new DistributedRegionFunctionExecutionDUnitTest("temp")
+    new DistributedRegionFunctionExecutionDUnitTest()
         .createCache(new Properties());
   }
 
@@ -888,15 +943,14 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     Properties props = new Properties();
     props.put(NAME, "SecurityServer");
     props.put(SECURITY_CLIENT_AUTHENTICATOR, DummyAuthenticator.class.getName() + ".create");
-    new DistributedRegionFunctionExecutionDUnitTest("temp").createCache(props);
+    new DistributedRegionFunctionExecutionDUnitTest().createCache(props);
   }
 
   public static void createCacheInClientVm() {
     Properties props = new Properties();
     props.put(MCAST_PORT, "0");
     props.put(LOCATORS, "");
-    new DistributedRegionFunctionExecutionDUnitTest("temp")
-        .createCache(new Properties());
+    new DistributedRegionFunctionExecutionDUnitTest().createCache(new Properties());
   }
 
   public static void createCacheInClientVm_41367() {
@@ -907,7 +961,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends DistributedTest
     props.put(SECURITY_CLIENT_AUTH_INIT, UserPasswordAuthInit.class.getName() + ".create");
     props.put("security-username", "reader1");
     props.put("security-password", "reader1");
-    new DistributedRegionFunctionExecutionDUnitTest("temp").createCache(props);
+    new DistributedRegionFunctionExecutionDUnitTest().createCache(props);
   }
 
   public static void executeFunction() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionExecution_ExceptionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionExecution_ExceptionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionExecution_ExceptionDUnitTest.java
index 78d3827..218cac9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionExecution_ExceptionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionExecution_ExceptionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.util.ArrayList;
 import java.util.HashSet;
@@ -40,6 +49,7 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class FunctionExecution_ExceptionDUnitTest extends
     PartitionedRegionDUnitTestCase {
 
@@ -48,10 +58,11 @@ public class FunctionExecution_ExceptionDUnitTest extends
    */
   private static final long serialVersionUID = 1L;
 
-  public FunctionExecution_ExceptionDUnitTest(String name) {
-    super(name);
+  public FunctionExecution_ExceptionDUnitTest() {
+    super();
   }
   
+  @Test
   public void testSingleKeyExecution_SendException_Datastore()
       throws Exception {
     final String rName = getUniqueName();
@@ -118,6 +129,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testSingleKeyExecution_SendException_MultipleTimes_Datastore()
       throws Exception {
     final String rName = getUniqueName();
@@ -169,6 +181,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
   
+  @Test
   public void testRemoteSingleKeyExecution_ThrowException_Datastore()
       throws Exception {
     final String rName = getUniqueName();
@@ -226,6 +239,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testRemoteSingleKeyExecution_SendException_Accessor()
       throws Exception {
     final String rName = getUniqueName();
@@ -303,6 +317,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testRemoteSingleKeyExecution_ThrowException_Accessor()
       throws Exception {
     final String rName = getUniqueName();
@@ -372,6 +387,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testRemoteMultiKeyExecution_SendException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -444,6 +460,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testRemoteAllKeyExecution_SendException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -510,6 +527,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testRemoteMultiKeyExecution_ThrowException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -580,6 +598,7 @@ public class FunctionExecution_ExceptionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
+  @Test
   public void testRemoteAllKeyExecution_ThrowException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
index c6af7e6..f0a4604 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
@@ -16,10 +16,35 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionException;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -30,22 +55,22 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionTestHelper;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/*
+/**
  * This is DUnite Test to test the Function Execution stats under various
- * scenarion like Cliet-Server with Region/without Region, P2P with partitioned
+ * scenarios like Client-Server with Region/without Region, P2P with partitioned
  * Region/Distributed Region,member Execution
- * 
  */
-
-public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
+@Category(DistributedTest.class)
+public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase {
   
   static Boolean isByName = null;
   
@@ -86,16 +111,6 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
   static int resultReceived_TestFunctionException  = 0;
   static int noOfExecutionExceptions_TestFunctionException  = 0;
   
-//  static Object[] VM0Stats;
-//  static Object[] VM1Stats;
-//  static Object[] VM2Stats;
-//  static Object[] VM3tats;
-  
-  
-  public FunctionServiceStatsDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   protected final void postSetUpPRClientServerTestBase() throws Exception {
     //Make sure stats to linger from a previous test
@@ -163,7 +178,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
     }
   }
 
-  /*
+  /**
    * 1-client 3-Servers 
    * Function : TEST_FUNCTION2 
    * Function : TEST_FUNCTION3
@@ -173,6 +188,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
    * On server side, function execution calls should be equal to the no of
    * function executions completed.
    */
+  @Test
   public void testClientServerPartitonedRegionFunctionExecutionStats() {
     createScenario();
     Function function = new TestFunction(true, TestFunction.TEST_FUNCTION2);
@@ -332,7 +348,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
     server3.invoke(checkStatsOnServer);
   }
 
-  /*
+  /**
    * 1-client 3-Servers
    * server1 : Replicate
    * server2 : Replicate
@@ -345,6 +361,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
    * On server side, function execution calls should be equal to the no of
    * function executions completed.
    */
+  @Test
   public void testClientServerDistributedRegionFunctionExecutionStats() {
      
     final String regionName = "FunctionServiceStatsDUnitTest";
@@ -540,15 +557,15 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
     };
     client.invoke(checkStatsOnClient);
   }
-  
-  
-  /*
+
+  /**
    * Execution of the function on server using the name of the function
    * TEST_FUNCTION1
    * TEST_FUNCTION5
    * On client side, the no of result received should equal to the no of function execution calls.
    * On server side, function execution calls should be equal to the no of function executions completed. 
    */
+  @Test
   public void testClientServerwithoutRegion() {
     createClientServerScenarionWithoutRegion();
     Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
@@ -711,6 +728,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
     server3.invoke(checkStatsOnServer);
   }
   
+  @Test
   public void testP2PDummyExecutionStats()
   throws Exception {
     Host host = Host.getHost(0);
@@ -732,16 +750,15 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
     datastore0.invoke(closeDistributedSystem);
     datastore1.invoke(closeDistributedSystem);
     datastore2.invoke(closeDistributedSystem);
-}
+  }
 
-  
   /**
    * Ensure that the execution is happening all the PR as a whole
    * 
    * Function Execution will not take place on accessor, accessor will onlu receive the resultsReceived.
    * On datastore, no of function execution calls should be equal to the no of function execution calls from the accessor.
-   * @throws Exception
    */
+  @Test
   public void testP2PPartitionedRegionsFunctionExecutionStats()
       throws Exception {
     final String rName = getUniqueName();
@@ -932,7 +949,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
    * Test the function execution statistics in case of the distributed Region P2P
    * DataStore0 is with Empty datapolicy 
    */
-  
+  @Test
   public void testP2PDistributedRegionFunctionExecutionStats() {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1047,10 +1064,8 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
    * Execution should happen on all other members too. so the no of function
    * execution calls and no of function executions completed should be equal tio
    * the no of functions from member 1
-   * 
-   * @throws Exception
    */
-  
+  @Test
   public void testP2PMembersFunctionExecutionStats()
       throws Exception {
     Host host = Host.getHost(0);
@@ -1204,9 +1219,8 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
    * 
    * Function throws the Exception,
    * The check is added to for the no of function execution execption in datatostore1
-   *  
-   * @throws Exception
    */
+  @Test
   public void testFunctionExecutionExceptionStatsOnAllNodesPRegion()
       throws Exception {
     final String rName = getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
index 850f925..a1a965c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
@@ -16,20 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Properties;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.EntryOperation;
 import com.gemstone.gemfire.cache.PartitionAttributes;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
@@ -40,19 +42,18 @@ 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.partition.PartitionRegionHelper;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.functions.LocalDataSetFunction;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class LocalDataSetDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class LocalDataSetDUnitTest extends JUnit4CacheTestCase {
 
   private static final long serialVersionUID = 1L;
 
@@ -70,10 +71,6 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
 
   protected static Region shipmentPR = null;
 
-  public LocalDataSetDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -83,6 +80,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
     accessor = host.getVM(3);
   }
 
+  @Test
   public void testLocalDataSet() {
     createCacheInAllVms();
     createCustomerPR();
@@ -93,6 +91,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
     executeFunctions();
   }
 
+  @Test
   public void testLocalDataSetIteration() {
     createCacheInAllVms();
     createCustomerPR();
@@ -242,7 +241,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
   }
 
   public static void createCacheInVm() {
-    new LocalDataSetDUnitTest("temp").createCache();
+    new LocalDataSetDUnitTest().createCache();
   }
 
   public void createCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
index c87ed56..a34ea69 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.Serializable;
 import java.util.ArrayList;
@@ -74,14 +83,15 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  * 
  */
-public class LocalDataSetIndexingDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class LocalDataSetIndexingDUnitTest extends JUnit4CacheTestCase {
 
   protected static VM dataStore1 = null;
 
   protected static VM dataStore2 = null;
 
-  public LocalDataSetIndexingDUnitTest(String name) {
-    super(name);
+  public LocalDataSetIndexingDUnitTest() {
+    super();
   }
 
   @Override
@@ -91,6 +101,7 @@ public class LocalDataSetIndexingDUnitTest extends CacheTestCase {
     dataStore2 = host.getVM(1);
   }
 
+  @Test
   public void testLocalDataSetIndexing() {
     final CacheSerializableRunnable createPRs = new CacheSerializableRunnable(
         "create prs ") {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
index 1c47ffd..2216160 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
@@ -16,9 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import java.util.HashSet;
+import static org.junit.Assert.*;
+
 import java.util.Properties;
-import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -35,14 +38,16 @@ import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
+@Category(DistributedTest.class)
+public class LocalFunctionExecutionDUnitTest extends JUnit4DistributedTestCase{
   
   protected static Cache cache = null;
 
@@ -50,17 +55,13 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
 
   protected static Region region = null;
   
-
-  public LocalFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
     dataStore1 = host.getVM(0);
   }
 
+  @Test
   public void testLocalDataSetPR(){
     dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.createCacheInVm());
     Object args[] = new Object[] { "testRegion", new Integer(1), new Integer(50),
@@ -70,6 +71,7 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
     dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.executeFunction());
   }
   
+  @Test
   public void testLocalDataSetDR(){
     dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.createCacheInVm());
     Object args[] = new Object[] { "testRegion",DataPolicy.REPLICATE };
@@ -78,13 +80,14 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
     dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.executeFunction());
   }
   
+  @Test
   public void testLocalMember(){
     dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.createCacheInVm());
     dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.executeFunctionOnMember());
   }
 
   public static void createCacheInVm() {
-    new LocalFunctionExecutionDUnitTest("temp").createCache();
+    new LocalFunctionExecutionDUnitTest().createCache();
   }
 
   public void createCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
index f8d4937..6b35900 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
@@ -16,9 +16,32 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.execute.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionException;
+import com.gemstone.gemfire.cache.execute.FunctionInvocationTargetException;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DM;
@@ -29,15 +52,18 @@ import com.gemstone.gemfire.i18n.LogWriterI18n;
 import com.gemstone.gemfire.internal.ClassBuilder;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.lang.reflect.Constructor;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+@Category(DistributedTest.class)
+public class MemberFunctionExecutionDUnitTest extends JUnit4CacheTestCase {
 
-public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
   private static final String TEST_FUNCTION6 = TestFunction.TEST_FUNCTION6;
   private static final String TEST_FUNCTION5 = TestFunction.TEST_FUNCTION5;
 
@@ -50,10 +76,6 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
   
   static InternalDistributedSystem ds = null;
 
-  public MemberFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -68,32 +90,38 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = true 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers(new Integer(5)));
   }
   
+  @Test
   public void testRemoteMultiKeyExecution_SendException1() throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers_SendException( new Integer(1) ));
   }
   
+  @Test
   public void testRemoteMultiKeyExecution_SendException2() throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers_SendException( new Integer(4) ));
   }
   
+  @Test
   public void testRemoteMultiKeyExecution_SendException3() throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers_SendException( new Integer(5) ));
   }
   
+  @Test
   public void testRemoteMultiKeyExecution_NoLastResult() throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers_NoLastResult( new Integer(5) ));
   }
   
+  @Test
   public void testLocalMultiKeyExecution_NoLastResult() throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers_NoLastResult( new Integer(1) ));
@@ -104,12 +132,14 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = true 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_InlineFunction()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.excuteOnMembers_InlineFunction(new Integer(5)));
   }
 
+  @Test
   public void testBug45328() throws Exception {
     createDistributedSystemAndRegisterFunction();
     ClassBuilder classBuilder = new ClassBuilder();
@@ -149,6 +179,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testBug40714() throws Exception {
     createDistributedSystemAndRegisterFunction();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.registerFunction());
@@ -159,6 +190,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
   }
 
   
+  @Test
   public void testBug46129() throws Exception {
     Properties props = new Properties();
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.connectToDistributedSystem( props ));
@@ -224,6 +256,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = false 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutionNoResult()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
@@ -234,6 +267,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = true 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutiononLocalMember()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
@@ -245,6 +279,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = true 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutiononLocalMember_InlineFunction()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
@@ -256,6 +291,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = true 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutiononOtherMembers()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
@@ -267,6 +303,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * haveResults = true 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutiononOtherMembers_InlineFunction()
       throws Exception {
     createDistributedSystemAndRegisterFunction();
@@ -277,11 +314,13 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
    * This tests make sure that, in case of LonerDistributedSystem we dont get ClassCast Exception.
    * Just making sure that the function executed on lonerDistribuedSystem
    */
+  @Test
   public void testBug41118()
       throws Exception {
     member1.invoke(() -> MemberFunctionExecutionDUnitTest.bug41118());
   }
   
+  @Test
   public void testOnMembersWithoutCache()
       throws Exception {
     DistributedMember member1Id = (DistributedMember) member1.invoke(new SerializableCallable() {
@@ -326,7 +365,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
   }
   
   public static void bug41118(){
-    ds = new MemberFunctionExecutionDUnitTest("temp").getSystem();
+    ds = new MemberFunctionExecutionDUnitTest().getSystem();
     assertNotNull(ds);
     ds.disconnect();
     Properties props = new Properties();
@@ -620,7 +659,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
   }
   
   public static void connectToDistributedSystem(Properties props) {
-    new MemberFunctionExecutionDUnitTest("temp").createSystem(props);
+    new MemberFunctionExecutionDUnitTest().createSystem(props);
   }
   
   private InternalDistributedSystem createSystem(Properties props){

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
index a129af9..5388c9a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.HashSet;
 import java.util.Properties;
 import java.util.Set;
@@ -40,7 +49,8 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
 @SuppressWarnings("serial")
-public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class MultiRegionFunctionExecutionDUnitTest extends JUnit4CacheTestCase {
 
   VM vm0 = null;
 
@@ -57,8 +67,8 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
   static Region LR1 = null ;
   static Cache cache = null ;
 
-  public MultiRegionFunctionExecutionDUnitTest(String name) {
-    super(name);
+  public MultiRegionFunctionExecutionDUnitTest() {
+    super();
   }
 
   @Override
@@ -76,6 +86,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
     Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
   }
   
+  @Test
   public void testMultiRegionFunctionExecution(){
     vm0.invoke(() -> MultiRegionFunctionExecutionDUnitTest.createRegionsOnVm0());
     vm1.invoke(() -> MultiRegionFunctionExecutionDUnitTest.createRegionsOnVm1());
@@ -158,7 +169,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
   }
   @SuppressWarnings("unchecked")
   public static void createRegionsOnVm0() {
-    new MultiRegionFunctionExecutionDUnitTest("temp").createCache();  
+    new MultiRegionFunctionExecutionDUnitTest().createCache();  
 
     PartitionAttributesFactory pf = new PartitionAttributesFactory();
     pf.setTotalNumBuckets(12);
@@ -178,7 +189,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
   
   @SuppressWarnings("unchecked")
   public static void createRegionsOnVm1() {
-    new MultiRegionFunctionExecutionDUnitTest("temp").createCache();   
+    new MultiRegionFunctionExecutionDUnitTest().createCache();   
         
     PartitionAttributesFactory pf = new PartitionAttributesFactory();
     pf.setTotalNumBuckets(12);
@@ -198,7 +209,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
   
   @SuppressWarnings("unchecked")
   public static void createRegionsOnVm2() {
-    new MultiRegionFunctionExecutionDUnitTest("temp").createCache();   
+    new MultiRegionFunctionExecutionDUnitTest().createCache();   
         
     PartitionAttributesFactory pf = new PartitionAttributesFactory();
     pf.setTotalNumBuckets(12);
@@ -227,7 +238,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
   
   @SuppressWarnings("unchecked")
   public static void createRegionsOnVm3() {
-    new MultiRegionFunctionExecutionDUnitTest("temp").createCache();   
+    new MultiRegionFunctionExecutionDUnitTest().createCache();   
         
     PartitionAttributesFactory pf = new PartitionAttributesFactory();
     pf.setTotalNumBuckets(12);
@@ -255,7 +266,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
   
   @SuppressWarnings("unchecked")
   public static void createRegionsOnUnitControllerVm() {
-    new MultiRegionFunctionExecutionDUnitTest("temp").createCache();   
+    new MultiRegionFunctionExecutionDUnitTest().createCache();   
         
     PartitionAttributesFactory pf = new PartitionAttributesFactory();
     pf.setTotalNumBuckets(12);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
index b2821cd..b84f55f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
@@ -17,6 +17,14 @@
 package com.gemstone.gemfire.internal.cache.execute;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheClosedException;
@@ -24,26 +32,30 @@ import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionException;
+import com.gemstone.gemfire.cache.execute.FunctionInvocationTargetException;
+import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Properties;
-
-/**
- * 
- */
-public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
-
-  public OnGroupsFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class OnGroupsFunctionExecutionDUnitTest extends JUnit4DistributedTestCase {
 
   @Override
   public final void preTearDown() throws Exception {
@@ -167,8 +179,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
         int count = 0;
         synchronized (OnGroupsFunction.class) {
         	count = f.invocationCount;
-        //    f.invocationCount = 0;
-		}
+		    }
         
         return count;
       }
@@ -182,16 +193,18 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
         OnGroupsFunction f = (OnGroupsFunction) FunctionService.getFunction(OnGroupsFunction.Id);
         synchronized (OnGroupsFunction.class) {
         	f.invocationCount = 0;
-		}
+		    }
         return null;
       }
     });
   }
 
+  @Test
   public void testBasicP2PFunctionNoCache() {
     doBasicP2PFunctionNoCache(false);
   }
 
+  @Test
   public void testBasicP2pRegisteredFunctionNoCache() {
     doBasicP2PFunctionNoCache(true);
   }
@@ -301,6 +314,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     verifyAndResetInvocationCount(vm2, 1);
   }
 
+  @Test
   public void testonMember() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -367,6 +381,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testBasicP2PFunction() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -470,6 +485,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testP2PException () {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -524,6 +540,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testP2PMemberFailure() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -554,6 +571,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testP2POneMemberFailure() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -585,6 +603,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testP2PIgnoreMemberFailure() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -620,18 +639,22 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testBasicClientServerFunction() {
     dotestBasicClientServerFunction(false, true);
   }
 
+  @Test
   public void testBasicClientServerRegisteredFunction() {
     dotestBasicClientServerFunction(true, true);
   }
 
+  @Test
   public void testBasicClientServerFunctionNoArgs() {
     dotestBasicClientServerFunction(false, false);
   }
 
+  @Test
   public void testBasicClientServerRegisteredFunctionNoArgs() {
     dotestBasicClientServerFunction(true, false);
   }
@@ -740,6 +763,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     verifyAndResetInvocationCount(server2, 1);
   }
 
+  @Test
   public void testStreamingClientServerFunction() {
     Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -817,6 +841,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testOnServer() {
     Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -897,6 +922,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     assertEquals(2, c0 + c1 + c2);
   }
 
+  @Test
   public void testClientServerException() {
     Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -974,6 +1000,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testClientServerMemberFailure() {
     Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1023,6 +1050,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testClientServerOneMemberFailure() {
     Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1072,6 +1100,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testClientServerIgnoreMemberFailure() {
     Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1136,6 +1165,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testNoAckGroupsFunction() {
     //Workaround for #52005. This is a product bug
     //that should be fixed

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
index 0c33b5f..3f8f758 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.util.ArrayList;
 import java.util.HashMap;
@@ -33,6 +42,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 
+@Category(DistributedTest.class)
 public class PRClientServerFunctionExecutionNoAckDUnitTest extends PRClientServerTestBase{
   /**
    * 
@@ -47,13 +57,14 @@ public class PRClientServerFunctionExecutionNoAckDUnitTest extends PRClientServe
   
   private static final int NUM_ITERATION=1;
   
-  public PRClientServerFunctionExecutionNoAckDUnitTest(String name) {
-    super(name);
+  public PRClientServerFunctionExecutionNoAckDUnitTest() {
+    super();
   }
 
   /*
    * Execution of the function on server using the name of the function
    */
+  @Test
   public void testServerFunctionExecution_NoAck() {
     createScenario();
 
@@ -71,6 +82,7 @@ public class PRClientServerFunctionExecutionNoAckDUnitTest extends PRClientServe
     client.invoke(() -> PRClientServerFunctionExecutionNoAckDUnitTest.allServerExecution( isByName, functionNoAck , toRegister));
   }
 
+  @Test
   public void testServerFunctionExecution_NoAck_WithoutRegister() {
     createScenario();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
index 4da6fbd..569fec7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
@@ -16,13 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
-import java.io.EOFException;
 import java.io.IOException;
 import java.io.Serializable;
-import java.net.SocketException;
-import java.net.SocketTimeoutException;
 import java.rmi.ServerException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -32,6 +31,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheClosedException;
@@ -57,14 +59,16 @@ import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServerTestBase {
+
   private static final String TEST_FUNCTION7 = TestFunction.TEST_FUNCTION7;
 
   private static final String TEST_FUNCTION2 = TestFunction.TEST_FUNCTION2;
@@ -77,10 +81,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
 
   static final String retryRegionName = "RetryDataRegion";
   
-  public PRClientServerRegionFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
-
+  @Test
   public void test_Bug_43126_Function_Not_Registered()
       throws InterruptedException {
     createScenario();
@@ -94,6 +95,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     }
   }
 
+  @Test
   public void test_Bug43126() throws InterruptedException {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -105,6 +107,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the function on server with single key as the routing
    * object and using the name of the function
    */   
+  @Test
   public void testServerSingleKeyExecution_byName() {
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -134,6 +137,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     runOnAllServers(endSuspect);
   }
   
+  @Test
   public void testServerSingleKeyExecution_Bug43513_OnRegion() {
     createScenario_SingleConnection();
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverSingleKeyExecutionOnRegion_SingleConnection());
@@ -144,6 +148,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverSingleKeyExecutionOnServer_SingleConnection());
   }
   
+  @Test
   public void testServerSingleKeyExecution_SendException() {
     createScenario();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_SEND_EXCEPTION);
@@ -153,6 +158,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverSingleKeyExecution_SendException( isByName, toRegister));
   }
   
+  @Test
   public void testServerSingleKeyExecution_ThrowException() {
     createScenario();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_THROW_EXCEPTION);
@@ -162,6 +168,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverSingleKeyExecution_ThrowException( isByName, toRegister));
   }
   
+  @Test
   public void testClientWithoutPool_Bug41832() {
     createScenarioWith2Regions();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -195,6 +202,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the function on server with single key as the routing
    * object and using the name of the function
    */   
+  @Test
   public void testServerExecution_NoLastResult() {
     createScenario();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_NO_LASTRESULT);
@@ -208,6 +216,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     ex.remove();
   }
 
+  @Test
   public void testServerSingleKeyExecution_byName_WithoutRegister() {
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -243,11 +252,13 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * of HA then system should retry the function execution. After 5th attempt
    * function will send Boolean as last result.
    */
+  @Test
   public void testserverSingleKeyExecution_FunctionInvocationTargetException() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverSingleKeyExecution_FunctionInvocationTargetException());
   }
   
+  @Test
   public void testServerSingleKeyExecution_SocketTimeOut() {
     createScenario();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
@@ -260,6 +271,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the function on server with single key as the routing
    * object and using the instance of the function
    */
+  @Test
   public void testServerSingleKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -273,6 +285,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the inline function on server with single key as the routing
    * object
    */   
+  @Test
   public void testServerSingleKeyExecution_byInlineFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverSingleKeyExecution_Inline());
@@ -282,6 +295,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the function on server with set multiple keys as the routing
    * object and using the name of the function
    */
+  @Test
   public void testserverMultiKeyExecution_byName(){
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -296,6 +310,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
   /*
    * Execution of the function on server with bucket as filter
    */
+  @Test
   public void testBucketFilter(){
     createScenarioForBucketFilter();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_BUCKET_FILTER);
@@ -313,6 +328,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     
   }
   
+  @Test
   public void testBucketFilterOverride(){
     createScenarioForBucketFilter();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_BUCKET_FILTER);
@@ -331,6 +347,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     
   }
   
+  @Test
   public void testserverMultiKeyExecution_SendException(){
     createScenario();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_SEND_EXCEPTION);
@@ -339,6 +356,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverMultiKeyExecution_SendException( isByName));
   }
   
+  @Test
   public void testserverMultiKeyExecution_ThrowException(){
     createScenario();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_THROW_EXCEPTION);
@@ -353,6 +371,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the inline function on server with set multiple keys as the routing
    * object
    */
+  @Test
   public void testserverMultiKeyExecution_byInlineFunction(){
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverMultiKeyExecution_Inline());
@@ -364,6 +383,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * this is the case of HA then system should retry the function execution.
    * After 5th attempt function will send Boolean as last result.
    */
+  @Test
   public void testserverMultiKeyExecution_FunctionInvocationTargetException() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.serverMultiKeyExecution_FunctionInvocationTargetException());
@@ -373,6 +393,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the function on server with set multiple keys as the routing
    * object and using the name of the function
    */
+  @Test
   public void testserverMultiKeyExecutionNoResult_byName(){
     createScenario();
     Function function = new TestFunction(false,TEST_FUNCTION7);
@@ -385,6 +406,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Execution of the function on server with set multiple keys as the routing
    * object and using the instance of the function
    */
+  @Test
   public void testserverMultiKeyExecution_byInstance(){
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -398,6 +420,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * that the routing logic works correctly such that there is not extra
    * execution
    */
+  @Test
   public void testserverMultiKeyExecutionOnASingleBucket_byName(){
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -411,6 +434,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * that the routing logic works correctly such that there is not extra
    * execution
    */
+  @Test
   public void testserverMultiKeyExecutionOnASingleBucket_byInstance(){
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);
@@ -1532,6 +1556,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
    * Attempt to do a client server function execution with an arg that fail deserialization
    * on the server. The client should see an exception instead of a hang if bug 43430 is fixed.
    */
+  @Test
   public void testBug43430() {
     createScenario();
     Function function = new TestFunction(true,TEST_FUNCTION2);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
index df7e9ae..f490e63 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
@@ -16,7 +16,24 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.execute.Execution;
@@ -32,27 +49,25 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
-    PRClientServerTestBase {
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends PRClientServerTestBase {
 
   private static Locator locator = null;
   
   private static Region region = null;
   
-  public PRClientServerRegionFunctionExecutionFailoverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   protected void postSetUpPRClientServerTestBase() throws Exception {
     IgnoredException.addIgnoredException("Connection reset");
@@ -61,6 +76,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     IgnoredException.addIgnoredException("Socket Closed");
   }
   
+  @Test
   public void testserverMultiKeyExecution_SocektTimeOut() {
     createScenario();
     Function function = new TestFunction(true,
@@ -73,6 +89,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerFailoverWithTwoServerAliveHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -104,6 +121,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerCacheClosedFailoverWithTwoServerAliveHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -131,6 +149,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     assertEquals(2, l.size());
   }
 
+  @Test
   public void testBug40714() {
     createScenario();
     server1.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.registerFunction());
@@ -140,6 +159,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.FunctionExecution_Inline_Bug40714());
   }
   
+  @Test
   public void testOnRegionFailoverWithTwoServerDownHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -164,6 +184,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
   }
 
   // retry attempts is 2
+  @Test
   public void testOnRegionFailoverWithOneServerDownHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -191,6 +212,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
    * Ensure that the while executing the function if the servers are down then
    * the execution shouldn't failover to other available server
    */
+  @Test
   public void testOnRegionFailoverNonHA() throws InterruptedException { // See #47489 before enabling it
     createScenario();
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -215,6 +237,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
    * Ensure that the while executing the function if the servers are down then
    * the execution shouldn't failover to other available server
    */
+  @Test
   public void testOnRegionFailoverNonHASingleHop() throws InterruptedException { // See #47489 before enabling it
     ArrayList commonAttributes = createCommonServerAttributes(
         "TestPartitionedRegion", null, 0, 13, null);
@@ -271,6 +294,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest.verifyMetaData( new Integer(1), new Integer(0) ));
   }
 
+  @Test
   public void testServerBucketMovedException() throws InterruptedException {
 
     IgnoredException.addIgnoredException("BucketMovedException");
@@ -293,18 +317,18 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     startLocatorInVM(portLocator);
     try {
 
-    Integer port1 = (Integer)server1.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createServerWithLocator( locator, false,
+    Integer port1 = (Integer)server1.invoke(() -> createServerWithLocator( locator, false,
             commonAttributes ));
 
-    Integer port2 = (Integer)server2.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createServerWithLocator( locator, false,
+    Integer port2 = (Integer)server2.invoke(() -> createServerWithLocator( locator, false,
             commonAttributes ));
 
-    server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createClientWithLocator( hostLocator, portLocator ));
+    server4.invoke(() -> createClientWithLocator( hostLocator, portLocator ));
     server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.putIntoRegion());
 
     server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.fetchMetaData());
     
-    Integer port3 = (Integer)server3.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createServerWithLocator( locator, false,
+    Integer port3 = (Integer)server3.invoke(() -> createServerWithLocator( locator, false,
             commonAttributes ));
 
     Object result = server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.executeFunction());
@@ -316,6 +340,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     }
   }
 
+  @Test
   public void testServerBucketMovedException_LocalServer()
       throws InterruptedException {
     IgnoredException.addIgnoredException("BucketMovedException");
@@ -337,15 +362,15 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     startLocatorInVM(portLocator);
     try {
 
-    Integer port1 = (Integer)server1.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createServerWithLocator( locator, false,
+    Integer port1 = (Integer)server1.invoke(() -> createServerWithLocator( locator, false,
             commonAttributes ));
 
-    server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createClientWithLocator( hostLocator, portLocator ));
+    server4.invoke(() -> createClientWithLocator( hostLocator, portLocator ));
     server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.putIntoRegion());
 
     server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.fetchMetaData());
     
-    Integer port2 = (Integer)server2.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.createServerWithLocator( locator, false,
+    Integer port2 = (Integer)server2.invoke(() -> createServerWithLocator( locator, false,
             commonAttributes ));
 
     Object result = server4.invoke(() -> PRClientServerRegionFunctionExecutionFailoverDUnitTest.executeFunction());
@@ -381,13 +406,11 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     locator.stop();
   }
   
-  public static int createServerWithLocator(String locator, boolean isAccessor, ArrayList commonAttrs) {
-    CacheTestCase test = new PRClientServerRegionFunctionExecutionFailoverDUnitTest(
-    "PRClientServerRegionFunctionExecutionFailoverDUnitTest");
+  public int createServerWithLocator(String locator, boolean isAccessor, ArrayList commonAttrs) {
     Properties props = new Properties();
     props = new Properties();
     props.setProperty(LOCATORS, locator);
-    DistributedSystem ds = test.getSystem(props);
+    DistributedSystem ds = getSystem(props);
     cache = new CacheFactory(props).create(ds);
     
     CacheServer server = cache.addCacheServer();
@@ -417,14 +440,12 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
     return port;
   }
   
-  public static void createClientWithLocator(String host, int port0) {
+  public void createClientWithLocator(String host, int port0) {
     Properties props = new Properties();
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PRClientServerRegionFunctionExecutionFailoverDUnitTest(
-        "PRClientServerRegionFunctionExecutionFailoverDUnitTest");
-    DistributedSystem ds = test.getSystem(props);
+    DistributedSystem ds = getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
     CacheServerTestUtil.disableShufflingOfEndpoints();



[09/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
index 1d7a5a0..9c805f2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
@@ -16,7 +16,21 @@
  */
 package com.gemstone.gemfire.management;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -27,41 +41,34 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Client health stats check
- * 
- * 
  */
-public class ClientHealthStatsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+@SuppressWarnings("serial")
+public class ClientHealthStatsDUnitTest extends JUnit4DistributedTestCase {
 
   private static final String k1 = "k1";
-
   private static final String k2 = "k2";
-
   private static final String client_k1 = "client-k1";
-
   private static final String client_k2 = "client-k2";
 
   /** name of the test region */
   private static final String REGION_NAME = "ClientHealthStatsDUnitTest_Region";
 
-  private VM server = null;
-
   private static VM client = null;
-  
   private static VM client2 = null;
-
   private static VM managingNode = null;
 
-  private static ManagementTestBase helper = new ManagementTestBase("ClientHealthStatsDUnitTest_Helper");
+  private static ManagementTestBase helper = new ManagementTestBase(){};
   
   private static int numOfCreates = 0;
   private static int numOfUpdates = 0;
@@ -70,9 +77,7 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
   
   private static GemFireCacheImpl cache = null;
 
-  public ClientHealthStatsDUnitTest(String name) {
-    super(name);
-  }
+  private VM server = null;
 
   @Override
   public final void postSetUp() throws Exception {
@@ -83,6 +88,7 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     server = host.getVM(1);
     client = host.getVM(2);
     client2 = host.getVM(3);
+
     IgnoredException.addIgnoredException("Connection reset");
   }
 
@@ -96,18 +102,16 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
 
     disconnectAllFromDS();
   }
-  
-  public static void reset() throws Exception {
+
+  private static void reset() throws Exception {
     lastKeyReceived = false;
     numOfCreates = 0;
     numOfUpdates = 0;
     numOfInvalidates = 0;
   }
 
-  private static final long serialVersionUID = 1L;
-
+  @Test
   public void testClientHealthStats_SubscriptionEnabled() throws Exception {
-
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);
 
@@ -126,8 +130,8 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     helper.stopManagingNode(managingNode);
   }
   
+  @Test
   public void testClientHealthStats_SubscriptionDisabled() throws Exception {
-
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);
 
@@ -146,8 +150,8 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     helper.stopManagingNode(managingNode);
   }
   
+  @Test
   public void testClientHealthStats_DurableClient() throws Exception {
-
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);
 
@@ -170,6 +174,7 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     helper.stopManagingNode(managingNode);
   }
   
+  @Test
   public void testStatsMatchWithSize() throws Exception {
     // start a server
     int port = (Integer) server.invoke(() -> ClientHealthStatsDUnitTest.createServerCache());
@@ -213,15 +218,14 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
       
       @Override
       public String description() {
-        // TODO Auto-generated method stub
         return "Proxy has not paused yet";
       }
     };
     
     Wait.waitForCriterion(criterion, 15 * 1000, 200, true);	  
   }
-  
-  public static int createServerCache() throws Exception {
+
+  private static int createServerCache() throws Exception {
     Cache cache = helper.createCache(false);
 
     RegionFactory<String, String> rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
@@ -234,22 +238,16 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     return server1.getPort();
   }
 
-  
-  
-  public static void closeClientCache() throws Exception {
+  private static void closeClientCache() throws Exception {
     cache.close(true);
   }
 
-  public static void createClientCache(Host host, Integer port, int clientNum, boolean subscriptionEnabled, boolean durable) throws Exception {
-
+  private static void createClientCache(Host host, Integer port, int clientNum, boolean subscriptionEnabled, boolean durable) throws Exception {
     Properties props = new Properties();
     props.setProperty(DURABLE_CLIENT_ID, "durable-"+clientNum);
     props.setProperty(DURABLE_CLIENT_TIMEOUT, "300000");
-
-//    props.setProperty("log-file", getTestMethodName()+"_client_" + clientNum + ".log");
     props.setProperty(LOG_LEVEL, "info");
-    props.setProperty(STATISTIC_ARCHIVE_FILE, getTestMethodName() + "_client_" + clientNum
-        + ".gfs");
+    props.setProperty(STATISTIC_ARCHIVE_FILE, getTestMethodName() + "_client_" + clientNum + ".gfs");
     props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
 
     ClientCacheFactory ccf = new ClientCacheFactory(props);
@@ -296,10 +294,9 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
       r.registerInterest("ALL_KEYS", true);
       cache.readyForEvents();
     }
-
   }
 
-  public static void doPuts() throws Exception {
+  private static void doPuts() throws Exception {
     Cache cache = GemFireCacheImpl.getInstance();
     final Region<String, String> r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     Thread t1 = new Thread(new Runnable() {
@@ -332,8 +329,8 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     t2.join();
     t3.join();
   }
-  
-  public static void resumePuts() {
+
+  private static void resumePuts() {
     Cache cache = GemFireCacheImpl.getInstance();
     Region<String, String> r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     for (int i = 0; i < 100; i++) {
@@ -342,7 +339,7 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     r.put("last_key", "last_value");
   }
 
-  public static void waitForLastKey() {
+  private static void waitForLastKey() {
     WaitCriterion wc = new WaitCriterion() {
       @Override
       public boolean done() {
@@ -356,14 +353,12 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     Wait.waitForCriterion(wc, 60*1000, 500, true);
   }
 
-
-  @SuppressWarnings("serial")
-  protected static DistributedMember getMember() throws Exception {
+  private static DistributedMember getMember() throws Exception {
     GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
     return cache.getDistributedSystem().getDistributedMember();
   }
 
-  protected static void verifyClientStats(DistributedMember serverMember, int serverPort, int numSubscriptions) {
+  private static void verifyClientStats(DistributedMember serverMember, int serverPort, int numSubscriptions) {
     GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
     try {
       ManagementService service = ManagementService.getExistingManagementService(cache);
@@ -376,8 +371,6 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
       
       ClientHealthStatus[] clientStatuses = bean.showAllClientStats();
 
- 
-      
       ClientHealthStatus clientStatus1 = bean.showClientStats(clientIds[0]);
       ClientHealthStatus clientStatus2 = bean.showClientStats(clientIds[1]);
       assertNotNull(clientStatus1);
@@ -391,22 +384,18 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
       assertTrue(clientStatuses.length == 2);
       for (ClientHealthStatus status : clientStatuses) {
         System.out.println("<ExpectedString> ClientStats of the Server is  " + status + "</ExpectedString> ");
-
       }
 
-
       DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
       assertEquals(2, dsBean.getNumClients());
       assertEquals(numSubscriptions, dsBean.getNumSubscriptions());
 
     } catch (Exception e) {
-      e.printStackTrace();
-      fail("Error while verifying cache server from remote member " + e);
+      fail("Error while verifying cache server from remote member", e);
     }
-
   }
 
-  protected static void put() {
+  private static void put() {
     Cache cache = GemFireCacheImpl.getInstance();
     Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r1);
@@ -432,11 +421,9 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     } catch (Exception e) {
       // sleep
     }
-
   }
 
-
-  public static void verifyStats(int serverPort) throws Exception {
+  private static void verifyStats(int serverPort) throws Exception {
     Cache cache = GemFireCacheImpl.getInstance();
     ManagementService service = ManagementService.getExistingManagementService(cache);
     CacheServerMXBean serverBean = service.getLocalCacheServerMXBean(serverPort);
@@ -452,5 +439,4 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
     ClientQueueDetail queueDetails = serverBean.showClientQueueDetails()[0];
     assertEquals(queueDetails.getQueueSize(), ccp.getQueueSizeStat());
   }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
index 565de1b..5e655fa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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 javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -29,10 +38,11 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
+@Category(DistributedTest.class)
 public class CompositeTypeTestDUnitTest extends ManagementTestBase {
 
-  public CompositeTypeTestDUnitTest(String name) {
-    super(name);
+  public CompositeTypeTestDUnitTest() {
+    super();
     // TODO Auto-generated constructor stub
   }
 
@@ -43,6 +53,7 @@ public class CompositeTypeTestDUnitTest extends ManagementTestBase {
   
   private static ObjectName objectName;
 
+  @Test
   public void testCompositeTypeGetters() throws Exception{
     
     initManagement(false);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
index 29a3a85..38e5fc0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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.Map;
 import java.util.Set;
 
@@ -39,6 +48,7 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
+@Category(DistributedTest.class)
 public class DLockManagementDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
@@ -50,8 +60,8 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
   // 60 seconds.
   private static final int MAX_WAIT = 70 * 1000;
 
-  public DLockManagementDUnitTest(String name) {
-    super(name);
+  public DLockManagementDUnitTest() {
+    super();
 
   }
 
@@ -61,6 +71,7 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-173: eats exceptions, HeadlessGFSH, time sensitive, waitForCriterions
+  @Test
   public void testDLockMBean() throws Throwable {
     
     initManagement(false);
@@ -93,6 +104,7 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-553: waitForCriterion, eats exceptions, HeadlessGFSH
+  @Test
   public void testDLockAggregate() throws Throwable {
     initManagement(false);
     VM[] managedNodes = new VM[getManagedNodeList()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
index e2acc24..cc69361 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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.util.Arrays;
 import java.util.List;
@@ -54,6 +63,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  * 
  */
+@Category(DistributedTest.class)
 public class DiskManagementDUnitTest extends ManagementTestBase {
 
   /**
@@ -75,8 +85,8 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
 
   protected static LogWriter logWriter;
 
-  public DiskManagementDUnitTest(String name) throws Exception {
-    super(name);
+  public DiskManagementDUnitTest() throws Exception {
+    super();
   
     diskDir = new File("diskDir-" + getName()).getAbsoluteFile();
     com.gemstone.gemfire.internal.FileUtil.delete(diskDir);
@@ -102,6 +112,7 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
 
+  @Test
   public void testDiskCompact() throws Throwable {
     initManagement(false);
     for (VM vm : getManagedNodeList()) {
@@ -122,6 +133,7 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
 
+  @Test
   public void testDiskCompactRemote() throws Throwable {
 
     initManagement(false);
@@ -139,6 +151,7 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
 
+  @Test
   public void testDiskOps() throws Throwable {
 
     initManagement(false);
@@ -152,6 +165,7 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
 
   }
 
+  @Test
   public void testDiskBackupAllMembers() throws Throwable {
     initManagement(false);
     for (VM vm : getManagedNodeList()) {
@@ -169,6 +183,7 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
    * @throws Throwable
    */
   @SuppressWarnings("serial")
+  @Test
   public void testMissingMembers() throws Throwable {
 
     initManagement(false);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
index bda9470..fca0a68 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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 java.util.HashMap;
 import java.util.Iterator;
@@ -85,6 +94,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  * 
  */
+@Category(DistributedTest.class)
 public class DistributedSystemDUnitTest extends ManagementTestBase {
 
   private static final Logger logger = LogService.getLogger();
@@ -105,8 +115,8 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
   static final String SEVERE_LEVEL_MESSAGE =  "Severelevel Alert Message";
 
   
-  public DistributedSystemDUnitTest(String name) {
-    super(name);
+  public DistributedSystemDUnitTest() {
+    super();
   }
 
   /**
@@ -114,6 +124,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
    * 
    * @throws Exception
    */
+  @Test
   public void testDistributedSystemAggregate() throws Exception {
     VM managingNode = getManagingNode();
     createManagementCache(managingNode);
@@ -138,6 +149,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
    * 
    * @throws Exception
    */
+  @Test
   public void testAlertManagedNodeFirst() throws Exception {
 
     for (VM vm : getManagedNodeList()) {
@@ -224,6 +236,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
    * 
    * @throws Exception
    */
+  @Test
   public void testShutdownAll() throws Exception {
     final Host host = Host.getHost(0);
     VM managedNode1 = host.getVM(0);
@@ -243,6 +256,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
     closeCache(managingNode);
   }
   
+  @Test
   public void testNavigationAPIS() throws Exception{
     
     final Host host = Host.getHost(0); 
@@ -257,6 +271,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
     checkNavigationAPIs(managingNode);    
   }
   
+  @Test
   public void testNotificationHub() throws Exception {
     this.initManagement(false);
 
@@ -485,6 +500,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
    * 
    * @throws Exception
    */
+  @Test
   public void testAlert() throws Exception {
     VM managingNode = getManagingNode();
    

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
index 6230119..ac608a6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
@@ -16,14 +16,8 @@
  */
 package com.gemstone.gemfire.management;
 
-import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.distributed.Locator;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.distributed.internal.InternalLocator;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.management.internal.ManagementConstants;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.IOException;
@@ -31,35 +25,36 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
+import com.gemstone.gemfire.distributed.DistributedMember;
+import com.gemstone.gemfire.distributed.Locator;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.management.internal.ManagementConstants;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test cases
  * 
  * DistributedSystem Cache Locator no no yes yes no yes yes yes yes
- * 
- * 
- * 
  */
-
+@Category(DistributedTest.class)
 public class LocatorManagementDUnitTest extends ManagementTestBase {
 
-  /** Default file name for locator log: <code>"locator.log"</code> */
-  public static final String DEFAULT_LOG_FILE = "locator.log";
-
   private static final int MAX_WAIT = 8 * ManagementConstants.REFRESH_TIME;
 
-  private static Properties props = new Properties();
-
   private VM locator;
-  
-
-  public LocatorManagementDUnitTest(String name) {
-    super(name);
-  }
-
-  private static final long serialVersionUID = 1L;
 
   @Override
   protected final void postSetUpManagementTestBase() throws Exception {
@@ -74,9 +69,8 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
   /**
    * When plan is to start Distributed System later so that the system can use
    * this locator
-   * 
-   * @throws Exception
    */
+  @Test
   public void testPeerLocation() throws Exception {
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
     startLocator(locator, true, locPort);
@@ -99,6 +93,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   }
 
+  @Test
   public void testPeerLocationWithPortZero() throws Exception {
     // Start the locator with port=0
     int locPort = startLocator(locator, true, 0);
@@ -123,9 +118,8 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   /**
    * Tests a locator which is co-located with already existing cache
-   * 
-   * @throws Exception
    */
+  @Test
   public void testColocatedLocator() throws Exception {
     initManagement(false);
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
@@ -134,6 +128,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   }
 
+  @Test
   public void testColocatedLocatorWithPortZero() throws Exception {
     initManagement(false);
     int locPort = startLocator(locator, false, 0);
@@ -141,6 +136,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   }
 
+  @Test
   public void testListManagers() throws Exception {
     initManagement(false);
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
@@ -148,12 +144,14 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
     listManagers(locator, locPort, false);
   }
 
+  @Test
   public void testListManagersWithPortZero() throws Exception {
     initManagement(false);
     int locPort = startLocator(locator, false, 0);
     listManagers(locator, locPort, false);
   }
 
+  @Test
   public void testWillingManagers() throws Exception {
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
     startLocator(locator, true, locPort);
@@ -173,6 +171,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
     listWillingManagers(locator, locPort, false);
   }
 
+  @Test
   public void testWillingManagersWithPortZero() throws Exception {
     int locPort = startLocator(locator, true, 0);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java b/geode-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
index 1c2c3fd..a1bb2d2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
@@ -16,8 +16,7 @@
  */
 package com.gemstone.gemfire.management;
 
-import java.util.Map;
-import java.util.Set;
+import static org.junit.Assert.*;
 
 import javax.management.InstanceNotFoundException;
 import javax.management.IntrospectionException;
@@ -27,27 +26,20 @@ import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
 
-import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.persistence.PersistentMemberID;
-import com.gemstone.gemfire.internal.cache.persistence.PersistentMemberManager;
 import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
 import com.gemstone.gemfire.management.internal.ManagementConstants;
 import com.gemstone.gemfire.management.internal.SystemManagementService;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * Utility test class to get various proxies
- * 
- * 
  */
 public class MBeanUtil {
-  
 
   private static final int MAX_WAIT = 8 * ManagementConstants.REFRESH_TIME;
   
@@ -522,11 +514,11 @@ public class MBeanUtil {
     try {
       info = mbeanServer.getMBeanInfo(objName);
     } catch (IntrospectionException e1) {
-      DistributedTestCase.fail("Could not obtain Sender Proxy Details");
+      fail("Could not obtain Sender Proxy Details");
     } catch (InstanceNotFoundException e1) {
-      DistributedTestCase.fail("Could not obtain Sender Proxy Details");
+      fail("Could not obtain Sender Proxy Details");
     } catch (ReflectionException e1) {
-      DistributedTestCase.fail("Could not obtain Sender Proxy Details");
+      fail("Could not obtain Sender Proxy Details");
     }
     attributeInfos = info.getAttributes();
     for (MBeanAttributeInfo attributeInfo : attributeInfos) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
index 08167ab..2915f06 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
@@ -17,31 +17,48 @@
 package com.gemstone.gemfire.management;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
 
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.statistics.SampleCollector;
-import com.gemstone.gemfire.management.internal.*;
-import com.gemstone.gemfire.test.dunit.*;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.util.*;
-
-public class ManagementTestBase extends DistributedTestCase {
-
-  public ManagementTestBase(String name) {
-    super(name);
-
-  }
+import com.gemstone.gemfire.management.internal.FederatingManager;
+import com.gemstone.gemfire.management.internal.LocalManager;
+import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
+import com.gemstone.gemfire.management.internal.ManagementStrings;
+import com.gemstone.gemfire.management.internal.SystemManagementService;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+
+@SuppressWarnings("serial")
+public abstract class ManagementTestBase extends JUnit4DistributedTestCase {
 
   private static final int MAX_WAIT = 70 * 1000;
 
-  private static final long serialVersionUID = 1L;
   /**
    * log writer instance
    */
@@ -181,7 +198,6 @@ public class ManagementTestBase extends DistributedTestCase {
     }
   }
 
-  @SuppressWarnings("serial")
   public void createCache(VM vm1) throws Exception {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
@@ -191,7 +207,6 @@ public class ManagementTestBase extends DistributedTestCase {
 
   }
 
-  @SuppressWarnings("serial")
   public void createCache(VM vm1, final Properties props) throws Exception {
     vm1.invoke(new SerializableRunnable("Create Cache") {
       public void run() {
@@ -204,7 +219,7 @@ public class ManagementTestBase extends DistributedTestCase {
   public Cache createCache(Properties props) {
     System.setProperty("dunitLogPerTest", "true");
     props.setProperty(LOG_FILE, getTestMethodName() + "-.log");
-    ds = (new ManagementTestBase("temp")).getSystem(props);
+    ds = getSystem(props);
     cache = CacheFactory.create(ds);
     managementService = ManagementService.getManagementService(cache);
     logWriter = ds.getLogWriter();
@@ -228,7 +243,7 @@ public class ManagementTestBase extends DistributedTestCase {
     props.setProperty(ENABLE_TIME_STATISTICS, "true");
     props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
     props.setProperty(LOG_FILE, getTestMethodName() + "-.log");
-    ds = (new ManagementTestBase("temp")).getSystem(props);
+    ds = getSystem(props);
     cache = CacheFactory.create(ds);
     managementService = ManagementService.getManagementService(cache);
     logWriter = ds.getLogWriter();
@@ -237,7 +252,6 @@ public class ManagementTestBase extends DistributedTestCase {
     return cache;
   }
 
-  @SuppressWarnings("serial")
   public void createManagementCache(VM vm1) throws Exception {
     vm1.invoke(new SerializableRunnable("Create Management Cache") {
       public void run() {
@@ -246,7 +260,6 @@ public class ManagementTestBase extends DistributedTestCase {
     });
   }
 
-  @SuppressWarnings("serial")
   public void closeCache(VM vm1) throws Exception {
     vm1.invoke(new SerializableRunnable("Close Cache") {
       public void run() {
@@ -317,7 +330,6 @@ public class ManagementTestBase extends DistributedTestCase {
    *
    * @throws Exception
    */
-  @SuppressWarnings("serial")
   public void startManagingNode(VM vm1) throws Exception {
     vm1.invoke(new SerializableRunnable("Start Being Managing Node") {
       public void run() {
@@ -342,7 +354,6 @@ public class ManagementTestBase extends DistributedTestCase {
    *
    * @throws Exception
    */
-  @SuppressWarnings("serial")
   public void startManagingNodeAsync(VM vm1) throws Exception {
     vm1.invokeAsync(new SerializableRunnable("Start Being Managing Node") {
 
@@ -364,7 +375,6 @@ public class ManagementTestBase extends DistributedTestCase {
    *
    * @throws Exception
    */
-  @SuppressWarnings("serial")
   public void stopManagingNode(VM vm1) throws Exception {
     vm1.invoke(new SerializableRunnable("Stop Being Managing Node") {
       public void run() {
@@ -386,7 +396,6 @@ public class ManagementTestBase extends DistributedTestCase {
    * remove all the artifacts of management namely a) Notification region b)
    * Monitoring Region c) Management task should stop
    */
-  @SuppressWarnings("serial")
   public void checkManagedNodeCleanup(VM vm) throws Exception {
     vm.invoke(new SerializableRunnable("Managing Node Clean up") {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
index f6bb6c0..b376c4e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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.lang.management.ManagementFactory;
 
 import com.gemstone.gemfire.cache.Region;
@@ -34,6 +43,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  * This test class checks around 89 attributes of Member MBeans
  *
  */
+@Category(DistributedTest.class)
 public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
   
 
@@ -53,8 +63,8 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
 
 
 
-  public MemberMBeanAttributesDUnitTest(String name) {
-    super(name);
+  public MemberMBeanAttributesDUnitTest() {
+    super();
   }
 
   protected void sample(VM vm1) {
@@ -69,6 +79,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
  
 
   
+  @Test
   public void testReplRegionAttributes() throws Exception{
     initManagement(false);    
     setupForReplicateRegonAttributes(managedNodeList.get(0), 1);
@@ -79,6 +90,7 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
   }
   
   
+  @Test
   public void testPRRegionAttributes() throws Exception{
     initManagement(false);    
     setupForPartitionedRegonAttributes(managedNodeList.get(0), 1);    
@@ -87,11 +99,13 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
     
   }
   
+  @Test
   public void testOSAttributes() throws Exception{
     initManagement(false);
     isOSRelatedAttrsOK(managedNodeList.get(0));
   }
   
+  @Test
   public void testConfigAttributes() throws Exception {
     initManagement(false);
     isConfigRelatedAttrsOK(managedNodeList.get(0));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
index d8f0476..b42930a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
@@ -16,11 +16,27 @@
  */
 package com.gemstone.gemfire.management;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.MBeanServer;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.OutOfOffHeapMemoryException;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.offheap.OffHeapMemoryStats;
@@ -28,21 +44,21 @@ import com.gemstone.gemfire.internal.offheap.OffHeapStorage;
 import com.gemstone.gemfire.internal.offheap.OffHeapStoredObject;
 import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
 import com.gemstone.gemfire.management.internal.beans.MemberMBean;
-import com.gemstone.gemfire.test.dunit.*;
-
-import javax.management.*;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the off-heap additions to the RegionMXBean and MemberMXBean JMX interfaces.
  */
 @SuppressWarnings("serial")
-public class OffHeapManagementDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
   /**
    * Specified assertion operations.
    */
@@ -123,14 +139,6 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
    */
   private static MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
 
-  /**
-   * Creates a new OffHeapManagementDUnitTest.
-   * @param name the test name.
-   */
-  public OffHeapManagementDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postSetUp() throws Exception {
     Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
@@ -155,6 +163,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
    * Tests off-heap additions to the RegionMXBean and MemberMXBean interfaces.
    * @throws Exception
    */
+  @Test
   public void testOffHeapMBeanAttributesAndStats() throws Exception {
     final VM vm = Host.getHost(0).getVM(0);    
 
@@ -203,6 +212,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
    * Tests the fragmentation statistic for off-heap memory.
    * @throws Exception
    */
+  @Test
   public void testFragmentationStat() throws Exception {
     final VM vm = Host.getHost(0).getVM(0);    
 
@@ -293,6 +303,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
    * Tests the compation time statistic for off-heap memory.
    * @throws Exception
    */
+  @Test
   public void testCompactionTimeStat() throws Exception {
     final VM vm = Host.getHost(0).getVM(0);    
 
@@ -351,6 +362,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
   /**
    *  Asserts that a monitor assigned to the OffHeapObjects attribute is triggered.
    */
+  @Test
   public void testOffHeapObjectsMonitoring()  throws Exception {
     final VM vm = Host.getHost(0).getVM(0);    
 
@@ -388,6 +400,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
   /**
    * Asserts that a monitor assigned to the OffHeapFreeSize attribute is triggered.
    */
+  @Test
   public void testOffHeapFreeSizeMonitoring()  throws Exception {
     final VM vm = Host.getHost(0).getVM(0);    
 
@@ -425,6 +438,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
   /**
    * Asserts that a monitor assigned to the OffHeapAllocatedSize attribute is triggered.
    */
+  @Test
   public void testOffHeapAllocatedSizeMonitoring()  throws Exception {
     final VM vm = Host.getHost(0).getVM(0);    
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
index ad26a05..c11dd0b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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 static com.gemstone.gemfire.cache.query.Utils.createPortfoliosAndPositions;
 
 import java.io.IOException;
@@ -84,6 +93,7 @@ import org.json.JSONObject;
 // ORDER by orders
 // Test all attributes are covered in an complex type
 
+@Category(DistributedTest.class)
 public class QueryDataDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
@@ -137,8 +147,8 @@ public class QueryDataDUnitTest extends ManagementTestBase {
   public static String[] queriesForLimit = new String[] { "select * from /" + repRegionName4 };
 
 
-  public QueryDataDUnitTest(String name) {
-    super(name);
+  public QueryDataDUnitTest() {
+    super();
   }
 
   @Override
@@ -315,6 +325,7 @@ public class QueryDataDUnitTest extends ManagementTestBase {
   }
 
   // disabled for bug 49698, serialization problems introduced by r44615
+  @Test
   public void testQueryOnPartitionedRegion() throws Exception {
 
     final DistributedMember member1 = getMember(managedNode1);
@@ -369,6 +380,7 @@ public class QueryDataDUnitTest extends ManagementTestBase {
     });
   }
 
+  @Test
   public void testQueryOnReplicatedRegion() throws Exception {
 
     
@@ -416,6 +428,7 @@ public class QueryDataDUnitTest extends ManagementTestBase {
     });
   }
   
+  @Test
   public void testMemberWise() throws Exception {
 
     final DistributedMember member1 = getMember(managedNode1);
@@ -454,6 +467,7 @@ public class QueryDataDUnitTest extends ManagementTestBase {
 
   
  
+  @Test
   public void testLimitForQuery() throws Exception {
     
     initCommonRegions();
@@ -529,6 +543,7 @@ public class QueryDataDUnitTest extends ManagementTestBase {
     });
   }
 
+  @Test
   public void testErrors() throws Exception{
     
     final DistributedMember member1 = getMember(managedNode1);
@@ -607,7 +622,8 @@ public class QueryDataDUnitTest extends ManagementTestBase {
     });
   }
   
- public void testNormalRegions() throws Exception{
+  @Test
+  public void testNormalRegions() throws Exception{
     
     final DistributedMember member1 = getMember(managedNode1);
     final DistributedMember member2 = getMember(managedNode2);
@@ -659,6 +675,7 @@ public class QueryDataDUnitTest extends ManagementTestBase {
     });
   }
  
+  @Test
   public void testRegionsLocalDataSet() throws Exception {
 
     final DistributedMember member1 = getMember(managedNode1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
index b613c0e..9b72ff7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management;
 
+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 java.util.Arrays;
 import java.util.List;
@@ -65,6 +74,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  * 
  */
+@Category(DistributedTest.class)
 public class RegionManagementDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
@@ -100,8 +110,8 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
   private static Region fixedPrRegion;
 
 
-  public RegionManagementDUnitTest(String name) {
-    super(name);
+  public RegionManagementDUnitTest() {
+    super();
 
   }
 
@@ -116,6 +126,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
    * @throws Exception
    */
 
+  @Test
   public void testDistributedRegion() throws Exception {
 
     initManagement(false);
@@ -157,6 +168,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
    * 
    * @throws Exception
    */
+  @Test
   public void testPartitionedRegion() throws Exception {
     initManagement(false);
 
@@ -196,6 +208,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
    * 
    * @throws Exception
    */
+  @Test
   public void testFixedPRRegionMBean() throws Exception {
 
     initManagement(false);
@@ -233,6 +246,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
    * while region is created in a member node asynchronously.
    * @throws Exception
    */
+  @Test
   public void testRegionAggregate() throws Exception{
     initManagement(true);
 
@@ -279,6 +293,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
 
   }
   
+  @Test
   public void testNavigationAPIS() throws Exception {
     initManagement(true);
     for(VM vm : managedNodeList){
@@ -306,6 +321,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
 
  
   
+  @Test
   public void testSubRegions() throws Exception{
     initManagement(false);
     for (VM vm : managedNodeList) {
@@ -327,6 +343,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
   
   
   
+  @Test
   public void testSpecialRegions() throws Exception{
     initManagement(false);
     createSpecialRegion(managedNodeList.get(0));
@@ -387,6 +404,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
 
   }
   
+  @Test
   public void testLruStats() throws Exception{
     initManagement(false);
     for (VM vm : managedNodeList) {
@@ -1346,7 +1364,7 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
     int initialCapacity = regAttrs.getInitialCapacity();
     assertEquals(initialCapacity, data.getInitialCapacity());
     float loadFactor = regAttrs.getLoadFactor();
-    assertEquals(loadFactor, data.getLoadFactor());
+    assertEquals(loadFactor, data.getLoadFactor(),0);
 
     boolean lockGrantor = regAttrs.isLockGrantor();
     assertEquals(lockGrantor, data.isLockGrantor());


[35/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
index 06d0e08..8f962f7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
@@ -16,34 +16,68 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
+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.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.CommitIncompleteException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.i18n.LogWriterI18n;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.BucketRegion;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.internal.cache.DistTXState;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
+import com.gemstone.gemfire.internal.cache.TXManagerImpl;
+import com.gemstone.gemfire.internal.cache.TXStateInterface;
+import com.gemstone.gemfire.internal.cache.TXStateProxyImpl;
 import com.gemstone.gemfire.internal.cache.execute.CustomerIDPartitionResolver;
 import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.Customer;
 import com.gemstone.gemfire.internal.cache.execute.data.Order;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 @SuppressWarnings("deprecation")
-public class DistributedTransactionDUnitTest extends CacheTestCase {
-  final protected String CUSTOMER_PR = "customerPRRegion";
-  final protected String ORDER_PR = "orderPRRegion";
-  final protected String D_REFERENCE = "distrReference";
-  final protected String PERSISTENT_CUSTOMER_PR = "persistentCustomerPRRegion";
+@Category(DistributedTest.class)
+public class DistributedTransactionDUnitTest extends JUnit4CacheTestCase {
 
-  final protected String CUSTOMER_RR = "customerRRRegion";
+  protected final String CUSTOMER_PR = "customerPRRegion";
+  protected final String ORDER_PR = "orderPRRegion";
+  protected final String D_REFERENCE = "distrReference";
+  protected final String PERSISTENT_CUSTOMER_PR = "persistentCustomerPRRegion";
+
+  protected final String CUSTOMER_RR = "customerRRRegion";
   
   @Override
   public final void postSetUp() throws Exception{
@@ -84,8 +118,8 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     }); 
   }
   
-  public DistributedTransactionDUnitTest(String name) {
-    super(name);
+  public DistributedTransactionDUnitTest() {
+    super();
   }
 
   public Object execute(VM vm, SerializableCallable c) {
@@ -337,9 +371,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
-  
-
-  
+  @Test
   public void testTransactionalPutOnReplicatedRegion() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -409,6 +441,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTransactionalPutOnPartitionedRegion() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -490,6 +523,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
   }
 
   @SuppressWarnings("serial")
+  @Test
   public void testCommitOnPartitionedAndReplicatedRegions() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -534,6 +568,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testGetIsolated() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -578,6 +613,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testCommitAndRollback() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -616,6 +652,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
    * We create 2 partitioned regions one on each server and have a third node
    * as accessor and fire transactional operations on it.
    */
+  @Test
   public void testNonColocatedPutByPartitioning() {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); // datastore
@@ -723,6 +760,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTransactionalKeyBasedUpdates() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); 
@@ -774,6 +812,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testTransactionalKeyBasedDestroys_PR() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); 
@@ -819,6 +858,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testTransactionalKeyBasedDestroys_RR() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); 
@@ -862,6 +902,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTransactionalUpdates() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); 
@@ -918,6 +959,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testPutAllWithTransactions() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); 
@@ -1035,6 +1077,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testRemoveAllWithTransactions() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); 
@@ -1104,6 +1147,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testTxWithSingleDataStore() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0); // datastore
@@ -1179,6 +1223,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testMultipleOpsOnSameKeyInTx() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1478,6 +1523,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
     execute(secondary, verifySecondary);
   }
   
+  @Test
   public void testBasicDistributedTX() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1513,6 +1559,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
 
   }
 
+  @Test
   public void testRegionAndEntryVersionsPR() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1606,6 +1653,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
 
   }
 
+  @Test
   public void testRegionAndEntryVersionsRR() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1699,6 +1747,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
   }
   
   
+  @Test
   public void testTxWorksWithNewNodeJoining() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1847,6 +1896,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
    * Start two concurrent transactions that put same entries. Make sure that
    * conflict is detected at the commit time.
    */
+  @Test
   public void testCommitConflicts_PR() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1867,6 +1917,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
    * Start two concurrent transactions that put same entries. Make sure that
    * conflict is detected at the commit time.
    */
+  @Test
   public void testCommitConflicts_RR() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1994,6 +2045,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
    * transaction in a new thread that modifies same entries as in the earlier
    * transaction. Make sure that conflict is detected
    */
+  @Test
   public void testCommitConflicts_PR_after_locks_acquired() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2011,6 +2063,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
    * transaction in a new thread that modifies same entries as in the earlier
    * transaction. Make sure that conflict is detected
    */
+  @Test
   public void testCommitConflicts_RR_after_locks_acquired() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2121,7 +2174,8 @@ private class TxOps_no_conflicts extends SerializableCallable {
    * transaction in a new thread that modifies different entries Make sure that
    * there is no conflict or exception.
    */
-public void testCommitNoConflicts_PR() throws Exception {
+  @Test
+  public void testCommitNoConflicts_PR() throws Exception {
   Host host = Host.getHost(0);
   VM server1 = host.getVM(0);
   VM server2 = host.getVM(1);
@@ -2136,7 +2190,8 @@ public void testCommitNoConflicts_PR() throws Exception {
  * transaction in a new thread that modifies different entries Make sure that
  * there is no conflict or exception.
  */
-public void testCommitNoConflicts_RR() throws Exception {
+  @Test
+  public void testCommitNoConflicts_RR() throws Exception {
   Host host = Host.getHost(0);
   VM server1 = host.getVM(0);
   VM server2 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java
index 38c033f..362127e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java
@@ -16,16 +16,20 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.internal.cache.execute.PRTransactionDUnitTest;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
 import java.util.Properties;
 
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.internal.cache.execute.PRTransactionDUnitTest;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
 public class PRDistTXDUnitTest extends PRTransactionDUnitTest {
 
-  public PRDistTXDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public Properties getDistributedSystemProperties() {
     Properties props = super.getDistributedSystemProperties();
@@ -33,30 +37,33 @@ public class PRDistTXDUnitTest extends PRTransactionDUnitTest {
     return props;
   }
   
-  // [DISTTX] TODO test overridden and intentionally left blank as they fail.
-  // Fix this 
-  
-  @Override
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
+  @Test
   public void testBasicPRTransactionRedundancy0() {
   }
 
-  @Override
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
+  @Test
   public void testBasicPRTransactionRedundancy1() {
   }
 
-  @Override
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
+  @Test
   public void testBasicPRTransactionRedundancy2() {
   }
 
-  @Override
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
+  @Test
   public void testBasicPRTransactionNoDataRedundancy0() {
   }
 
-  @Override
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
+  @Test
   public void testBasicPRTransactionNoDataRedundancy1() {
   }
 
-  @Override
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
+  @Test
   public void testBasicPRTransactionNoDataRedundancy2() {
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java
index 5affa6a..880606c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java
@@ -16,19 +16,20 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.internal.cache.execute.PRTransactionWithVersionsDUnitTest;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.internal.cache.execute.PRTransactionWithVersionsDUnitTest;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class PRDistTXWithVersionsDUnitTest extends
-    PRTransactionWithVersionsDUnitTest {
+@Category(DistributedTest.class)
+public class PRDistTXWithVersionsDUnitTest extends PRTransactionWithVersionsDUnitTest {
 
-  public PRDistTXWithVersionsDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public Properties getDistributedSystemProperties() {
     Properties props = super.getDistributedSystemProperties();
@@ -36,30 +37,39 @@ public class PRDistTXWithVersionsDUnitTest extends
     return props;
   }
   
-  // [DISTTX] TODO test overridden and intentionally left blank as they fail.
-  // Fix this 
-  
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
   @Override
+  @Test
   public void testBasicPRTransactionRedundancy0() {
   }
 
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
   @Override
+  @Test
   public void testBasicPRTransactionRedundancy1() {
   }
 
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
   @Override
+  @Test
   public void testBasicPRTransactionRedundancy2() {
   }
 
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
   @Override
+  @Test
   public void testBasicPRTransactionNoDataRedundancy0() {
   }
 
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
   @Override
+  @Test
   public void testBasicPRTransactionNoDataRedundancy1() {
   }
 
+  @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.")
   @Override
+  @Test
   public void testBasicPRTransactionNoDataRedundancy2() {
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
index 4267292..5f28a2e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
@@ -16,18 +16,22 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.internal.cache.partitioned.PersistentPartitionedRegionWithTransactionDUnitTest;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
 import java.util.Properties;
 
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.internal.cache.partitioned.PersistentPartitionedRegionWithTransactionDUnitTest;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Same tests as that of
  * {@link PersistentPartitionedRegionWithTransactionDUnitTest} after setting
  * "distributed-transactions" property to true
  */
-public class PersistentPartitionedRegionWithDistTXDUnitTest extends
-    PersistentPartitionedRegionWithTransactionDUnitTest {
+@Category(DistributedTest.class)
+public class PersistentPartitionedRegionWithDistTXDUnitTest extends PersistentPartitionedRegionWithTransactionDUnitTest {
 
   @Override
   public Properties getDistributedSystemProperties() {
@@ -35,8 +39,4 @@ public class PersistentPartitionedRegionWithDistTXDUnitTest extends
     props.setProperty(DISTRIBUTED_TRANSACTIONS, "true");
     return props;
   }
-  
-  public PersistentPartitionedRegionWithDistTXDUnitTest(String name) {
-    super(name);
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
index ca870cc..b1b6662 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal;
 
+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.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.DataInput;
@@ -42,7 +51,8 @@ import com.gemstone.gemfire.internal.cache.DistributedPutAllOperation.EntryVersi
  * 
  * 
  */
-public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class BackwardCompatibilitySerializationDUnitTest extends JUnit4CacheTestCase {
 
   private transient ByteArrayOutputStream baos;
   private transient ByteArrayInputStream bais;
@@ -56,8 +66,8 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
 
   public TestMessage msg = new TestMessage();
 
-  public BackwardCompatibilitySerializationDUnitTest(String name) {
-    super(name);
+  public BackwardCompatibilitySerializationDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
index b61be01..edc8f3c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal;
 
+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.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -48,19 +57,22 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *
  */
-public class ClassNotFoundExceptionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClassNotFoundExceptionDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * @param name
    */
-  public ClassNotFoundExceptionDUnitTest(String name) {
-    super(name);
+  public ClassNotFoundExceptionDUnitTest() {
+    super();
   }
   
+  @Test
   public void testDataSerializable() throws InterruptedException {
     doTest(new ObjectFactory() { public Object get() { return new ClassNotFoundDataSerializable();} });
   }
   
+  @Test
   public void testPdx() throws InterruptedException {
     doTest(new ObjectFactory() { public Object get() { return new ClassNotFoundPdx(false);} });
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java
index 157fe7e..68b81bf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java
@@ -16,19 +16,17 @@
  */
 package com.gemstone.gemfire.internal;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-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.ResultSender;
-import com.gemstone.gemfire.internal.cache.InternalCache;
-import com.gemstone.gemfire.internal.cache.execute.FunctionContextImpl;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.RandomAccessFile;
 import java.lang.management.ManagementFactory;
 import java.lang.management.ThreadInfo;
 import java.lang.management.ThreadMXBean;
@@ -42,39 +40,25 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.regex.Pattern;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+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.ResultSender;
+import com.gemstone.gemfire.internal.cache.InternalCache;
+import com.gemstone.gemfire.internal.cache.execute.FunctionContextImpl;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * TODO: Need to fix this testDeclarableFunctionsWithParms and testClassOnClasspath on Windows:
- * 
- * java.io.IOException: The process cannot access the file because another process has locked a portion of the file
-        at java.io.FileOutputStream.writeBytes(Native Method)
-        at java.io.FileOutputStream.write(FileOutputStream.java:325)
-        at com.gemstone.gemfire.internal.JarClassLoaderJUnitTest.writeJarBytesToFile(JarClassLoaderJUnitTest.java:704)
-        at com.gemstone.gemfire.internal.JarClassLoaderJUnitTest.testDeclarableFunctionsWithParms(JarClassLoaderJUnitTest.java:412)
-        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
-        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
-        at java.lang.reflect.Method.invoke(Method.java:606)
-        at junit.framework.TestCase.runTest(TestCase.java:176)
-        at junit.framework.TestCase.runBare(TestCase.java:141)
-        at junit.framework.TestResult$1.protect(TestResult.java:122)
-        at junit.framework.TestResult.runProtected(TestResult.java:142)
-        at junit.framework.TestResult.run(TestResult.java:125)
-        at junit.framework.TestCase.run(TestCase.java:129)
-        at junit.framework.TestSuite.runTest(TestSuite.java:255)
-        at junit.framework.TestSuite.run(TestSuite.java:250)
-        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
-        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
-        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
-        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
-        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
-        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
-        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  */
 @Category(IntegrationTest.class)
 public class JarClassLoaderJUnitTest {
+
   private static final String JAR_PREFIX = "vf.gf#";
   
   private final ClassBuilder classBuilder = new ClassBuilder();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
index 7576756..4c24a61 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
@@ -16,20 +16,17 @@
  */
 package com.gemstone.gemfire.internal;
 
-import com.gemstone.gemfire.cache.execute.Execution;
-import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.cache.execute.ResultCollector;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.DistributedSystemConfigProperties;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-import com.gemstone.gemfire.test.dunit.VM;
-import org.junit.Test;
-
-import java.io.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.RandomAccessFile;
 import java.nio.channels.FileLock;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -41,20 +38,34 @@ import java.util.concurrent.CyclicBarrier;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.DistributedSystemConfigProperties;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.test.dunit.Assert;
+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;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Unit tests for the JarDeployer class
  * 
  * @since GemFire 7.0
  */
-public class JarDeployerDUnitTest extends CacheTestCase {
-  private static final long serialVersionUID = 1L;
+@Category(DistributedTest.class)
+@SuppressWarnings("serial")
+public class JarDeployerDUnitTest extends JUnit4CacheTestCase {
+
   static FileLock savedFileLock = null;
   private final ClassBuilder classBuilder = new ClassBuilder();
 
-  public JarDeployerDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     JarDeployer jarDeployer = new JarDeployer();
@@ -151,7 +162,6 @@ public class JarDeployerDUnitTest extends CacheTestCase {
   }
 
   @Test
-  @SuppressWarnings("serial")
   public void testDeployExclusiveLock() throws IOException, ClassNotFoundException {
     final JarDeployer jarDeployer = new JarDeployer();
     final File currentDir = new File(".").getAbsoluteFile();
@@ -208,7 +218,6 @@ public class JarDeployerDUnitTest extends CacheTestCase {
   }
 
   @Test
-  @SuppressWarnings("serial")
   public void testDeploySharedLock() throws IOException, ClassNotFoundException {
     final JarDeployer jarDeployer = new JarDeployer();
     final File currentDir = new File(".").getAbsoluteFile();
@@ -273,7 +282,6 @@ public class JarDeployerDUnitTest extends CacheTestCase {
   }
 
   @Test
-  @SuppressWarnings("serial")
   public void testUndeploySharedLock() throws IOException, ClassNotFoundException {
     final JarDeployer jarDeployer = new JarDeployer();
     final File currentDir = new File(".").getAbsoluteFile();
@@ -325,7 +333,6 @@ public class JarDeployerDUnitTest extends CacheTestCase {
   }
 
   @Test
-  @SuppressWarnings("serial")
   public void testDeployUpdateByAnotherVM() throws IOException, ClassNotFoundException {
     final JarDeployer jarDeployer = new JarDeployer();
     final File currentDir = new File(".").getAbsoluteFile();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
index b507156..4c50ab0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
@@ -16,8 +16,25 @@
  */
 package com.gemstone.gemfire.internal;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.internal.cache.DiskStoreImpl;
 import com.gemstone.gemfire.pdx.PdxInstance;
 import com.gemstone.gemfire.pdx.PdxReader;
@@ -29,23 +46,15 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+@Category(DistributedTest.class)
+public class PdxDeleteFieldDUnitTest extends JUnit4CacheTestCase {
 
-public class PdxDeleteFieldDUnitTest  extends CacheTestCase{
   final List<String> filesToBeDeleted = new CopyOnWriteArrayList<String>();
   
-  public PdxDeleteFieldDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testPdxDeleteFieldVersioning() throws Exception {
     final String DS_NAME = "PdxDeleteFieldDUnitTestDiskStore";
     final String DS_NAME2 = "PdxDeleteFieldDUnitTestDiskStore2";
@@ -180,8 +189,10 @@ public class PdxDeleteFieldDUnitTest  extends CacheTestCase{
   }
   
   public static class PdxValue implements PdxSerializable {
+
     public int value;
     public long fieldToDelete = -1L;
+
     public PdxValue() {} // for deserialization
     public PdxValue(int v, long lv) {
       this.value = v;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
index f85f750..345cefb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
@@ -16,8 +16,25 @@
  */
 package com.gemstone.gemfire.internal;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.internal.cache.DiskStoreImpl;
 import com.gemstone.gemfire.pdx.PdxInstance;
 import com.gemstone.gemfire.pdx.PdxReader;
@@ -30,23 +47,15 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+@Category(DistributedTest.class)
+public class PdxRenameDUnitTest  extends JUnit4CacheTestCase{
 
-public class PdxRenameDUnitTest  extends CacheTestCase{
   final List<String> filesToBeDeleted = new CopyOnWriteArrayList<String>();
   
-  public PdxRenameDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testPdxRenameVersioning() throws Exception {
     final String DS_NAME = "PdxRenameDUnitTestDiskStore";
     final String DS_NAME2 = "PdxRenameDUnitTestDiskStore2";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java
index cb9135e..62b4adf 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java
@@ -16,30 +16,29 @@
  */
 package com.gemstone.gemfire.internal;
 
-import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.AssertionFailedError;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.test.junit.categories.SecurityTest;
 
 /**
  * Test that DistributionConfigImpl handles SSL options correctly.
- * 
  */
-@Category(IntegrationTest.class)
+@Category({ IntegrationTest.class, SecurityTest.class })
 public class SSLConfigJUnitTest {
 
-  private static final Properties SSL_PROPS_MAP     = new Properties();
-  private static final Properties CLUSTER_SSL_PROPS_MAP     = new Properties();
-  private static final Properties CLUSTER_SSL_PROPS_SUBSET_MAP     = new Properties();
+  private static final Properties SSL_PROPS_MAP = new Properties();
+  private static final Properties CLUSTER_SSL_PROPS_MAP = new Properties();
+  private static final Properties CLUSTER_SSL_PROPS_SUBSET_MAP = new Properties();
   private static final Properties JMX_SSL_PROPS_MAP = new Properties();
   private static final Properties JMX_SSL_PROPS_SUBSET_MAP = new Properties();
   private static final Properties SERVER_SSL_PROPS_MAP = new Properties();
@@ -47,7 +46,6 @@ public class SSLConfigJUnitTest {
   private static final Properties GATEWAY_SSL_PROPS_MAP = new Properties();
   private static final Properties GATEWAY_PROPS_SUBSET_MAP = new Properties();
   
-
   static {
     
     SSL_PROPS_MAP.put("javax.net.ssl.keyStoreType", "jks");
@@ -102,8 +100,6 @@ public class SSLConfigJUnitTest {
 
   }
   
-  //----- test methods ------
-
   @Test
   public void testMCastPortWithSSL() throws Exception {
     Properties props = new Properties( );
@@ -113,7 +109,7 @@ public class SSLConfigJUnitTest {
     try {
       new DistributionConfigImpl( props );
     } catch ( IllegalArgumentException e ) {
-      if (! e.toString().matches( ".*Could not set \"ssl-enabled.*" ) ) {
+      if (! e.toString().matches( ".*Could not set \"ssl-enabled.*" ) ) { // TODO: what if this isn't thrown at all?? Is it expected?
         throw new Exception( "did not get expected exception, got this instead...", e );
       }
     }
@@ -141,7 +137,7 @@ public class SSLConfigJUnitTest {
   }
   
   @Test
-  public void testConfigCopyWithSSL( ) throws Exception {
+  public void testConfigCopyWithSSL() throws Exception {
     boolean sslenabled = false;
     String sslprotocols = "any";
     String sslciphers = "any";
@@ -330,7 +326,6 @@ public class SSLConfigJUnitTest {
     isEqual( config.getGatewaySSLRequireAuthentication(), gatewaySslRequireAuth );
   }
   
-
   @Test
   public void testManagerConfig() throws Exception {
     boolean sslenabled = false;
@@ -381,7 +376,6 @@ public class SSLConfigJUnitTest {
     isEqual( config.getJmxManagerSSLRequireAuthentication(), jmxManagerSslRequireAuth );
   }
   
-  
   @Test
   public void testCacheServerConfig() throws Exception {
     boolean sslenabled = false;
@@ -454,7 +448,6 @@ public class SSLConfigJUnitTest {
   
   @Test
   public void testCustomizedClusterSslConfig() throws Exception {
-    
     boolean sslenabled = true;
     String  sslprotocols = "SSLv1";
     String  sslciphers = "RSA_WITH_NOTHING";
@@ -620,7 +613,6 @@ public class SSLConfigJUnitTest {
     
     clusterSSLProperties = config.getClusterSSLProperties();
     isEqual( SSL_PROPS_MAP, clusterSSLProperties );
-    
   }
   
   @Test
@@ -689,7 +681,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
     gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforCS(false));
+    gemFireProps.putAll(getGfSecurityPropertiesForCS(false));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -732,7 +724,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(GATEWAY_SSL_CIPHERS, gatewaySslciphers);
     gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, String.valueOf(gatewaySslRequireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforGateway(false));
+    gemFireProps.putAll(getGfSecurityPropertiesForGateway(false));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -750,7 +742,6 @@ public class SSLConfigJUnitTest {
     isEqual(GATEWAY_SSL_PROPS_MAP.get(GATEWAY_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword());
     isEqual(GATEWAY_SSL_PROPS_MAP.get(GATEWAY_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore());
     isEqual(GATEWAY_SSL_PROPS_MAP.get(GATEWAY_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword());
-    
   }
   
   @Test
@@ -802,7 +793,6 @@ public class SSLConfigJUnitTest {
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getJmxManagerSSLTrustStorePassword());
   }
   
-  
   @Test
   public void testPartialCustomizedCacheServerSslConfig() throws Exception {
     boolean sslenabled = false;
@@ -826,7 +816,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
     gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforCS(true));
+    gemFireProps.putAll(getGfSecurityPropertiesForCS(true));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -875,7 +865,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(GATEWAY_SSL_CIPHERS, gatewaySslciphers);
     gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, String.valueOf(gatewaySslRequireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforGateway(true));
+    gemFireProps.putAll(getGfSecurityPropertiesForGateway(true));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -899,11 +889,10 @@ public class SSLConfigJUnitTest {
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword());
     isEqual(GATEWAY_PROPS_SUBSET_MAP.get(GATEWAY_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword());
-
   }
   
   @Test
-  public void testP2pSSLPropsOverriden_ServerPropsNotOverriden(){
+  public void testP2pSSLPropsOverriden_ServerPropsNotOverriden() throws Exception {
     boolean sslenabled = true;
     String  sslprotocols = "overrriden";
     String  sslciphers = "overrriden";
@@ -921,7 +910,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(CLUSTER_SSL_CIPHERS, sslciphers);
     gemFireProps.put(CLUSTER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(requireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforCS(true));
+    gemFireProps.putAll(getGfSecurityPropertiesForCS(true));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -952,11 +941,10 @@ public class SSLConfigJUnitTest {
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getServerSSLKeyStorePassword());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE), config.getServerSSLTrustStore());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getServerSSLTrustStorePassword());
-    
   }
   
   @Test
-  public void testP2pSSLPropsOverriden_ServerPropsOverriden(){
+  public void testP2pSSLPropsOverriden_ServerPropsOverriden() throws Exception {
     boolean sslenabled = true;
     String  sslprotocols = "overrriden";
     String  sslciphers = "overrriden";
@@ -979,7 +967,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
     gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforCS(true));
+    gemFireProps.putAll(getGfSecurityPropertiesForCS(true));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -1013,7 +1001,7 @@ public class SSLConfigJUnitTest {
   }
   
   @Test
-  public void testClusterSSLPropsOverriden_GatewayPropsNotOverriden(){
+  public void testClusterSSLPropsOverriden_GatewayPropsNotOverriden() throws Exception {
     boolean sslenabled = true;
     String  sslprotocols = "overrriden";
     String  sslciphers = "overrriden";
@@ -1031,7 +1019,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(CLUSTER_SSL_CIPHERS, sslciphers);
     gemFireProps.put(CLUSTER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(requireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforGateway(true));
+    gemFireProps.putAll(getGfSecurityPropertiesForGateway(true));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -1062,11 +1050,10 @@ public class SSLConfigJUnitTest {
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword());
-    
   }
   
   @Test
-  public void testP2pSSLPropsOverriden_GatewayPropsOverriden(){
+  public void testP2pSSLPropsOverriden_GatewayPropsOverridden() throws Exception {
     boolean sslenabled = true;
     String  sslprotocols = "overrriden";
     String  sslciphers = "overrriden";
@@ -1089,7 +1076,7 @@ public class SSLConfigJUnitTest {
     gemFireProps.put(GATEWAY_SSL_CIPHERS, gatewayServerSslciphers);
     gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, String.valueOf(gatewayServerSslRequireAuth));
 
-    gemFireProps.putAll(getGfSecurityPropertiesforGateway(true));
+    gemFireProps.putAll(getGfSecurityPropertiesForGateway(true));
 
     DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps );
     isEqual( config.getClusterSSLEnabled(), sslenabled );
@@ -1115,11 +1102,10 @@ public class SSLConfigJUnitTest {
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword());
     isEqual(GATEWAY_PROPS_SUBSET_MAP.get(GATEWAY_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword());
-    
   }
   
   @Test
-  public void testP2pSSLPropsOverriden_JMXPropsNotOverriden(){
+  public void testP2pSSLPropsOverriden_JMXPropsNotOverriden() throws Exception {
     boolean sslenabled = true;
     String  sslprotocols = "overrriden";
     String  sslciphers = "overrriden";
@@ -1168,7 +1154,6 @@ public class SSLConfigJUnitTest {
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getJmxManagerSSLKeyStorePassword());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE), config.getJmxManagerSSLTrustStore());
     isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getJmxManagerSSLTrustStorePassword());
-    
   }
   
   private static Properties getGfSecurityPropertiesSSL() {
@@ -1222,7 +1207,7 @@ public class SSLConfigJUnitTest {
     return gfSecurityProps;
   }
   
-  private static Properties getGfSecurityPropertiesforCS(boolean partialCSSslConfigOverride) {
+  private static Properties getGfSecurityPropertiesForCS(boolean partialCSSslConfigOverride) {
     Properties gfSecurityProps = new Properties();
 
     Set<Entry<Object, Object>> entrySet = CLUSTER_SSL_PROPS_MAP.entrySet();
@@ -1243,7 +1228,7 @@ public class SSLConfigJUnitTest {
     return gfSecurityProps;
   }
 
-  private static Properties getGfSecurityPropertiesforGateway(boolean partialGatewaySslConfigOverride) {
+  private static Properties getGfSecurityPropertiesForGateway(boolean partialGatewaySslConfigOverride) {
     Properties gfSecurityProps = new Properties();
 
     Set<Entry<Object, Object>> entrySet = CLUSTER_SSL_PROPS_MAP.entrySet();
@@ -1263,11 +1248,11 @@ public class SSLConfigJUnitTest {
     return gfSecurityProps;
   }
   
-  public void isEqual( boolean a, boolean e ) throws AssertionFailedError {
-    assertEquals( a, e );
+  private void isEqual(boolean a, boolean e) {
+    assertEquals(a,e );
   }
   
-  public void isEqual( Object a, Object e ) throws AssertionFailedError {
+  private void isEqual(Object a,Object e ) {
     assertEquals( a, e );
   } 
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
index 638a55b..ba87eb6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.BufferedReader;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -65,19 +74,11 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-/**
- *
- */
+@Category(DistributedTest.class)
 public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
   private static final long  MAX_WAIT = 30 * 1000;
 
-
-
-  public BackupDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     StringBuilder failures = new StringBuilder();
@@ -87,6 +88,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     }
   }
   
+  @Test
   public void testBackupPR() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -155,6 +157,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
    * Test of bug 42419
    * @throws Throwable
    */
+  @Test
   public void testBackupFromMemberWithDiskStore() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -218,6 +221,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
    * Test for bug 42419
    * @throws Throwable
    */
+  @Test
   public void testBackupWhileBucketIsCreated() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -295,6 +299,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
       checkData(vm0, 0, 1, "A", "region1");
   }
   
+  @Test
   public void testBackupWhileBucketIsMovedBackupBeforeSendDestroy() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
@@ -319,6 +324,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     backupWhileBucketIsMoved(observer);
   }
   
+  @Test
   public void testBackupWhileBucketIsMovedBackupAfterSendDestroy() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -358,6 +364,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     backupWhileBucketIsMoved(observer);
   }
   
+  @Test
   public void testBackupStatusCleanedUpAfterFailureOnOneMember() throws Throwable {
     IgnoredException.addIgnoredException("Uncaught exception");
     IgnoredException.addIgnoredException("Stop processing");
@@ -511,6 +518,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
    * data as backed up.
    * @throws Throwable
    */
+  @Test
   public void testBackupOverflow() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -535,6 +543,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     
   }
   
+  @Test
   public void testBackupPRWithOfflineMembers() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
index 4c31a38..88385f5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
@@ -23,6 +23,9 @@ package com.gemstone.gemfire.internal.cache;
 
 import java.util.Properties;
 
+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.CacheException;
@@ -34,20 +37,14 @@ import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class Bug33359DUnitTest extends DistributedTestCase {
-    
-    /** Creates a new instance of Bug33359DUnitTest */
-    public Bug33359DUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class Bug33359DUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
     static Cache cache;
     static Properties props = new Properties();
@@ -80,7 +77,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
     
     public static void createCacheVM0(){
         try{
-            ds = (new Bug33359DUnitTest("temp")).getSystem(props);
+            ds = (new Bug33359DUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             
             AttributesFactory factory  = new AttributesFactory();
@@ -98,7 +95,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
     } //end of create cache for VM0
     public static void createCacheVM1(){
         try{
-            ds = (new Bug33359DUnitTest("temp")).getSystem(props);
+            ds = (new Bug33359DUnitTest()).getSystem(props);
             DistributedSystem.setThreadsSocketPolicy(false);
             
             cache = CacheFactory.create(ds);
@@ -128,7 +125,8 @@ public class Bug33359DUnitTest extends DistributedTestCase {
     //test methods
     
     
-    public void testClearMultiVM(){
+  @Test
+  public void testClearMultiVM(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
index 16443b3..742211f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
@@ -16,8 +16,13 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+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.CacheFactory;
@@ -28,22 +33,19 @@ import com.gemstone.gemfire.cache.RegionEvent;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class Bug33726DUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class Bug33726DUnitTest extends JUnit4DistributedTestCase {
   
   static boolean[] flags = new boolean[2];
   static Cache cache = null;
   static DistributedSystem ds = null;
   static boolean isOK = false;
   
-
-  public Bug33726DUnitTest(String name){
-	super(name);
-  }
-
   @Override
   public final void preTearDown() throws Exception {
     Host host = Host.getHost(0);
@@ -63,6 +65,7 @@ public class Bug33726DUnitTest extends DistributedTestCase {
 	}
    }
 
+  @Test
   public void testAfterRegionCreate() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -76,7 +79,7 @@ public class Bug33726DUnitTest extends DistributedTestCase {
   
   public static void createCacheAndPopulateRegion1() {
     try {
-      ds = (new Bug33726DUnitTest("temp")).getSystem(new Properties());
+      ds = (new Bug33726DUnitTest()).getSystem(new Properties());
       cache = CacheFactory.create(ds);
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.GLOBAL);
@@ -97,7 +100,7 @@ public class Bug33726DUnitTest extends DistributedTestCase {
 
   public static void createCacheAndRegion2() {
     try {
-      ds = (new Bug33726DUnitTest("temp")).getSystem(new Properties());
+      ds = (new Bug33726DUnitTest()).getSystem(new Properties());
       cache = CacheFactory.create(ds);
       AttributesFactory factory = new AttributesFactory();
       factory.setCacheListener(new TestCacheListener());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java
index 4eea76d..cbc5e4c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java
@@ -14,25 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.fail;
-
 import java.io.File;
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-
 /**
  * Disk region perf test for Persist only with Async writes and  Buffer.
  * Set Rolling oplog to true and setMaxOplogSize to 10240
@@ -43,25 +36,25 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * The disk properties will ensure that very many oplog files are created.
  * 
  * This test is currently not being executed and is marked with an underscore
- *  
  */
 @Category(IntegrationTest.class)
-public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase
-{
+public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private static int ENTRY_SIZE = 1024;
+
+  private static int OP_COUNT = 100000;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private LogWriter log = null;
+
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
  
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     File file1 = new File("testingDirectory/" + getName()+ "1");
     file1.mkdir();
     file1.deleteOnExit();
-   dirs = new File[1];
-   dirs[0] = file1;
+    dirs = new File[1];
+    dirs[0] = file1;
     diskProps.setDiskDirs(dirs);
      
     diskProps.setPersistBackup(true);
@@ -75,43 +68,24 @@ public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-    
-  }
-
-  
-  private static int ENTRY_SIZE = 1024;
-
-  private static int OP_COUNT = 100000;
-  
   /**
    * currently not being executed for congo but after transition to JDK 1.5, this test should be executed.
-   *
    */
-  public void _testPopulate1kbwrites()
-  {
-    try {
-      final byte[] value = new byte[ENTRY_SIZE];
-      Arrays.fill(value, (byte)77);
-      for (int i = 0; i < OP_COUNT; i++) {
-        region.put(new Integer(i), value);
-      }
-      closeDown(); // closes disk file which will flush all buffers
-    }
-    catch (Exception ex) {
-      fail("IOException occured due to " + ex);
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testPopulate1kbwrites() {
+    final byte[] value = new byte[ENTRY_SIZE];
+    Arrays.fill(value, (byte)77);
+    for (int i = 0; i < OP_COUNT; i++) {
+      region.put(new Integer(i), value);
     }
-
+    closeDown(); // closes disk file which will flush all buffers
   }
+
   /**
    * cleans all the directory of all the files present in them
-   *
    */
-  protected static void deleteFiles()
-  {
+  protected static void deleteFiles() {
     for (int i = 0; i < dirs.length; i++) {
       File[] files = dirs[i].listFiles();
       for (int j = 0; j < files.length; j++) {
@@ -120,11 +94,4 @@ public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase
     }
   }
   
-  @Test
-  public void testDoNothing(){
-    //dummy method to ensure at least one test is present in this file if the other tests are commented
-  }
-  
-  
 }// end of Bug34179TooManyFilesOpenJUnitTest
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
index 1b4ca3b..0eda7ba 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
@@ -17,8 +17,14 @@
 
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -29,18 +35,19 @@ import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.ReplyException;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/*
+/**
  * Confirms the bug 37241 is fixed.
  * CleanupFailedInitialization on should also clean disk files created
  */
+@Category(DistributedTest.class)
+public class Bug37241DUnitTest extends JUnit4DistributedTestCase {
 
-public class Bug37241DUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
 
   static VM server1 = null;
@@ -52,11 +59,6 @@ public class Bug37241DUnitTest extends DistributedTestCase
   static final String expectedReplyException = ReplyException.class.getName();
 
   static final String expectedException = IllegalStateException.class.getName();
-  /* Constructor */
-
-  public Bug37241DUnitTest(String name) {
-    super(name);
-  }
 
   @Override
   public final void postSetUp() throws Exception {
@@ -71,6 +73,7 @@ public class Bug37241DUnitTest extends DistributedTestCase
    *  3.Region creation should fail . Check for all files created in the directory for server 2
    *    gets deleted.
    */
+  @Test
   public void testBug37241ForNewDiskRegion()
   {
     server1.invoke(() -> Bug37241DUnitTest.createRegionOnServer1());   
@@ -84,6 +87,7 @@ public class Bug37241DUnitTest extends DistributedTestCase
     }
   }
 
+  @Test
   public void testBug37241ForRecreatedDiskRegion()
   {
     server1.invoke(() -> Bug37241DUnitTest.createRegionOnServer1());
@@ -110,7 +114,7 @@ public class Bug37241DUnitTest extends DistributedTestCase
 
   public static void createRegionOnServer1() throws Exception
   {
-    new Bug37241DUnitTest("temp").createCache(new Properties());
+    new Bug37241DUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.GLOBAL);
     factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
@@ -133,7 +137,7 @@ public class Bug37241DUnitTest extends DistributedTestCase
 
   public static void createRegionOnServer2(Scope scope) throws Exception
   {
-    new Bug37241DUnitTest("temp").createCache(new Properties());
+    new Bug37241DUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(scope);
     factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
index f5c1d81..0531100 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.util.Properties;
 
@@ -48,7 +57,8 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * 
  */
 
-public class Bug37377DUnitTest extends CacheTestCase
+@Category(DistributedTest.class)
+public class Bug37377DUnitTest extends JUnit4CacheTestCase
 {
 
   protected static String regionName = "TestRegion";
@@ -67,17 +77,12 @@ public class Bug37377DUnitTest extends CacheTestCase
 
   private static final int maxEntries = 10000;
 
-  /**
-   * Constructor
-   * 
-   * @param name
-   */
-  public Bug37377DUnitTest(String name) {
-    super(name);
-    File file1 = new File(name + "1");
+  public Bug37377DUnitTest() {
+    super();
+    File file1 = new File(getTestMethodName() + "1");
     file1.mkdir();
     file1.deleteOnExit();
-    File file2 = new File(name + "2");
+    File file2 = new File(getTestMethodName() + "2");
     file2.mkdir();
     file2.deleteOnExit();
     dirs = new File[2];
@@ -112,7 +117,7 @@ public class Bug37377DUnitTest extends CacheTestCase
       {
         try {
 
-          distributedSystem = (new Bug37377DUnitTest("vm0_diskReg"))
+          distributedSystem = (new Bug37377DUnitTest())
               .getSystem(props);
           assertTrue(distributedSystem != null);
           cache = CacheFactory.create(distributedSystem);
@@ -149,7 +154,7 @@ public class Bug37377DUnitTest extends CacheTestCase
       public void run2()
       {
         try {
-          distributedSystem = (new Bug37377DUnitTest("vm1_diskReg"))
+          distributedSystem = (new Bug37377DUnitTest())
               .getSystem(props);
           assertTrue(distributedSystem != null);
           cache = CacheFactory.create(distributedSystem);
@@ -303,6 +308,7 @@ public class Bug37377DUnitTest extends CacheTestCase
    * 
    */
 
+  @Test
   public void testGIIputWithClear()
   {
     vm0.invoke(createCacheForVM0());


[12/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
index 1e48447..cfde00a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
@@ -16,9 +16,48 @@
  */
 package com.gemstone.gemfire.internal.cache.wan;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventListener;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
@@ -32,8 +71,13 @@ import com.gemstone.gemfire.cache.control.RebalanceResults;
 import com.gemstone.gemfire.cache.control.ResourceManager;
 import com.gemstone.gemfire.cache.persistence.PartitionOfflineException;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache.wan.*;
+import com.gemstone.gemfire.cache.wan.GatewayEventFilter;
+import com.gemstone.gemfire.cache.wan.GatewayEventSubstitutionFilter;
+import com.gemstone.gemfire.cache.wan.GatewayReceiver;
+import com.gemstone.gemfire.cache.wan.GatewayReceiverFactory;
+import com.gemstone.gemfire.cache.wan.GatewaySender;
 import com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
+import com.gemstone.gemfire.cache.wan.GatewaySenderFactory;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
@@ -42,20 +86,19 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.RegionQueue;
 import com.gemstone.gemfire.internal.cache.lru.Sizeable;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.File;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class AsyncEventQueueTestBase extends DistributedTestCase {
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class AsyncEventQueueTestBase extends JUnit4DistributedTestCase {
 
   protected static Cache cache;
 
@@ -84,8 +127,8 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   // list
   protected static int numDispatcherThreadsForTheRun = 1;
 
-  public AsyncEventQueueTestBase(String name) {
-    super(name);
+  public AsyncEventQueueTestBase() {
+    super();
   }
 
   @Override
@@ -118,7 +161,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
     if (Locator.hasLocator()) {
       Locator.getLocator().stop();
     }
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
     Properties props = test.getDistributedSystemProperties();
     props.setProperty(MCAST_PORT, "0");
@@ -132,7 +175,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   }
 
   public static Integer createFirstRemoteLocator(int dsId, int remoteLocPort) {
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
     Properties props = test.getDistributedSystemProperties();
     props.setProperty(MCAST_PORT, "0");
@@ -651,7 +694,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   }
 
   protected static void createCache(Integer locPort) {
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     Properties props = test.getDistributedSystemProperties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "localhost[" + locPort
@@ -661,7 +704,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   }
 
   public static void createCacheWithoutLocator(Integer mCastPort) {
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     Properties props = test.getDistributedSystemProperties();
     props.setProperty(MCAST_PORT, "" + mCastPort);
     InternalDistributedSystem ds = test.getSystem(props);
@@ -872,7 +915,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   }
 
   public static int createReceiver(int locPort) {
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     Properties props = test.getDistributedSystemProperties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "localhost[" + locPort
@@ -1520,7 +1563,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
       cache = null;
     }
     else {
-      AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+      AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
       if (test.isConnectedToDS()) {
         test.getSystem().disconnect();
       }
@@ -1528,7 +1571,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   }
 
   public static void shutdownLocator() {
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     test.getSystem().disconnect();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
index 5ef8909..3a1d901 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
@@ -16,6 +16,18 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.asyncqueue;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueueFactory;
 import com.gemstone.gemfire.cache.asyncqueue.internal.AsyncEventQueueFactoryImpl;
@@ -27,31 +39,23 @@ import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueTestBase;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
+@Category(DistributedTest.class)
 public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
 
-  private static final long serialVersionUID = 1L;
-
-  public AsyncEventListenerDUnitTest(String name) {
-    super(name);
+  public AsyncEventListenerDUnitTest() {
+    super();
   }
 
   /**
    * Test to verify that AsyncEventQueue can not be created when null listener
    * is passed.
    */
+  @Test
   public void testCreateAsyncEventQueueWithNullListener() {
-    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
+    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     InternalDistributedSystem ds = test.getSystem(props);
@@ -69,6 +73,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
 
   }
 
+  @Test
   public void testSerialAsyncEventQueueAttributes() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -80,6 +85,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm1.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventQueueAttributes( "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true ));
   }
   
+  @Test
   public void testSerialAsyncEventQueueSize() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -138,38 +144,39 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Added to reproduce defect #50366: 
    * NullPointerException with AsyncEventQueue#size() when number of dispatchers is more than 1
    */
+  @Test
   public void testConcurrentSerialAsyncEventQueueSize() {
-	Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
-	vm1.invoke(createCacheRunnable(lnPort));
-	vm2.invoke(createCacheRunnable(lnPort));
-	vm3.invoke(createCacheRunnable(lnPort));
-	vm4.invoke(createCacheRunnable(lnPort));
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
+    vm3.invoke(createCacheRunnable(lnPort));
+    vm4.invoke(createCacheRunnable(lnPort));
 
     vm1.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 150, true, false, null, false, 2, OrderPolicy.KEY ));
     vm2.invoke(() -> AsyncEventQueueTestBase.createConcurrentAsyncEventQueue( "ln",
         false, 100, 150, true, false, null, false, 2, OrderPolicy.KEY ));
 
-	vm1.invoke(createReplicatedRegionRunnable());
-	vm2.invoke(createReplicatedRegionRunnable());
-	vm3.invoke(createReplicatedRegionRunnable());
-	vm4.invoke(createReplicatedRegionRunnable());
+    vm1.invoke(createReplicatedRegionRunnable());
+    vm2.invoke(createReplicatedRegionRunnable());
+    vm3.invoke(createReplicatedRegionRunnable());
+    vm4.invoke(createReplicatedRegionRunnable());
 
-	vm1
-	  .invoke(pauseAsyncEventQueueRunnable());
-	vm2
-	  .invoke(pauseAsyncEventQueueRunnable());
+    vm1
+      .invoke(pauseAsyncEventQueueRunnable());
+    vm2
+      .invoke(pauseAsyncEventQueueRunnable());
 
-	Wait.pause(1000);// pause at least for the batchTimeInterval
+    Wait.pause(1000);// pause at least for the batchTimeInterval
 
-	vm1.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
-		1000 ));
+    vm1.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_RR",
+      1000 ));
 
-	int vm1size = (Integer)vm1.invoke(() -> AsyncEventQueueTestBase.getAsyncEventQueueSize( "ln" ));
-	int vm2size = (Integer)vm2.invoke(() -> AsyncEventQueueTestBase.getAsyncEventQueueSize( "ln" ));
-	assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm1size);
-	assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm2size);
+    int vm1size = (Integer)vm1.invoke(() -> AsyncEventQueueTestBase.getAsyncEventQueueSize( "ln" ));
+    int vm2size = (Integer)vm2.invoke(() -> AsyncEventQueueTestBase.getAsyncEventQueueSize( "ln" ));
+    assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm1size);
+    assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm2size);
   }
   
   /**
@@ -178,7 +185,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Region: Replicated WAN: Serial Region persistence enabled: false Async
    * channel persistence enabled: false
    */
-
+  @Test
   public void testReplicatedSerialAsyncEventQueue() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -210,6 +217,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Verify that the events loaded by CacheLoader reach the AsyncEventListener
    * with correct operation detail (added for defect #50237).
    */
+  @Test
   public void testReplicatedSerialAsyncEventQueueWithCacheLoader() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -252,7 +260,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Error is thrown from AsyncEventListener implementation while processing the batch.
    * Added to test the fix done for defect #45152.
    */
-
+  @Test
   public void testReplicatedSerialAsyncEventQueue_ExceptionScenario() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -305,6 +313,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Region: Replicated WAN: Serial Region persistence enabled: false Async
    * channel persistence enabled: false AsyncEventQueue conflation enabled: true
    */
+  @Test
   public void testReplicatedSerialAsyncEventQueueWithConflationEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -381,8 +390,6 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 0 ));// secondary
   }
 
-  
-
   /**
    * Test configuration::
    * 
@@ -391,8 +398,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * 
    * Note: The test doesn't create a locator but uses MCAST port instead.
    */
-  @Ignore("Disabled until I can sort out the hydra dependencies - see bug 52214")
-  public void DISABLED_testReplicatedSerialAsyncEventQueueWithoutLocator() {
+  @Ignore("TODO: Disabled until I can sort out the hydra dependencies - see bug 52214")
+  @Test
+  public void testReplicatedSerialAsyncEventQueueWithoutLocator() {
     int mPort = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
     vm1.invoke(() -> AsyncEventQueueTestBase.createCacheWithoutLocator( mPort ));
     vm2.invoke(() -> AsyncEventQueueTestBase.createCacheWithoutLocator( mPort ));
@@ -427,6 +435,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * No VM is restarted.
    */
 
+  @Test
   public void testReplicatedSerialAsyncEventQueueWithPeristenceEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -465,9 +474,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * 
    * There is only one vm in the site and that vm is restarted
    */
-
-  @Ignore("Disabled for 52351")
-  public void DISABLED_testReplicatedSerialAsyncEventQueueWithPeristenceEnabled_Restart() {
+  @Ignore("TODO: Disabled for 52351")
+  @Test
+  public void testReplicatedSerialAsyncEventQueueWithPeristenceEnabled_Restart() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
     vm1.invoke(createCacheRunnable(lnPort));
@@ -506,8 +515,9 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * 
    * There are 3 VMs in the site and the VM with primary sender is shut down.
    */
-  @Ignore("Disabled for 52351")
-  public void DISABLED_testReplicatedSerialAsyncEventQueueWithPeristenceEnabled_Restart2() {
+  @Ignore("TODO: Disabled for 52351")
+  @Test
+  public void testReplicatedSerialAsyncEventQueueWithPeristenceEnabled_Restart2() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
     vm1.invoke(createCacheRunnable(lnPort));
@@ -550,6 +560,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Dispatcher threads: more than 1
    * Order policy: key based ordering
    */
+  @Test
   public void testConcurrentSerialAsyncEventQueueWithReplicatedRegion() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -588,6 +599,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Region persistence enabled: false 
    * Async queue persistence enabled: false
    */
+  @Test
   public void testConcurrentSerialAsyncEventQueueWithReplicatedRegion_2() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -628,6 +640,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Dispatcher threads set to more than 1 but no order policy set.
    * Added for defect #50514.
    */
+  @Test
   public void testConcurrentSerialAsyncEventQueueWithoutOrderPolicy() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -664,6 +677,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Region: Partitioned WAN: Serial Region persistence enabled: false Async
    * channel persistence enabled: false
    */
+  @Test
   public void testPartitionedSerialAsyncEventQueue() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -698,6 +712,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Region: Partitioned WAN: Serial Region persistence enabled: false Async
    * channel persistence enabled: false AsyncEventQueue conflation enabled: true
    */
+  @Test
   public void testPartitionedSerialAsyncEventQueueWithConflationEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -782,6 +797,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * 
    * No VM is restarted.
    */
+  @Test
   public void testPartitionedSerialAsyncEventQueueWithPeristenceEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -822,6 +838,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * 
    * There is only one vm in the site and that vm is restarted
    */
+  @Test
   public void testPartitionedSerialAsyncEventQueueWithPeristenceEnabled_Restart() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -854,6 +871,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm1.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventListener( "ln", 1000 ));// primary sender
   }
 
+  @Test
   public void testParallelAsyncEventQueueWithReplicatedRegion() {
     try {
       Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
@@ -883,6 +901,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     }
   }
 
+  @Test
   public void testParallelAsyncEventQueue() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -921,6 +940,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     assertEquals(vm1size + vm2size + vm3size + vm4size, 256);
   }
 
+  @Test
   public void testParallelAsyncEventQueueWithSubstitutionFilter() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -940,6 +960,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm1.invoke(() -> verifySubstitutionFilterInvocations( "ln" ,numPuts ));
   }
 
+  @Test
   public void testParallelAsyncEventQueueWithSubstitutionFilterNoSubstituteValueToDataInvocations() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -963,6 +984,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Verify that the events reaching the AsyncEventListener have correct operation detail.
    * (added for defect #50237).
    */
+  @Test
   public void testParallelAsyncEventQueueWithCacheLoader() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -993,6 +1015,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     vm4.invoke(() -> AsyncEventQueueTestBase.validateAsyncEventForOperationDetail( "ln", 250, false, true ));
   }
   
+  @Test
   public void testParallelAsyncEventQueueSize() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1039,6 +1062,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * Added to reproduce defect #50366: 
    * NullPointerException with AsyncEventQueue#size() when number of dispatchers is more than 1
    */
+  @Test
   public void testConcurrentParallelAsyncEventQueueSize() {
 	Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1081,6 +1105,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
 	assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm2size);
   }
   
+  @Test
   public void testParallelAsyncEventQueueWithConflationEnabled() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1165,6 +1190,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   /**
    * Added to reproduce defect #47213
    */
+  @Test
   public void testParallelAsyncEventQueueWithConflationEnabled_bug47213() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1242,6 +1268,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     
   }
 
+  @Test
   public void testParallelAsyncEventQueueWithOneAccessor() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1282,6 +1309,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
 
   }
 
+  @Test
   public void testParallelAsyncEventQueueWithPersistence() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1320,12 +1348,13 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     assertEquals(vm1size + vm2size + vm3size + vm4size, 256);
   }
   
-/**
- * Test case to test possibleDuplicates. vm1 & vm2 are hosting the PR. vm2 is
- * killed so the buckets hosted by it are shifted to vm1.
- */
-  @Ignore("Disabled for 52349")
-  public void DISABLED_testParallelAsyncEventQueueHA_Scenario1() {
+  /**
+   * Test case to test possibleDuplicates. vm1 & vm2 are hosting the PR. vm2 is
+   * killed so the buckets hosted by it are shifted to vm1.
+   */
+  @Ignore("TODO: Disabled for 52349")
+  @Test
+  public void testParallelAsyncEventQueueHA_Scenario1() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
     vm1.invoke(createCacheRunnable(lnPort));
     vm2.invoke(createCacheRunnable(lnPort));
@@ -1378,6 +1407,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * between vm1 & vm3.
    */
   @Category(FlakyTest.class) // GEODE-688 & GEODE-713: random ports, thread sleeps, async actions
+  @Test
   public void testParallelAsyncEventQueueHA_Scenario2() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1444,6 +1474,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
    * vm1, vm2 & vm3.
    */
   @Ignore("Depends on hydra code. See bug ")
+  @Test
   public void testParallelAsyncEventQueueHA_Scenario3() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -1502,6 +1533,7 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
   /**
    * Added for defect #50364 Can't colocate region that has AEQ with a region that does not have that same AEQ
    */
+  @Test
   public void testParallelAsyncEventQueueAttachedToChildRegionButNotToParentRegion() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerOffHeapDUnitTest.java
index e78dd6b..170383d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerOffHeapDUnitTest.java
@@ -16,11 +16,21 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.asyncqueue;
 
+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;
+
 @SuppressWarnings("serial")
+@Category(DistributedTest.class)
 public class AsyncEventListenerOffHeapDUnitTest extends AsyncEventListenerDUnitTest {
 
-  public AsyncEventListenerOffHeapDUnitTest(String name) {
-    super(name);
+  public AsyncEventListenerOffHeapDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
index 8972595..ef1137b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.asyncqueue;
 
+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.HashMap;
 import java.util.Map;
 
@@ -23,17 +32,19 @@ import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueTestBase;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.dunit.Wait;
 
+@Category(DistributedTest.class)
 public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
 
   private static final long serialVersionUID = 1L;
   
-  public AsyncEventQueueStatsDUnitTest(String name) {
-    super(name);
+  public AsyncEventQueueStatsDUnitTest() {
+    super();
   }
   
   /**
    * Normal replication scenario
    */
+  @Test
   public void testReplicatedSerialPropagation() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -73,6 +84,7 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
   /**
    * Two listeners added to the same RR.
    */
+  @Test
   public void testAsyncStatsTwoListeners() throws Exception {
     Integer lnPort = createFirstLocatorWithDSId(1);
 
@@ -128,6 +140,7 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
   /**
    * HA scenario: kill one vm when puts are in progress on the other vm.
    */
+  @Test
   public void testReplicatedSerialPropagationHA() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -174,6 +187,7 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
   /**
    * Two regions attached to same AsyncEventQueue
    */
+  @Test
   public void testReplicatedSerialPropagationUNPorcessedEvents() throws Exception {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -228,6 +242,7 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
   /**
    * Test with conflation enabled
    */
+  @Test
   public void testSerialPropagationConflation() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
index 3055c8e..5d2e8ac 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
@@ -19,6 +19,21 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.asyncqueue;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static junitparams.JUnitParamsRunner.*;
+import static org.junit.Assert.*;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -30,26 +45,7 @@ import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueConfigurationExcep
 import com.gemstone.gemfire.internal.cache.wan.MyGatewayEventFilter;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.util.test.TestUtil;
-import com.jayway.awaitility.Awaitility;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
 
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.CACHE_XML_FILE;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static junitparams.JUnitParamsRunner.$;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-/**
- *
- */
 @Category(IntegrationTest.class)
 @RunWith(JUnitParamsRunner.class)
 public class AsyncEventQueueValidationsJUnitTest {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
index 3e52393..e0216f1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.concurrent;
 
+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.asyncqueue.internal.AsyncEventQueueFactoryImpl;
 import com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
 import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueTestBase;
@@ -25,14 +34,16 @@ import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 /**
  *
  */
+@Category(DistributedTest.class)
 public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase {
 
   private static final long serialVersionUID = 1L;
 
-  public ConcurrentAsyncEventQueueDUnitTest(String name) {
-    super(name);
+  public ConcurrentAsyncEventQueueDUnitTest() {
+    super();
   }
 
+  @Test
   public void testConcurrentSerialAsyncEventQueueAttributes() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -45,6 +56,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
   }
   
  
+  @Test
   public void testConcurrentParallelAsyncEventQueueAttributesOrderPolicyKey() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -56,6 +68,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
     vm1.invoke(() -> AsyncEventQueueTestBase.validateConcurrentAsyncEventQueueAttributes( "ln", 100, 150, AsyncEventQueueFactoryImpl.DEFAULT_BATCH_TIME_INTERVAL, true, "testDS", true, true, 5, OrderPolicy.KEY ));
   }
 
+  @Test
   public void testConcurrentParallelAsyncEventQueueAttributesOrderPolicyPartition() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -76,6 +89,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    * Order policy: key based ordering
    */
 
+  @Test
   public void testReplicatedSerialAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyKey() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -121,6 +135,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    * Order policy: Thread ordering
    */
 
+  @Test
   public void testReplicatedSerialAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyThread() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -180,6 +195,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    * Order policy: key based ordering
    */
   // Disabling test for bug #48323
+  @Test
   public void testPartitionedParallelAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyKey() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 
@@ -229,6 +245,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
    * Order policy: PARTITION based ordering
    */
   // Disabled test for bug #48323
+  @Test
   public void testPartitionedParallelAsyncEventQueueWithMultipleDispatcherThreadsOrderPolicyPartition() {
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueOffHeapDUnitTest.java
index ac6472e..8e5034f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueOffHeapDUnitTest.java
@@ -16,12 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.concurrent;
 
+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;
+
 @SuppressWarnings("serial")
+@Category(DistributedTest.class)
 public class ConcurrentAsyncEventQueueOffHeapDUnitTest extends
     ConcurrentAsyncEventQueueDUnitTest {
 
-  public ConcurrentAsyncEventQueueOffHeapDUnitTest(String name) {
-    super(name);
+  public ConcurrentAsyncEventQueueOffHeapDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
index 8a88d43..0261620 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.misc;
 
+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.internal.cache.wan.AsyncEventQueueTestBase;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
@@ -23,14 +32,16 @@ import com.gemstone.gemfire.test.dunit.IgnoredException;
 /**
  *
  */
+@Category(DistributedTest.class)
 public class CommonParallelAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase {
   
   private static final long serialVersionUID = 1L;
 
-  public CommonParallelAsyncEventQueueDUnitTest(String name) {
-    super(name);
+  public CommonParallelAsyncEventQueueDUnitTest() {
+    super();
   }
 
+  @Test
   public void testSameSenderWithNonColocatedRegions() throws Exception {
     IgnoredException.addIgnoredException("cannot have the same parallel async");
     Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueOffHeapDUnitTest.java
index bceae58..f570cfb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueOffHeapDUnitTest.java
@@ -16,12 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.misc;
 
+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;
+
 @SuppressWarnings("serial")
+@Category(DistributedTest.class)
 public class CommonParallelAsyncEventQueueOffHeapDUnitTest extends
     CommonParallelAsyncEventQueueDUnitTest {
 
-  public CommonParallelAsyncEventQueueOffHeapDUnitTest(String name) {
-    super(name);
+  public CommonParallelAsyncEventQueueOffHeapDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
index 26832db..1092721 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
@@ -16,25 +16,36 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.compression.Compressor;
-import com.gemstone.gemfire.compression.SnappyCompressor;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.compression.Compressor;
+import com.gemstone.gemfire.compression.SnappyCompressor;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests configured and badly configured cache.xml files with regards to compression.
- * 
  */
-public class CompressionCacheConfigDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CompressionCacheConfigDUnitTest extends JUnit4CacheTestCase {
+
   /**
    * The name of our test region.
    */
@@ -51,22 +62,14 @@ public class CompressionCacheConfigDUnitTest extends CacheTestCase {
   private static final String BAD_COMPRESSOR = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE cache PUBLIC \"-//GemStone Systems, Inc.//GemFire Declarative Cache 8.0//EN\" \"http://www.gemstone.com/dtd/cache8_0.dtd\">\n<cache lock-lease=\"120\" lock-timeout=\"60\" search-timeout=\"300\" is-server=\"true\" copy-on-read=\"false\">\n<region name=\"compressedRegion\">\n<region-attributes data-policy=\"replicate\" cloning-enabled=\"true\">\n<compressor>\n<class-name>BAD_COMPRESSOR</class-name>\n</compressor>\n</region-attributes>\n</region>\n</cache>";
 
   /**
-   * Create a new CompressionCacheConfigDUnitTest.
-   * @param name test name.
-   */
-  public CompressionCacheConfigDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Asserts that a member is successfully initialized with a compressed region when
    * a compressor is included in the region attributes.
-   * @throws Exception
    */
+  @Test
   public void testCreateCacheWithGoodCompressor() throws Exception {
     try {
       SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
+    } catch (Throwable t) { // TODO: use junit Assume
       // Not a supported OS
       return;
     }
@@ -80,8 +83,8 @@ public class CompressionCacheConfigDUnitTest extends CacheTestCase {
   /**
    * Asserts that member initialization fails when an unrecognized compressor is declared in the
    * cache.xml.
-   * @throws Exception
    */
+  @Test
   public void testCreateCacheWithBadCompressor() throws Exception {
     IgnoredException.addIgnoredException("Unable to load class BAD_COMPRESSOR");
     File cacheXml = createCacheXml(BAD_COMPRESSOR);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
index f6f7eac..f649d9a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
+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.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
@@ -40,7 +49,8 @@ import com.gemstone.gemfire.test.dunit.VM;
  * Asserts that values received in EntryEvents for CacheWriters and CacheListeners are not compressed.
  * 
  */
-public class CompressionCacheListenerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CompressionCacheListenerDUnitTest extends JUnit4CacheTestCase {
   /**
    * The name of our test region.
    */
@@ -156,8 +166,8 @@ public class CompressionCacheListenerDUnitTest extends CacheTestCase {
    * @param name
    *          a test name.
    */
-  public CompressionCacheListenerDUnitTest(String name) {
-    super(name);
+  public CompressionCacheListenerDUnitTest() {
+    super();
   }
 
   @Override
@@ -219,6 +229,7 @@ public class CompressionCacheListenerDUnitTest extends CacheTestCase {
   /**
    * Tests CacheWriter and CacheListener events on the test vm.
    */
+  @Test
   public void testCacheListenerAndWriter() {
     testCacheListenerAndWriterWithVM(getVM(TEST_VM));
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
index e42a801..ddf814e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
@@ -16,30 +16,21 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.compression.SnappyCompressor;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 @SuppressWarnings("serial")
-public class CompressionCacheListenerOffHeapDUnitTest extends
-    CompressionCacheListenerDUnitTest {
-
-  public CompressionCacheListenerOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
-  public static void caseSetUp() {
-    System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "trackOffHeapRefCounts", "true");
-  }
-  public static void caseTearDown() {
-    System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "trackOffHeapRefCounts");
-  }
+@Category(DistributedTest.class)
+public class CompressionCacheListenerOffHeapDUnitTest extends CompressionCacheListenerDUnitTest {
 
   @Override
   public final void preTearDownAssertions() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
index 58cb117..93c8c00 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
+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.IOException;
 
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -41,7 +50,8 @@ import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
  * Sanity checks on a number of basic cluster configurations with compression turned on.
  * 
  */
-public class CompressionRegionConfigDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CompressionRegionConfigDUnitTest extends JUnit4CacheTestCase {
   /**
    * The name of our test region.
    */
@@ -66,14 +76,15 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
    * Creates a new CompressionRegionOperationsDUnitTest.
    * @param name a test name.
    */
-  public CompressionRegionConfigDUnitTest(String name) {
-    super(name);
+  public CompressionRegionConfigDUnitTest() {
+    super();
   }
 
   /**
    * Sanity check using two peers sharing a replicated region.
    * @throws Exception
    */
+  @Test
   public void testReplicateRegion() throws Exception {
     Compressor compressor = null;
     try {
@@ -94,6 +105,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
    * Sanity check for two peers sharing a persisted replicated region.
    * @throws Exception
    */
+  @Test
   public void testReplicatePersistentRegion() throws Exception {
     Compressor compressor = null;
     try {
@@ -116,6 +128,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
   /**
    * Sanity check for two peers hosting a partitioned region.
    */
+  @Test
   public void testPartitionedRegion() {
     Compressor compressor = null;
     try {
@@ -135,6 +148,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
   /**
    * Sanity check for two peers hosting a persistent partitioned region.
    */
+  @Test
   public void testPartitionedPersistentRegion() {
     Compressor compressor = null;
     try {
@@ -157,6 +171,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
   /**
    * Sanity check for a non caching client and a cache server.
    */
+  @Test
   public void testClientProxyRegion() {
     Compressor compressor = null;
     try {
@@ -177,6 +192,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
   /**
    * Sanity check for a caching client and a cache server.
    */
+  @Test
   public void testCachingClientProxyRegion() {
     Compressor compressor = null;
     try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
index 9f8d228..43f7d23 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
+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.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache30.CacheTestCase;
@@ -29,7 +38,8 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  * Tests that the compressor region attribute is properly set or rejected by a RegionFactory.
  */
-public class CompressionRegionFactoryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CompressionRegionFactoryDUnitTest extends JUnit4CacheTestCase {
   /**
    * Compressed region name.
    */
@@ -49,14 +59,15 @@ public class CompressionRegionFactoryDUnitTest extends CacheTestCase {
    * Creates a new CompressionRegionFactoryDUnitTest.
    * @param name test name.
    */
-  public CompressionRegionFactoryDUnitTest(String name) {
-    super(name);
+  public CompressionRegionFactoryDUnitTest() {
+    super();
   }
   
   /**
    * Asserts that a region is created when a valid compressor is used.
    * Asserts that the region attributes contain the correct compressor value. 
    */
+  @Test
   public void testRegionFactoryCompressor() {
     Compressor compressor = null;
     try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
index dedf3eb..1f56859 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
@@ -16,14 +16,18 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
+import static org.junit.Assert.*;
+
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.compression.Compressor;
 import com.gemstone.gemfire.compression.SnappyCompressor;
 import com.gemstone.gemfire.internal.cache.CachedDeserializableFactory;
@@ -32,12 +36,14 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests basic region operations with compression enabled.
- * 
  */
-public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CompressionRegionOperationsDUnitTest extends JUnit4CacheTestCase {
   /**
    * The name of our test region.
    */
@@ -119,14 +125,6 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
     getAllCollection.add(KEY_3);
   }
   
-  /**
-   * Creates a new CompressionRegionOperationsDUnitTest.
-   * @param name a test name.
-   */
-  public CompressionRegionOperationsDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     createRegion();
@@ -177,6 +175,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
   /**
    * Invokes basic get/put operations tests on the test vm.
    */
+  @Test
   public void testGetPutOperations() {
     testGetPutOperationsOnVM(getVM(TEST_VM));
   }
@@ -244,6 +243,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
   /**
    * Invokes key, value operations using the test VM.
    */
+  @Test
   public void testKeysAndValuesOperations() {
     testKeysAndValuesOperationsOnVM(getVM(TEST_VM));
   }
@@ -334,6 +334,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
    * Tests compressed put/get region operations using CachedDeserializable values.
    * @see CompressionRegionOperationsDUnitTest#testGetPutOperations()
    */
+  @Test
   public void testGetPutOperationsWithCachedDeserializable() {
     testGetPutOperationsWithCachedDeserializableOnVM(getVM(TEST_VM));
   }
@@ -403,6 +404,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
    * Tests compressed put/get region operations using byte[] values.
    * @see CompressionRegionOperationsDUnitTest#testGetPutOperations()
    */
+  @Test
   public void testGetPutOperationsWithByteArrays() {
     testGetPutOperationsWithByteArraysOnVM(getVM(TEST_VM));
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
index 7e15b12..16398a7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
@@ -16,22 +16,22 @@
  */
 package com.gemstone.gemfire.internal.compression;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.compression.Compressor;
 import com.gemstone.gemfire.compression.SnappyCompressor;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import java.util.Properties;
+@Category(DistributedTest.class)
+public class CompressionRegionOperationsOffHeapDUnitTest extends CompressionRegionOperationsDUnitTest {
 
-public class CompressionRegionOperationsOffHeapDUnitTest extends
-    CompressionRegionOperationsDUnitTest {
-
-  public CompressionRegionOperationsOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionStatsDUnitTest.java
index 9f6dbf5..2f99ffd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionStatsDUnitTest.java
@@ -17,6 +17,15 @@
 
 package com.gemstone.gemfire.internal.compression;
 
+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 com.gemstone.gemfire.cache.DataPolicy;
@@ -35,7 +44,8 @@ import com.gemstone.gemfire.test.dunit.VM;
  * Tests compression statistics.
  * @since GemFire 8.0
  */
-public class CompressionStatsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CompressionStatsDUnitTest extends JUnit4CacheTestCase {
   /**
    * The name of our test region.
    */
@@ -62,8 +72,8 @@ public class CompressionStatsDUnitTest extends CacheTestCase {
    * Creates a new CompressionStatsDUnitTest.
    * @param name test name.
    */
-  public CompressionStatsDUnitTest(String name) {
-    super(name);
+  public CompressionStatsDUnitTest() {
+    super();
   }
 
   /**
@@ -270,6 +280,7 @@ public class CompressionStatsDUnitTest extends CacheTestCase {
   /**
    * Asserts that compression stats are functioning properly.
    */
+  @Test
   public void testCompressionStats() {
     VM vm = Host.getHost(0).getVM(TEST_VM);
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
index 01343f5..abcca13 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
@@ -23,31 +23,31 @@
 package com.gemstone.gemfire.internal.datasource;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import com.gemstone.gemfire.util.test.TestUtil;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
+import java.sql.Connection;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 import javax.naming.Context;
 import javax.sql.PooledConnection;
 import javax.sql.XAConnection;
 import javax.transaction.xa.XAResource;
-import java.sql.Connection;
-import java.util.*;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-/**
- */
 @Category(IntegrationTest.class)
 public class AbstractPoolCacheJUnitTest {
 
@@ -74,67 +74,38 @@ public class AbstractPoolCacheJUnitTest {
 
   @Test
   public void testGetSimpleDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
-          .lookup("java:/SimpleDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-          fail("DataSourceFactoryTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception thrown in testGetSimpleDataSource due to " + e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
+        .lookup("java:/SimpleDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+        fail("DataSourceFactoryTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
   }
 
   /**
-   * Test of closeActiveConnection method, of class
-   * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
-   */
-  /*
-   * @Test
-  public void testCloseActiveConnection() { try { Context ctx =
-   * cache.getJNDIContext(); GemFireConnPooledDataSource ds =
-   * (GemFireConnPooledDataSource) ctx .lookup("java:/PooledDataSource");
-   * GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-   * .getConnectionProvider(); ConnectionPoolCacheImpl poolCache =
-   * (ConnectionPoolCacheImpl) provider .getConnectionPoolCache();
-   * PooledConnection conn = poolCache.getPooledConnectionFromPool();
-   * poolCache.closeActiveConnection(conn); if
-   * (poolCache.activeCache.containsKey(conn)) fail("close active connection
-   * failed"); } catch (Exception e) { e.printStackTrace(); } }
-   */
-  /**
    * Test of returnPooledConnectionToPool method, of class
    * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
    */
   @Test
-  public void testReturnPooledConnectionToPool() {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-          .getConnectionProvider();
-      ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
-          .getConnectionPoolCache();
-      PooledConnection conn = (PooledConnection) poolCache
-          .getPooledConnectionFromPool();
-      if (poolCache.availableCache.containsKey(conn))
-          fail("connection not removed from available cache list");
-      if (!poolCache.activeCache.containsKey(conn))
-          fail("connection not put in active connection list");
-      provider.returnConnection(conn);
-      if (!poolCache.availableCache.containsKey(conn))
-          fail("connection not returned to pool");
-      if (poolCache.activeCache.containsKey(conn))
-          fail("connection not returned to active list");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testReturnPooledConnectionToPool due to " + e);
-      e.printStackTrace();
-    }
+  public void testReturnPooledConnectionToPool() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
+        .getConnectionProvider();
+    ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
+        .getConnectionPoolCache();
+    PooledConnection conn = (PooledConnection) poolCache
+        .getPooledConnectionFromPool();
+    if (poolCache.availableCache.containsKey(conn))
+        fail("connection not removed from available cache list");
+    if (!poolCache.activeCache.containsKey(conn))
+        fail("connection not put in active connection list");
+    provider.returnConnection(conn);
+    if (!poolCache.availableCache.containsKey(conn))
+        fail("connection not returned to pool");
+    if (poolCache.activeCache.containsKey(conn))
+        fail("connection not returned to active list");
   }
 
   /**
@@ -142,26 +113,20 @@ public class AbstractPoolCacheJUnitTest {
    * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
    */
   @Test
-  public void testValidateConnection() {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-          .getConnectionProvider();
-      ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
-          .getConnectionPoolCache();
-      PooledConnection poolConn = (PooledConnection) poolCache
-          .getPooledConnectionFromPool();
-      Connection conn = poolConn.getConnection();
-      if (!ds.validateConnection(conn)) fail("validate connection failed");
-      conn.close();
-      if (ds.validateConnection(conn)) fail("validate connection failed");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testValidateConnection due to " + e);
-      e.printStackTrace();
-    }
+  public void testValidateConnection() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
+        .getConnectionProvider();
+    ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
+        .getConnectionPoolCache();
+    PooledConnection poolConn = (PooledConnection) poolCache
+        .getPooledConnectionFromPool();
+    Connection conn = poolConn.getConnection();
+    if (!ds.validateConnection(conn)) fail("validate connection failed");
+    conn.close();
+    if (ds.validateConnection(conn)) fail("validate connection failed");
   }
 
   /**
@@ -169,28 +134,22 @@ public class AbstractPoolCacheJUnitTest {
    * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
    */
   @Test
-  public void testGetPooledConnectionFromPool() {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-          .getConnectionProvider();
-      ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
-          .getConnectionPoolCache();
-      PooledConnection poolConn = (PooledConnection) poolCache
-          .getPooledConnectionFromPool();
-      if (poolConn == null)
-          fail("getPooledConnectionFromPool failed to get a connection from pool");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetPooledConnectionFromPool due to " + e);
-      e.printStackTrace();
-    }
+  public void testGetPooledConnectionFromPool() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
+        .getConnectionProvider();
+    ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
+        .getConnectionPoolCache();
+    PooledConnection poolConn = (PooledConnection) poolCache
+        .getPooledConnectionFromPool();
+    if (poolConn == null)
+        fail("getPooledConnectionFromPool failed to get a connection from pool");
   }
 
   @Test
-  public void testCleanUp() {
+  public void testCleanUp() throws Exception {
     cache.close();
     ds1.disconnect();
   }
@@ -199,48 +158,41 @@ public class AbstractPoolCacheJUnitTest {
    * Tests if an XAresource obtained from an XAConnection which is already
    * closed , can return null or not.
    */
+  @Ignore("TODO: test used to eat its own exception and it fails")
   @Test
-  public void testEffectOfBlockingTimeoutOnXAConnection()
-  {
-    try {
-      Map map = new HashMap();
-      map.put("init-pool-size", "2");
-      map.put("jndi-name", "TestXAPooledDataSource");
-      map.put("max-pool-size", "7");
-      map.put("idle-timeout-seconds", "20");
-      map.put("blocking-timeout-seconds", "2");
-      map.put("login-timeout-seconds", "5");
-      //map.put("xa-datasource-class","org.apache.derby.jdbc.EmbeddedXADataSource");
-      map.put("jdbc-driver-class", "org.apache.derby.jdbc.EmbeddedDriver");
-      map.put("user-name", "mitul");
-      map.put("password", "83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a");
-      map.put("connection-url", "jdbc:derby:newDB;create=true");
-      List props = new ArrayList();
-      props
-          .add(new ConfigProperty("databaseName", "newDB", "java.lang.String"));
-
-      GemFireBasicDataSource gbds = (GemFireBasicDataSource)DataSourceFactory
-          .getSimpleDataSource(map, props);
-      map.put("xa-datasource-class",
-          "org.apache.derby.jdbc.EmbeddedXADataSource");
-
-      map.put("connection-url", "jdbc:derby:newDB;create=true");
-
-      GemFireTransactionDataSource gtds = (GemFireTransactionDataSource)DataSourceFactory
-          .getTranxDataSource(map, props);
-
-      XAConnection xaconn = (XAConnection)gtds.provider.borrowConnection();
-      try { Thread.sleep(4); } catch (InterruptedException e) { fail("interrupted"); }
-      for (int i = 0; i < 1000; ++i) {
-        XAResource xar = xaconn.getXAResource();
-        System.out.println("XAResource=" + xar);
-        assertNotNull(xar);
-      }
-
-    }
-    catch (Exception ignore) {
-      // TODO Auto-generated catch block
-
+  public void testEffectOfBlockingTimeoutOnXAConnection() throws Exception {
+    Map map = new HashMap();
+    map.put("init-pool-size", "2");
+    map.put("jndi-name", "TestXAPooledDataSource");
+    map.put("max-pool-size", "7");
+    map.put("idle-timeout-seconds", "20");
+    map.put("blocking-timeout-seconds", "2");
+    map.put("login-timeout-seconds", "5");
+    //map.put("xa-datasource-class","org.apache.derby.jdbc.EmbeddedXADataSource");
+    map.put("jdbc-driver-class", "org.apache.derby.jdbc.EmbeddedDriver");
+    map.put("user-name", "mitul");
+    map.put("password", "83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a");
+    map.put("connection-url", "jdbc:derby:newDB;create=true");
+    List props = new ArrayList();
+    props
+        .add(new ConfigProperty("databaseName", "newDB", "java.lang.String"));
+
+    GemFireBasicDataSource gbds = (GemFireBasicDataSource)DataSourceFactory
+        .getSimpleDataSource(map, props);
+    map.put("xa-datasource-class",
+        "org.apache.derby.jdbc.EmbeddedXADataSource");
+
+    map.put("connection-url", "jdbc:derby:newDB;create=true");
+
+    GemFireTransactionDataSource gtds = (GemFireTransactionDataSource)DataSourceFactory
+        .getTranxDataSource(map, props);
+
+    XAConnection xaconn = (XAConnection)gtds.provider.borrowConnection();
+    try { Thread.sleep(4); } catch (InterruptedException e) { fail("interrupted"); }
+    for (int i = 0; i < 1000; ++i) {
+      XAResource xar = xaconn.getXAResource();
+      System.out.println("XAResource=" + xar);
+      assertNotNull(xar);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
index 8b6243d..768b0c0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
@@ -16,26 +16,24 @@
  */
 package com.gemstone.gemfire.internal.datasource;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import com.gemstone.gemfire.util.test.TestUtil;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.sql.Connection;
+import java.util.Properties;
+import javax.naming.Context;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import javax.naming.Context;
-import java.sql.Connection;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.fail;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-/*
- *  
- */
 @Category(IntegrationTest.class)
 public class DataSourceFactoryJUnitTest {
 
@@ -60,52 +58,34 @@ public class DataSourceFactoryJUnitTest {
 
   @Test
   public void testGetSimpleDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
-          .lookup("java:/SimpleDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryJUnitTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetSimpleDataSource due to "+e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
+        .lookup("java:/SimpleDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryJUnitTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
   }
 
   @Test
   public void testGetPooledDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryJUnitTest-testGetPooledDataSource() Error in creating the GemFireConnPooledDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetPooledDataSource due to "+e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryJUnitTest-testGetPooledDataSource() Error in creating the GemFireConnPooledDataSource");
   }
 
   @Test
   public void testGetTranxDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      //DataSourceFactory dsf = new DataSourceFactory();
-      //GemFireTransactionDataSource ds =
-      // (GemFireTransactionDataSource)dsf.getTranxDataSource(map);
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryJUnitTest-testGetTranxDataSource() Error in creating the getTranxDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetTranxDataSource due to "+e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    //DataSourceFactory dsf = new DataSourceFactory();
+    //GemFireTransactionDataSource ds =
+    // (GemFireTransactionDataSource)dsf.getTranxDataSource(map);
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryJUnitTest-testGetTranxDataSource() Error in creating the getTranxDataSource");
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
index c056a5d..216e4b0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
@@ -16,20 +16,27 @@
  */
 package com.gemstone.gemfire.internal.jta;
 
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.*;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import javax.transaction.*;
 import java.util.Properties;
+import javax.transaction.NotSupportedException;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.UserTransaction;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.fail;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Check if the correct expectations are being thrown when they are supposed to.
- * 
  */
 @Category(IntegrationTest.class)
 public class ExceptionJUnitTest {
@@ -59,10 +66,6 @@ public class ExceptionJUnitTest {
     utx = new UserTransactionImpl();
   }
 
-  @After
-  public void tearDown() {
-  }
-
   @Test
   public void testNestedTransactionNotSupported() throws Exception {
     try {


[18/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
index 426d0ca..977b2bd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
@@ -16,7 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
-import static com.gemstone.gemfire.internal.lang.ThrowableUtils.getRootCause;
+import static com.gemstone.gemfire.internal.lang.ThrowableUtils.*;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.util.Set;
@@ -24,6 +25,9 @@ import java.util.TreeSet;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.admin.AdminDistributedSystemFactory;
 import com.gemstone.gemfire.admin.AdminException;
@@ -32,58 +36,41 @@ import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheClosedException;
-import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.EntryEvent;
 import com.gemstone.gemfire.cache.EvictionAction;
 import com.gemstone.gemfire.cache.EvictionAttributes;
-import com.gemstone.gemfire.cache.MirrorType;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionDestroyedException;
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache.EntryEvent;
-import com.gemstone.gemfire.cache.PartitionAttributesFactory;
-import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.admin.remote.ShutdownAllRequest;
 import com.gemstone.gemfire.internal.cache.DiskRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.PutAllPartialResultException;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserver;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
-import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the basic use cases for PR persistence.
- *
  */
-public class ShutdownAllDUnitTest extends CacheTestCase {
-  protected static HangingCacheListener listener;
+@Category(DistributedTest.class)
+public class ShutdownAllDUnitTest extends JUnit4CacheTestCase {
 
+  private static HangingCacheListener listener;
 
-  final String expectedExceptions = InternalGemFireError.class.getName()+"||ShutdownAllRequest: disconnect distributed without response";
+  private static final String expectedExceptions = InternalGemFireError.class.getName()+"||ShutdownAllRequest: disconnect distributed without response";
 
-  public ShutdownAllDUnitTest(String name) {
-    super(name);
-  }
-  /**
-   * 
-   */
   private static final int MAX_WAIT = 600 * 1000;
   
   @Override
@@ -91,9 +78,10 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
     //Get rid of any existing distributed systems. We want
     //to make assertions about the number of distributed systems
     //we shut down, so we need to start with a clean slate.
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
 
+  @Test
   public void testShutdownAll2Servers() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -136,6 +124,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
     checkData(vm0, numBuckets, 113, "b", "region");
   }
 
+  @Test
   public void testShutdownAllWithEncounterIGE1() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -161,6 +150,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
     vm0.invoke(removeExceptionTag1(expectedExceptions));
   }
 
+  @Test
   public void testShutdownAllWithEncounterIGE2() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -198,6 +188,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
     vm1.invoke(removeExceptionTag1(expectedExceptions));
   }
 
+  @Test
   public void testShutdownAllOneServerAndRecover() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -219,6 +210,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
     createData(vm0, 1, 10, "b", "region");
   }
 
+  @Test
   public void testPRWithDR() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -244,6 +236,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
     checkData(vm0, 0, 1, "c", "region_dr");
   }
   
+  @Test
   public void testShutdownAllFromServer() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -282,6 +275,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
   }
   
   // shutdownAll, then restart to verify
+  @Test
   public void testCleanStop() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -326,6 +320,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
   }
 
   // shutdownAll, then restart to verify
+  @Test
   public void testCleanStopWithConflictCachePort() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -364,6 +359,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
   }
   
   /*
+  @Test
   public void testStopNonPersistRegions() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -388,6 +384,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
   }
   */
 
+  @Test
   public void testMultiPRDR() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -428,6 +425,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
   }
 
 
+  @Test
   public void testShutdownAllTimeout() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -523,6 +521,7 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
    * members waiting on recovery.
    * @throws Throwable
    */
+  @Test
   public void testShutdownAllWithMembersWaiting() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationManyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationManyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationManyDUnitTest.java
index abc088a..fc7bed3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationManyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationManyDUnitTest.java
@@ -19,6 +19,15 @@
 //
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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 java.util.Iterator;
 import java.util.List;
@@ -47,7 +56,8 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class StreamingPartitionOperationManyDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class StreamingPartitionOperationManyDUnitTest extends JUnit4CacheTestCase {
 
 	/* SerializableRunnable object to create a PR */
 	CacheSerializableRunnable createPrRegionWithDS_DACK = new CacheSerializableRunnable("createPrRegionWithDS") {
@@ -66,10 +76,11 @@ public class StreamingPartitionOperationManyDUnitTest extends CacheTestCase {
 	};
 
 
-  public StreamingPartitionOperationManyDUnitTest(String name) {
-    super(name);
+  public StreamingPartitionOperationManyDUnitTest() {
+    super();
   }
 
+  @Test
   public void testStreamingManyProvidersNoExceptions() throws Exception {
 //    final String name = this.getUniqueName();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationOneDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationOneDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationOneDUnitTest.java
index f5e0b71..d4a4fa5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationOneDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/StreamingPartitionOperationOneDUnitTest.java
@@ -20,6 +20,15 @@
 //
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.util.ArrayList;
 import java.util.Collections;
@@ -51,7 +60,8 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class StreamingPartitionOperationOneDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class StreamingPartitionOperationOneDUnitTest extends JUnit4CacheTestCase {
 
 	/* SerializableRunnable object to create PR */
 	CacheSerializableRunnable createPrRegionWithDS_DACK = new CacheSerializableRunnable("createPrRegionWithDS") {
@@ -76,10 +86,11 @@ public class StreamingPartitionOperationOneDUnitTest extends CacheTestCase {
   }
 
 
-  public StreamingPartitionOperationOneDUnitTest(String name) {
-    super(name);
+  public StreamingPartitionOperationOneDUnitTest() {
+    super();
   }
 
+  @Test
   public void testStreamingPartitionOneProviderNoExceptions() throws Exception {
 //    final String name = this.getUniqueName();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
index 3fcd791..12aabc8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned.fixed;
 
+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 java.util.List;
 
@@ -36,10 +45,11 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * This Dunit test class have multiple tests to tests different validations of
  * static partitioning
  */
+@Category(DistributedTest.class)
 public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
 
-  public FixedPartitioningDUnitTest(String name) {
-    super(name);
+  public FixedPartitioningDUnitTest() {
+    super();
   }
 
   private static final long serialVersionUID = 1L;
@@ -57,6 +67,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * This test validates that null partition name cannot be added in
    * FixedPartitionAttributes
    */
+  @Test
   public void testNullPartitionName() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -83,6 +94,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * 
    */
 
+  @Test
   public void testSamePartitionNameTwice() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -110,6 +122,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * This test validates that FixedPartitionAttributes cannot be defined for
    * accessor nodes
    */
+  @Test
   public void testFixedPartitionAttributes_Accessor() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -139,6 +152,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * condition is not met.
    */
 
+  @Test
   public void testSamePartitionName_Primary_OnTwoMembers() {
     IgnoredException ex = IgnoredException.addIgnoredException("DuplicatePrimaryPartitionException");
     try {
@@ -181,6 +195,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * the nodes then illegalStateException will be thrown
    */
 
+  @Test
   public void testSamePartitionName_DifferentNumBuckets() {
     IgnoredException ex = IgnoredException.addIgnoredException("IllegalStateException");
     try {
@@ -222,6 +237,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * if this condition is not met.
    */
 
+  @Test
   public void testNumberOfPartitions() {
     IgnoredException expected = IgnoredException.addIgnoredException("IllegalStateException");
     try {
@@ -278,6 +294,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * greater than totalNumBuckets.
    */
 
+  @Test
   public void testNumBuckets_totalNumBuckets() {
     IgnoredException expected = IgnoredException.addIgnoredException("IllegalStateException");
     try {
@@ -323,6 +340,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * This test validates that if the required partition is not available at the
    * time of entry operation then PartitionNotAvailabelException is thrown
    */
+  @Test
   public void testPut_PartitionNotAvailableException() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -360,6 +378,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * partition attributes defined
    */
   
+  @Test
   public void test_DataStoreWithoutPartition_DataStoreWithPartition() {
     IgnoredException expected = IgnoredException.addIgnoredException("IllegalStateException");
     try {
@@ -390,6 +409,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * partition attributes defined
    */
 
+  @Test
   public void test_DataStoreWithPartition_DataStoreWithoutPartition() {
     IgnoredException expected = IgnoredException.addIgnoredException("IllegalStateException");
     try {
@@ -418,6 +438,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * This tests validate that accessor member does the put on datastores as per
    * primary FixedPartitionAttributes defined on datastores
    */
+  @Test
   public void testPut_ValidateDataOnMember_OnlyPrimary_Accessor() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     member1.invoke(() -> FixedPartitioningTestBase.createRegionWithPartitionAttributes( "Quarter", null, 0, 0, 12,
@@ -454,6 +475,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
   }
 
   @Category(FlakyTest.class) // GEODE-567: async actions, waitForCriterion, time sensitive, non-thread-safe test hook, eats exceptions (partially fixed)
+  @Test
   public void testBug43283() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     member2.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -527,6 +549,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * datastores.
    */
   
+  @Test
   public void testPut_ValidateDataOnMember_OnlyPrimary_Datastore() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -574,6 +597,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * This test validate that a delete operation on empty region will throw
    * EntryNotFoundException
    */
+  @Test
   public void testDelete_WithoutPut() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -626,6 +650,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * datastores. But No resolver is provided. So IllegalStateException in expected
    */
   
+  @Test
   public void testPut_NoResolver() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -673,6 +698,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * datastores. here CallBack implements FixedPartitionResolver.
    */
   
+  @Test
   public void testPut_CallBackWithResolver() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -721,6 +747,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * FixedPartitionResolver will do custom partitioning as per resolver.
    */
   
+  @Test
   public void testPut_WithResolver_NoFPAs() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     member1.invoke(() -> FixedPartitioningTestBase.createRegionWithPartitionAttributes( "Quarter", null, 0, 40, 12,
@@ -751,6 +778,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    */
   
   
+  @Test
   public void testPut_FixedPartitionResolver_NoResolver() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -800,6 +828,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * IllegalStateException is expected.
    */
   
+  @Test
   public void testPut_FixedPartitionResolver_PartitionResolver() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -847,6 +876,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * datastores with only one bucket per partition.  
    */
 
+  @Test
   public void testFPR_DefaultNumBuckets() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -894,6 +924,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * primary and secondary FixedPartitionAttributes defined on datastores.
    */
   
+  @Test
   public void testPut_ValidateDataOnMember_PrimarySecondary_Accessor() {
     createCacheOnMember();
     createRegionWithPartitionAttributes("Quarter", null, 3, 0, 12,
@@ -964,6 +995,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * datastores.
    */
   
+  @Test
   public void testPut_ValidateDataOnMember_PrimarySecondary_Datastore() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -1026,6 +1058,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * 
    */
   
+  @Test
   public void testPut_ValidateDataOnMember_OnlySecondary_Datastore() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -1105,6 +1138,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    *        
    * 
    */
+  @Test
   public void testPut_ValidateDataOnMember_PrimarySecondary_Accessor_CacheClosed() {
     createCacheOnMember();
     createRegionWithPartitionAttributes("Quarter", null, 3, 0, 12,
@@ -1213,6 +1247,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * Member4 =       Q4(9,10,11)            Q1(0,1,2)
    */
   
+  @Test
   public void testPut_ValidateDataOnMember_PrimarySecondary_Datastore_CacheClosed() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -1294,6 +1329,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
     member4.invoke(() -> FixedPartitioningTestBase.checkPrimaryBucketsForQuarter( 6, 3 ));
   }
   
+  @Test
   public void test_Bug46619_Put_ValidateDataOnMember_PrimarySecondary_Datastore_CacheClosed() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember_DisableMovePrimary());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -1416,6 +1452,7 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
    * 
    */
   
+  @Test
   public void testPut_ValidateDataOnMember_MultiplePrimaries_Datastore_CacheClosed() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
index cbef135..8a1a49c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
@@ -16,8 +16,32 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned.fixed;
 
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.FixedPartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionResolver;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.control.RebalanceOperation;
 import com.gemstone.gemfire.cache.control.RebalanceResults;
 import com.gemstone.gemfire.cache.control.ResourceManager;
@@ -26,31 +50,35 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.internal.cache.*;
-import com.gemstone.gemfire.internal.cache.execute.data.*;
+import com.gemstone.gemfire.internal.cache.FixedPartitionAttributesImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
+import com.gemstone.gemfire.internal.cache.PartitionRegionConfig;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper;
+import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.Customer;
 import com.gemstone.gemfire.internal.cache.execute.data.Order;
+import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.execute.data.Shipment;
+import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
 import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserver;
 import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverAdapter;
 import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is the base class to do operations
  */
+@Category(DistributedTest.class)
+public class FixedPartitioningTestBase extends JUnit4DistributedTestCase {
 
-public class FixedPartitioningTestBase extends DistributedTestCase {
-
-  private static final long serialVersionUID = 1L;
-  
-  protected static String Quarter1 = "Q1";  
+  protected static String Quarter1 = "Q1";
   protected static String Quarter2 = "Q2";
   protected static String Quarter3 = "Q3";
   protected static String Quarter4 = "Q4";
@@ -95,17 +123,17 @@ public class FixedPartitioningTestBase extends DistributedTestCase {
     OCT, NOV, DEC
   };
 
-  public FixedPartitioningTestBase(String name) {
-    super(name);
+  public FixedPartitioningTestBase() {
+    super();
   }
 
   public static void createCacheOnMember() {
-    new FixedPartitioningTestBase("Temp").createCache();
+    new FixedPartitioningTestBase().createCache();
   }
 
   public static void createCacheOnMember_DisableMovePrimary() {
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_MOVE_PRIMARIES_ON_STARTUP", "true");
-    new FixedPartitioningTestBase("Temp").createCache();
+    new FixedPartitioningTestBase().createCache();
   }
   
   private void createCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
index b508b56..bfccf52 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned.fixed;
 
+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 java.util.List;
 
@@ -25,11 +34,12 @@ import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Wait;
 
+@Category(DistributedTest.class)
 public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
     FixedPartitioningTestBase {
 
-  public FixedPartitioningWithColocationAndPersistenceDUnitTest(String name) {
-    super(name);
+  public FixedPartitioningWithColocationAndPersistenceDUnitTest() {
+    super();
   }
 
   private static final long serialVersionUID = 1L;
@@ -49,6 +59,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * 
    */
 
+  @Test
   public void testColocation_WithFPROnChildRegion() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -90,6 +101,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * 
    */
 
+  @Test
   public void testColocation_FPRs_ChildUsingAttributesOfParent() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -203,6 +215,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
     }
   }
 
+  @Test
   public void testColocation_FPR_Persistence_ChildUsingAttributesOfParent() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -321,6 +334,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * scenario,
    */
 
+  @Test
   public void testColocation_FPRs_ChildUsingAttributesOfParent_HA() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -479,6 +493,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
     }
   }
 
+  @Test
   public void testColocation_FPR_Persistence_ChildUsingAttributesOfParent_HA() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -641,6 +656,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * Tests validate the behavior of FPR with persistence when one member is kept
    * alive and other members goes down and come up
    */
+  @Test
   public void testFPR_Persistence_OneMemberAlive() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -706,6 +722,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * down and comes up.
    * 
    */
+  @Test
   public void testFPR_Persistence() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -780,6 +797,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * Tests validate the behavior of FPR with persistence and with colocation
    * when one member is kept alive and other members goes down and come up
    */
+  @Test
   public void testColocation_FPR_Persistence_Colocation_OneMemberAlive() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -886,6 +904,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * 
    */
 
+  @Test
   public void testColocation_FPR_Persistence_Colocation() {
     try {
       member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
@@ -964,6 +983,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
     }
   }
 
+  @Test
   public void testFPR_Persistence2() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -1026,6 +1046,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
     member2.invoke(() -> FixedPartitioningTestBase.checkPrimaryBucketsForQuarter( 6, 6 ));
   }
 
+  @Test
   public void testFPR_Persistence3() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     FixedPartitionAttributes fpa1 = FixedPartitionAttributes
@@ -1143,6 +1164,7 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
    * cache is closed respectively. Member2 is brought back and persisted data is
    * verified.
    */
+  @Test
   public void testPR_Persistence() {
     member1.invoke(() -> FixedPartitioningTestBase.createCacheOnMember());
     member1.invoke(() -> FixedPartitioningTestBase.createRegionWithPartitionAttributes( "Quarter", null,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/BackupInspectorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/BackupInspectorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/BackupInspectorJUnitTest.java
index dbb58bc..54c1f61 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/BackupInspectorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/BackupInspectorJUnitTest.java
@@ -35,14 +35,7 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * TODO: fails when running integrationTest from gradle command-line on Windows 7
- * 
-com.gemstone.gemfire.internal.cache.DiskRegionJUnitTest > testAssertionErrorIfMissingOplog FAILED
-    junit.framework.AssertionFailedError
-        at junit.framework.Assert.fail(Assert.java:55)
-        at junit.framework.Assert.assertTrue(Assert.java:22)
-        at junit.framework.Assert.assertTrue(Assert.java:31)
-        at com.gemstone.gemfire.internal.cache.DiskRegionJUnitTest.testAssertionErrorIfMissingOplog(DiskRegionJUnitTest.java:2630)
- * 
+ *
  * Tests for the BackupInspector.
  */
 @Category(IntegrationTest.class)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java
index 7e0fb44..f7c011d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.persistence;
 
+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.ByteArrayInputStream;
 import java.io.DataInputStream;
 import java.io.File;
@@ -25,8 +34,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import util.TestException;
-
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -76,12 +83,13 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
+@Category(DistributedTest.class)
 public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase {
   
   private static final int TEST_REPLICATED_TOMBSTONE_TIMEOUT = 1000;
 
-  public PersistentRVVRecoveryDUnitTest(String name) {
-    super(name);
+  public PersistentRVVRecoveryDUnitTest() {
+    super();
   }
   
   @Override
@@ -89,6 +97,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
     Invoke.invokeInEveryVM(PersistentRecoveryOrderDUnitTest.class, "resetAckWaitThreshold");
   }
   
+  @Test
   public void testNoConcurrencyChecks () {
     Cache cache = getCache();
     RegionFactory rf = new RegionFactory();
@@ -106,6 +115,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
    * Test that we can recover the RVV information with some normal
    * usage.
    */
+  @Test
   public void testRecoveryWithKRF() throws Throwable {
     doTestRecovery(new Runnable() {
       @Override
@@ -118,6 +128,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
   /**
    * Test that we can recover the RVV information if the krf is missing
    */
+  @Test
   public void testRecoveryWithoutKRF() throws Throwable {
     doTestRecovery(new Runnable() {
       @Override
@@ -134,6 +145,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
   /**
    * Test that we correctly recover and expire recovered tombstones, with compaction enabled
    */
+  @Test
   public void testLotsOfTombstones() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -339,6 +351,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
    * then it must not get applied. Which is Bug #45921.
    *
    */
+  @Test
   public void testConflictChecksDuringConcurrentDeltaGIIAndOtherOp() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -402,7 +415,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
     try {
       async.join(3000);
     } catch (InterruptedException e) {
-      new TestException("VM1 entry destroy did not finish in 3000 ms");
+      new AssertionError("VM1 entry destroy did not finish in 3000 ms");
     }
 
     vm1.invoke(new CacheSerializableRunnable("Verifying entry version in new node VM1") {
@@ -531,6 +544,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
    * Test that we skip conflict checks with entries that are on
    * disk compared to entries that come in as part of a GII
    */
+  @Test
   public void testSkipConflictChecksForGIIdEntries() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -580,6 +594,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
    * Test that we skip conflict checks with entries that are on
    * disk compared to entries that come in as part of a concurrent operation
    */
+  @Test
   public void testSkipConflictChecksForConcurrentOps() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -653,6 +668,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
    * Test that with concurrent updates to an async disk region,
    * we correctly update the RVV On disk
    */
+  @Test
   public void testUpdateRVVWithAsyncPersistence() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(1);
@@ -736,6 +752,7 @@ public class PersistentRVVRecoveryDUnitTest extends PersistentReplicatedTestBase
    * Test that when we generate a krf, we write the version tag
    * that matches the entry in the crf.
    */
+  @Test
   public void testWriteCorrectVersionToKrf() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
index dabdd3c..b61cd25 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
@@ -16,12 +16,41 @@
  */
 package com.gemstone.gemfire.internal.cache.persistence;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.internal.lang.ThrowableUtils.*;
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.admin.AdminDistributedSystem;
 import com.gemstone.gemfire.admin.AdminDistributedSystemFactory;
 import com.gemstone.gemfire.admin.AdminException;
 import com.gemstone.gemfire.admin.DistributedSystemConfig;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.persistence.ConflictingPersistentDataException;
 import com.gemstone.gemfire.cache.persistence.PersistentID;
 import com.gemstone.gemfire.cache.persistence.PersistentReplicatesOfflineException;
@@ -37,36 +66,36 @@ import com.gemstone.gemfire.internal.HeapDataOutputStream;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.cache.AbstractUpdateOperation.AbstractUpdateMessage;
 import com.gemstone.gemfire.internal.cache.DestroyRegionOperation.DestroyRegionMessage;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.DiskRegion;
+import com.gemstone.gemfire.internal.cache.DiskRegionStats;
+import com.gemstone.gemfire.internal.cache.DistributedRegion;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMessage;
+import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.TXManagerImpl;
 import com.gemstone.gemfire.internal.cache.versions.RegionVersionHolder;
 import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector;
-import com.gemstone.gemfire.test.dunit.*;
-import org.junit.Ignore;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static com.gemstone.gemfire.internal.lang.ThrowableUtils.getRootCause;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is a test of how persistent distributed
  * regions recover. This test makes sure that when
  * multiple VMs are persisting the same region, they recover
  * with the latest data during recovery.
- * 
- *
  */
+@Category(DistributedTest.class)
 public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBase {
-  public PersistentRecoveryOrderDUnitTest(String name) {
-    super(name);
-  }
 
   public static void resetAckWaitThreshold() {
     if (SAVED_ACK_WAIT_THRESHOLD != null) {
@@ -77,9 +106,9 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
   /**
    * Tests to make sure that a persistent region will wait
    * for any members that were online when is crashed before starting up.
-   * @throws Throwable
    */
-  public void testWaitForLatestMember() throws Throwable {
+  @Test
+  public void testWaitForLatestMember() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -129,9 +158,10 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
   /**
    * Tests to make sure that we stop waiting for a member
    * that we revoke.
-   * @throws Throwable
+   * @throws Exception
    */
-  public void testRevokeAMember() throws Throwable {
+  @Test
+  public void testRevokeAMember() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -264,9 +294,10 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
   /**
    * Tests to make sure that we can revoke a member
    * before initialization, and that member will stay revoked
-   * @throws Throwable
+   * @throws Exception
    */
-  public void testRevokeAHostBeforeInitialization() throws Throwable {
+  @Test
+  public void testRevokeAHostBeforeInitialization() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -356,9 +387,10 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
 
   /**
    * Test which members show up in the list of members we're waiting on.
-   * @throws Throwable
+   * @throws Exception
    */
-  public void testWaitingMemberList() throws Throwable {
+  @Test
+  public void testWaitingMemberList() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -497,9 +529,10 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * A crashes.
    * B crashes.
    * B starts up. It should not wait for A.
-   * @throws Throwable
+   * @throws Exception
    */
-  public void testDontWaitForOldMember() throws Throwable {
+  @Test
+  public void testDontWaitForOldMember() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -528,9 +561,10 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * Tests that if two members crash simultaneously, they
    * negotiate which member should initialize with what is
    * on disk and which member should copy data from that member.
-   * @throws Throwable
+   * @throws Exception
    */
-  public void testSimultaneousCrash() throws Throwable {
+  @Test
+  public void testSimultaneousCrash() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -587,7 +621,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * AC are started, they should figure out who
    * has the latest data, without needing B. 
    */
-  public void testTransmitCrashedMembers() throws Throwable {
+  @Test
+  public void testTransmitCrashedMembers() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -630,7 +665,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * Tests that a persistent region cannot recover from 
    * a non persistent region.
    */
-  public void testRecoverFromNonPeristentRegion() throws Throwable {
+  @Test
+  public void testRecoverFromNonPeristentRegion() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -661,7 +697,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     checkForEntry(vm1);
   }
 
-  public void testFinishIncompleteInitializationNoSend() throws Throwable {
+  @Test
+  public void testFinishIncompleteInitializationNoSend() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -792,11 +829,13 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     return vm.invokeAsync(createRegion);
   }
 
-  public void testPersistConflictOperations() throws Throwable {
+  @Test
+  public void testPersistConflictOperations() throws Exception {
     doTestPersistConflictOperations(true);
   }
   
-  public void testPersistConflictOperationsAsync() throws Throwable {
+  @Test
+  public void testPersistConflictOperationsAsync() throws Exception {
     doTestPersistConflictOperations(false);
   }
 
@@ -808,7 +847,7 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * tag, while another member will persist both of the 2 operations.
    * Overall, their RVV should match after the operations.  
    */
-  public void doTestPersistConflictOperations(boolean diskSync) throws Throwable {
+  public void doTestPersistConflictOperations(boolean diskSync) throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -959,7 +998,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * of crashed members to other persistent regions, So that the persistent
    * regions can negotiate who has the latest data during recovery.
    */
-  public void testTransmitCrashedMembersWithNonPeristentRegion() throws Throwable {
+  @Test
+  public void testTransmitCrashedMembersWithNonPeristentRegion() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1001,7 +1041,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     checkForEntry(vm2);
   }
   
-  public void testSplitBrain() throws Throwable {
+  @Test
+  public void testSplitBrain() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1045,7 +1086,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * while a GII is in progress, we wait
    * for the member to come back for starting.
    */
-  public void testCrashDuringGII() throws Throwable { 
+  @Test
+  public void testCrashDuringGII() throws Exception { 
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1147,7 +1189,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * Test to make sure we don't leak any persistent ids if a member does GII
    * while a distributed destroy is in progress
    */
-  public void testGIIDuringDestroy() throws Throwable { 
+  @Test
+  public void testGIIDuringDestroy() throws Exception { 
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
     final VM vm1 = host.getVM(1);
@@ -1244,7 +1287,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     });
   }
   
-  public void testCrashDuringPreparePersistentId() throws Throwable { 
+  @Test
+  public void testCrashDuringPreparePersistentId() throws Exception { 
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1305,7 +1349,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     checkForEntry(vm1);
   }
   
-  public void testSplitBrainWithNonPersistentRegion() throws Throwable {
+  @Test
+  public void testSplitBrainWithNonPersistentRegion() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1340,7 +1385,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     checkForRecoveryStat(vm1, true);
   }
 
-  public void testMissingEntryOnDisk() throws Throwable {
+  @Test
+  public void testMissingEntryOnDisk() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1399,9 +1445,10 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
   /**
    * Tests to make sure that we stop waiting for a member
    * that we revoke.
-   * @throws Throwable
+   * @throws Exception
    */
-  public void testCompactFromAdmin() throws Throwable {
+  @Test
+  public void testCompactFromAdmin() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1478,7 +1525,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     vm1.invoke(compactVM);
   }
   
-  public void testCloseDuringRegionOperation() throws Throwable {
+  @Test
+  public void testCloseDuringRegionOperation() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1555,8 +1603,9 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
     checkConcurrentCloseValue(vm0, vm1, 1, lastSuccessfulInt1);
   }
   
-  @Ignore("Disabled due to bug #52240")
-  public void DISABLED_testCloseDuringRegionOperationWithTX() throws Throwable {
+  @Ignore("TODO: Disabled due to bug #52240")
+  @Test
+  public void testCloseDuringRegionOperationWithTX() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1641,7 +1690,8 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa
    * 
    * This is bug XX.
    */
-  public void testRecoverAfterConflict() throws Throwable {
+  @Test
+  public void testRecoverAfterConflict() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderOldConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderOldConfigDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderOldConfigDUnitTest.java
index bddf85d..5d4c367 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderOldConfigDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderOldConfigDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.persistence;
 
+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 com.gemstone.gemfire.cache.Cache;
@@ -32,11 +41,12 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *
  */
+@Category(DistributedTest.class)
 public class PersistentRecoveryOrderOldConfigDUnitTest extends
     PersistentRecoveryOrderDUnitTest {
 
-  public PersistentRecoveryOrderOldConfigDUnitTest(String name) {
-    super(name);
+  public PersistentRecoveryOrderOldConfigDUnitTest() {
+    super();
     // TODO Auto-generated constructor stub
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
index 1500269..5c68f38 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
@@ -16,44 +16,37 @@
  */
 package com.gemstone.gemfire.internal.cache.persistence;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.Map;
 import java.util.Set;
 
-import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.DiskStore;
 import com.gemstone.gemfire.cache.DiskStoreFactory;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionExistsException;
 import com.gemstone.gemfire.cache.RegionFactory;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.TimeoutException;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.FileUtil;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
-import com.gemstone.gemfire.internal.cache.RegionFactoryImpl;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
-public abstract class PersistentReplicatedTestBase extends CacheTestCase {
+public abstract class PersistentReplicatedTestBase extends JUnit4CacheTestCase {
 
   protected static final int MAX_WAIT = 30 * 1000;
   protected static String REGION_NAME = "region";
   protected File diskDir;
   protected static String SAVED_ACK_WAIT_THRESHOLD;
 
-  public PersistentReplicatedTestBase(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postSetUp() throws Exception {
     Invoke.invokeInEveryVM(PersistentReplicatedTestBase.class,"setRegionName", new Object[]{getUniqueName()});
@@ -159,7 +152,7 @@ public abstract class PersistentReplicatedTestBase extends CacheTestCase {
     return vm0.invokeAsync(close);
   }
 
-  protected void createNonPersistentRegion(VM vm) throws Throwable {
+  protected void createNonPersistentRegion(VM vm) throws Exception {
     SerializableRunnable createRegion = new SerializableRunnable("Create non persistent region") {
       public void run() {
         Cache cache = getCache();
@@ -172,13 +165,13 @@ public abstract class PersistentReplicatedTestBase extends CacheTestCase {
     vm.invoke(createRegion);
   }
 
-  protected AsyncInvocation createPersistentRegionWithWait(VM vm) throws Throwable {
+  protected AsyncInvocation createPersistentRegionWithWait(VM vm) throws Exception {
     return _createPersistentRegion(vm, true);
   }
-  protected void createPersistentRegion(VM vm) throws Throwable {
+  protected void createPersistentRegion(VM vm) throws Exception {
     _createPersistentRegion(vm, false);
   }
-  private AsyncInvocation _createPersistentRegion(VM vm, boolean wait) throws Throwable {
+  private AsyncInvocation _createPersistentRegion(VM vm, boolean wait) throws Exception {
     AsyncInvocation future = createPersistentRegionAsync(vm);
     long waitTime = wait ? 500 : MAX_WAIT;
     future.join(waitTime);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
index 95642a2..f44bad6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
@@ -22,26 +22,37 @@ import java.util.Map.Entry;
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.cache.snapshot.SnapshotIterator;
 import com.gemstone.gemfire.internal.cache.snapshot.GFSnapshot.GFSnapshotExporter;
 import com.gemstone.gemfire.internal.cache.snapshot.GFSnapshot.GFSnapshotImporter;
 import com.gemstone.gemfire.internal.cache.snapshot.GFSnapshot.SnapshotWriter;
 import com.gemstone.gemfire.internal.cache.snapshot.SnapshotPacket.SnapshotRecord;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 
-@Category(IntegrationTest.class)
+@Category(PerformanceTest.class)
+@Ignore("Test has no assertions and will always pass")
 public class GFSnapshotJUnitPerformanceTest {
-  private final File f = new File("test.snapshot");
+
   private static final String val = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
 
+  private File f;
+
+  @Before
+  public void setUp() throws Exception {
+    f = new File("test.snapshot");
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    if (f.exists()) {
+      f.delete();
+    }
+  }
+
   @Test
   public void testStreamWritePerformance() throws IOException {
     int i = 0;
@@ -148,11 +159,4 @@ public class GFSnapshotJUnitPerformanceTest {
       out.close();
     }
   }
-  
-  @After
-  public void tearDown() throws Exception {
-    if (f.exists()) {
-      f.delete();
-    }
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
index e21e780..a643c95 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
@@ -16,8 +16,13 @@
  */
 package com.gemstone.gemfire.internal.cache.tier;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+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.CacheFactory;
@@ -30,16 +35,19 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.tier.sockets.DeltaEOFException;
 import com.gemstone.gemfire.internal.cache.tier.sockets.FaultyDelta;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Test delta propagation for faulty delta implementation
  * @since GemFire 6.1
  */
-public class Bug40396DUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class Bug40396DUnitTest extends JUnit4DistributedTestCase {
   
   private static Cache cache;
   private static final String REGION_NAME="Bug40396DUnitTest_region";
@@ -54,8 +62,8 @@ public class Bug40396DUnitTest extends DistributedTestCase {
 
   private static final int PUT_COUNT = 10;
   
-  public Bug40396DUnitTest(String name) {
-    super(name);
+  public Bug40396DUnitTest() {
+    super();
   }
 
   @Override
@@ -71,7 +79,7 @@ public class Bug40396DUnitTest extends DistributedTestCase {
    */
   public static Integer createServerCache() throws Exception
   {
-    new Bug40396DUnitTest("temp").createCache(new Properties());
+    new Bug40396DUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -160,6 +168,7 @@ public class Bug40396DUnitTest extends DistributedTestCase {
    * This test does the following 1)send faulty implementation (Reading more in
    * fromDelta then what sent by toDelta) of delta raises EOF exception<br>
    */
+  @Test
   public void testForFaultyDeltaImplementationForEOFEX() {
     boolean matched = false;
     ((Integer)server.invoke(() -> Bug40396DUnitTest.createServerCache())).intValue();
@@ -187,6 +196,7 @@ public class Bug40396DUnitTest extends DistributedTestCase {
    * incorrect order from toDelta, raises delta raises array index out of bound
    * exception<br>
    */
+  @Test
   public void testForFaultyDeltaImplementationForAIOBEX() {
     boolean matched = false;
     ((Integer)server.invoke(() -> Bug40396DUnitTest.createServerCache())).intValue();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
index e447917..f49f068 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
@@ -16,7 +16,21 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -24,20 +38,19 @@ import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.tier.ConnectionProxy;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * Test to verify that server responds to a higher versioned client.
  */
+@Category(DistributedTest.class)
+public class BackwardCompatibilityHigherVersionClientDUnitTest extends JUnit4DistributedTestCase {
 
-public class BackwardCompatibilityHigherVersionClientDUnitTest extends
-    DistributedTestCase {
   /** the cache */
   private static Cache cache = null;
 
@@ -60,11 +73,6 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends
 
   private static short currentClientVersion = ConnectionProxy.VERSION.ordinal();
 
-  /** constructor */
-  public BackwardCompatibilityHigherVersionClientDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -84,12 +92,11 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends
 
   public static void createClientCache(String host, Integer port1)
       throws Exception {
-    new BackwardCompatibilityHigherVersionClientDUnitTest("temp");
+    new BackwardCompatibilityHigherVersionClientDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new BackwardCompatibilityHigherVersionClientDUnitTest("temp")
-        .createCache(props);
+    new BackwardCompatibilityHigherVersionClientDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host,
         port1.intValue()).setSubscriptionEnabled(true)
         .setSubscriptionRedundancy(1).setThreadLocalConnections(true)
@@ -108,7 +115,7 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends
   }
 
   public static Integer createServerCache() throws Exception {
-    new BackwardCompatibilityHigherVersionClientDUnitTest("temp")
+    new BackwardCompatibilityHigherVersionClientDUnitTest()
         .createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -146,6 +153,7 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends
   /**
    * Verify that server responds to a higher versioned client.
    */
+  @Test
   public void testHigherVersionedClient() {
     Integer port1 = ((Integer)server1.invoke(() -> BackwardCompatibilityHigherVersionClientDUnitTest.createServerCache()));
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
index 4b31e49..8a5d29c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
@@ -16,7 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -26,12 +39,14 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * The Region Destroy Operation from Cache Client does not pass the Client side
@@ -39,9 +54,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * object in the DestroyRegionMessage. This can cause sender to recieve it own
  * region destruction message.
  */
-
-public class Bug36269DUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class Bug36269DUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -57,24 +71,16 @@ public class Bug36269DUnitTest extends DistributedTestCase
 
   private static PoolImpl pool = null;
 
-  /** constructor */
-  public Bug36269DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
-    // Server1 VM
     server1 = host.getVM(0);
-
-    // Server2 VM
     server2 = host.getVM(1);
 
-    PORT1 = ((Integer)server1.invoke(() -> Bug36269DUnitTest.createServerCache())).intValue();
-    PORT2 = ((Integer)server2.invoke(() -> Bug36269DUnitTest.createServerCache())).intValue();
+    PORT1 = server1.invoke(() -> Bug36269DUnitTest.createServerCache());
+    PORT2 = server2.invoke(() -> Bug36269DUnitTest.createServerCache());
   }
 
   private void createCache(Properties props) throws Exception
@@ -84,32 +90,20 @@ public class Bug36269DUnitTest extends DistributedTestCase
     assertNotNull(cache);
   }
 
-//  static private final String WAIT_PROPERTY = "Bug36269DUnitTest.maxWaitTime";
-//
-//  static private final int WAIT_DEFAULT = 60000;
-
   /**
    * This tests whether the region destroy are not received by the sender
-   * 
    */
-  public void testRegionDestroyNotReceivedBySender() throws Exception
-  {
-    try {
-      createClientCache();
-      acquireConnectionsAndDestroyRegion(NetworkUtils.getServerHostName(Host.getHost(0)));
-      server1.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy());
-      server2.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy());
-      Wait.pause(5000);
-      verifyNoRegionDestroyOnOriginator();
-    }
-    catch (Exception ex) {
-      fail("failed gggg testRegionDestroyNotReceivedBySender  " + ex);
-    }
-
+  @Test
+  public void testRegionDestroyNotReceivedBySender() throws Exception {
+    createClientCache();
+    acquireConnectionsAndDestroyRegion(NetworkUtils.getServerHostName(Host.getHost(0)));
+    server1.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy());
+    server2.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy());
+    Wait.pause(5000);
+    verifyNoRegionDestroyOnOriginator();
   }
 
-  public static void acquireConnectionsAndDestroyRegion(String host)
-  {
+  public static void acquireConnectionsAndDestroyRegion(String host) {
     try {
       Connection desCon = pool.acquireConnection(new ServerLocation(host, PORT2));
       ServerRegionProxy srp = new ServerRegionProxy(Region.SEPARATOR + REGION_NAME, pool);
@@ -120,13 +114,11 @@ public class Bug36269DUnitTest extends DistributedTestCase
     }
   }
 
-  public static void createClientCache() throws Exception
-  {
-
+  public static void createClientCache() throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new Bug36269DUnitTest("temp").createCache(props);
+    new Bug36269DUnitTest().createCache(props);
     CacheServerTestUtil.disableShufflingOfEndpoints();
     PoolImpl p;
     String host = NetworkUtils.getServerHostName(Host.getHost(0));
@@ -150,12 +142,11 @@ public class Bug36269DUnitTest extends DistributedTestCase
     pool = p;
     assertNotNull(pool);
     cache.createRegion(REGION_NAME, factory.create());
-
   }
 
   public static Integer createServerCache() throws Exception
   {
-    new Bug36269DUnitTest("temp").createCache(new Properties());
+    new Bug36269DUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setMirrorType(MirrorType.KEYS_VALUES);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
index 14acf01..9af315e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
@@ -16,7 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -26,14 +42,13 @@ import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Bug Test for bug#36457
@@ -43,8 +58,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * error because the region has been destroyed on the server and hence falsely
  * marks the server dead.
  */
-public class Bug36457DUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class Bug36457DUnitTest extends JUnit4DistributedTestCase {
+
   private static Cache cache = null;
 
   private VM server1 = null;
@@ -60,8 +76,8 @@ public class Bug36457DUnitTest extends DistributedTestCase
   private static final String regionName = "Bug36457DUnitTest_Region";
 
   /** constructor */
-  public Bug36457DUnitTest(String name) {
-    super(name);
+  public Bug36457DUnitTest() {
+    super();
   }
 
   @Override
@@ -89,7 +105,7 @@ public class Bug36457DUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new Bug36457DUnitTest("temp").createCache(props);
+    new Bug36457DUnitTest().createCache(props);
     Pool p = PoolManager.createFactory()
       .addServer(host, port1.intValue())
       .addServer(host, port2.intValue())
@@ -114,7 +130,7 @@ public class Bug36457DUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new Bug36457DUnitTest("temp").createCache(new Properties());
+    new Bug36457DUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -146,6 +162,7 @@ public class Bug36457DUnitTest extends DistributedTestCase
     }
   }
 
+  @Test
   public void testBug36457()
   {
     Integer port1 = ((Integer)server1.invoke(() -> Bug36457DUnitTest.createServerCache()));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
index e53a1e0..7a4791f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
@@ -16,6 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerOperationException;
@@ -23,19 +39,24 @@ import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.dunit.*;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 /**
  * bug test for bug 36805
- * 
- * 
+ *
  * When server is running but region is not created on server. Client sends
  * register interest request, server checks for region, and if region is not
  * exist on server, it throws an exception to the client. Hence, client marks
@@ -43,10 +64,10 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * 
  * To avoid this, there should not be any check of region before registration.
  * And region registration should not fail due to non existent region.
- * 
  */
-public class Bug36805DUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class Bug36805DUnitTest extends JUnit4DistributedTestCase {
+
   private static Cache cache = null;
 
   private VM server1 = null;
@@ -64,8 +85,8 @@ public class Bug36805DUnitTest extends DistributedTestCase
   private static final String regionName = "Bug36805DUnitTest_Region";
 
   /** constructor */
-  public Bug36805DUnitTest(String name) {
-    super(name);
+  public Bug36805DUnitTest() {
+    super();
   }
 
   @Override
@@ -93,7 +114,7 @@ public class Bug36805DUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new Bug36805DUnitTest("temp").createCache(props);
+    new Bug36805DUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, port1.intValue())
       .addServer(host, port2.intValue())
@@ -112,7 +133,7 @@ public class Bug36805DUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new Bug36805DUnitTest("temp").createCache(new Properties());
+    new Bug36805DUnitTest().createCache(new Properties());
    // no region is created on server 
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     CacheServer server1 = cache.addCacheServer();
@@ -140,6 +161,7 @@ public class Bug36805DUnitTest extends DistributedTestCase
     }
   }
 
+  @Test
   public void testBug36805()
   {
     Integer port1 = ((Integer)server1.invoke(() -> Bug36805DUnitTest.createServerCache()));



[16/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
index d91e3f5..3d5bdf7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
@@ -16,8 +16,25 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.GemFireIOException;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.NoAvailableServersException;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -27,30 +44,28 @@ import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests client server corner cases between Region and Pool
- *
- *
  */
-public class ClientServerMiscDUnitTest extends CacheTestCase
-{
-//  private static Cache cache = null;
+@Category(DistributedTest.class)
+public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase {
 
   protected static PoolImpl pool = null;
 
@@ -82,7 +97,6 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
 
   private static RegionAttributes attrs;
 
-
   // variables for concurrent map API test
   Properties props = new Properties();
   final int putRange_1Start = 1;
@@ -98,13 +112,6 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   final int removeRange_2Start = 7;
   final int removeRange_2End = 9;
 
-  
-  
-  /** constructor */
-  public ClientServerMiscDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     host = Host.getHost(0);
@@ -127,6 +134,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   }
 
   
+  @Test
   public void testConcurrentOperationsWithDRandPR() throws Exception {
     int port1 = initServerCache(true); // vm0
     int port2 = initServerCache2(true); // vm1
@@ -141,6 +149,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
     // TODO add verification in vm3
   }
 
+  @Test
   public void testConcurrentOperationsWithDRandPRandEmptyClient() throws Exception {
     int port1 = initServerCache(true); // vm0
     int port2 = initServerCache2(true); // vm1
@@ -357,6 +366,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * If an update/create is made on region1 , the client should not receive any.
    * If the create/update is on region2 , the client should receive the update.
    */
+  @Test
   public void testForTwoRegionHavingDifferentInterestList()
       throws Exception
   {
@@ -390,6 +400,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * ( which is diferent from not receiving a callbak on the client).
    * If an update on region2 is made on the server , then client should receive the calback
    */
+  @Test
   public void testForTwoRegionHavingALLKEYSInterest()
       throws Exception
   {
@@ -413,6 +424,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * close all the server connection threads on the server &
    * remove the CacheClientProxy from the CacheClient notifier
    */
+  @Test
   public void testRegionClose() throws Exception
   {
     // start server first
@@ -440,6 +452,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * to the clients. Then create third region and verify that no
    * CacheClientProxy is created on server
    */
+  @Test
   public void testCCPDestroyOnLastDestroyRegion() throws Exception
   {
     PORT1 = initServerCache(true);
@@ -473,6 +486,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * updates on server in their respective regions
    *
    */
+  @Test
   public void testInvalidatesPropagateOnTwoRegions()
       throws Exception
   {
@@ -494,6 +508,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * client's cache.  This turned out to be expected behavior, but we
    * now have this test to guarantee that the product behaves as expected.
    */
+  @Test
   public void testGetInClientCreatesEntry() throws Exception {
     // start server first
     PORT1 = initServerCache(false);
@@ -527,6 +542,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   /**
    * GEODE-478 - large payloads are rejected by client->server
    */
+  @Test
   public void testLargeMessageIsRejected() throws Exception {
     PORT1 = initServerCache(false);
     createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1);
@@ -557,9 +573,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * populate some entries on region both on client and server.
    * Update the entries on server the client.
    * The client should not have entry invalidate.
-   *
-   * @throws Exception
    */
+  @Test
   public void testInvalidatesPropagateOnRegionHavingNoPool()
       throws Exception
   {
@@ -568,7 +583,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new ClientServerMiscDUnitTest("temp").createCache(props);
+    new ClientServerMiscDUnitTest().createCache(props);
     String host = NetworkUtils.getServerHostName(server1.getHost());
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, PORT1)
@@ -662,6 +677,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    * @throws Exception
    */
 
+  @Test
   public void testProxyCreationBeforeCacheCreation() throws Exception
   {
     Properties props = new Properties();
@@ -712,6 +728,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
    *  
    * @throws Exception
    */
+  @Test
   public void testSystemCanBeCycledWithAnInitializedPool() throws Exception
   {
     //work around GEODE-477
@@ -805,7 +822,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    Cache cache = new ClientServerMiscDUnitTest("temp").createCacheV(props);
+    Cache cache = new ClientServerMiscDUnitTest().createCacheV(props);
     ClientServerMiscDUnitTest.static_cache = cache;
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(h, port)
@@ -864,7 +881,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
 
   public static Integer createServerCache(Boolean notifyBySubscription, Integer maxThreads)
   throws Exception {
-    Cache cache = new ClientServerMiscDUnitTest("temp").createCacheV(new Properties());
+    Cache cache = new ClientServerMiscDUnitTest().createCacheV(new Properties());
     unsetSlowDispatcherFlag();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -900,7 +917,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void registerInterest()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r);
       //r.registerInterestRegex(CacheClientProxy.ALL_KEYS);
@@ -915,7 +932,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void registerInterestForInvalidatesInBothTheRegions()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       assertNotNull(r1);
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
@@ -934,7 +951,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void registerInterestInBothTheRegions()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       assertNotNull(r1);
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
@@ -953,7 +970,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void closeRegion1()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       assertNotNull(r1);
       r1.close();
@@ -967,7 +984,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void closeBothRegions()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       Region pr = cache.getRegion(Region.SEPARATOR + PR_REGION_NAME);
@@ -987,7 +1004,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void destroyRegion1()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       assertNotNull(r1);
       r1.destroyRegion();
@@ -1001,7 +1018,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void destroyRegion2()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r2);
       r2.destroyRegion();
@@ -1014,7 +1031,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
 
   public static void destroyPRRegion()  {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r2 = cache.getRegion(Region.SEPARATOR + PR_REGION_NAME);
       assertNotNull(r2);
       r2.destroyRegion();
@@ -1027,7 +1044,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyInterestListOnServer()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       assertEquals("More than one BridgeServer", 1, cache.getCacheServers()
           .size());
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
@@ -1057,7 +1074,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyNoCacheClientProxyOnServer()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       assertEquals("More than one BridgeServer", 1, cache.getCacheServers()
           .size());
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
@@ -1087,7 +1104,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyCacheClientProxyOnServer(String regionName)
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       assertNull(cache.getRegion(Region.SEPARATOR + regionName));
        verifyCacheClientProxyOnServer();
 
@@ -1102,7 +1119,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyCacheClientProxyOnServer()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       assertEquals("More than one BridgeServer", 1, cache.getCacheServers()
           .size());
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
@@ -1132,7 +1149,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void populateCache()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r1);
@@ -1160,7 +1177,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void put()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r1);
@@ -1185,7 +1202,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyUpdates()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       final Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       final Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r1);
@@ -1252,7 +1269,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyInvalidatesOnBothRegions()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       final Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME1);
       final Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r1);
@@ -1331,7 +1348,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
   public static void verifyUpdatesOnRegion2()
   {
     try {
-      Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+      Cache cache = new ClientServerMiscDUnitTest().getCache();
       final Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r2);
       WaitCriterion wc = new WaitCriterion() {
@@ -1376,7 +1393,7 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
 
   public static void closeCacheAndDisconnect()
   {
-    Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
+    Cache cache = new ClientServerMiscDUnitTest().getCache();
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscSelectorDUnitTest.java
index bc02159..d25e3a7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscSelectorDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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;
+
 
 /**
  * Just like parent but enables server thread pool
@@ -23,10 +32,11 @@ package com.gemstone.gemfire.internal.cache.tier.sockets;
  *
  *
  */
+@Category(DistributedTest.class)
 public class ClientServerMiscSelectorDUnitTest extends ClientServerMiscDUnitTest
 {
-  public ClientServerMiscSelectorDUnitTest(String name) {
-    super(name);
+  public ClientServerMiscSelectorDUnitTest() {
+    super();
   }
 
   protected int getMaxThreads() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
index 0ab0116..e0d672f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
@@ -16,7 +16,24 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -24,17 +41,22 @@ import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
+import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
 import com.gemstone.gemfire.internal.cache.ha.HAHelper;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test verifies the conflation functionality of the
@@ -47,25 +69,20 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * The test has two regions. In one scenario
  * they share a common bridgewriter and in the second
  * scenario, each has a unique bridgewriter.
- *
  */
-public class ConflationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class ConflationDUnitTest extends JUnit4DistributedTestCase {
+
   VM vm0 = null;
   VM vm2 = null;
   private static Cache cache = null;
   private int PORT ;
   private static final String REGION_NAME1 = "ConflationDUnitTest_region1" ;
   private static final String REGION_NAME2 = "ConflationDUnitTest_region2" ;
-  final static String MARKER = "markerKey";
+  static final String MARKER = "markerKey";
 
   private static HashMap statMap = new HashMap();
 
-  /** constructor */
-  public ConflationDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -120,6 +137,7 @@ public class ConflationDUnitTest extends DistributedTestCase
    * two regions, with two writers (each region will have a unique bridgwriter).
    *
    */
+  @Test
   public void testTwoRegionsTwoWriters()
   {
     try {
@@ -151,6 +169,7 @@ public class ConflationDUnitTest extends DistributedTestCase
    * two regions with a common bridgewriter
    *
    */
+  @Test
   public void testTwoRegionsOneWriter() throws Exception
   {
       vm0.invoke(() -> ConflationDUnitTest.setIsSlowStart());
@@ -178,6 +197,7 @@ public class ConflationDUnitTest extends DistributedTestCase
    * test more messages are not sent to client from server
    *
    */
+  @Test
   public void testNotMoreMessagesSent() throws Exception
   {
       vm0.invoke(() -> ConflationDUnitTest.setIsSlowStart());
@@ -237,7 +257,7 @@ public class ConflationDUnitTest extends DistributedTestCase
 
   public static void createClientCache1CommonWriter(String host, Integer port) throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -255,7 +275,7 @@ public class ConflationDUnitTest extends DistributedTestCase
 
   public static void createClientCache1CommonWriterTest3(String host, Integer port) throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -272,7 +292,7 @@ public class ConflationDUnitTest extends DistributedTestCase
    */
   public static void createClientCache2CommonWriter(String host, Integer port) throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -319,7 +339,7 @@ public class ConflationDUnitTest extends DistributedTestCase
   public static void createClientCache2CommonWriterTest3(String host, Integer port)
       throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -371,7 +391,7 @@ public class ConflationDUnitTest extends DistributedTestCase
 
   public static void createClientCache1UniqueWriter(String host, Integer port) throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -390,7 +410,7 @@ public class ConflationDUnitTest extends DistributedTestCase
    */
   public static void createClientCache2UniqueWriter(String host, Integer port) throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(createProperties1());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -626,7 +646,7 @@ public class ConflationDUnitTest extends DistributedTestCase
    */
   public static Integer createServerCache() throws Exception
   {
-    ConflationDUnitTest test = new ConflationDUnitTest("temp");
+    ConflationDUnitTest test = new ConflationDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
index ba08e33..74987f0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
@@ -16,9 +16,27 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.TestDataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -31,19 +49,20 @@ import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
-
-  private static final long serialVersionUID = 0L;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.StoppableWaitCriterion;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class DataSerializerPropogationDUnitTest extends JUnit4DistributedTestCase {
 
   private static Cache cache = null;
 
@@ -71,11 +90,6 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
 
   public static boolean successfullyLoadedTestDataSerializer = false;
 
-  public DataSerializerPropogationDUnitTest(String name) {
-    super(name);
-    // TODO Auto-generated constructor stub
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -99,7 +113,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new DataSerializerPropogationDUnitTest("temp").createCache(props);
+    new DataSerializerPropogationDUnitTest().createCache(props);
     Pool p = PoolManager.createFactory().addServer(host, port1.intValue())
         .setMinConnections(1).setSubscriptionEnabled(true).setPingInterval(200)
         .create("ClientServerDataSerializersRegistrationDUnitTestPool");
@@ -121,7 +135,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
   }
 
   public static Integer createServerCache(Integer maxThreads) throws Exception {
-    new DataSerializerPropogationDUnitTest("temp")
+    new DataSerializerPropogationDUnitTest()
         .createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -381,6 +395,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
    * Verified if the 2 DataSerializers get propogated to client when client gets
    * connected.
    */
+  @Test
   public void testServerUpFirstClientLater() throws Exception {
     PORT1 = initServerCache(server1);
 
@@ -443,6 +458,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     });
   }
 
+  @Test
   public void testDataSerializersWith2ClientsN2Servers() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -468,6 +484,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
   }
 
   // this test is for bug 44112
+  @Test
   public void testLocalOnlyDS() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -493,6 +510,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(0) ));
   }
 
+  @Test
   public void testDataSerializersWithServerKill() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -538,6 +556,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     expectedEx.remove();
   }
 
+  @Test
   public void testDataSerializers() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -564,6 +583,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers( new Integer(2) ));
   }
 
+  @Test
   public void testDataSerializersWithServerKillAndReInvoked() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -620,6 +640,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
     expectedEx.remove();
   }
 
+  @Test
   public void testDataSerializerCount() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -652,6 +673,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
    * servers
    * 
    */
+  @Test
   public void testDataSerializersEventIdVerificationClientsAndServers()
       throws Exception {
     PORT1 = initServerCache(server1, 1);
@@ -677,6 +699,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
 
   }
 
+  @Test
   public void testLazyLoadingOfDataSerializersWith2ClientsN2Servers() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -792,7 +815,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
    */
   public static Integer createServerCacheTwo(Integer maxThreads)
       throws Exception {
-    new DataSerializerPropogationDUnitTest("temp")
+    new DataSerializerPropogationDUnitTest()
         .createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -818,7 +841,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
    */
   public static Integer createServerCacheOne(Integer maxThreads)
       throws Exception {
-    new DataSerializerPropogationDUnitTest("temp").createCache(new Properties());
+    new DataSerializerPropogationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setMirrorType(MirrorType.KEYS_VALUES);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
index 592b179..99f4a80 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
@@ -16,7 +16,27 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -29,42 +49,36 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.EventIDHolder;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-import util.TestException;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
 /**
  * Tests propagation of destroy entry operation across the vms
  */
-public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DestroyEntryPropagationDUnitTest extends JUnit4DistributedTestCase {
 
-  VM vm0 = null;
+  private static final String REGION_NAME = DestroyEntryPropagationDUnitTest.class.getSimpleName() + "_region";
+  private static final String WAIT_PROPERTY = DestroyEntryPropagationDUnitTest.class.getSimpleName() + ".maxWaitTime";
+  private static final int WAIT_DEFAULT = 120000;
 
-  VM vm1 = null;
+  private static Cache cache;
 
-  VM vm2 = null;
-
-  VM vm3 = null;
+  private VM vm0;
+  private VM vm1;
+  private VM vm2;
+  private VM vm3;
 
   private int PORT1 ;
   private int PORT2;
-  protected static Cache cache = null;
-
-  private static final String REGION_NAME = "DestroyEntryPropagationDUnitTest_region";
-
-  /** constructor */
-  public DestroyEntryPropagationDUnitTest(String name) {
-    super(name);
-  }
 
   @Override
   public final void postSetUp() throws Exception {
@@ -90,8 +104,22 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2)));
   }
 
-  private void createCache(Properties props) throws Exception
-  {
+  @Override
+  public final void preTearDown() throws Exception {
+    //close client
+    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
+    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
+    //close server
+    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
+    vm1.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
+  }
+
+  @Override
+  public final void postTearDown() throws Exception {
+    cache = null;
+  }
+
+  private void createCache(Properties props) throws Exception {
     DistributedSystem ds = getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -99,10 +127,9 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
 
   /**
    * This tests whether the destroy are propagted or not according to interest registration.
-   *
    */
-  public void testDestroyPropagation()
-  {
+  @Test
+  public void testDestroyPropagation() {
     //First create entries on both servers via the two clients
     vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
     vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
@@ -122,16 +149,14 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
     // verify only key-1 is destroyed
     vm3.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed());
-
   }
 
   /**
    * This tests whether the destroy happened directly on server are propagted or
    * not.
-   *
    */
-  public void testDestroyOnServerPropagation()
-  {
+  @Test
+  public void testDestroyOnServerPropagation() {
     //First create entries on both servers via the two client
     vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
     vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createEntriesK1andK2());
@@ -149,19 +174,14 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed());
     //  verify destroy entry only for registered keys in client 2
     vm3.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed());
-
   }
 
-  static private final String WAIT_PROPERTY =
-    "DestroyEntryPropagationDUnitTest.maxWaitTime";
-  static private final int WAIT_DEFAULT = 120000;
-
   /**
    * This tests whether the destroy are received by the sender or not if there
    * are situation of Interest List fail over
-   *
    */
   @Category(FlakyTest.class) // GEODE-897: random port, time sensitive, waitForCriterion, 2 minute timeouts, eats exception (1 fixed)
+  @Test
   public void testVerifyDestroyNotReceivedBySender() {
     final int maxWaitTime = Integer.getInteger(WAIT_PROPERTY, WAIT_DEFAULT).intValue();
     //First create entries on both servers via the two client
@@ -234,11 +254,9 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     vm1.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed());
 
     vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyNoDestroyEntryInSender());
-
   }
 
-  public void acquireConnectionsAndDestroyEntriesK1andK2()
-  {
+  private void acquireConnectionsAndDestroyEntriesK1andK2() {
     try {
       Region r1 = cache.getRegion(Region.SEPARATOR+REGION_NAME);
       assertNotNull(r1);
@@ -260,12 +278,11 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
       srp.destroyOnForTestsOnly(conn1, "key2", null, Operation.DESTROY, new EventIDHolder(new EventID(new byte[] {1},100000,2)), null);
     }
     catch (Exception ex) {
-      throw new TestException("Failed while setting acquireConnectionsAndDestroyEntry  ", ex);
+      throw new AssertionError("Failed while setting acquireConnectionsAndDestroyEntry  ", ex);
     }
   }
 
-  public static void killServer(Integer port)
-  {
+  private static void killServer(Integer port) {
     try {
       Iterator iter = cache.getCacheServers().iterator();
       LogWriterUtils.getLogWriter().fine ("Asif: servers running = "+cache.getCacheServers().size());
@@ -282,8 +299,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void startServer(Integer port)
-  {
+  private static void startServer(Integer port) {
     try {
       CacheServer server1 = cache.addCacheServer();
       server1.setPort(port.intValue());
@@ -297,10 +313,8 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
 
   /**
    * Creates entries on the server
-   *
    */
-  public static void createEntriesK1andK2()
-  {
+  private static void createEntriesK1andK2() {
     try {
       Region r1 = cache.getRegion(Region.SEPARATOR+REGION_NAME);
       assertNotNull(r1);
@@ -320,10 +334,8 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
 
   /**
    * destroy entry
-   *
    */
-  public static void destroyEntriesK1andK2()
-  {
+  private static void destroyEntriesK1andK2() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR+ REGION_NAME);
       assertNotNull(r);
@@ -335,8 +347,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyNoDestroyEntryInSender()
-  {
+  private static void verifyNoDestroyEntryInSender() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR+ REGION_NAME);
       assertNotNull(r);
@@ -348,8 +359,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyEntriesAreDestroyed()
-  {
+  private static void verifyEntriesAreDestroyed() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR+ REGION_NAME);
       assertNotNull(r);
@@ -362,8 +372,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyOnlyRegisteredEntriesAreDestroyed()
-  {
+  private static void verifyOnlyRegisteredEntriesAreDestroyed() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR+ REGION_NAME);
       assertNotNull(r);
@@ -376,7 +385,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void waitForDestroyEvent(Region r, final Object key) {
+  private static void waitForDestroyEvent(Region r, final Object key) {
     final CertifiableTestCacheListener ccl = (CertifiableTestCacheListener) r.getAttributes().getCacheListener();
     WaitCriterion ev = new WaitCriterion() {
       public boolean done() {
@@ -390,14 +399,13 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     ccl.destroys.remove(key);
   }
 
-  public static void createClientCache(String host, Integer port1, Integer port2) throws Exception
-  {
+  private static void createClientCache(String host, Integer port1, Integer port2) throws Exception {
     int PORT1 = port1.intValue();
     int PORT2 = port2.intValue();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new DestroyEntryPropagationDUnitTest("temp").createCache(props);
+    new DestroyEntryPropagationDUnitTest().createCache(props);
     CacheServerTestUtil.disableShufflingOfEndpoints();
     Pool p;
     try {
@@ -425,9 +433,8 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
 
   }
 
-  public static Integer createServerCache() throws Exception
-  {
-    new DestroyEntryPropagationDUnitTest("temp").createCache(new Properties());
+  private static Integer createServerCache() throws Exception {
+    new DestroyEntryPropagationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -443,8 +450,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     return new Integer(server.getPort());
   }
 
-  public static void registerKey1()
-  {
+  private static void registerKey1() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR+REGION_NAME);
       assertNotNull(r);
@@ -458,21 +464,10 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void closeCache()
-  {
+  private static void closeCache() {
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();
     }
   }
-
-  @Override
-  public final void preTearDown() throws Exception {
-    //close client
-    vm2.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
-    vm3.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
-    //close server
-    vm0.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
-    vm1.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
index fb5a60d..0821592 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
@@ -16,31 +16,42 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.client.internal.PoolImpl;
-import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class DurableClientBug39997DUnitTest extends CacheTestCase {
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-  private static final long serialVersionUID = -2712855295338732543L;
-
-  public DurableClientBug39997DUnitTest(String name) {
-    super(name);
-  }
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache.client.internal.PoolImpl;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class DurableClientBug39997DUnitTest extends JUnit4CacheTestCase {
 
   public final void postTearDownCacheTestCase() {
     Host.getHost(0) .getVM(0).invoke(() -> disconnectFromDS());
   }
 
+  @Test
   public void testNoServerAvailableOnStartup() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
index 11a3e45..9ccc3c9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
@@ -16,29 +16,41 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionFactory;
 import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache.client.*;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- *
- */
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
+public class DurableClientQueueSizeDUnitTest extends JUnit4DistributedTestCase {
 
   private static VM vm0 = null;
   private static VM vm1 = null;
@@ -53,21 +65,14 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
 
   private static final int EXCEPTION = -5;
 
-  public static final String REGION_NAME = "DurableClientQueueSizeDunitTest_region";
+  public static final String REGION_NAME = DurableClientQueueSizeDUnitTest.class.getSimpleName() + "_region";
 
-  public static final String NEW_REGION = "DurableClientQueueSizeDunitTest_region_2";
+  public static final String NEW_REGION = DurableClientQueueSizeDUnitTest.class.getSimpleName() + "_region_2";
 
   public static final String POOL_NAME = "my-pool";
 
   public static final String DEFAULT_POOL_NAME = "DEFAULT";
 
-  /**
-   * @param name
-   */
-  public DurableClientQueueSizeDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     vm0 = Host.getHost(0).getVM(0);
@@ -92,8 +97,9 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm1.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
   }
 
+  @Test
   public void testNonDurableClientFails() throws Exception {
-    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
+    vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache", // TODO: change to lambda
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, false });
 
     vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION ));
@@ -102,7 +108,9 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
   // this test is disabled due to a high rate of failure.  It fails with
   // the queue size being 11 instead of 10 in the first verifyQueueSize check.
   // See internal ticket #52227.
-  public void disabledtestSinglePoolClientReconnectsBeforeTimeOut() throws Exception {
+  @Ignore("TODO: test is disabled due to #52227")
+  @Test
+  public void testSinglePoolClientReconnectsBeforeTimeOut() throws Exception {
     int num = 10;
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }});
@@ -123,6 +131,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
 
   }
 
+  @Test
   public void testSinglePoolClientReconnectsAfterTimeOut() throws Exception {
     int num = 10;
     long timeoutSeconds = 10;
@@ -145,6 +154,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_TIMED_OUT ));
   }
 
+  @Test
   public void testPrimaryServerRebootReturnsCorrectResponse() throws Exception {
     int num = 10;
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
@@ -175,7 +185,9 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE ));
   }
 
-  public void bug51854_testMultiPoolClientReconnectsBeforeTimeOut() throws Exception {
+  @Ignore("TODO: test is disabled due to #51854")
+  @Test
+  public void testMultiPoolClientReconnectsBeforeTimeOut() throws Exception {
     int num = 10;
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache",
         new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, "300",
@@ -197,7 +209,9 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION, EXCEPTION ));
   }
 
-  public void bug51854_testMultiPoolClientReconnectsAfterTimeOut() throws Exception {
+  @Ignore("TODO: test is disabled due to #51854")
+  @Test
+  public void testMultiPoolClientReconnectsAfterTimeOut() throws Exception {
     int num = 10;
     long timeout = 10;
     vm2.invoke(
@@ -225,7 +239,9 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
     vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_TIMED_OUT, PoolImpl.PRIMARY_QUEUE_TIMED_OUT));
   }
 
-  public void _testMultiPoolClientFailsOver() throws Exception {
+  @Ignore("TODO: test is not implemented")
+  @Test
+  public void testMultiPoolClientFailsOver() throws Exception {
   }
 
   public static void closeCache() throws Exception {
@@ -253,12 +269,10 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
       throws Exception {
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
-    DurableClientQueueSizeDUnitTest test = new DurableClientQueueSizeDUnitTest(
-        "DurableClientQueueSizeDUnitTest");
+    DurableClientQueueSizeDUnitTest test = new DurableClientQueueSizeDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     ds.disconnect();
     cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
-//    cache = (GemFireCacheImpl) new CacheFactory(props).create();
 
     RegionFactory<String, String> rf = cache
         .createRegionFactory(RegionShortcut.REPLICATE);
@@ -305,8 +319,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
           timeoutSeconds);
     }
 
-    DistributedSystem ds = new DurableClientQueueSizeDUnitTest(
-        "DurableClientQueueSizeDUnitTest").getSystem(props);
+    DistributedSystem ds = new DurableClientQueueSizeDUnitTest().getSystem(props);
     ds.disconnect();
     ClientCacheFactory ccf = new ClientCacheFactory(props);
     ccf.setPoolSubscriptionEnabled(true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
index 4936053..e706290 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
@@ -16,34 +16,42 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * @since GemFire 5.7
- *
  * Test reconnecting a durable client that is using
  * the locator to discover its servers
+ *
+ * @since GemFire 5.7
  */
-public class DurableClientReconnectAutoDUnitTest extends
-    DurableClientReconnectDUnitTest {
+@Category(DistributedTest.class)
+public class DurableClientReconnectAutoDUnitTest extends DurableClientReconnectDUnitTest {
 
+  @BeforeClass
   public static void caseSetUp() throws Exception {
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
  
-  public DurableClientReconnectAutoDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Ignore("do nothing, this test doesn't make sense with the locator")
+  @Override
+  @Test
   public void testDurableReconnectSingleServerWithZeroConnPerServer() {
     //do nothing, this test doesn't make sense with the locator
   }
 
+  @Ignore("do nothing, this test doesn't make sense with the locator")
+  @Override
+  @Test
   public void testDurableReconnectSingleServer() throws Exception {
     //do nothing, this test doesn't make sense with the locator
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
index e8b24cf..b2b1b5c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
@@ -16,7 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.net.SocketException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -27,22 +50,25 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.net.SocketException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-
-/**      
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+/**
  * Tests for durable reconnect issue
  * 
  * @since GemFire 5.2
  */
+@Category(DistributedTest.class)
+public class DurableClientReconnectDUnitTest extends JUnit4DistributedTestCase {
 
-public class DurableClientReconnectDUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
   
   private static VM server1 = null;
@@ -62,17 +88,13 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   private static String SERVER3;
   private static String SERVER4;
 
-  private static final String REGION_NAME = "DurableClientReconnectDUnitTest_region";
+  private static final String REGION_NAME = DurableClientReconnectDUnitTest.class.getSimpleName() + "_region";
   
   private DurableClientReconnectDUnitTest instance = null ;
 
-  /** constructor */
-  public DurableClientReconnectDUnitTest(String name) {
-    super(name);
-  }
-
+  @BeforeClass
   public static void caseSetUp() throws Exception {
-    DistributedTestCase.disconnectAllFromDS();
+    disconnectAllFromDS();
   }
  
   @Override
@@ -97,8 +119,8 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false");
   }
 
-  public void testDurableReconnectSingleServer() throws Exception
-  {
+  @Test
+  public void testDurableReconnectSingleServer() throws Exception {
     createCacheClientAndConnectToSingleServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
     List redundantServers = pool.getRedundantNames();    
     String primaryName = pool.getPrimaryName();
@@ -115,8 +137,9 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertTrue(redundantServers2.isEmpty());
     assertTrue(primaryName2.equals(primaryName));
   }
-  public void testDurableReconnectSingleServerWithZeroConnPerServer() throws Exception
-  {
+
+  @Test
+  public void testDurableReconnectSingleServerWithZeroConnPerServer() throws Exception {
     createCacheClientAndConnectToSingleServerWithZeroConnPerServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
     List redundantServers = pool.getRedundantNames();
     String primaryName = pool.getPrimaryName();
@@ -129,8 +152,9 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertTrue(redundantServers2.isEmpty());
     assertTrue(primaryName2.equals(primaryName));
   }
-  public void testDurableReconnectNonHA() throws Exception
-  {
+
+  @Test
+  public void testDurableReconnectNonHA() throws Exception {
     createCacheClient(0);
     List redundantServers = pool.getRedundantNames();
     String primaryName = pool.getPrimaryName();
@@ -147,12 +171,12 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertTrue(redundantServers2.isEmpty());
     assertTrue(primaryName2.equals(primaryName));
   }
+
   /**
    * (R = 1 ) , four servers , all Servers are up, Check client reconnect to either of server having queue.
-   * @throws Exception
-   */ 
-  public void testDurableReconnect() throws Exception
-  {
+   */
+  @Test
+  public void testDurableReconnect() throws Exception {
    //create client cache and Send clientReady message
     createCacheClient();
     HashSet redundantServers = new HashSet(pool.getRedundantNames());
@@ -178,10 +202,9 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     assertTrue(redundantServers.equals(redundantServersAfterReconnect));
   }
-  
-  
-  public void testDurableReconnect_DifferentPrimary() throws Exception
-  {
+
+  @Test
+  public void testDurableReconnect_DifferentPrimary() throws Exception {
    //create client cache and Send clientReady message
     createCacheClient();
     HashSet redundantServers = new HashSet(pool.getRedundantNames());
@@ -207,10 +230,10 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     assertTrue(redundantServers.equals(redundantServersAfterReconnect));
     assertFalse(primaryBefore.equals(primaryAfter));
-    
   }
-  public void testDurableReconnectWithOneRedundantServerDown() throws Exception
-  {
+
+  @Test
+  public void testDurableReconnectWithOneRedundantServerDown() throws Exception {
     //create client cache and Send clientReady message
     createCacheClient();
     List redundantServers = pool.getRedundantNames();
@@ -247,8 +270,8 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertTrue(redundantServersAfterReconnect.contains(rServer2));    
   }
   
-  public void testDurableReconnectWithBothRedundantServersDown() throws Exception
-  {
+  @Test
+  public void testDurableReconnectWithBothRedundantServersDown() throws Exception {
    //create client cache and Send clientReady message
     createCacheClient();
     List redundantServers = pool.getRedundantNames();
@@ -290,9 +313,8 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertFalse(redundantServersAfterReconnect.contains(rServer2));
   }
   
-  
-  public void testDurableReconnectWithBothNonRedundantServersDown() throws Exception
-  {
+  @Test
+  public void testDurableReconnectWithBothNonRedundantServersDown() throws Exception {
    //create client cache and Send clientReady message
     createCacheClient();
     HashSet redundantServers = new HashSet(pool.getRedundantNames());
@@ -343,7 +365,8 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertFalse("redundantServersAfterReconnect contains " + rServer2, redundantServersAfterReconnect.contains(rServer2));
   }
   
-  /** This test checks a problem found in bug 39332 
+  /**
+   * This test checks a problem found in bug 39332
    * 1. Durable client disconnects
    * 2. Durable client comes back, creates a create to server connection but not a queue connection
    * 3. Durable client disconnects again
@@ -351,6 +374,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
    * 5. Eventually, all of the durable clients connections are closed because the durable expiration timer task created
    * in step 1 is never cancelled.
    */
+  @Test
   public void testBug39332() {
    //create client cache and Send clientReady message
     createCacheClient(2, 20);
@@ -424,8 +448,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     assertEquals(redundantServers, redundantServersAfterReconnect);
   }
-  
-  
+
   private static void verifyRedundantServers(Set redundantServers , Set redundantServersAfterReconnect) {
     try{
       Iterator iter = redundantServers.iterator();
@@ -445,11 +468,10 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
       Assert.fail("test failed due to" , e);
     }    
   }
-  
-  public static Integer createServerCache() throws Exception
-  {
+
+  private static Integer createServerCache() throws Exception {
     Properties props = new Properties();
-    new DurableClientReconnectDUnitTest("temp").createCache(props);
+    new DurableClientReconnectDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -509,16 +531,15 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     }
   }
 
-  
   private static void verifyDurableClientOnServer() {
-    try{
-    checkNumberOfClientProxies(1);
-    CacheClientProxy proxy = getClientProxy();
-    assertNotNull(proxy);    
-    // Verify that it is durable and its properties are correct
-    assertTrue(proxy.isDurable());
-    assertEquals("DurableClientReconnectDUnitTest_client", proxy.getDurableId());
-//    assertIndexDetailsEquals(60, proxy.getDurableTimeout());
+    try {
+      checkNumberOfClientProxies(1);
+      CacheClientProxy proxy = getClientProxy();
+      assertNotNull(proxy);
+      // Verify that it is durable and its properties are correct
+      assertTrue(proxy.isDurable());
+      assertEquals("DurableClientReconnectDUnitTest_client", proxy.getDurableId());
+  //    assertIndexDetailsEquals(60, proxy.getDurableTimeout());
     }catch (Exception e){
       Assert.fail("test failed due to" , e);
     }    
@@ -540,17 +561,19 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   
   private static void checkNumberOfClientProxies(final int expected) {
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         return expected == getNumberOfClientProxies();
       }
+      @Override
       public String description() {
         return null;
       }
     };
     Wait.waitForCriterion(ev, 15 * 1000, 200, true);
   }
-  
-  protected static int getNumberOfClientProxies() {
+
+  private static int getNumberOfClientProxies() {
     return getBridgeServer().getAcceptor().getCacheClientNotifier()
         .getClientProxies().size();
   }
@@ -560,25 +583,25 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertNotNull(bridgeServer);
     return bridgeServer;
   }
-  private  void createCache(Properties props) 
-  {try{
-    DistributedSystem ds = getSystem(props);
-    assertNotNull(ds);
-    ds.disconnect();
-    ds = getSystem(props);
-    cache = CacheFactory.create(ds);
-    assertNotNull(cache);    
-  } catch(Exception e){
-    Assert.fail("test failed due to " , e ); 
-  }
+
+  private  void createCache(Properties props) {
+    try{
+      DistributedSystem ds = getSystem(props);
+      assertNotNull(ds);
+      ds.disconnect();
+      ds = getSystem(props);
+      cache = CacheFactory.create(ds);
+      assertNotNull(cache);
+    } catch(Exception e){
+      Assert.fail("test failed due to ", e);
+    }
   }
 
-  private void createCacheClient()
-  {
+  private void createCacheClient() {
     createCacheClient(1);
   }
-  
-  protected PoolFactory getPoolFactory() {
+
+  private PoolFactory getPoolFactory() {
     Host host = Host.getHost(0);
     PoolFactory factory = PoolManager.createFactory()
     .addServer(NetworkUtils.getServerHostName(host), PORT1.intValue())
@@ -592,84 +615,83 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     createCacheClient(redundancyLevel, 60);
   }
   
-  private void createCacheClient(int redundancyLevel, final int durableClientTimeout){
+  private void createCacheClient(int redundancyLevel, final int durableClientTimeout) {
     createCacheClient(redundancyLevel, durableClientTimeout, true);
   }
   
-  private void createCacheClient(int redundancyLevel, final int durableClientTimeout, boolean queueEnabled){
-    try{
-    final String durableClientId = "DurableClientReconnectDUnitTest_client";
-    Properties props = getClientDistributedSystemProperties(durableClientId,durableClientTimeout );
-    instance = new DurableClientReconnectDUnitTest("temp");
-    instance.createCache(props);
-//    Host host = Host.getHost(0);
-    PoolImpl p = (PoolImpl) getPoolFactory()
-      .setSubscriptionEnabled(queueEnabled)
-      .setReadTimeout(10000)
-      // .setRetryInterval(2000)
-      .setSubscriptionRedundancy(redundancyLevel)
-      .create("DurableClientReconnectDUnitTestPool");
+  private void createCacheClient(int redundancyLevel, final int durableClientTimeout, boolean queueEnabled) {
+    try {
+      final String durableClientId = "DurableClientReconnectDUnitTest_client";
+      Properties props = getClientDistributedSystemProperties(durableClientId,durableClientTimeout );
+      instance = new DurableClientReconnectDUnitTest();
+      instance.createCache(props);
+  //    Host host = Host.getHost(0);
+      PoolImpl p = (PoolImpl) getPoolFactory()
+        .setSubscriptionEnabled(queueEnabled)
+        .setReadTimeout(10000)
+        // .setRetryInterval(2000)
+        .setSubscriptionRedundancy(redundancyLevel)
+        .create("DurableClientReconnectDUnitTestPool");
 
-    AttributesFactory factory = new AttributesFactory();
-    factory.setScope(Scope.LOCAL);
-    factory.setPoolName(p.getName());
+      AttributesFactory factory = new AttributesFactory();
+      factory.setScope(Scope.LOCAL);
+      factory.setPoolName(p.getName());
 
-    RegionAttributes attrs = factory.create();
-    Region r = cache.createRegion(REGION_NAME, attrs);
-    assertNotNull(r);
+      RegionAttributes attrs = factory.create();
+      Region r = cache.createRegion(REGION_NAME, attrs);
+      assertNotNull(r);
 
-    pool = p;
-    conn = pool.acquireConnection();
-    assertNotNull(conn);
-    
-    cache.readyForEvents();
+      pool = p;
+      conn = pool.acquireConnection();
+      assertNotNull(conn);
+
+      cache.readyForEvents();
     
     }catch(Exception e){
       Assert.fail("test failed due to " , e );
     }
-    
   }
   
-  private void createCacheClientAndConnectToSingleServer(String host, int redundancyLevel){
-    try{
-    final String durableClientId = "DurableClientReconnectDUnitTest_client";
-    final int durableClientTimeout = 60; // keep the client alive for 60 seconds
-    Properties props = getClientDistributedSystemProperties(durableClientId,durableClientTimeout );
-    instance = new DurableClientReconnectDUnitTest("temp");
-    instance.createCache(props);
-    PoolImpl p = (PoolImpl)PoolManager.createFactory()
-      .addServer(host, PORT1.intValue())
-      .setSubscriptionEnabled(true)
-      .setReadTimeout(10000)
-      // .setRetryInterval(2000)
-      .setSubscriptionRedundancy(redundancyLevel)
-      .create("DurableClientReconnectDUnitTestPool");
-      
-    AttributesFactory factory = new AttributesFactory();
-    factory.setScope(Scope.LOCAL);
-    factory.setPoolName(p.getName());
+  private void createCacheClientAndConnectToSingleServer(String host, int redundancyLevel) {
+    try {
+      final String durableClientId = "DurableClientReconnectDUnitTest_client";
+      final int durableClientTimeout = 60; // keep the client alive for 60 seconds
+      Properties props = getClientDistributedSystemProperties(durableClientId,durableClientTimeout );
+      instance = new DurableClientReconnectDUnitTest();
+      instance.createCache(props);
+      PoolImpl p = (PoolImpl)PoolManager.createFactory()
+        .addServer(host, PORT1.intValue())
+        .setSubscriptionEnabled(true)
+        .setReadTimeout(10000)
+        // .setRetryInterval(2000)
+        .setSubscriptionRedundancy(redundancyLevel)
+        .create("DurableClientReconnectDUnitTestPool");
 
-    RegionAttributes attrs = factory.create();
-    Region r = cache.createRegion(REGION_NAME, attrs);
-    assertNotNull(r);
+      AttributesFactory factory = new AttributesFactory();
+      factory.setScope(Scope.LOCAL);
+      factory.setPoolName(p.getName());
 
-    pool = p;
-    conn = pool.acquireConnection();
-    assertNotNull(conn);
-    
-    cache.readyForEvents();
+      RegionAttributes attrs = factory.create();
+      Region r = cache.createRegion(REGION_NAME, attrs);
+      assertNotNull(r);
+
+      pool = p;
+      conn = pool.acquireConnection();
+      assertNotNull(conn);
+
+      cache.readyForEvents();
     
     }catch(Exception e){
       Assert.fail("test failed due to " , e );
     }    
   }
 
-  private void createCacheClientAndConnectToSingleServerWithZeroConnPerServer(String host, int redundancyLevel){
-    try{
+  private void createCacheClientAndConnectToSingleServerWithZeroConnPerServer(String host, int redundancyLevel) {
+    try {
       final String durableClientId = "DurableClientReconnectDUnitTest_client";
       final int durableClientTimeout = 60; // keep the client alive for 60 seconds
       Properties props = getClientDistributedSystemProperties(durableClientId,durableClientTimeout );
-      instance = new DurableClientReconnectDUnitTest("temp");
+      instance = new DurableClientReconnectDUnitTest();
       instance.createCache(props);
       PoolImpl p = (PoolImpl)PoolManager.createFactory()
         .addServer(host, PORT1.intValue())
@@ -694,13 +716,12 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
       
       cache.readyForEvents();
       
-      }catch(Exception e){
-        Assert.fail("test failed due to " , e );
-      }    
+    }catch(Exception e){
+      Assert.fail("test failed due to " , e );
+    }
   }
 
-  private Properties getClientDistributedSystemProperties(
-      String durableClientId, int durableClientTimeout) {
+  private Properties getClientDistributedSystemProperties( String durableClientId, int durableClientTimeout) {
     Properties properties = new Properties();
     properties.setProperty(MCAST_PORT, "0");
     properties.setProperty(LOCATORS, "");
@@ -721,17 +742,14 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     server4.invoke(() -> DurableClientReconnectDUnitTest.closeCache());
   }
 
- public void closeCache(boolean keepAlive)
- {
-   if (cache != null && !cache.isClosed()) {
-     cache.close(keepAlive);
-     cache.getDistributedSystem().disconnect();
-   }
- }
-
+  private void closeCache(boolean keepAlive) {
+    if (cache != null && !cache.isClosed()) {
+      cache.close(keepAlive);
+      cache.getDistributedSystem().disconnect();
+    }
+  }
 
-  public static void closeCache()
-  {
+  private static void closeCache() {
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
index c2145b3..b1f0095 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
@@ -16,6 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.concurrent.RejectedExecutionException;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.InterestResultPolicy;
@@ -26,17 +36,15 @@ import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.Properties;
-import java.util.concurrent.RejectedExecutionException;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
- * 
  * The DUnitTest checks whether the following Three counts are incremented
  * correctly or not:
  * 1) DurableReconnectionCount -> Incremented Each time 
@@ -49,7 +57,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * In the given test DurableClient comes up and goes down discreetly with
  * different DurableClientTimeouts so as to increment the counts
  */
-public class DurableClientStatsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DurableClientStatsDUnitTest extends JUnit4DistributedTestCase {
 
   private VM server1VM;
 
@@ -61,10 +70,6 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
   private final String K1 = "Key1";
 
-  public DurableClientStatsDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -81,9 +86,8 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
     CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
   }
   
+  @Test
   public void testNonDurableClientStatistics() {
-
-
     // Step 1: Starting the servers
     PORT1 = ((Integer)this.server1VM.invoke(() -> CacheServerTestUtil.createCacheServer( regionName, new Boolean(true)
              ))).intValue();
@@ -119,9 +123,9 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatisticsWithExpectedValues( new Integer(0),
             new Integer(0), new Integer(0) ));
-  
-    
   }
+
+  @Test
   public void testDurableClientStatistics() {
 
     // Step 1: Starting the servers
@@ -160,9 +164,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
     this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatisticsWithExpectedValues( new Integer(3),
             new Integer(4), new Integer(2) ));
   }
-  
-  
-  
+
   public void startRegisterAndCloseDurableClientCache(int durableClientTimeout) {
     final String durableClientId = getName() + "_client";
 
@@ -269,7 +271,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
           + stats.get_eventEnqueuedWhileClientAwayCount());
     }
     catch (Exception e) {
-      fail("Exception thrown while executing checkStatistics()");
+      fail("Exception thrown while executing checkStatistics()", e);
     }
   }
 
@@ -293,7 +295,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
       assertEquals(enqueueCount, stats.get_eventEnqueuedWhileClientAwayCount());
     }
     catch (Exception e) {
-      fail("Exception thrown while executing checkStatisticsWithExpectedValues()");
+      fail("Exception thrown while executing checkStatisticsWithExpectedValues()", e);
     }
   }
 
@@ -339,9 +341,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
       assertEquals(value, r.getEntry(key).getValue());
     }
     catch (Exception e) {
-
-      fail("Put in Server has some fight");
-
+      fail("Put in Server has some fight", e);
     }
   }
 



[36/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
index 5729bf6..ebd0b95 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.distributed;
 
+import static org.junit.Assert.*;
+
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
@@ -25,8 +27,8 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import junit.framework.Assert;
-import junit.framework.AssertionFailedError;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
@@ -43,7 +45,6 @@ import com.gemstone.gemfire.distributed.internal.locks.RemoteThread;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.util.StopWatch;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
@@ -54,32 +55,24 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import org.junit.experimental.categories.Category;
-
 /**
  * This class tests distributed ownership via the DistributedLockService api.
  */
 @Category(DistributedTest.class)
-public class DistributedLockServiceDUnitTest extends DistributedTestCase {
-  
-	protected static DistributedSystem dlstSystem;
+public class DistributedLockServiceDUnitTest extends JUnit4DistributedTestCase {
+
+  private static DistributedSystem dlstSystem;
   private static DistributedLockBlackboard blackboard;
-  protected static Object monitor = new Object();
+  private static Object monitor = new Object();
 
   private int hits = 0;
   private int completes = 0;
   private boolean done;
   private boolean got;
 
-
-  public DistributedLockServiceDUnitTest(String name) {
-    super(name);
-  }
-  
-  /////////// Test lifecycle //////////
-
   /**
    * Returns a previously created (or new, if this is the first
    * time this method is called in this VM) distributed system
@@ -132,17 +125,14 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     DLockService.dumpAllServices();
   }
 
-  ///////// Remote setup/teardown support
-
   /**
    * Connects a DistributedSystem, saves it in static variable "system"
    */
   protected static void connectDistributedSystem() {
-    dlstSystem = (new DistributedLockServiceDUnitTest("dummy")).getSystem();
+    dlstSystem = (new DistributedLockServiceDUnitTest()).getSystem();
   }
 
-  /////////  Public test methods
-  
+  @Test
   public void testBasic() {
     String serviceName = getUniqueName();
     String objectName = "object";
@@ -169,6 +159,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     DistributedLockService.destroy(serviceName);
   }
   
+  @Test
   public void testCreateDestroy() throws Exception {
     final String serviceName = getUniqueName();
     final String abc = "abc";
@@ -275,6 +266,8 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   protected static volatile boolean stop_testFairness;
   protected static volatile boolean[] done_testFairness = new boolean[16];
   static { Arrays.fill(done_testFairness, true); }
+  
+  @Test
   public void testFairness() throws Exception {
     final String serviceName = "testFairness_" + getUniqueName();
     final Object lock = "lock";
@@ -418,6 +411,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     return new Integer(count_testFairness[i.intValue()]);
   }
   
+  @Test
   public void testOneGetsAndOthersTimeOut() throws Exception {
     doOneGetsAndOthersTimeOut(1, 1);
 //     doOneGetsAndOthersTimeOut(2, 2);
@@ -475,6 +469,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     service.becomeLockGrantor();
   }
   
+  @Test
   public void testGrantorSelection() {
     // TODO change distributedCreateService usage to be concurrent threads
     
@@ -501,6 +496,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     }
   }
   
+  @Test
   public void testBasicGrantorRecovery() {
     //DLockGrantor.setUncleanDestroyEnabled(true);
 //    try {
@@ -572,7 +568,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
           logInfo("[testBasicGrantorRecovery] succeeded attempt " + attempt);
           break; // success
         }
-        catch (AssertionFailedError e) {
+        catch (AssertionError e) {
           logInfo("[testBasicGrantorRecovery] failed attempt " + attempt);
           if (attempt == attempts-1) throw e;
         }
@@ -583,6 +579,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
 //    }
   }
   
+  @Test
   public void testLockFailover() {
     final int originalGrantorVM = 0;
     final int oneVM = 1;
@@ -672,6 +669,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
                  oneID, twoID);
   }
   
+  @Test
   public void testLockThenBecomeLockGrantor() {
     final int originalGrantorVM = 0;
     final int becomeGrantorVM = 1;
@@ -752,6 +750,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
                  Boolean.FALSE, unlocked);
   }
   
+  @Test
   public void testBecomeLockGrantor() {
     // create lock services...
     int numVMs = 4;
@@ -828,6 +827,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     // verify that pending requests are granted by unlocking them also
   }
 
+  @Test
   public void testTryLock() {
     final Long waitMillis = new Long(100);
     
@@ -860,6 +860,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
                  1, unlockCount);    
   }
   
+  @Test
   public void testOneGetsThenOtherGets()  throws Exception  { // (numVMs, numThreadsPerVM)
     doOneGetsThenOtherGets(1, 1);
 //     doOneGetsThenOtherGets(2, 2);
@@ -867,6 +868,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     doOneGetsThenOtherGets(4, 3);
   }
   
+  @Test
   public void testLockDifferentNames() throws Exception  {
     String serviceName = getUniqueName();
 
@@ -890,6 +892,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     service.unlock("masterVMobj");
   }
   
+  @Test
   public void testLocalGetLockAndIncrement()  throws Exception {
     String serviceName = getUniqueName();
     remoteCreateService(serviceName);
@@ -897,6 +900,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     assertEquals(Boolean.TRUE, 
                  getLockAndIncrement(serviceName, "localVMobj", -1, 0));
   }
+  @Test
   public void testRemoteGetLockAndIncrement() {
     String serviceName = getUniqueName();
     VM vm = Host.getHost(0).getVM(0);
@@ -906,6 +910,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
       )));
   }
   
+  @Test
   public void testLockSameNameDifferentService() 
   {
     String serviceName1 = getUniqueName() + "_1";
@@ -933,6 +938,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     service1.unlock(objName);
   }
   
+  @Test
   public void testLeaseDoesntExpire()
   throws InterruptedException
   {
@@ -970,6 +976,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     service.unlock(objName);
   }
 
+  @Test
   public void testLockUnlock() {
     String serviceName = getUniqueName();
     Object objName = new Integer(42);
@@ -978,15 +985,16 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     DistributedLockService service = 
         DistributedLockService.getServiceNamed(serviceName);
 
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
     
     service.lock(objName, -1, -1);
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.isHeldByCurrentThread(objName));
     
     service.unlock(objName);
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
   }
   
+  @Test
   public void testLockExpireUnlock() {
     long leaseMs = 200;
     long waitBeforeLockingMs = 210;
@@ -1013,6 +1021,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     }
   }
   
+  @Test
   public void testLockRecursion() {
     String serviceName = getUniqueName();
     Object objName = new Integer(42);
@@ -1021,24 +1030,25 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     DistributedLockService service = 
         DistributedLockService.getServiceNamed(serviceName);
 
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
     
     // initial lock...
-    Assert.assertTrue(service.lock(objName, -1, -1));
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.lock(objName, -1, -1));
+    assertTrue(service.isHeldByCurrentThread(objName));
 
     // recursion +1...
-    Assert.assertTrue(service.lock(objName, -1, -1));
+    assertTrue(service.lock(objName, -1, -1));
 
     // recursion -1...    
     service.unlock(objName);
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.isHeldByCurrentThread(objName));
 
     // and unlock...    
     service.unlock(objName);
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
   }
   
+  @Test
   public void testLockRecursionWithExpiration() {
     long leaseMs = 500;
     long waitBeforeLockingMs = 750;
@@ -1050,19 +1060,19 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     DistributedLockService service = 
         DistributedLockService.getServiceNamed(serviceName);
 
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
     
     // initial lock...
-    Assert.assertTrue(service.lock(objName, -1, leaseMs));
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.lock(objName, -1, leaseMs));
+    assertTrue(service.isHeldByCurrentThread(objName));
 
     // recursion +1...
-    Assert.assertTrue(service.lock(objName, -1, leaseMs));
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.lock(objName, -1, leaseMs));
+    assertTrue(service.isHeldByCurrentThread(objName));
     
     // expire...
     sleep(waitBeforeLockingMs);
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
 
     // should fail...
     try {
@@ -1072,39 +1082,41 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     }
     
     // relock it...
-    Assert.assertTrue(service.lock(objName, -1, leaseMs));
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.lock(objName, -1, leaseMs));
+    assertTrue(service.isHeldByCurrentThread(objName));
 
     // and unlock to verify no recursion...    
     service.unlock(objName);
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName)); // throws failure!!
+    assertTrue(!service.isHeldByCurrentThread(objName)); // throws failure!!
     
     // go thru again in different order...
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
     
     // initial lock...
-    Assert.assertTrue(service.lock(objName, -1, leaseMs));
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.lock(objName, -1, leaseMs));
+    assertTrue(service.isHeldByCurrentThread(objName));
 
     // expire...
     sleep(waitBeforeLockingMs);
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
 
     // relock it...
-    Assert.assertTrue(service.lock(objName, -1, leaseMs));
-    Assert.assertTrue(service.isHeldByCurrentThread(objName));
+    assertTrue(service.lock(objName, -1, leaseMs));
+    assertTrue(service.isHeldByCurrentThread(objName));
     
     // and unlock to verify no recursion...    
     service.unlock(objName);
-    Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+    assertTrue(!service.isHeldByCurrentThread(objName));
   }
   
+  @Test
   public void testLeaseExpiresBeforeOtherLocks()
   throws InterruptedException 
   {
     leaseExpiresTest(false);
   }
   
+  @Test
   public void testLeaseExpiresWhileOtherLocks()
   throws InterruptedException 
   {
@@ -1131,7 +1143,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     sleep(waitBeforeLockingMs);
 
     if (waitBeforeLockingMs > leaseMs) {
-      Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+      assertTrue(!service.isHeldByCurrentThread(objName));
     }
     
     LogWriterUtils.getLogWriter().fine("[testLeaseExpires] acquire lock that expired");
@@ -1141,7 +1153,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
       public void run() {
         resultHolder[0] = service.lock(objName, -1, -1);
         service.unlock(objName);
-        Assert.assertTrue(!service.isHeldByCurrentThread(objName));
+        assertTrue(!service.isHeldByCurrentThread(objName));
       }
     });
     thread.start();
@@ -1181,6 +1193,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testSuspendLockingAfterExpiration() throws Exception {
     LogWriterUtils.getLogWriter().fine("[leaseExpiresThenSuspendTest]");
     
@@ -1228,6 +1241,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   volatile Throwable exception = null;
   volatile Throwable throwable = null;
 
+  @Test
   public void testLockInterruptiblyIsInterruptible() {
     started = false;
     gotLock = false;
@@ -1291,6 +1305,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   
   volatile boolean wasFlagSet = false;
 
+  @Test
   public void testLockIsNotInterruptible() {
     // Lock entire service in first thread
     LogWriterUtils.getLogWriter().fine("[testLockIsNotInterruptible] lock in first thread");
@@ -1355,6 +1370,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   /**
    * Test DistributedLockService.acquireExclusiveLocking(), releaseExclusiveLocking()
    */
+  @Test
   public void testSuspendLockingBasic() 
   throws InterruptedException {
     final DistributedLockService service = 
@@ -1396,6 +1412,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   /**
    * Test that exlusive locking prohibits locking activity
    */
+  @Test
   public void testSuspendLockingProhibitsLocking() 
   {
     final String name = getUniqueName();
@@ -1646,6 +1663,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   /**
    * Test that exlusive locking prohibits locking activity
    */
+  @Test
   public void testSuspendLockingBlocksUntilNoLocks() 
   throws InterruptedException
   {
@@ -1717,6 +1735,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     
   }
   
+  @Test
   public void testSuspendLockingInterruptiblyIsInterruptible() {
     
     started = false;
@@ -1761,6 +1780,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     DistributedLockService.destroy(name);
   }
   
+  @Test
   public void testSuspendLockingIsNotInterruptible() {
     
     started = false;
@@ -1822,6 +1842,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
    *
    * @author David Whitlock
    */
+  @Test
   public void testLockDestroyedService() {
     String serviceName = this.getUniqueName();
     DistributedLockService service =
@@ -1836,6 +1857,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     }
   }
   
+  @Test
   public void testDepartedLastOwnerWithLease() {
     final String serviceName = this.getUniqueName();
 
@@ -1868,6 +1890,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     
   }
   
+  @Test
   public void testDepartedLastOwnerNoLease() {
     final String serviceName = this.getUniqueName();
 
@@ -1907,6 +1930,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
    * attempts to lock "lock" and old dlock throws StuckLockException. VM-C
    * should now succeed in acquiring the lock.
    */
+  @Test
   public void testBug32461() throws Exception {
     LogWriterUtils.getLogWriter().fine("[testBug32461] prepping");
 
@@ -1956,6 +1980,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     });
   }
   
+  @Test
   public void testNoStuckLock() {
     final String serviceName = this.getUniqueName();
     final Object keyWithLease = "key-with-lease";
@@ -1999,6 +2024,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
    * the grant reply. This causes the Client to send a release msg to the
    * grantor.
    */
+  @Test
   public void testReleaseOrphanedGrant_Local() {
     DLockRequestProcessor.setDebugReleaseOrphanedGrant(true);
     DLockRequestProcessor.setWaitToProcessDLockResponse(false);
@@ -2089,9 +2115,11 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   static volatile boolean unlockedThreadVM1_testReleaseOrphanedGrant_Remote;
   static volatile boolean startedThreadVM2_testReleaseOrphanedGrant_Remote;
   static volatile boolean gotLockThreadVM2_testReleaseOrphanedGrant_Remote;
+  @Test
   public void testReleaseOrphanedGrant_Remote() {
     doTestReleaseOrphanedGrant_Remote(false);
   }
+  @Test
   public void testReleaseOrphanedGrant_RemoteWithDestroy() {
     doTestReleaseOrphanedGrant_Remote(true);
   }
@@ -2217,6 +2245,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     }
   }
   
+  @Test
   public void testDestroyLockServiceAfterGrantResponse() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2270,6 +2299,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
     });
   }
   
+  @Test
   public void testDestroyLockServiceBeforeGrantRequest() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2537,6 +2567,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
 
   }
   
+  @Test
   public void testTokenCleanup() throws Exception {
     final String dlsName = getUniqueName();
   
@@ -2666,6 +2697,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   //static volatile boolean finishedThreadVM2_testTokenCleanup;
   //static volatile DLockToken grantorDLockToken_testTokenCleanup;
   
+  @Test
   public void testGrantTokenCleanup() throws Exception {
     final String dlsName = getUniqueName();
   
@@ -2761,6 +2793,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
   }
 
   static final AtomicBoolean testLockQuery_whileVM1Locks = new AtomicBoolean();
+  @Test
   public void testLockQuery() throws Exception {
     final String dlsName = getUniqueName();
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index 3e133f6..b40f91b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.distributed;
 
+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.ForcedDisconnectException;
 import com.gemstone.gemfire.GemFireConfigException;
 import com.gemstone.gemfire.LogWriter;
@@ -57,7 +66,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 4.0
  */
-public class LocatorDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class LocatorDUnitTest extends JUnit4DistributedTestCase {
 
   private static volatile InternalDistributedSystem system = null;
 
@@ -66,8 +76,8 @@ public class LocatorDUnitTest extends DistributedTestCase {
   /**
    * Creates a new <code>LocatorDUnitTest</code>
    */
-  public LocatorDUnitTest(String name) {
-    super(name);
+  public LocatorDUnitTest() {
+    super();
   }
 
   private static final String WAIT2_MS_NAME = "LocatorDUnitTest.WAIT2_MS";
@@ -122,6 +132,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * it hung with the restarted locator trying to become elder again because
    * it put its address at the beginning of the new view it sent out.
    */
+  @Test
   public void testCollocatedLocatorWithSecurity() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -251,6 +262,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    *
    * @throws Exception
    */
+  @Test
   public void testStartTwoLocators() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -364,6 +376,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
   /**
    * test lead member selection
    */
+  @Test
   public void testLeadMemberSelection() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -473,6 +486,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * We then kill the lead member and demonstrate that the original locator
    * (which is now the sole remaining member) shuts itself down.
    */
+  @Test
   public void testLeadAndCoordFailure() throws Exception {
     IgnoredException.addIgnoredException("Possible loss of quorum due");
     disconnectAllFromDS();
@@ -606,6 +620,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * We then shut down the group coordinator and observe the second locator
    * pick up the job and the remaining member continues to operate normally.
    */
+  @Test
   public void testLeadFailureAndCoordShutdown() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -752,6 +767,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    */
   // disabled on trunk - should be reenabled on cedar_dev_Oct12
   // this test leaves a CloserThread around forever that logs "pausing" messages every 500 ms
+  @Test
   public void testForceDisconnectAndPeerShutdownCause() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -889,6 +905,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * We kill the coordinator and shut down the lead member and observe the second locator
    * pick up the job and the remaining member continue to operate normally.
    */
+  @Test
   public void testLeadShutdownAndCoordFailure() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1014,6 +1031,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * Tests that attempting to connect to a distributed system in which
    * no locator is defined throws an exception.
    */
+  @Test
   public void testNoLocator() {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1074,6 +1092,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * <p>The locator is then restarted and is shown to take over the
    * role of membership coordinator.
    */
+  @Test
   public void testOneLocator() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1166,6 +1185,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * is correct.  It then restarts the locator to demonstrate that
    * it can connect to and function as the group coordinator
    */
+  @Test
   public void testLocatorBecomesCoordinator() throws Exception {
     disconnectAllFromDS();
     final String expected = "java.net.ConnectException";
@@ -1303,6 +1323,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
   /**
    * Tests starting multiple locators in multiple VMs.
    */
+  @Test
   public void testMultipleLocators() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1420,6 +1441,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * GEODE-870
    */
   @Category(FlakyTest.class) // GEODE-1150: random ports, disk pollution, waitForCriterion, time sensitive, eats exceptions (fixed several)
+  @Test
   public void testMultipleLocatorsRestartingAtSameTime() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1622,6 +1644,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
   /**
    * Tests starting multiple locators in multiple VMs.
    */
+  @Test
   public void testMultipleMcastLocators() throws Exception {
     disconnectAllFromDS();
     IgnoredException.addIgnoredException("Could not stop  Distribution Locator"); // shutdown timing issue in InternalLocator
@@ -1737,6 +1760,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * Tests that a VM can connect to a locator that is hosted in its
    * own VM.
    */
+  @Test
   public void testConnectToOwnLocator() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1764,6 +1788,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
   /**
    * Tests that a single VM can NOT host multiple locators
    */
+  @Test
   public void testHostingMultipleLocators() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -1821,6 +1846,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    *
    * @since GemFire 4.1
    */
+  @Test
   public void testRestartLocator() throws Exception {
     disconnectAllFromDS();
     port1 =

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
index 55fc69b..ac3c23e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
@@ -16,34 +16,33 @@
  */
 package com.gemstone.gemfire.distributed;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.distributed.internal.DM;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the setting of Roles in a DistributedSystem
- *
  */
-public class RoleDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class RoleDUnitTest extends JUnit4DistributedTestCase {
   
   static Properties distributionProperties = new Properties();
 
-  public RoleDUnitTest(String name) {
-    super(name);
-  }
-  
-  
-  
   @Override
   public Properties getDistributedSystemProperties() {
     return distributionProperties;
@@ -52,11 +51,11 @@ public class RoleDUnitTest extends DistributedTestCase {
   /**
    * Tests usage of Roles in a Loner vm.
    */
+  @Test
   public void testRolesInLonerVM() {
     final String rolesProp = "A,B,C,D,E,F,G";
     final String[] rolesArray = new String[] {"A","B","C","D","E","F","G"};
-//    final List rolesList = Arrays.asList(rolesArray);
-    
+
     distributionProperties = new Properties();
     distributionProperties.setProperty(MCAST_PORT, "0");
     distributionProperties.setProperty(LOCATORS, "");
@@ -90,6 +89,7 @@ public class RoleDUnitTest extends DistributedTestCase {
   /**
    * Tests usage of Roles in four distributed vms.
    */
+  @Test
   public void testRolesInDistributedVMs() {  
     // connect all four vms...
     final String[] vmRoles = new String[] 
@@ -150,6 +150,7 @@ public class RoleDUnitTest extends DistributedTestCase {
   /** 
    * Tests that specifying duplicate role names results in just one Role.
    */
+  @Test
   public void testDuplicateRoleNames() {
     final String rolesProp = "A,A";
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
index 73c9c8c..782a41b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
@@ -16,28 +16,29 @@
  */
 package com.gemstone.gemfire.distributed;
 
+import static org.junit.Assert.*;
+
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.SystemAdmin;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class SystemAdminDUnitTest extends DistributedTestCase {
-
-  public SystemAdminDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class SystemAdminDUnitTest extends JUnit4DistributedTestCase {
 
   @Override
   public final void postSetUp() throws Exception {
@@ -59,6 +60,7 @@ public class SystemAdminDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testPrintStacks() throws Exception {
 
     // create a gemfire.properties that lets SystemAdmin find the dunit locator

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
index 9aee361..4c22cfd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
@@ -16,30 +16,41 @@
  */
 package com.gemstone.gemfire.distributed.internal;
 
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.ToDataException;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.ToDataException;
+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.Scope;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 	
-public class Bug40751DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug40751DUnitTest extends JUnit4CacheTestCase {
 	 
-  public Bug40751DUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
   }
 	 
+  @Test
   public void testRR() {
     System.setProperty("p2p.nodirectBuffers", "true");
     try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
index 10ebdaf..3c48fb9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
@@ -17,40 +17,57 @@
 package com.gemstone.gemfire.distributed.internal;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedLockService;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.Config;
-import com.gemstone.gemfire.internal.admin.*;
+import com.gemstone.gemfire.internal.admin.Alert;
+import com.gemstone.gemfire.internal.admin.AlertListener;
+import com.gemstone.gemfire.internal.admin.ApplicationVM;
+import com.gemstone.gemfire.internal.admin.DLockInfo;
+import com.gemstone.gemfire.internal.admin.EntryValueNode;
+import com.gemstone.gemfire.internal.admin.GemFireVM;
+import com.gemstone.gemfire.internal.admin.GfManagerAgent;
+import com.gemstone.gemfire.internal.admin.GfManagerAgentConfig;
+import com.gemstone.gemfire.internal.admin.GfManagerAgentFactory;
+import com.gemstone.gemfire.internal.admin.StatResource;
 import com.gemstone.gemfire.internal.admin.remote.RemoteTransportConfig;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Set;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the functionality of the {@linkplain com.gemstone.gemfire.internal.admin internal
  * admin} API.
  */
-public class ConsoleDistributionManagerDUnitTest 
-  extends CacheTestCase implements AlertListener {
+@Category(DistributedTest.class)
+public class ConsoleDistributionManagerDUnitTest extends JUnit4CacheTestCase implements AlertListener {
 
   protected GfManagerAgent agent = null;
   private static boolean firstTime = true;
   
-  public ConsoleDistributionManagerDUnitTest(String name) {
-    super(name);
-  }
-
-//  private volatile Alert lastAlert = null;
-
   public void alert(Alert alert) {
     LogWriterUtils.getLogWriter().info("DEBUG: alert=" + alert);
-//    this.lastAlert = alert;
   }
 
   @Override
@@ -140,12 +157,14 @@ public class ConsoleDistributionManagerDUnitTest
     }
   }
 
+  @Test
   public void testGetDistributionVMType() {
     DM dm = this.agent.getDM();
     InternalDistributedMember ipaddr = dm.getId();
     assertEquals(DistributionManager.ADMIN_ONLY_DM_TYPE, ipaddr.getVmKind());
   }
 
+  @Test
   public void testAgent() {
     assertEquals("expected empty peer array", 0, agent.listPeers().length);
     int systemCount = 0;
@@ -159,6 +178,7 @@ public class ConsoleDistributionManagerDUnitTest
     assertTrue("agent should have been disconnected", !agent.isConnected());
   }
 
+  @Test
   public void testApplications() throws Exception {
     {
       WaitCriterion ev = new WaitCriterion() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
index 375c2c6..8a9806b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
@@ -16,31 +16,31 @@
  */
 package com.gemstone.gemfire.distributed.internal;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.CancelCriterion;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class DistributionAdvisorDUnitTest extends JUnit4DistributedTestCase {
 
-/**
- *
- *
- */
-public class DistributionAdvisorDUnitTest extends DistributedTestCase {
   private transient DistributionAdvisor.Profile profiles[];
   protected transient DistributionAdvisor advisor;
   
-  public DistributionAdvisorDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     // connect to distributed system in every VM
@@ -88,6 +88,7 @@ public class DistributionAdvisorDUnitTest extends DistributedTestCase {
   }
   
     
+  @Test
   public void testGenericAdvice() {
     Set expected = new HashSet();
     for (int i = 0; i < profiles.length; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
index 39a50b3..86e0fdc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
@@ -16,9 +16,34 @@
  */
 package com.gemstone.gemfire.distributed.internal;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Properties;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.admin.*;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.admin.AdminDistributedSystem;
+import com.gemstone.gemfire.admin.AdminDistributedSystemFactory;
+import com.gemstone.gemfire.admin.Alert;
+import com.gemstone.gemfire.admin.AlertLevel;
+import com.gemstone.gemfire.admin.AlertListener;
+import com.gemstone.gemfire.admin.DistributedSystemConfig;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
@@ -28,22 +53,26 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManage
 import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Manager;
 import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager;
 import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.*;
-import org.apache.logging.log4j.Logger;
-import org.junit.Assert;
-
-import java.net.InetAddress;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the functionality of the {@link
  * DistributionManager} class.
  */
-public class DistributionManagerDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributionManagerDUnitTest extends JUnit4DistributedTestCase {
   private static final Logger logger = LogService.getLogger();
-  
+
+  public static DistributedSystem ds;
+
   /**
    * Clears the exceptionInThread flag in the given distribution
    * manager. 
@@ -52,18 +81,12 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
     dm.clearExceptionInThreads();
   }
 
-  public DistributionManagerDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public void preSetUp() throws Exception {
     disconnectAllFromDS();
   }
 
-  ////////  Test Methods
-
-  protected static class ItsOkayForMyClassNotToBeFound 
+  protected static class ItsOkayForMyClassNotToBeFound
     extends SerialDistributionMessage {
 
     public int getDSFID() {
@@ -76,8 +99,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
     }
   };
   
-  public static DistributedSystem ds;
-  
+  @Test
   public void testGetDistributionVMType() {
     DM dm = getSystem().getDistributionManager();
     InternalDistributedMember ipaddr = dm.getId();
@@ -87,6 +109,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
   /**
    * Send the distribution manager a message it can't deserialize
    */
+  @Ignore("TODO: use Awaitility and reenable assertions")
+  @Test
   public void testExceptionInThreads() throws InterruptedException {
     DM dm = getSystem().getDistributionManager();
     String p1 = "ItsOkayForMyClassNotToBeFound";
@@ -100,7 +124,9 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
 //    assertTrue(!dm.exceptionInThreads());
   }
 
-  public void _testGetDistributionManagerIds() {
+  @Ignore("TODO: this passes when enabled")
+  @Test
+  public void testGetDistributionManagerIds() {
     int systemCount = 0;
     for (int h = 0; h < Host.getHostCount(); h++) {
       Host host = Host.getHost(h);
@@ -112,14 +138,12 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
 
     assertEquals(systemCount, dm.getNormalDistributionManagerIds().size());
   }
-  
-  
-
 
   /**
    * Demonstrate that a new UDP port is used when an attempt is made to
    * reconnect using a shunned port
    */
+  @Test
   public void testConnectAfterBeingShunned() {
     InternalDistributedSystem sys = getSystem();
     MembershipManager mgr = MembershipManagerHelper.getMembershipManager(sys);
@@ -149,6 +173,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
    * until the member should be gone and force more view processing to have
    * it scrubbed from the set.
    **/ 
+  @Test
   public void testSurpriseMemberHandling() {
     VM vm0 = Host.getHost(0).getVM(0);
 
@@ -206,7 +231,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
         Thread.sleep(gracePeriod);
       }
       catch (InterruptedException e) {
-        fail("test was interrupted");
+        fail("test was interrupted", e);
       }
       
       vm0.invoke(connectDisconnect);
@@ -214,8 +239,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
           !mgr.isSurpriseMember(mbr));
       
     }
-    catch (java.net.UnknownHostException e) {
-      fail("unable to resolve localhost - test needs some attention");
+    catch (UnknownHostException e) {
+      fail("unable to resolve localhost - test needs some attention", e);
     }
     finally {
       if (sys != null && sys.isConnected()) {
@@ -237,6 +262,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
    * region that sleeps when notified, forcing the operation to take longer
    * than ack-wait-threshold + ack-severe-alert-threshold
    */
+  @Test
   public void testAckSevereAlertThreshold() throws Exception {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -332,7 +358,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
           Thread.sleep(15000);
         }
         catch (InterruptedException ie) {
-          fail("interrupted");
+          fail("interrupted", ie);
         }
       }
       @Override
@@ -378,6 +404,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
   /**
    * Tests that a sick member is kicked out
    */
+  @Test
   public void testKickOutSickMember() throws Exception {
     disconnectAllFromDS();
     IgnoredException.addIgnoredException("10 seconds have elapsed while waiting");
@@ -490,8 +517,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
 
   /**
    * test use of a bad bind-address for bug #32565
-   * @throws Exception
    */
+  @Test
   public void testBadBindAddress() throws Exception {
     disconnectAllFromDS();
 
@@ -521,6 +548,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
   /**
    * install a new view and show that waitForViewInstallation works as expected
    */
+  @Test
   public void testWaitForViewInstallation() {
     getSystem(new Properties());
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/LDM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/LDM.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/LDM.java
index bcc4041..ba16278 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/LDM.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/LDM.java
@@ -16,14 +16,14 @@
  */
 package com.gemstone.gemfire.distributed.internal;
 
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.logging.LogService;
-import org.apache.logging.log4j.Logger;
-import util.TestException;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
+import org.apache.logging.log4j.Logger;
+
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.logging.LogService;
 
 /**
  * A little class for testing the local DistributionManager
@@ -50,7 +50,7 @@ public class LDM {
       Thread.sleep(5 * 1000);
 
     } catch (InterruptedException ex) {
-      throw new TestException("interrupted");
+      throw new AssertionError("interrupted");
     }
 
     system.disconnect();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
index c0aa6c5..cc99bad 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
@@ -16,6 +16,18 @@
  */
 package com.gemstone.gemfire.distributed.internal;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionShortcut;
@@ -23,26 +35,19 @@ import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-
-public class ProductUseLogDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ProductUseLogDUnitTest extends JUnit4CacheTestCase {
 
-  public ProductUseLogDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public void preSetUp() {
     disconnectAllFromDS();
@@ -55,6 +60,7 @@ public class ProductUseLogDUnitTest extends CacheTestCase {
     return p;
   }
   
+  @Test
   public void testMembershipMonitoring() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
index 8977172..7767432 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.distributed.internal.deadlock;
 
+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.Collections;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -46,7 +55,8 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
-public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class GemFireDeadlockDetectorDUnitTest extends JUnit4CacheTestCase {
   
   private static final Set<Thread> stuckThreads = Collections.synchronizedSet(new HashSet<Thread>());
 
@@ -73,10 +83,11 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
     });
   }
 
-  public GemFireDeadlockDetectorDUnitTest(String name) {
-    super(name);
+  public GemFireDeadlockDetectorDUnitTest() {
+    super();
   }
   
+  @Test
   public void testNoDeadlock() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -96,6 +107,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
   private static final Lock lock = new ReentrantLock();
   
   @Category(FlakyTest.class) // GEODE-516 & GEODE-576: async actions, thread sleeps, time sensitive
+  @Test
   public void testDistributedDeadlockWithFunction() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -142,6 +154,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testDistributedDeadlockWithDLock() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
index fb3c5a7..3a6060e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
@@ -16,10 +16,45 @@
  */
 package com.gemstone.gemfire.distributed.internal.membership.gms.messenger;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.*;
+import static org.mockito.Mockito.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.lang.SerializationException;
+import org.jgroups.Address;
+import org.jgroups.Event;
+import org.jgroups.JChannel;
+import org.jgroups.Message;
+import org.jgroups.conf.ClassConfigurator;
+import org.jgroups.protocols.UNICAST3;
+import org.jgroups.protocols.pbcast.NAKACK2;
+import org.jgroups.util.Digest;
+import org.jgroups.util.UUID;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.ForcedDisconnectException;
 import com.gemstone.gemfire.GemFireIOException;
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
-import com.gemstone.gemfire.distributed.internal.*;
+import com.gemstone.gemfire.distributed.internal.DM;
+import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
+import com.gemstone.gemfire.distributed.internal.DistributionManager;
+import com.gemstone.gemfire.distributed.internal.DistributionMessage;
+import com.gemstone.gemfire.distributed.internal.DistributionStats;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.distributed.internal.SerialAckedMessage;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.NetView;
 import com.gemstone.gemfire.distributed.internal.membership.gms.GMSMember;
@@ -34,39 +69,19 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.messages.JoinReq
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.JoinResponseMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.LeaveRequestMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messenger.JGroupsMessenger.JGroupsReceiver;
-import com.gemstone.gemfire.internal.*;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.internal.DataSerializableFixedID;
+import com.gemstone.gemfire.internal.HeapDataOutputStream;
+import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.admin.remote.RemoteTransportConfig;
 import com.gemstone.gemfire.internal.cache.DistributedCacheOperation;
 import com.gemstone.gemfire.internal.logging.log4j.AlertAppender;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.apache.commons.lang.SerializationException;
-import org.jgroups.Address;
-import org.jgroups.Event;
-import org.jgroups.JChannel;
-import org.jgroups.Message;
-import org.jgroups.conf.ClassConfigurator;
-import org.jgroups.protocols.UNICAST3;
-import org.jgroups.protocols.pbcast.NAKACK2;
-import org.jgroups.util.Digest;
-import org.jgroups.util.UUID;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.*;
 
 @Category(IntegrationTest.class)
 public class JGroupsMessengerJUnitTest {
+
   private Services services;
   private JGroupsMessenger messenger;
   private JoinLeave joinLeave;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
index a5bba7c..f220e96 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
@@ -20,7 +20,7 @@
 //
 package com.gemstone.gemfire.distributed.internal.streaming;
 
-import static com.gemstone.gemfire.test.dunit.Wait.pause;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -30,28 +30,26 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.TimeUnit;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.distributed.internal.DM;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.ReplyException;
 import com.gemstone.gemfire.distributed.internal.ReplyProcessor21;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.cache.Token;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
-import com.jayway.awaitility.Awaitility;
-
-public class StreamingOperationManyDUnitTest extends DistributedTestCase {
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-  public StreamingOperationManyDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class StreamingOperationManyDUnitTest extends JUnit4DistributedTestCase {
 
+  @Test
   public void testStreamingManyProvidersNoExceptions() throws Exception {
 //    final String name = this.getUniqueName();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
index a09c167..c46c7c5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
@@ -20,6 +20,8 @@
 //
 package com.gemstone.gemfire.distributed.internal.streaming;
 
+import static org.junit.Assert.*;
+
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -30,6 +32,9 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
@@ -37,16 +42,15 @@ import com.gemstone.gemfire.distributed.internal.ReplyException;
 import com.gemstone.gemfire.distributed.internal.ReplyProcessor21;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.cache.Token;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class StreamingOperationOneDUnitTest extends DistributedTestCase {
-
-  public StreamingOperationOneDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class StreamingOperationOneDUnitTest extends JUnit4DistributedTestCase {
 
+  @Test
   public void testStreamingOneProviderNoExceptions() throws Exception {
 //    final String name = this.getUniqueName();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
index 976a2fa..4bf7ecb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
@@ -16,6 +16,16 @@
  */
 package com.gemstone.gemfire.distributed.internal.tcpserver;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.Locator;
@@ -26,34 +36,18 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.locator.FindCoor
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.SocketCreator;
 import com.gemstone.gemfire.internal.Version;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 /**
  * This tests the rolling upgrade for locators with
  * different GOSSIPVERSION.
- *
- *
  */
 @Category(DistributedTest.class)
-public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
-
-  /**
-   * @param name
-   */
-  public TcpServerBackwardCompatDUnitTest(String name) {
-    super(name);
-  }
+public class TcpServerBackwardCompatDUnitTest extends JUnit4DistributedTestCase {
 
   @Override
   public final void postSetUp() throws Exception {
@@ -84,6 +78,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
    * GOSSIPVERSION and verifies that it has recoverd the system
    * View. Then we upgrade next locator.
    */
+  @Test
   public void testGossipVersionBackwardCompatibility() {
     Host host = Host.getHost(0);
     final VM locator0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
index 9b1b8d3..425b391 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
@@ -16,20 +16,19 @@
  */
 package com.gemstone.gemfire.distributed.internal.tcpserver;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.net.ConnectException;
 import java.net.InetAddress;
-import java.net.UnknownHostException;
 import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import junit.framework.Assert;
-
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -44,12 +43,12 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 @Category(IntegrationTest.class)
 public class TcpServerJUnitTest {
   
-  protected/*GemStoneAddition*/ InetAddress localhost;
-  protected/*GemStoneAddition*/ int port;
+  private/*GemStoneAddition*/ InetAddress localhost;
+  private/*GemStoneAddition*/ int port;
   private SimpleStats stats;
   private TcpServer server;
 
-  public void start(TcpHandler handler) throws IOException {
+  private void start(TcpHandler handler) throws IOException {
     localhost = InetAddress.getLocalHost();
     port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     
@@ -59,18 +58,18 @@ public class TcpServerJUnitTest {
   }
   
   @Test
-  public void test() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException {
+  public void test() throws Exception {
     EchoHandler handler = new EchoHandler();
     start(handler);
     
     TestObject test = new TestObject();
     test.id = 5;
     TestObject result = (TestObject) TcpClient.requestToServer(localhost, port, test, 60 * 1000 );
-    Assert.assertEquals(test.id, result.id);
+    assertEquals(test.id, result.id);
     
     String[] info = TcpClient.getInfo(localhost, port);
-    Assert.assertNotNull(info);
-    Assert.assertTrue(info.length > 1);
+    assertNotNull(info);
+    assertTrue(info.length > 1);
    
     try { 
       TcpClient.stop(localhost, port);
@@ -78,16 +77,16 @@ public class TcpServerJUnitTest {
       // must not be running 
     }
     server.join(60 * 1000);
-    Assert.assertFalse(server.isAlive());
-    Assert.assertTrue(handler.shutdown);
+    assertFalse(server.isAlive());
+    assertTrue(handler.shutdown);
     
-    Assert.assertEquals(4, stats.started.get());
-    Assert.assertEquals(4, stats.ended.get());
+    assertEquals(4, stats.started.get());
+    assertEquals(4, stats.ended.get());
     
   }
   
   @Test
-  public void testConcurrency() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException {
+  public void testConcurrency() throws Exception {
     CountDownLatch latch = new CountDownLatch(1);
     DelayHandler handler = new DelayHandler(latch);
     start(handler);
@@ -109,17 +108,17 @@ public class TcpServerJUnitTest {
     delayedThread.start();
     try {
       Thread.sleep(500);
-      Assert.assertFalse(done.get());
+      assertFalse(done.get());
       TcpClient.requestToServer(localhost, port, Boolean.valueOf(false), 60 * 1000 );
-      Assert.assertFalse(done.get());
+      assertFalse(done.get());
 
       latch.countDown();
       Thread.sleep(500);
-      Assert.assertTrue(done.get());
+      assertTrue(done.get());
     } finally {
       latch.countDown();
       delayedThread.join(60 * 1000);
-      Assert.assertTrue(!delayedThread.isAlive()); // GemStoneAddition
+      assertTrue(!delayedThread.isAlive()); // GemStoneAddition
       try {
         TcpClient.stop(localhost, port);
       } catch ( ConnectException ignore ) {
@@ -128,8 +127,8 @@ public class TcpServerJUnitTest {
       server.join(60 * 1000);
     }
   }
-  
-  public static class TestObject implements DataSerializable {
+
+  private static class TestObject implements DataSerializable {
     int id;
     
     public TestObject() {
@@ -146,7 +145,7 @@ public class TcpServerJUnitTest {
     
   }
 
-  protected/*GemStoneAddition*/ static class EchoHandler implements TcpHandler {
+  private/*GemStoneAddition*/ static class EchoHandler implements TcpHandler {
 
     protected/*GemStoneAddition*/ boolean shutdown;
 
@@ -202,8 +201,8 @@ public class TcpServerJUnitTest {
     public void endRequest(Object request,long startTime) { }
     public void endResponse(Object request,long startTime) { }
   }
-  
-  protected/*GemStoneAddition*/ static class SimpleStats implements PoolStatHelper {
+
+  private/*GemStoneAddition*/ static class SimpleStats implements PoolStatHelper {
     AtomicInteger started = new AtomicInteger();
     AtomicInteger ended = new AtomicInteger();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
index df05a3d..e776e2a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.disttx;
 
+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.cache30.CacheMapTxnDUnitTest;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
@@ -27,10 +36,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * Same tests as that of {@link CacheMapTxnDUnitTest} after setting
  * "distributed-transactions" property to true
  */
+@Category(DistributedTest.class)
 public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest {
 
-  public CacheMapDistTXDUnitTest(String name) {
-    super(name);
+  public CacheMapDistTXDUnitTest() {
+    super();
   }
 
   @Override
@@ -68,6 +78,7 @@ public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest {
   }
   
   @Override
+  @Test
   public void testCommitTxn() {
     // [DISTTX] TODO test overridden intentionally and left blank as it fails
     // fix this 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXManagerImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXManagerImplJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXManagerImplJUnitTest.java
index a78216a..9dc6a96 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXManagerImplJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXManagerImplJUnitTest.java
@@ -16,6 +16,13 @@
  */
 package com.gemstone.gemfire.disttx;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static junit.framework.TestCase.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.CacheTransactionManager;
 import com.gemstone.gemfire.cache.RegionShortcut;
@@ -24,25 +31,14 @@ import com.gemstone.gemfire.internal.cache.TXManagerImpl;
 import com.gemstone.gemfire.internal.cache.TXManagerImplJUnitTest;
 import com.gemstone.gemfire.test.junit.categories.DistributedTransactionsTest;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static junit.framework.TestCase.assertTrue;
 
 /**
  * Same tests as that of {@link TXManagerImplJUnitTest} after setting
  * "distributed-transactions" property to true
- *
  */
 @Category({IntegrationTest.class, DistributedTransactionsTest.class })
 public class DistTXManagerImplJUnitTest extends TXManagerImplJUnitTest {
 
-  public DistTXManagerImplJUnitTest() {
-  }
-  
   @Override
   protected void createCache() {
     Properties props = new Properties();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
index 76f7736..9d4623b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
@@ -16,37 +16,43 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.cache.CacheException;
-import com.gemstone.gemfire.cache30.TXOrderDUnitTest;
-
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
 import java.util.Properties;
 
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache30.TXOrderDUnitTest;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Same tests as that of {@link TXOrderDUnitTest} after setting
  * "distributed-transactions" property to true
  */
+@Category(DistributedTest.class)
 public class DistTXOrderDUnitTest extends TXOrderDUnitTest {
 
-  public DistTXOrderDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public Properties getDistributedSystemProperties() {
     Properties props = super.getDistributedSystemProperties();
     props.setProperty(DISTRIBUTED_TRANSACTIONS, "true");
     return props;
   }
-  
+
+  @Ignore("TODO: test is disabled for Dist TX")
   @Override
+  @Test
   public void testFarSideOrder() throws CacheException {
     // [DISTTX] TODO test overridden intentionally and left blank as it fails
     // fix this 
   }
-  
+
+  @Ignore("TODO: test is disabled for Dist TX")
   @Override
+  @Test
   public void testInternalRegionNotExposed() {
     // [DISTTX] TODO test overridden intentionally and left blank as it fails
     // fix this 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
index c0fbd8d..b8165d5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
@@ -16,20 +16,22 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.cache30.TXRestrictionsDUnitTest;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
 import java.util.Properties;
 
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache30.TXRestrictionsDUnitTest;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Same tests as that of {@link TXRestrictionsDUnitTest} after setting
  * "distributed-transactions" property to true
  */
+@Category(DistributedTest.class)
 public class DistTXRestrictionsDUnitTest extends TXRestrictionsDUnitTest {
 
-  public DistTXRestrictionsDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public Properties getDistributedSystemProperties() {
     Properties props = super.getDistributedSystemProperties();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
index 8aa5c51..32f6dae 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
@@ -16,14 +16,20 @@
  */
 package com.gemstone.gemfire.disttx;
 
-import com.gemstone.gemfire.internal.cache.TransactionsWithDeltaDUnitTest;
-import java.util.Properties;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.internal.cache.TransactionsWithDeltaDUnitTest;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
 public class DistTXWithDeltaDUnitTest extends TransactionsWithDeltaDUnitTest {
 
-  public DistTXWithDeltaDUnitTest(String name) {
-    super(name);
+  public DistTXWithDeltaDUnitTest() {
+    super();
   }
   
   @Override


[41/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
index c7563e2..57aea3d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
@@ -20,6 +20,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -29,6 +31,9 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -48,15 +53,13 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
 import com.gemstone.gemfire.internal.cache.xmlcache.DiskStoreAttributesCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
+@Category(DistributedTest.class)
 public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
-  private static final long serialVersionUID = 225193925777688541L;
 
-  public CacheXml80DUnitTest(String name) {
-    super(name);
+  public CacheXml80DUnitTest() {
+    super();
   }
 
   protected String getGemFireVersion()
@@ -65,6 +68,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testCompressor() {
     final String regionName = "testCompressor";
     
@@ -91,6 +95,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
    * Restarts the cache with the new xml
    * Makes sure the new cache has the 4 indexes
    */
+  @Test
   public void testIndexXmlCreation() throws Exception {
     CacheCreation cache = new CacheCreation();
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -176,6 +181,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
     observer.reset();
   }
   
+  @Test
   public void testCacheServerDisableTcpNoDelay()
       throws CacheException
   {
@@ -191,6 +197,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
   }
 
   
+  @Test
   public void testCacheServerEnableTcpNoDelay()
       throws CacheException
   {
@@ -205,6 +212,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
     testXml(cache);
   }
 
+  @Test
   public void testDiskUsage() {
     CacheCreation cache = new CacheCreation();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 1b39b2c..0ce5215 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
@@ -16,8 +16,10 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import org.junit.Rule;
+import static org.junit.Assert.*;
+
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXParseException;
 
@@ -32,6 +34,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.XmlParser;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests 8.1 schema based configuration. From this point all config test cases
@@ -40,11 +43,12 @@ import com.gemstone.gemfire.test.dunit.IgnoredException;
  *
  * @since GemFire 8.1
  */
+@Category(DistributedTest.class)
 public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
   private static final long serialVersionUID = 1L;
   
-  public CacheXml81DUnitTest(String name) {
-    super(name);
+  public CacheXml81DUnitTest() {
+    super();
   }
 
   protected String getGemFireVersion() {
@@ -61,6 +65,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
    * 
    * @since GemFire 8.1
    */
+  @Test
   public void testCacheExtension() {
     final CacheCreation cache = new CacheCreation();
     final MockCacheExtension extension = new MockCacheExtension("testCacheExtension");
@@ -93,6 +98,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
    * 
    * @since GemFire 8.1
    */
+  @Test
   public void testRegionExtension() {
     final String regionName = "testRegionExtension";
     final CacheCreation cache = new CacheCreation();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
index be4c657..39376e7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
@@ -20,6 +20,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Declarable;
 import com.gemstone.gemfire.cache.Region;
@@ -35,18 +44,15 @@ import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
 import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
-
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 
+@Category(DistributedTest.class)
 public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
   private static final long serialVersionUID = -6437436147079728413L;
 
-  public CacheXmlGeode10DUnitTest(String name) {
-    super(name);
+  public CacheXmlGeode10DUnitTest() {
+    super();
   }
 
   
@@ -58,6 +64,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testEnableOffHeapMemory() {
     try {
       System.setProperty(DistributionConfig.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE, "1m");
@@ -89,6 +96,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testEnableOffHeapMemoryRootRegionWithoutOffHeapMemoryThrowsException() {
     final String regionName = getUniqueName();
     
@@ -115,6 +123,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
   }
   
   @SuppressWarnings({ "rawtypes", "deprecation", "unchecked" })
+  @Test
   public void testEnableOffHeapMemorySubRegionWithoutOffHeapMemoryThrowsException() {
     final String rootRegionName = getUniqueName();
     final String subRegionName = "subRegion";
@@ -154,6 +163,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
    * eviction-off-heap-percentage attributes
    * @throws Exception
    */
+  @Test
   public void testResourceManagerThresholds() throws Exception {
     CacheCreation cache = new CacheCreation();
     final float low = 90.0f;
@@ -170,8 +180,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
       testXml(cache);
       {
         c = getCache();
-        assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage());
-        assertEquals(high, c.getResourceManager().getCriticalOffHeapPercentage());
+        assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+        assertEquals(high, c.getResourceManager().getCriticalOffHeapPercentage(),0);
       }
       closeCache();
       
@@ -183,8 +193,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
       testXml(cache);
       {
         c = getCache();
-        assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage());
-        assertEquals(low + 1, c.getResourceManager().getCriticalOffHeapPercentage());
+        assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+        assertEquals(low + 1, c.getResourceManager().getCriticalOffHeapPercentage(),0);
       }
       closeCache();
   
@@ -210,8 +220,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
       testXml(cache);
       {
         c = getCache();
-        assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage());
-        assertEquals(low, c.getResourceManager().getCriticalOffHeapPercentage());
+        assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+        assertEquals(low, c.getResourceManager().getCriticalOffHeapPercentage(),0);
       }
       closeCache();
   
@@ -223,8 +233,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
       testXml(cache);
       {
         c = getCache();
-        assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage());
-        assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage());
+        assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+        assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage(),0);
       }
       closeCache();
   
@@ -235,14 +245,15 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
       cache.setResourceManagerCreation(rmc);
       testXml(cache);
       c = getCache();
-      assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage());
-      assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage());
+      assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+      assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage(),0);
     } finally {
       System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE);
     }
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testAsyncEventQueueIsEnableEvictionAndExpirationAttribute() {
 
     final String regionName = "testAsyncEventQueueIsEnableEvictionAndExpirationAttribute";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 7e0d552..7942db4 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,20 +16,26 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Properties;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
 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;
 
-import java.io.*;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class CacheXmlTestCase extends CacheTestCase {
+public class CacheXmlTestCase extends JUnit4CacheTestCase {
 
   /** The file used by this test (method) to initialize the cache */
   private File xmlFile;
@@ -37,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/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
index 6b95b03..03b5124 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.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.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -44,15 +53,16 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 5.0
  */
-public class CallbackArgDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CallbackArgDUnitTest extends JUnit4CacheTestCase {
 
 //  private transient Region r;
 //  private transient DistributedMember otherId;
   protected transient int invokeCount;
   protected static String callbackArg;
   
-  public CallbackArgDUnitTest(String name) {
-    super(name);
+  public CallbackArgDUnitTest() {
+    super();
   }
 
   private VM getOtherVm() {
@@ -126,9 +136,11 @@ public class CallbackArgDUnitTest extends CacheTestCase {
   /**
    * make sure callback arg is NOT_AVAILABLE in all the places it should be
    */
+  @Test
   public void testForNA_CA() throws CacheException {
     doTest();
   }
+  @Test
   public void testForCA() throws Exception {
     callbackArg = "cbArg";
     getOtherVm().invoke(new SerializableCallable() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
index bfd32fc..6573ed5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
@@ -22,26 +22,33 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
+@Category(DistributedTest.class)
+public class ClearMultiVmCallBkDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
 
-/**
- *
- */
-public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
-    
-    /** Creates a new instance of ClearMultiVmCallBkDUnitTest */
-    public ClearMultiVmCallBkDUnitTest(String name) {
-        super(name);
-    }
-    
     static Cache cache;
     static Properties props = new Properties();
     static Properties propsWork = new Properties();
@@ -71,43 +78,30 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
     }
     
     public static void createCache(){
-        try{
-            CacheListener aListener = new ListenerCallBk();
-            //            props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
-//            ds = DistributedSystem.connect(props);
-            ds = (new ClearMultiVmCallBkDUnitTest("temp")).getSystem(props);            
-            
-            cache = CacheFactory.create(ds);
-            AttributesFactory factory  = new AttributesFactory();
-            factory.setScope(Scope.DISTRIBUTED_ACK);
-            
-            // Set Cachelisterner : aListener
-            
-            factory.setCacheListener(aListener);
-            RegionAttributes attr = factory.create();
-            
-            region = cache.createRegion("map", attr);
-            
-            
-        } catch (Exception ex){
-            ex.printStackTrace();
-        }
+      CacheListener aListener = new ListenerCallBk();
+      ds = (new ClearMultiVmCallBkDUnitTest()).getSystem(props);
+
+      cache = CacheFactory.create(ds);
+      AttributesFactory factory  = new AttributesFactory();
+      factory.setScope(Scope.DISTRIBUTED_ACK);
+
+      // Set Cachelisterner : aListener
+
+      factory.setCacheListener(aListener);
+      RegionAttributes attr = factory.create();
+
+      region = cache.createRegion("map", attr);
     }
     
     public static void closeCache(){
-        try{
-            
-            cache.close();
-            ds.disconnect();
-            
-        } catch (Exception ex){
-            ex.printStackTrace();
-        }
+      cache.close();
+      ds.disconnect();
     }
     
     //test methods
     
-    public void testClearSingleVM(){
+  @Test
+  public void testClearSingleVM(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
@@ -135,7 +129,8 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
         
     }//end of test case1
     
-     public void testClearMultiVM(){
+  @Test
+  public void testClearMultiVM(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
@@ -170,7 +165,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
             }
         }catch(Exception ex){
             ex.printStackTrace();
-            fail("Failed while region.put");
+            fail("Failed while region.put", ex);
         }
         return obj;
     }
@@ -180,7 +175,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
         try{
             obj = region.get(ob);
         } catch(Exception ex){
-            fail("Failed while region.get");
+            fail("Failed while region.get", ex);
         }
         return obj;
     }
@@ -190,7 +185,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
         try{
             flag = region.containsValue(ob);
         }catch(Exception ex){
-            fail("Failed while region.containsValueMethod");
+            fail("Failed while region.containsValueMethod", ex);
         }
         return flag;
     }
@@ -200,7 +195,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
         try{
             i = region.size();
         }catch(Exception ex){
-            fail("Failed while region.size");
+            fail("Failed while region.size", ex);
         }
         return i;
     }
@@ -209,7 +204,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
         try{
             region.clear();
         } catch(Exception ex){
-            ex.printStackTrace();
+            fail("clearMethod failed", ex);
         }
     }
     
@@ -226,13 +221,8 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
                 region.put(""+i, "inAfterClear");
                 afterClear = true;
             }catch (Exception e){
-                //
+              fail("afterRegionClear failed", e);
             }
-            
         }
-        
     }
-    
-    
-    
 }//end of class

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
index 42d7e4b..bf31151 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
@@ -22,8 +22,13 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+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.CacheException;
@@ -38,22 +43,16 @@ import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class ClearMultiVmDUnitTest extends DistributedTestCase{
-    
-    /** Creates a new instance of ClearMultiVmDUnitTest */
-    public ClearMultiVmDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class ClearMultiVmDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
     static Cache cache;
     static Properties props = new Properties();
@@ -86,7 +85,7 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
     
     public static void createCache(){
         try{            
-            ds = (new ClearMultiVmDUnitTest("temp")).getSystem(props);
+            ds = (new ClearMultiVmDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -116,7 +115,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
     
     //test methods
     
-    public void testClearSimpleScenarios(){
+  @Test
+  public void testClearSimpleScenarios(){
         
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
@@ -195,7 +195,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
         
     }//end of test case
     
-    public void testClearMultiVM() throws Throwable{
+  @Test
+  public void testClearMultiVM() throws Throwable{
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -240,7 +241,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
         
     }//end of testClearMultiVM
     
-    public void testClearExceptions(){
+  @Test
+  public void testClearExceptions(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -271,7 +273,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
         
     }//end of testClearExceptions
 
-    public void testGiiandClear() throws Throwable{
+  @Test
+  public void testGiiandClear() throws Throwable{
       if (false) {
         getSystem().getLogWriter().severe("testGiiandClear skipped because of bug 34963");
       } else {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 27205c4..a4a6d42 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
@@ -16,6 +16,27 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.InternalGemFireException;
 import com.gemstone.gemfire.Statistics;
 import com.gemstone.gemfire.StatisticsType;
@@ -36,17 +57,17 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
 import com.gemstone.gemfire.management.membership.ClientMembership;
 import com.gemstone.gemfire.management.membership.ClientMembershipEvent;
 import com.gemstone.gemfire.management.membership.ClientMembershipListener;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
@@ -56,6 +77,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 4.2.1
  */
+@Category(DistributedTest.class)
 public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
   protected static final boolean CLIENT = true;
@@ -67,10 +89,6 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
   private static Properties properties;
 
-  public ClientMembershipDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     Invoke.invokeInEveryVM((() -> cleanup()));
@@ -105,6 +123,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * test that a server times out waiting for a handshake that
    * never arrives.
    */
+  @Test
   public void testConnectionTimeout() throws Exception {
     IgnoredException.addIgnoredException("failed accepting client connection");
     final Host host = Host.getHost(0);
@@ -207,6 +226,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     }
   }
 
+  @Test
   public void testSynchronousEvents() throws Exception {
     getSystem();
     InternalClientMembership.setForceSynchronous(true);
@@ -220,6 +240,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
   /**
    * Tests event notification methods on ClientMembership.
    */
+  @Test
   public void testBasicEvents() throws Exception {
     getSystem();
     doTestBasicEvents();
@@ -397,6 +418,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * Tests unregisterClientMembershipListener to ensure that no further events
    * are delivered to unregistered listeners.
    */
+  @Test
   public void testUnregisterClientMembershipListener() throws Exception {
     final boolean[] fired = new boolean[1];
     final DistributedMember[] member = new DistributedMember[1];
@@ -453,6 +475,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertFalse(isClient[0]);
   }
 
+  @Test
   public void testMultipleListeners() throws Exception {
     final int NUM_LISTENERS = 4;
     final boolean[] fired = new boolean[NUM_LISTENERS];
@@ -721,6 +744,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * crashes or departs gracefully, the client will detect this as a crash.
    */
   @Category(FlakyTest.class) // GEODE-1240: eats exceptions, random ports, time sensitive waits
+  @Test
   public void testClientMembershipEventsInClient() throws Exception {
     getSystem();
     IgnoredException.addIgnoredException("IOException");
@@ -927,6 +951,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * Tests notification of events in server process. Bridge servers detect
    * client joins when the client connects to the server.
    */
+  @Test
   public void testClientMembershipEventsInServer() throws Exception {
     final boolean[] fired = new boolean[3];
     final DistributedMember[] member = new DistributedMember[3];
@@ -1182,6 +1207,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * Tests registration and event notification in conjunction with
    * disconnecting and reconnecting to DistributedSystem.
    */
+  @Test
   public void testLifecycle() throws Exception {
     final boolean[] fired = new boolean[3];
     final DistributedMember[] member = new DistributedMember[3];
@@ -1265,6 +1291,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * Starts up server in controller vm and 4 clients, then calls and tests
    * ClientMembership.getConnectedClients().
    */
+  @Test
   public void testGetConnectedClients() throws Exception {
     final String name = this.getUniqueName();
     final int[] ports = new int[1];
@@ -1350,6 +1377,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * Starts up 4 server and the controller vm as a client, then calls and tests
    * ClientMembership.getConnectedServers().
    */
+  @Test
   public void testGetConnectedServers() throws Exception {
     final Host host = Host.getHost(0);
     final String name = this.getUniqueName();
@@ -1454,6 +1482,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
    * Tests getConnectedClients(boolean onlyClientsNotifiedByThisServer) where
    * onlyClientsNotifiedByThisServer is true.
    */
+  @Test
   public void testGetNotifiedClients() throws Exception {
     final Host host = Host.getHost(0);
     final String name = this.getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
index 79fd543..0971db3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
@@ -16,15 +16,18 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Same as parent but uses selector in server
  *
  * @since GemFire 5.1
  */
+@Category(DistributedTest.class)
 public class ClientMembershipSelectorDUnitTest extends ClientMembershipDUnitTest {
-  public ClientMembershipSelectorDUnitTest(String name) {
-    super(name);
-  }
+  @Override
   protected int getMaxThreads() {
     return 2;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
index b6cffa0..8d0eae7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
@@ -16,31 +16,41 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoaderException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.SubscriptionNotEnabledException;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the client register interest
  *
  * @since GemFire 4.2.3
  */
+@Category(DistributedTest.class)
 public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
 
-  public ClientRegisterInterestDUnitTest(String name) {
-    super(name);
-  }
-  
+  protected static int bridgeServerPort;
+
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS(); // cleans up bridge server and client and lonerDS
@@ -50,6 +60,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
    * Tests for Bug 35381 Calling register interest if 
    * establishCallbackConnection is not set causes bridge server NPE.
    */
+  @Test
   public void testBug35381() throws Exception {
     final Host host = Host.getHost(0);
     final String name = this.getUniqueName();
@@ -73,7 +84,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
         }
         catch (IOException e) {
           LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
-          fail("startBridgeServer threw IOException " + e.getMessage());
+          fail("startBridgeServer threw IOException ", e);
         }
         
         assertTrue(bridgeServerPort != 0);
@@ -107,7 +118,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
     catch (SubscriptionNotEnabledException expected) {
     }
   }
-  protected static int bridgeServerPort;
+
   private static int getBridgeServerPort() {
     return bridgeServerPort;
   }
@@ -125,7 +136,9 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
    * <p>Bug 35655 "a single failed re-registration causes all other pending
    * re-registrations to be cancelled"
    */
-  public void _testRegisterInterestFailover() throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testRegisterInterestFailover() throws Exception {
     // controller is bridge client
     
     final Host host = Host.getHost(0);
@@ -159,7 +172,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
         }
         catch (IOException e) {
           LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
-          fail("startBridgeServer threw IOException " + e.getMessage());
+          fail("startBridgeServer threw IOException ", e);
         }
         
         assertTrue(bridgeServerPort != 0);
@@ -190,7 +203,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
         }
         catch (IOException e) {
           LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
-          fail("startBridgeServer threw IOException " + e.getMessage());
+          fail("startBridgeServer threw IOException ", e);
         }
         
         assertTrue(bridgeServerPort != 0);
@@ -305,7 +318,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
         }
         catch (IOException e) {
           LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
-          fail("startBridgeServer threw IOException " + e.getMessage());
+          fail("startBridgeServer threw IOException ", e);
         }
       }
     });
@@ -331,7 +344,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
       assertEquals(null, region2.get(key2));
       fail("CacheLoaderException expected");
     }
-    catch (com.gemstone.gemfire.cache.CacheLoaderException e) {
+    catch (CacheLoaderException e) {
     }
   
     // region2 registration should be gone now

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
index d4d44c5..0638c85 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
@@ -16,15 +16,18 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Same as parent but uses selector in server
  *
  * @since GemFire 5.1
  */
+@Category(DistributedTest.class)
 public class ClientRegisterInterestSelectorDUnitTest extends ClientRegisterInterestDUnitTest {
-  public ClientRegisterInterestSelectorDUnitTest(String name) {
-    super(name);
-  }
+  @Override
   protected int getMaxThreads() {
     return 2;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
index 80f932e..63b621e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
@@ -17,8 +17,24 @@
 package com.gemstone.gemfire.cache30;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
@@ -29,17 +45,25 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.AssertionFailedError;
-
-import java.util.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * concurrency-control tests for client/server
  * 
  *
  */
-public class ClientServerCCEDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClientServerCCEDUnitTest extends JUnit4CacheTestCase {
   public static LocalRegion TestRegion;
   
   public void setup() {
@@ -53,18 +77,21 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
     HARegionQueue.setMessageSyncInterval(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
   }
 
-  public ClientServerCCEDUnitTest(String name) {
-    super(name);
+  public ClientServerCCEDUnitTest() {
+    super();
   }
 
+  @Test
   public void testClientServerRRTombstoneGC() {
     clientServerTombstoneGCTest(getUniqueName(), true);
   }
   
+  @Test
   public void testClientServerPRTombstoneGC() {
     clientServerTombstoneGCTest(getUniqueName(), false);
   }
   
+  @Test
   public void testPutAllInNonCCEClient() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -111,10 +138,12 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
    * registerInterest() to protect the client cache from stray putAll
    * events sitting in backup queues on the server 
    */
+  @Test
   public void testClientRIGetsTombstonesRR() throws Exception {
     clientRIGetsTombstoneTest(getUniqueName(),true);
   }
   
+  @Test
   public void testClientRIGetsTombstonesPR() throws Exception {
     clientRIGetsTombstoneTest(getUniqueName(),false);
   }
@@ -167,10 +196,12 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
     ensureAllTombstonesPresent(vm2);
   }
   
+  @Test
   public void testClientRIGetsInvalidEntriesRR() throws Exception {
     clientRIGetsInvalidEntriesTest(getUniqueName(),true);
   }
   
+  @Test
   public void testClientRIGetsInvalidEntriesPR() throws Exception {
     clientRIGetsInvalidEntriesTest(getUniqueName(),false);
   }
@@ -336,10 +367,12 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
 
   //  private void closeCache(VM vm) {
 
+  @Test
   public void testClientServerRRQueueCleanup() {  // see bug #50879 if this fails
     clientServerTombstoneMessageTest(true);
   }
   
+  @Test
   public void testClientServerPRQueueCleanup() {  // see bug #50879 if this fails
     clientServerTombstoneMessageTest(false);
   }
@@ -530,7 +563,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
         if (TestRegion.getTombstoneCount() == 0) {
           LogWriterUtils.getLogWriter().warning("region has no tombstones");
 //          TestRegion.dumpBackingMap();
-          throw new AssertionFailedError("expected to find tombstones but region is empty");
+          throw new AssertionError("expected to find tombstones but region is empty");
         }
         return null;
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
index 8dba782..e251e93 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.Properties;
@@ -34,12 +36,12 @@ import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.LonerDistributionManager;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 
 /**
  * Provides helper methods for testing clients and servers. This
@@ -48,7 +50,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  *
  * @since GemFire 4.2.1
  */
-public class ClientServerTestCase extends CacheTestCase {
+public abstract class ClientServerTestCase extends JUnit4CacheTestCase {
   
   public static String NON_EXISTENT_KEY = "NON_EXISTENT_KEY";
   
@@ -74,10 +76,6 @@ public class ClientServerTestCase extends CacheTestCase {
   protected void preTearDownClientServerTestCase() throws Exception {
   }
 
-  public ClientServerTestCase(String name) {
-    super(name);
-  }
-
   /**
    * Starts a bridge server on the given port
    *

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
index c2f06c1..19e37eb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
@@ -15,6 +15,15 @@
  * limitations under the License.
  */
 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.Region;
 import com.gemstone.gemfire.cache.RegionShortcut;
@@ -35,12 +44,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.RegionMap;
 
-public class ConcurrentLeaveDuringGIIDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentLeaveDuringGIIDUnitTest extends JUnit4CacheTestCase {
 
-  public ConcurrentLeaveDuringGIIDUnitTest(String name) {
-    super(name);
+  public ConcurrentLeaveDuringGIIDUnitTest() {
+    super();
   }
   
+  @Test
   public void testRemoveWhenBug50988IsFixed() {
     // remove this placeholder
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
index 32712d3..8e12961 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.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 com.gemstone.gemfire.cache.AttributesFactory;
@@ -30,25 +39,23 @@ import com.gemstone.gemfire.internal.OSProcess;
  *
  *
  */
+@Category(DistributedTest.class)
 public class DiskDistributedNoAckAsyncOverflowRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
   
   /** Creates a new instance of DiskDistributedNoAckSyncOverflowRegionTest */
-  public DiskDistributedNoAckAsyncOverflowRegionDUnitTest(String name) {
-    super(name);
+  public DiskDistributedNoAckAsyncOverflowRegionDUnitTest() {
+    super();
   }
   
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_NO_ACK);
 
-    File[] diskDirs = new File[1];
-    diskDirs[0] = new File("diskRegionDirs/" + OSProcess.getId());
-    diskDirs[0].mkdirs();
     factory.setDiskStoreName(getCache().createDiskStoreFactory()
-                             .setDiskDirs(diskDirs)
+                             .setDiskDirs(getDiskDirs())
                              .setTimeInterval(1000)
                              .setQueueSize(0)
-                             .create("DiskDistributedNoAckAsyncOverflowRegionDUnitTest")
+                             .create(getUniqueName())
                              .getName());
    
     factory.setEvictionAttributes(EvictionAttributes

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
index 4677985..2bd2caa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
@@ -16,15 +16,25 @@
  */
 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.*;
 import java.io.*;
 import com.gemstone.gemfire.internal.OSProcess;
 
+@Category(DistributedTest.class)
 public class DiskDistributedNoAckAsyncRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
   
   /** Creates a new instance of DiskDistributedNoAckSyncOverflowRegionTest */
-  public DiskDistributedNoAckAsyncRegionDUnitTest(String name) {
-    super(name);
+  public DiskDistributedNoAckAsyncRegionDUnitTest() {
+    super();
   }
   
   protected RegionAttributes getRegionAttributes() {
@@ -35,10 +45,10 @@ public class DiskDistributedNoAckAsyncRegionDUnitTest extends DiskDistributedNoA
     diskDirs[0] = new File("diskRegionDirs/" + OSProcess.getId());
     diskDirs[0].mkdirs();
     factory.setDiskStoreName(getCache().createDiskStoreFactory()
-                             .setDiskDirs(diskDirs)
+                             .setDiskDirs(getDiskDirs())
                              .setTimeInterval(1000)
                              .setQueueSize(0)
-                             .create("DiskDistributedNoAckAsyncRegionDUnitTest")
+                             .create(getUniqueName())
                              .getName());
     factory.setDiskSynchronous(false);
     factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
index ff6bc67..232d44a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
@@ -16,22 +16,25 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import org.junit.Test;
+
+import com.gemstone.gemfire.cache.CacheException;
 
 public abstract class DiskDistributedNoAckRegionTestCase extends DistributedNoAckRegionDUnitTest {
 
-  final protected DiskRegionTestImpl regionTestImpl;
+  protected DiskRegionTestImpl regionTestImpl;
   
-  /** Creates a new instance of DiskDistributedNoAckRegionTest */
-  public DiskDistributedNoAckRegionTestCase(String name) {
-    super(name);
-    regionTestImpl = new DiskRegionTestImpl(this);
+  @Override
+  public final void postSetUp() throws Exception {
+    this.regionTestImpl = new DiskRegionTestImpl(this);
   }
   
+  @Test
   public void testCreateDiskRegion() throws CacheException {
     this.regionTestImpl.testCreateDiskRegion();
   }
   
+  @Test
   public void testBackupFillInValues() throws CacheException {
     this.regionTestImpl.testBackupFillValues();
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
index 8c3ead3..75d4f20 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
@@ -18,37 +18,32 @@ package com.gemstone.gemfire.cache30;
 
 import java.io.File;
 
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.DiskWriteAttributes;
+import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.EvictionAction;
 import com.gemstone.gemfire.cache.EvictionAttributes;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.internal.OSProcess;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- *
- */
+@Category(DistributedTest.class)
 public class DiskDistributedNoAckSyncOverflowRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
   
   /** Creates a new instance of DiskDistributedNoAckSyncOverflowRegionDUnitTest */
-  public DiskDistributedNoAckSyncOverflowRegionDUnitTest(String name) {
-    super(name);
+  public DiskDistributedNoAckSyncOverflowRegionDUnitTest() {
+    super();
   }
   
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_NO_ACK);
     
-    File[] diskDirs = new File[1];
-    diskDirs[0] = new File("diskRegionDirs/" + OSProcess.getId());
-    diskDirs[0].mkdirs();
-    
     factory.setDiskStoreName(getCache().createDiskStoreFactory()
-                             .setDiskDirs(diskDirs)
-                             .create("DiskDistributedNoAckSyncOverflowRegionDUnitTest")
+                             .setDiskDirs(getDiskDirs())
+                             .create(getUniqueName())
                              .getName());
 
     factory.setEvictionAttributes(EvictionAttributes

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 0e7b193..a43950e 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
@@ -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.lang.reflect.Array;
 import java.util.BitSet;
@@ -62,13 +71,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  *
  * @since GemFire 3.2
  */
-public class DiskRegionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DiskRegionDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * Creates a new <code>DiskRegionDUnitTest</code>
    */
-  public DiskRegionDUnitTest(String name) {
-    super(name);
+  public DiskRegionDUnitTest() {
+    super();
   }
 
 //   public RegionAttributes getRegionAttributes() {
@@ -100,6 +110,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
   /**
    * Tests that data overflows correctly to a disk region
    */
+  @Test
   public void testDiskRegionOverflow() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -183,6 +194,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Makes sure that updates from other VMs cause existing entries to
    * be written to disk.
    */
+  @Test
   public void testRemoteUpdates() throws Exception {
     final String name = this.getUniqueName();
 
@@ -287,6 +299,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Overflows a region and makes sure that gets of recently-used
    * objects do not cause faults.
    */
+  @Test
   public void testNoFaults() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -336,6 +349,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * the data in the receiver VM, thus cause the two VMs to have
    * different LRU eviction behavior.
    */
+  @Test
   public void testOverflowMirror() throws Exception {
     final String name = this.getUniqueName();
 
@@ -405,6 +419,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
   /**
    * Tests destroying entries in an overflow region
    */
+  @Test
   public void testDestroy() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -465,6 +480,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests cache listeners in an overflow region are invoked and that
    * their events are reasonable.
    */
+  @Test
   public void testCacheEvents() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -573,6 +589,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests iterating over all of the values when some have been
    * overflowed.
    */
+  @Test
   public void testValues() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -616,6 +633,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
   /**
    * Tests for region.evictValue().
    */
+  @Test
   public void testRegionEvictValue() throws Exception {
     final String name = this.getUniqueName()+ "testRegionEvictValue";
     File d = new File("DiskRegions" + OSProcess.getId());
@@ -662,6 +680,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
   /**
    * Tests calling region.evictValue() on region with eviction-attribute set.
    */
+  @Test
   public void testEvictValueOnRegionWithEvictionAttributes() throws Exception {
     final String name = this.getUniqueName()+ "testRegionEvictValue";
     File d = new File("DiskRegions" + OSProcess.getId());
@@ -699,6 +718,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests that the disk region statistics are updated correctly for
    * persist backup regions.
    */
+  @Test
   public void testBackupStatistics() throws CacheException {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -765,6 +785,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testBackup() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -857,6 +878,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * com.gemstone.gemfire.cache.Region.Entry#getValue values} of
    * region entries that have been overflowed.
    */
+  @Test
   public void testRegionEntryValues() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -900,6 +922,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests that once an overflowed entry is {@linkplain
    * Region#invalidate invalidated} its value is gone.
    */
+  @Test
   public void testInvalidate() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -934,6 +957,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests that invalidates and updates received from different VMs
    * are handled appropriately by overflow regions.
    */
+  @Test
   public void testDistributedInvalidate() throws Exception {
     final String name = this.getUniqueName();
 
@@ -1030,6 +1054,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
   /**
    * Tests that the updated value gets overflowed
    */
+  @Test
   public void testOverflowUpdatedValue() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -1083,6 +1108,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests that the "test hook" {@link DiskRegionStats} work as
    * advertised. 
    */
+  @Test
   public void testTestHookStatistics() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -1169,6 +1195,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * {@link LocalRegion#getValueOnDisk getValueOnDisk} methods that
    * were added for testing.
    */
+  @Test
   public void testLowLevelGetMethods() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -1224,6 +1251,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests disk overflow with an entry-based {@link
    * LRUCapacityController}. 
    */
+  @Test
   public void testLRUCapacityController() throws CacheException {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -1301,6 +1329,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
    * Tests a disk-based region with an {@link LRUCapacityController}
    * with size 1 and an eviction action of "overflow".
    */
+  @Test
   public void testLRUCCSizeOne() throws CacheException {
     int threshold = 1;
 
@@ -1359,6 +1388,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
   }
 
 
+  @Test
   public void testPersistentReplicateB4NonPersistent() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -1399,6 +1429,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testRRProxyWithPersistentReplicates() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
index ec2a430..9179312 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
@@ -35,10 +35,14 @@ import com.gemstone.gemfire.test.dunit.VM;
  * An instance of this class is delegated to by test classes that test
  * disk regions.
  *
- *
+ * Used by: DiskDistributedNoAckRegionTestCase
+ * TODO: move this content into DiskDistributedNoAckRegionTestCase
  */
 public class DiskRegionTestImpl implements Serializable {
-  
+
+  private static final int NUM_ENTRIES = 1000;
+  private static final int VALUE_SIZE = 2000;
+
   final RegionTestCase rtc;
 
   private CacheSerializableRunnable createRgnRunnable(final String name) {
@@ -64,12 +68,6 @@ public class DiskRegionTestImpl implements Serializable {
     
     vm0.invoke(createRgnRunnable(name));
   }
-  
-  
-  
-  
-  private static final int NUM_ENTRIES = 1000;
-  private static final int VALUE_SIZE = 2000;
 
   /**
    * Tests fillValues on backup regions.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 71b3dd7..ffd3248 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
@@ -22,20 +22,41 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.*;
+import static org.junit.Assert.*;
 
 import java.util.HashSet;
 import java.util.Properties;
 import java.util.Set;
 
-/**
- *
- */
-public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheWriter;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class DistAckMapMethodsDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
+
     static Cache cache;
     static Properties props = new Properties();
     static DistributedSystem ds = null;
@@ -48,11 +69,6 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
     //helper class referece objects
     static Object afterDestroyObj;
     
-    /** Creates a new instance of DistAckMapMethodsDUnitTest */
-    public DistAckMapMethodsDUnitTest(String name) {
-        super(name);
-    }
-    
     @Override
     public final void postSetUp() throws Exception {
       Host host = Host.getHost(0);
@@ -77,7 +93,7 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         try{
             //props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
             //ds = DistributedSystem.connect(props);
-            ds = (new DistAckMapMethodsDUnitTest("temp")).getSystem(props);
+            ds = (new DistAckMapMethodsDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -129,7 +145,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
     
     //testMethods
     
-    public void testPutMethod(){
+  @Test
+  public void testPutMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -158,7 +175,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         }
     }
     
-    public void testRemoveMethod(){
+  @Test
+  public void testRemoveMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -191,7 +209,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         }
     }
     
-    public void testRemoveMethodDetails(){
+  @Test
+  public void testRemoveMethodDetails(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -214,7 +233,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         );
     }//end of testRemoveMethodDetails
     
-    public void testIsEmptyMethod(){
+  @Test
+  public void testIsEmptyMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -238,7 +258,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         }
     }
     
-    public void testContainsValueMethod(){
+  @Test
+  public void testContainsValueMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -262,7 +283,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         }
     }
     
-    public void testKeySetMethod(){
+  @Test
+  public void testKeySetMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -295,7 +317,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
     }
     
     
-    public void testEntrySetMethod(){
+  @Test
+  public void testEntrySetMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -327,7 +350,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         }
     }
     
-    public void testSizeMethod(){
+  @Test
+  public void testSizeMethod(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);
@@ -350,7 +374,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
         }
     }
     
-    public void testallMethodsArgs(){
+  @Test
+  public void testallMethodsArgs(){
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         vm0.invoke(() -> DistAckMapMethodsDUnitTest.allMethodsArgs());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 74661bc..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
@@ -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 org.junit.Ignore;
 import org.junit.Test;
 
@@ -26,11 +35,12 @@ import com.gemstone.gemfire.cache.EvictionAttributes;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 
+@Category(DistributedTest.class)
 public class DistributedAckOverflowRegionCCEDUnitTest extends
     DistributedAckRegionCCEDUnitTest {
 
-  public DistributedAckOverflowRegionCCEDUnitTest(String name) {
-    super(name);
+  public DistributedAckOverflowRegionCCEDUnitTest() {
+    super();
   }
 
   @Override
@@ -61,8 +71,8 @@ public class DistributedAckOverflowRegionCCEDUnitTest extends
   }
 
   @Override
-  @Test
   @Ignore
+  @Test
   public void testClearWithConcurrentEvents() throws Exception {
     // TODO this test is disabled due to frequent failures.  See bug #
     // Remove this method from this class when the problem is fixed
@@ -70,8 +80,8 @@ public class DistributedAckOverflowRegionCCEDUnitTest extends
   }
 
   @Override
-  @Test
   @Ignore
+  @Test
   public void testClearWithConcurrentEventsAsync() throws Exception {
     // TODO this test is disabled due to frequent failures.  See bug #
     // Remove this method from this class when the problem is fixed

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
index 366acf1..5fc8cc9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
@@ -16,15 +16,18 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Distributed Ack Overflow Region with ConcurrencyChecksEnabled and OffHeap memory.
@@ -32,10 +35,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * @since Geode 1.0
  */
 @SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
 public class DistributedAckOverflowRegionCCEOffHeapDUnitTest extends DistributedAckOverflowRegionCCEDUnitTest {
 
-  public DistributedAckOverflowRegionCCEOffHeapDUnitTest(String name) {
-    super(name);
+  public DistributedAckOverflowRegionCCEOffHeapDUnitTest() {
+    super();
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 0acd2aa..3e62425 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
@@ -20,42 +20,23 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.Ignore;
+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.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.RegionFactory;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.cache.DistributedCacheOperation;
-import com.gemstone.gemfire.internal.cache.DistributedRegion;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.internal.cache.tier.sockets.Part;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.io.IOException;
-import java.util.Map;
-
-import junit.framework.Assert;
-
+@Category(DistributedTest.class)
 public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRegionCCEDUnitTest {
 
-  public DistributedAckPersistentRegionCCEDUnitTest(String name) {
-    super(name);
-  }
-  
-  /**
-   * Returns region attributes for a <code>GLOBAL</code> region
-   */
+  @Override
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -64,26 +45,27 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
     return factory.create();
   }
 
-//  public void testClearWithConcurrentEventsAsync() throws Exception {
-//    int end = 100;
-//    for (int i=0; i<end; i++) {
-//      System.out.println("Starting run #" + i);
-//      super.testClearWithConcurrentEventsAsync();
-//      if (i<(end-1)) {
-//        tearDown();
-//        setUp();
-//      }
-//    }
-//  }
-  
-  public void testClearOnNonReplicateWithConcurrentEvents() {}
-  
-  public void testConcurrentEventsOnNonReplicatedRegion() {}
-  
-  public void testGetAllWithVersions() {}
+  @Ignore("Skip test for this configuration")
+  @Override
+  @Test
+  public void testClearOnNonReplicateWithConcurrentEvents() {
+  }
+
+  @Ignore("Skip test for this configuration")
+  @Override
+  @Test
+  public void testConcurrentEventsOnNonReplicatedRegion() {
+  }
+
+  @Ignore("Skip test for this configuration")
+  @Override
+  @Test
+  public void testGetAllWithVersions() {
+  }
 
   private VersionTag getVersionTag(VM vm, final String key) {
     SerializableCallable getVersionTag = new SerializableCallable("verify recovered entry") {
+      @Override
       public Object call() {
         VersionTag tag = CCRegion.getVersionTag(key);
         return tag;
@@ -92,7 +74,8 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
     };
     return (VersionTag)vm.invoke(getVersionTag);
   }
-  
+
+  // TODO: resurrect dead test or delete the following dead code
 //  protected void do_version_recovery_if_necessary(final VM vm0, final VM vm1, final VM vm2, final Object[] params) {
 //    final String name = (String)params[0];
 //    final String hostName = (String)params[1];

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
index 905cafc..36e2893 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
@@ -16,14 +16,18 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 
 /**
@@ -32,10 +36,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * @since Geode 1.0
  */
 @SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
 public class DistributedAckPersistentRegionCCEOffHeapDUnitTest extends DistributedAckPersistentRegionCCEDUnitTest {
   
-  public DistributedAckPersistentRegionCCEOffHeapDUnitTest(String name) {
-    super(name);
+  public DistributedAckPersistentRegionCCEOffHeapDUnitTest() {
+    super();
   }
 
   @Override


[22/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
index 0e8514f..939e81e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
@@ -16,8 +16,13 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+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.CacheException;
@@ -34,13 +39,14 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.HARegion;
 import com.gemstone.gemfire.internal.cache.RegionQueue;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test checks Expiration of events in the regionqueue.
@@ -49,11 +55,9 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 3. Checks size of the regionqueue. Size of the regionqueue should be greater than 0.
  * 4. Waits for the period which is slightly greater than expiration period.
  * 5. Checks size of the regionqueue. Size of the regionqueue should be equal to 0.
- *
  */
-
-public class HAExpiryDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HAExpiryDUnitTest extends JUnit4DistributedTestCase {
 
   VM vm0 = null;
 
@@ -73,8 +77,8 @@ public class HAExpiryDUnitTest extends DistributedTestCase
 
   protected static int regionQueueSize = -1;
 
-  public HAExpiryDUnitTest(String name) {
-    super(name);
+  public HAExpiryDUnitTest() {
+    super();
   }
 
   /**
@@ -103,6 +107,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
     Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
   }
 
+  @Test
   public void testExpiryPeriod() throws Exception
   {
     vm0.invoke(() -> HAExpiryDUnitTest.createRegionQueue(new Boolean(false)));
@@ -132,6 +137,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
     vm3.invoke(() -> HAExpiryDUnitTest.checkSizeAfterExpiration());
   }
   
+  @Test
   public void testDurableExpiryPeriod() throws Exception
   {
     vm0.invoke(() -> HAExpiryDUnitTest.createRegionQueue(new Boolean(true)));
@@ -234,7 +240,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
 
   public static void createRegionQueue(Boolean isDurable) throws Exception
   {
-    new HAExpiryDUnitTest("temp").createCache(new Properties());
+    new HAExpiryDUnitTest().createCache(new Properties());
     HARegionQueueAttributes hattr = new HARegionQueueAttributes();
     // setting expiry time for the regionqueue.
     hattr.setExpiryTime(4);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
index b6b4071..5e659f5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
@@ -16,10 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Properties;
 
+import org.junit.Ignore;
+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.CacheException;
@@ -28,9 +34,9 @@ import com.gemstone.gemfire.cache.CacheListener;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.EntryEvent;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Region.Entry;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.Region.Entry;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -39,13 +45,14 @@ import com.gemstone.gemfire.internal.cache.HARegion;
 import com.gemstone.gemfire.internal.cache.RegionQueue;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test points out the bug when GII of HARegion Queue is happening and at the same time it is receiving puts from peer to peer.
@@ -55,11 +62,9 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 4. Start vm1 and create HARegion Queue asynchronously and notify vm0 after its creation
  * 5. Put the data from vm0 asynchronously till HARegion Queue gets created in vm1.
  * 6. Validate the data. Puts happened during GII should be missed.
- *
  */
-
-public class HAGIIBugDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HAGIIBugDUnitTest extends JUnit4DistributedTestCase {
 
   VM vm0 = null;
 
@@ -133,15 +138,9 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
     assertNotNull(cache);
   }
 
-  
-  public void testDummy() throws Exception
-  {
-    LogWriterUtils.getLogWriter().info("This is Dummy test for the GII");  
-  }
-  
-  
-  public void _testGIIBug() throws Exception
-  {
+  @Ignore("TODO")
+  @Test
+  public void testGIIBug() throws Exception {
 
     vm0.invoke(putFromVmBeforeGII("vm0_1"));
     populateKeySet("vm0_1");
@@ -336,7 +335,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
 
   public static void createRegionQueue() throws Exception
   {
-    new HAGIIBugDUnitTest("temp").createCache(new Properties());
+    new HAGIIBugDUnitTest().createCache(new Properties());
     HARegionQueueAttributes hattr = new HARegionQueueAttributes();
     // setting expiry time for the regionqueue.
     hattr.setExpiryTime(12000000);
@@ -361,11 +360,6 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
     }
   }
 
-  public HAGIIBugDUnitTest(String arg0) {
-    super(arg0);
-
-  }
-
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
index fabe3e6..62375f9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
@@ -14,10 +14,29 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@ -32,86 +51,35 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientTombstoneMessage;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
 import com.gemstone.gemfire.internal.cache.versions.VersionSource;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Client is connected to S1 which has a slow dispatcher. Puts are made on S1.  Then S2 is started
  * and made available for the client. After that , S1 's  server is stopped. The client fails over to
  * S2. The client should receive all the puts . These puts have arrived on S2 via GII of HARegion.
- *
- *
  */
+@Category(DistributedTest.class)
+public class HAGIIDUnitTest extends JUnit4DistributedTestCase {
 
-class GIIChecker extends CacheListenerAdapter
-{
-  private boolean gotFirst = false;
-  private boolean gotSecond = false;
-  private boolean gotThird = false;
-  private int updates = 0;
-  
-  public void afterUpdate(EntryEvent event) {
-    
-    this.updates++;
-    
-    String key = (String) event.getKey();
-    String value = (String) event.getNewValue();
-    
-    if (key.equals("key-1") && value.equals("value-1")) {
-      this.gotFirst = true;
-    }
-    
-    if (key.equals("key-2") && value.equals("value-2")) {
-      this.gotSecond = true;
-    }
-    
-    if (key.equals("key-3") && value.equals("value-3")) {
-      this.gotThird = true;
-    }
-  }
-  
-  public int getUpdates() {
-    return this.updates;
-  }
-  
-  public boolean gotFirst() {
-    return this.gotFirst;
-  }
-  
-  public boolean gotSecond() {
-    return this.gotSecond;
-  }
-  
-  public boolean gotThird() {
-    return this.gotThird;
-  }
-}
-
-public class HAGIIDUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
   //server
   private static VM server0 = null;
   private static VM server1 = null;
   private static VM client0 = null;
 
-  private static final String REGION_NAME = "HAGIIDUnitTest_region";
+  private static final String REGION_NAME = HAGIIDUnitTest.class.getSimpleName() + "_region";
   
   protected static GIIChecker checker = new GIIChecker();
   private int PORT2;
 
-  /** constructor */
-  public HAGIIDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -134,6 +102,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
     client0.invoke(() -> HAGIIDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2)));
   }
   
+  @Test
   public void testGIIRegionQueue()
   {
     client0.invoke(() -> HAGIIDUnitTest.createEntries());
@@ -167,7 +136,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAGIIDUnitTest("temp").createCache(props);
+    new HAGIIDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     ClientServerTestCase.configureConnectionPool(factory, host, new int[] {PORT1,PORT2}, true, -1, 2, null, 1000, -1, false, -1);
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -178,7 +147,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
 
   public static Integer createServer1Cache() throws Exception
   {
-    new HAGIIDUnitTest("temp").createCache(new Properties());
+    new HAGIIDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -194,7 +163,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
 
   public static void createServer2Cache(Integer port) throws Exception
   {
-    new HAGIIDUnitTest("temp").createCache(new Properties());
+    new HAGIIDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -219,6 +188,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
       Assert.fail("failed while registering keys ", ex);
     }
   }
+
   public static void createEntries()
   {
     try {
@@ -244,7 +214,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
       }
     }
     catch (Exception e) {
-      fail("failed while stopServer()" + e);
+      fail("failed while stopServer()", e);
     }
   }
 
@@ -401,7 +371,6 @@ public class HAGIIDUnitTest extends DistributedTestCase
       Wait.waitForCriterion(ev, 60 * 1000, 200, true);
       // assertIndexDetailsEquals( "key-2",r.getEntry("key-2").getValue());
 
-
       // wait until
       // we have a
       // dead server
@@ -450,4 +419,49 @@ public class HAGIIDUnitTest extends DistributedTestCase
       cache.getDistributedSystem().disconnect();
     }
   }
+
+  private static class GIIChecker extends CacheListenerAdapter {
+
+    private boolean gotFirst = false;
+    private boolean gotSecond = false;
+    private boolean gotThird = false;
+    private int updates = 0;
+
+    @Override
+    public void afterUpdate(EntryEvent event) {
+
+      this.updates++;
+
+      String key = (String) event.getKey();
+      String value = (String) event.getNewValue();
+
+      if (key.equals("key-1") && value.equals("value-1")) {
+        this.gotFirst = true;
+      }
+
+      if (key.equals("key-2") && value.equals("value-2")) {
+        this.gotSecond = true;
+      }
+
+      if (key.equals("key-3") && value.equals("value-3")) {
+        this.gotThird = true;
+      }
+    }
+
+    public int getUpdates() {
+      return this.updates;
+    }
+
+    public boolean gotFirst() {
+      return this.gotFirst;
+    }
+
+    public boolean gotSecond() {
+      return this.gotSecond;
+    }
+
+    public boolean gotThird() {
+      return this.gotThird;
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
index 6cb5b47..4bbc49f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
@@ -16,37 +16,41 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.internal.cache.Conflatable;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
-import org.apache.logging.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
 
 /**
  * Test to verify Add operation to HARegion Queue with and without conflation.
- * 
  */
-
 @Category(IntegrationTest.class)
-public class HARQAddOperationJUnitTest
-{
+public class HARQAddOperationJUnitTest {
   private static final Logger logger = LogService.getLogger();
 
   /** The cache instance */
@@ -74,78 +78,40 @@ public class HARQAddOperationJUnitTest
   
   volatile static int expiryCount = 0;
   
-  /**
-   * Create the cache in setup
-   * 
-   * @throws Exception -
-   *           thrown if any exception occurs in setUp
-   */
   @Before
-  public void setUp() throws Exception
-  {
+  public void setUp() throws Exception {
     this.cache = createCache();
     this.logWriter = cache.getLogger();
   }
 
-  /**
-   * Close the cache in tear down *
-   * 
-   * @throws Exception -
-   *           thrown if any exception occurs in tearDown
-   */
   @After
-  public void tearDown() throws Exception
-  {
+  public void tearDown() throws Exception {
     this.cache.close();
   }
 
   /**
    * Creates the cache instance for the test
-   * 
-   * @return the cache instance
-   * @throws CacheException -
-   *           thrown if any exception occurs in cache creation
    */
-  private Cache createCache() throws CacheException
-  {
+  private Cache createCache() throws CacheException {
     return new CacheFactory().set(MCAST_PORT, "0").create();
   }
 
   /**
    * Creates HA region-queue object
-   * 
-   * @return HA region-queue object
-   * @throws IOException
-   * @throws ClassNotFoundException
-   * @throws CacheException
-   * @throws InterruptedException
    */
-  protected HARegionQueue createHARegionQueue(String name)
-      throws IOException, ClassNotFoundException, CacheException, InterruptedException
-  {
+  protected HARegionQueue createHARegionQueue(String name) throws IOException, ClassNotFoundException, CacheException, InterruptedException {
     AttributesFactory factory = new AttributesFactory();
     factory.setDataPolicy(DataPolicy.REPLICATE);
     factory.setScope(Scope.DISTRIBUTED_ACK);
-    HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name,
-        cache, HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
+    HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name, cache, HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
     return regionqueue;
   }
 
   /**
    * Creates HA region-queue object
-   * 
-   * @return HA region-queue object
-   * @throws IOException
-   * @throws ClassNotFoundException
-   * @throws CacheException
-   * @throws InterruptedException
    */
-  protected HARegionQueue createHARegionQueue(String name,
-      HARegionQueueAttributes attrs) throws IOException, ClassNotFoundException, CacheException, InterruptedException
-  {
-
-    HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name,
-        cache, attrs, HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
+  protected HARegionQueue createHARegionQueue(String name, HARegionQueueAttributes attrs) throws IOException, ClassNotFoundException, CacheException, InterruptedException {
+    HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name, cache, attrs, HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
     return regionqueue;
   }
 
@@ -155,11 +121,9 @@ public class HARQAddOperationJUnitTest
    * to value 2 3) Available IDs , Last DispatchedWrapper Set & Conflation Map
    * should have size 1. 4) Conflation Map , LastDispatchedWrapper Set &
    * Available IDs should have counter corresponding to second operation
-   * 
    */
   @Test
-  public void testQueueAddOperationWithConflation() throws Exception
-  {
+  public void testQueueAddOperationWithConflation() throws Exception {
     this.logWriter
         .info("HARegionQueueJUnitTest : testQueueAddOperationWithConflation BEGIN");
     this.rq = createHARegionQueue("testQueueAddOperationWithConflation");
@@ -191,11 +155,9 @@ public class HARQAddOperationJUnitTest
    * 3) This wrapper should have a set with size 1. 4) The available IDs set
    * shoudl have size 1. 5) Put another object by same thread. 6) The wrapper
    * set & availableIs List should have size 2 .
-   * 
    */
   @Test
-  public void testQueueAddOperationWithoutConflation() throws Exception
-  {
+  public void testQueueAddOperationWithoutConflation() throws Exception {
     this.logWriter
         .info("HARegionQueueJUnitTest : testQueueAddOperationWithoutConflation BEGIN");
     this.rq = createHARegionQueue("testQueueAddOperationWithConflation");
@@ -239,12 +201,9 @@ public class HARQAddOperationJUnitTest
    * available IDs , LastDispatchedWrapper's Set should have size 0. Events map
    * containg should have size 1 ( corresponding to the
    * lastDispatchedAndCurrentEvent Wrapper objcet)
-   * 
-   * @throws Exception
    */
   @Test
-  public void testQueueAddTakeOperationWithoutConflation() throws Exception
-  {
+  public void testQueueAddTakeOperationWithoutConflation() throws Exception {
     this.logWriter
         .info("HARegionQueueJUnitTest : testQueueAddTakeOperationWithoutConflation BEGIN");
 
@@ -269,12 +228,9 @@ public class HARQAddOperationJUnitTest
    * with Threaddentifer as key & sequence as the value for Expiry. Perform a
    * take operation. Validate that expiry on ThreadIdentifier removes itself
    * from Events Map
-   * 
-   * 
    */
   @Test
-  public void testExpiryOnThreadIdentifier()
-  {
+  public void testExpiryOnThreadIdentifier() {
     try {
       HARegionQueueAttributes attrs = new HARegionQueueAttributes();
       attrs.setExpiryTime(2);
@@ -312,12 +268,9 @@ public class HARQAddOperationJUnitTest
    * expiry. Validate the data present in Queue experiences expiry. After the
    * expiry of the data , AvaialbleIds size should be 0, entry removed from
    * Region, LastDispatchedWrapperSet should have size 0.
-   * 
-   * 
    */
   @Test
-  public void testNoExpiryOnThreadIdentifier()
-  {
+  public void testNoExpiryOnThreadIdentifier() {
     try {
       HARegionQueueAttributes hqa = new HARegionQueueAttributes();
       hqa.setExpiryTime(8);
@@ -370,11 +323,9 @@ public class HARQAddOperationJUnitTest
    * queue contains objects from 1- 10. QRM with sequenceID 5 arrives It should
    * remove only remove objects for 1- 5. Then sequenceID 10 come which should
    * remove 5-10.
-   * 
    */
   @Test
-  public void testMultipleQRMArrival() throws Exception
-  {
+  public void testMultipleQRMArrival() throws Exception {
     HARegionQueue regionqueue = createHARegionQueue("testNoExpiryOnThreadIdentifier");
 
     EventID[] ids = new EventID[10];
@@ -404,7 +355,6 @@ public class HARQAddOperationJUnitTest
 
     regionqueue.removeDispatchedEvents(ids[9]);
     assertEquals(0, regionqueue.getAvalaibleIds().size());
-
   }
 
   /**
@@ -414,11 +364,9 @@ public class HARQAddOperationJUnitTest
    * before QRM thread acts , the object should be present in the
    * lastDispatchedSet & AvailableID. Then the QRM thread gets unblocked , it
    * should remove from the available ID.
-   * 
    */
   @Test
-  public void testConcurrentPutAndQRM() throws Exception
-  {
+  public void testConcurrentPutAndQRM() throws Exception {
     testFailed = false;
     message = new StringBuffer();
     final HARegionQueue regionqueue = createHARegionQueue("testConcurrentPutAndQRM");
@@ -475,8 +423,7 @@ public class HARQAddOperationJUnitTest
    * put operation shud remove from region without adding the ID anywhere.
    */
   @Test
-  public void testConcurrentQRMAndPut() throws Exception
-  {
+  public void testConcurrentQRMAndPut() throws Exception {
     testFailed = false;
     final HARegionQueue regionqueue = createHARegionQueue("testConcurrentQRMAndPut");
     final EventID id1 = new EventID(new byte[] { 1 }, 1, 1);
@@ -523,20 +470,15 @@ public class HARQAddOperationJUnitTest
 
     assertEquals(0, regionqueue.getAvalaibleIds().size());
     assertEquals(2, regionqueue.getLastDispatchedSequenceId(id2));
-
   }
 
   /**
    * Two QRMs arriving such that higer sequence number arriving before lower
    * sequence number. The lower squnce number should not set itself & also not
    * do any checking on the IDs of the LinkedHashSet
-   * 
-   * @throws Exception
    */
-
   @Test
-  public void testEventMapPopulationForQRM() throws Exception
-  {
+  public void testEventMapPopulationForQRM() throws Exception {
     HARegionQueue regionqueue = createHARegionQueue("testEventMapPopulationForQRM");
     EventID id1 = new EventID(new byte[] { 1 }, 1, 1);
     EventID id2 = new EventID(new byte[] { 1 }, 1, 2);
@@ -566,13 +508,9 @@ public class HARQAddOperationJUnitTest
    * for that ThreadIdentifier. The ID which gets conflated should not be
    * present in the availableID, Region & that ThreadIdentifier's HashSet . The
    * conflation map should contain the Old IDs position.
-   * 
-   * @throws Exception
    */
-
   @Test
-  public void testCleanUpForConflation() throws Exception
-  {
+  public void testCleanUpForConflation() throws Exception {
     this.logWriter
         .info("HARQAddOperationJUnitTest : testCleanUpForConflation BEGIN");
     testFailed = false;
@@ -661,10 +599,8 @@ public class HARQAddOperationJUnitTest
    * are deleted from the available IDs & the Counters set contained in DACE.
    * Conflation is disabled.
    */
-
   @Test
-  public void testPeekAndRemoveWithoutConflation() throws Exception
-  {
+  public void testPeekAndRemoveWithoutConflation() throws Exception {
     testFailed = false;
     message = null;
     final int numOfThreads = 5;
@@ -719,7 +655,6 @@ public class HARQAddOperationJUnitTest
 
     this.logWriter
         .info("testPeekAndRemoveWithoutConflation() completed successfully");
-
   }
 
   /**
@@ -728,10 +663,8 @@ public class HARQAddOperationJUnitTest
    * are deleted from the available IDs & the Counters set contained in DACE.
    * Conflation is enabled
    */
-
   @Test
-  public void testPeekAndRemoveWithConflation() throws Exception
-  {
+  public void testPeekAndRemoveWithConflation() throws Exception {
     testFailed = false;
     message = null;
     final int numOfThreads = 5;
@@ -791,7 +724,6 @@ public class HARQAddOperationJUnitTest
 
     this.logWriter
         .info("testPeekAndRemoveWithConflation() completed successfully");
-
   }
 
   /**
@@ -799,13 +731,9 @@ public class HARQAddOperationJUnitTest
    * do a peek of batch size 5, 10 , 15 & 20 respectively. And all of them
    * concurrently cal remove. The remove should ensure that the entries are
    * deleted from the available IDs & the Counters set contained in DACE.
-   * 
-   * @throws Exception
    */
-
   @Test
-  public void testPeekForDiffBatchSizeAndRemoveAll() throws Exception
-  {
+  public void testPeekForDiffBatchSizeAndRemoveAll() throws Exception {
     testFailed = false;
     message = null;
     barrierCount = 0;
@@ -913,12 +841,9 @@ public class HARQAddOperationJUnitTest
    * do a peek of batch size 5, 10 and 15 respectively. And all of them
    * concurrently call remove. The remove should ensure that the entries are
    * deleted from the available IDs & the Counters set contained in DACE.
-   * 
-   * @throws Exception
    */
   @Test
-  public void testPeekForDiffBatchSizeAndRemoveSome() throws Exception
-  {
+  public void testPeekForDiffBatchSizeAndRemoveSome() throws Exception {
     testFailed = false;
     barrierCount = 0;
     message = null;
@@ -1010,7 +935,6 @@ public class HARQAddOperationJUnitTest
 
     this.logWriter
         .info("testPeekForDiffBatchSizeAndRemoveSome() completed successfully");
-
   }
 
   /**
@@ -1023,9 +947,8 @@ public class HARQAddOperationJUnitTest
    * next expiry should remove the LastDisptachedWrapper
    */
   @Test
-  public void testAddWithQRMAndExpiry() throws Exception
-  {
-	try{  
+  public void testAddWithQRMAndExpiry() throws Exception {
+	  try {
       HARegionQueueAttributes attrs = new HARegionQueueAttributes();
       attrs.setExpiryTime(10);
       final HARegionQueue regionqueue = new HARegionQueue.TestOnlyHARegionQueue("testing", cache, attrs) {
@@ -1067,11 +990,11 @@ public class HARQAddOperationJUnitTest
       assertEquals(4, regionqueue.getLastDispatchedSequenceId(new EventID(new byte[] { 1 }, 1, 1)));
       // verify 1-5 not in region
       for (long i = 1; i < 6; i++) {
-        Assert.assertTrue(!regionqueue.getRegion().containsKey(new Long(i)));
+        assertTrue(!regionqueue.getRegion().containsKey(new Long(i)));
       }
       // verify 6-10 still in region queue
       for (long i = 6; i < 11; i++) {
-        Assert.assertTrue(regionqueue.getRegion().containsKey(new Long(i)));
+        assertTrue(regionqueue.getRegion().containsKey(new Long(i)));
       }
 
       // Perform 5 take operations to remove next 5-9 sequence ids
@@ -1083,7 +1006,7 @@ public class HARQAddOperationJUnitTest
       assertEquals(9, regionqueue.getLastDispatchedSequenceId(new EventID(new byte[] { 1 }, 1, 1)));
       // verify that sequence ids 1-10 all are removed from the RQ
       for (long i = 1; i < 11; i++) {
-        Assert.assertTrue(!regionqueue.getRegion().containsKey(new Long(i)));
+        assertTrue(!regionqueue.getRegion().containsKey(new Long(i)));
       }
 
       // wait until expiry thread has run once
@@ -1109,11 +1032,11 @@ public class HARQAddOperationJUnitTest
       assertNull(regionqueue.getRegion().get(tID));
     }
     catch (Exception e) {
-      fail("Exception occured in test due to " + e);
+      throw new AssertionError("Exception occurred in test due to", e);
     }
   }
 
-  /**
+  /*
    * This test does the following:<br>
    * 1)Create a blocking HARegionQueue<br>
    * 2)Add some events to the queue with same ThreadIdentifier<br>
@@ -1125,18 +1048,13 @@ public class HARQAddOperationJUnitTest
    * 7)Verify that the size of wrapper-map is 1 as all events had same ThreadId<br>
    * 8)Verify that the sequenceId against the ThreadId in the wrapper-map is
    * same as that of the last event taken<br>
-   * 
-   * @throws Exception -
-   *           thrown if any exception occurs in test execution
    */
   
   /**
    * Behaviour of take() has been changed for relaible messaging feature. Region queue take()
    * operation will no longer add to the Dispatch Message Map. Hence disabling the test - SUYOG
-  */
- 
-  public void _testDispatchedMsgsMapUpdateOnTakes() throws Exception
-  {
+   */
+  public void _testDispatchedMsgsMapUpdateOnTakes() throws Exception {
     this.logWriter
         .info("HARQAddOperationJUnitTest : testDispatchedEventsMapUpdateOnTakes BEGIN");
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
index 2843fc0..340f10b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
@@ -14,17 +14,38 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/**
- * 
- */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.NetworkUtils.*;
+import static com.gemstone.gemfire.test.dunit.Wait.*;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
@@ -32,71 +53,53 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessage;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
 import com.gemstone.gemfire.internal.cache.tier.sockets.HAEventWrapper;
-import com.gemstone.gemfire.test.dunit.*;
-import util.TestException;
-
-import java.io.File;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 
 /**
  * This DUnit contains various tests to ensure new implementation of ha region
  * queues works as expected.
  * 
  * @since GemFire 5.7
- * 
  */
-public class HARQueueNewImplDUnitTest extends DistributedTestCase {
-  protected static Cache cache = null;
+public class HARQueueNewImplDUnitTest extends JUnit4DistributedTestCase {
 
-  protected static VM serverVM0 = null;
+  private static final String regionName = HARQueueNewImplDUnitTest.class.getSimpleName();
+  private static final Map map = new HashMap();
 
+  private static Cache cache = null;
+  private static VM serverVM0 = null;
   private static VM serverVM1 = null;
+  private static VM clientVM1 = null;
+  private static VM clientVM2 = null;
 
-  protected static VM clientVM1 = null;
-
-  protected static VM clientVM2 = null;
+  private static LogWriter logger = null;
+  private static int numOfCreates = 0;
+  private static int numOfUpdates = 0;
+  private static int numOfInvalidates = 0;
+  private static Object[] deletedValues = null;
 
   private int PORT1;
-
   private int PORT2;
 
-  private static final String regionName = "HARQueueNewImplDUnitTest";
-
-  private static final Map map = new HashMap();
-
-  protected static LogWriter logger = null;
-
-  protected static int numOfCreates = 0;
-
-  protected static int numOfUpdates = 0;
-
-  protected static int numOfInvalidates = 0;
-  
-  private static Object[] deletedValues = null;
-
-  /**
-   * @param name
-   *          name of the test
-   */
-  public HARQueueNewImplDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Sets up the test.
    */
   @Override
   public final void postSetUp() throws Exception {
+    map.clear();
+    
     final Host host = Host.getHost(0);
     serverVM0 = host.getVM(0);
     serverVM1 = host.getVM(1);
     clientVM1 = host.getVM(2);
     clientVM2 = host.getVM(3);
 
-    PORT1 = ((Integer)serverVM0.invoke(() -> HARQueueNewImplDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ))).intValue();
-    PORT2 = ((Integer)serverVM1.invoke(() -> HARQueueNewImplDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_ENTRY ))).intValue();
+    PORT1 = serverVM0.invoke(() -> HARQueueNewImplDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_MEMORY ));
+    PORT2 = serverVM1.invoke(() -> HARQueueNewImplDUnitTest.createServerCache( HARegionQueue.HA_EVICTION_POLICY_ENTRY ));
+    
     numOfCreates = 0;
     numOfUpdates = 0;
     numOfInvalidates = 0;
@@ -107,6 +110,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    */
   @Override
   public final void preTearDown() throws Exception {
+    map.clear();
+
     closeCache();
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
@@ -114,6 +119,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     // Unset the isSlowStartForTesting flag
     serverVM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
     serverVM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
+    
     // then close the servers
     serverVM0.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
     serverVM1.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
@@ -138,9 +144,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     return createServerCache(ePolicy, new Integer(1));
   }
 
-  public static Integer createServerCache(String ePolicy, Integer cap)
-      throws Exception {
-    new HARQueueNewImplDUnitTest("temp").createCache(new Properties());
+  public static Integer createServerCache(String ePolicy, Integer cap) throws Exception {
+    new HARQueueNewImplDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -167,8 +172,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     return new Integer(server1.getPort());
   }
 
-  public static Integer createOneMoreBridgeServer(Boolean notifyBySubscription)
-      throws Exception {
+  public static Integer createOneMoreBridgeServer(Boolean notifyBySubscription) throws Exception {
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     CacheServer server1 = cache.addCacheServer();
     server1.setPort(port);
@@ -180,14 +184,13 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     return new Integer(server1.getPort());
   }
 
-  public static void createClientCache(String host, Integer port1, Integer port2,
-      String rLevel, Boolean addListener) throws Exception {
+  public static void createClientCache(String host, Integer port1, Integer port2, String rLevel, Boolean addListener) throws Exception {
     CacheServerTestUtil.disableShufflingOfEndpoints();
 
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HARQueueNewImplDUnitTest("temp").createCache(props);
+    new HARQueueNewImplDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     ClientServerTestCase.configureConnectionPool(factory, host, port1
         .intValue(), port2.intValue(), true, Integer.parseInt(rLevel), 2, null,
@@ -222,8 +225,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     logger = cache.getLogger();
   }
 
-  public static void createClientCache(String host, Integer port1, Integer port2,
-      String rLevel) throws Exception {
+  public static void createClientCache(String host, Integer port1, Integer port2, String rLevel) throws Exception {
     createClientCache(host, port1, port2, rLevel, Boolean.FALSE);
   }
 
@@ -234,7 +236,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.registerInterest("ALL_KEYS");
     }
     catch (Exception ex) {
-      Assert.fail("failed in registerInterestListAll", ex);
+      fail("failed in registerInterestListAll", ex);
     }
   }
 
@@ -247,7 +249,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.registerInterest("k5");
     }
     catch (Exception ex) {
-      Assert.fail("failed while registering keys", ex);
+      fail("failed while registering keys", ex);
     }
   }
 
@@ -264,7 +266,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.put("k5", "pv5");
     }
     catch (Exception ex) {
-      Assert.fail("failed in putEntries()", ex);
+      fail("failed in putEntries()", ex);
     }
   }
 
@@ -280,7 +282,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.create("k5", "v5");
     }
     catch (Exception ex) {
-      Assert.fail("failed in createEntries()", ex);
+      fail("failed in createEntries()", ex);
     }
   }
 
@@ -293,7 +295,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      Assert.fail("failed in createEntries(Long)", ex);
+      fail("failed in createEntries(Long)", ex);
     }
   }
 
@@ -308,7 +310,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      Assert.fail("failed in putHeavyEntries(Long)", ex);
+      fail("failed in putHeavyEntries(Long)", ex);
     }
   }
 
@@ -316,18 +318,17 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * This test verifies that the client-messages-region does not store duplicate
    * ClientUpdateMessageImpl instances, during a normal put path as well as the
    * GII path.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testClientMsgsRegionSize() throws Exception {
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
     serverVM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -348,18 +349,17 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * This test verifies that the ha-region-queues increment the reference count
    * of their respective HAEventWrapper instances in the client-messages-region
    * correctly, during put as well as GII path.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testRefCountForNormalAndGIIPut() throws Exception {
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
     serverVM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -384,16 +384,15 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * This test verifies that the ha-region-queues decrement the reference count
    * of their respective HAEventWrapper instances in the client-messages-region
    * correctly, after the events have been peeked and removed from the queue.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testRefCountForPeekAndRemove() throws Exception {
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -415,16 +414,15 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * This test verifies that the processing of the QRM messages results in
    * decrementing the reference count of corresponding HAEventWrapper instances,
    * correctly.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testRefCountForQRM() throws Exception {
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -449,18 +447,17 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * proxy/client disconnect), causes the reference count of all HAEventWrapper
    * instances belonging to the ha-region-queue to be decremented by one, and
    * makes it visible to the client-messages-region.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testRefCountForDestroy() throws Exception {
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
     serverVM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -497,17 +494,16 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * Addresses the bug 39179. If a clientUpdateMessage is dispatched to the
    * client while its GII was under way, then it should not be put into the
    * HARegionQueue of a client at receiving server side.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testConcurrentGIIAndDispatch() throws Exception {
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "40000" ));
     serverVM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "40000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -537,27 +533,21 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
   }
 
-  /*
-   * public void PtestRefCountForConcurrentPutAndRemove() throws Exception { }
-   * public void PtestRefCountForConcurrentGIIPut() throws Exception { }
-   */
-
   /**
    * This test verifies that when two BridgeServerImpl instances are created in
    * a single VM, they do share the client-messages-region.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testTwoBridgeServersInOneVMDoShareCMR() throws Exception {
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
     Integer port3 = (Integer)serverVM0.invoke(() -> HARQueueNewImplDUnitTest.createOneMoreBridgeServer( Boolean.TRUE ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), port3, "0");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), port3, "0");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -574,14 +564,13 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * This test verifies that two clients, connected to two bridge servers with
    * different notifyBySubscription values, on a single VM, receive
    * updates/invalidates depending upon their notifyBySubscription value.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testUpdatesWithTwoBridgeServersInOneVM() throws Exception {
     Integer port3 = (Integer)serverVM0.invoke(() -> HARQueueNewImplDUnitTest.createOneMoreBridgeServer( Boolean.FALSE ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1", Boolean.TRUE);
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1", Boolean.TRUE);
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, port3, new Integer(PORT2), "1", Boolean.TRUE ));
 
     registerInterestListAll();
@@ -606,17 +595,16 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * This test verifies that the HAEventWrapper instances present in the
    * client-messages-region give up the references to their respective
    * ClientUpdateMessageImpl instances.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testHAEventWrapperDoesNotHoldCUMOnceInsideCMR() throws Exception {
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -640,9 +628,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * servers will have simple HashMap structures. Also, it verifies that such a
    * structure (referred to as haContainer, in general) is destroyed when its
    * bridge server is stopped.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testCMRNotCreatedForNoneEvictionPolicy() throws Exception {
     serverVM0.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
     serverVM1.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
@@ -653,10 +640,10 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -680,18 +667,17 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    * servers who have eviction policy either as 'mem' or as 'entry'. Also, it
    * verifies that such a client-messages-region is destroyed when its bridge
    * server is stopped.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testCMRCreatedForMemOrEntryEvictionPolicy() throws Exception {
     Boolean isRegion = Boolean.TRUE;
     // slow start for dispatcher
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "30000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    final String client2Host = getServerHostName(clientVM1.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -713,15 +699,14 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
   /**
    * This test verifies that the Cache.rootRegions() method does not return the
    * client-messages-region of any of the cache's attached bridge servers.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testCMRNotReturnedByRootRegionsMethod() throws Exception {
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -735,14 +720,13 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
   }
 
   /**
-   * This test verifies that the memory foorprint of the ha region queues is
+   * This test verifies that the memory footprint of the ha region queues is
    * less when ha-overflow is enabled (with an appropriate value of haCapacity)
    * compared to when it is disabled, for the same amount of data feed.
-   * 
-   * @throws Exception
    */
-  public void _testMemoryFootprintOfHARegionQueuesWithAndWithoutOverflow()
-      throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testMemoryFootprintOfHARegionQueuesWithAndWithoutOverflow() throws Exception {
     serverVM0.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
     serverVM1.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
     Thread.sleep(2000);
@@ -756,10 +740,10 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM0.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
     serverVM1.invoke(() -> ConflationDUnitTest.setIsSlowStart( "60000" ));
 
-    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
+    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = getServerHostName(clientVM1.getHost());
     clientVM1.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client1Host, new Integer(PORT1), new Integer(PORT2), "1" ));
-    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
+    final String client2Host = getServerHostName(clientVM2.getHost());
     clientVM2.invoke(() -> HARQueueNewImplDUnitTest.createClientCache( client2Host, new Integer(PORT1), new Integer(PORT2), "1" ));
 
     registerInterestListAll();
@@ -813,8 +797,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  static Long getUsedMemoryAndVerifyRegionSize(Integer rSize,
-      Integer haContainerSize, Integer port) {
+  static Long getUsedMemoryAndVerifyRegionSize(Integer rSize, Integer haContainerSize, Integer port) {
     Long retVal = null;
     try {
       retVal = new Long(Runtime.getRuntime().totalMemory()
@@ -942,22 +925,22 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyNullValuesInCMR(final Integer numOfEntries, 
-      final Integer port,
-      String[] keys) {
+  public static void verifyNullValuesInCMR(final Integer numOfEntries, final Integer port, String[] keys) {
     final Region msgsRegion = cache.getRegion(CacheServerImpl
         .generateNameForClientMsgsRegion(port.intValue()));
     WaitCriterion wc = new WaitCriterion() {
       String excuse;
+      @Override
       public boolean done() {
         int sz = msgsRegion.size();
         return sz == numOfEntries.intValue();
       }
+      @Override
       public String description() {
         return excuse;
       }
     };
-    Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
+    waitForCriterion(wc, 60 * 1000, 1000, true);
 
     Set entries = msgsRegion.entrySet();
     Iterator iter = entries.iterator();
@@ -972,8 +955,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void makeValuesOfSomeKeysNullInClientMsgsRegion(Integer port,
-      String[] keys) {
+  public static void makeValuesOfSomeKeysNullInClientMsgsRegion(Integer port, String[] keys) {
     Region msgsRegion = cache.getRegion(CacheServerImpl
         .generateNameForClientMsgsRegion(port.intValue()));
     assertNotNull(msgsRegion);
@@ -994,8 +976,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void populateValuesOfSomeKeysInClientMsgsRegion(Integer port,
-      String[] keys) {
+  public static void populateValuesOfSomeKeysInClientMsgsRegion(Integer port, String[] keys) {
     Region msgsRegion = cache.getRegion(CacheServerImpl
         .generateNameForClientMsgsRegion(port.intValue()));
     assertNotNull(msgsRegion);
@@ -1020,8 +1001,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyQueueData(Integer regionsize,
-      Integer msgsRegionsize, Integer port) {
+  public static void verifyQueueData(Integer regionsize, Integer msgsRegionsize, Integer port) {
     try {
       // Get the clientMessagesRegion and check the size.
       Region msgsRegion = cache.getRegion(CacheServerImpl
@@ -1049,10 +1029,10 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyRegionSize(final Integer regionSize,
-      final Integer msgsRegionsize, final Integer port) {
+  public static void verifyRegionSize(final Integer regionSize, final Integer msgsRegionsize, final Integer port) {
     WaitCriterion wc = new WaitCriterion() {
       String excuse;
+      @Override
       public boolean done() {
         try {
           // Get the clientMessagesRegion and check the size.
@@ -1086,17 +1066,18 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
           return false;
         }
       }
+      @Override
       public String description() {
         return excuse;
       }
     };
-    Wait.waitForCriterion(wc, 120 * 1000, 1000, true);
+    waitForCriterion(wc, 120 * 1000, 1000, true);
   }
 
-  public static void verifyRegionSize(final Integer regionSize, 
-      final Integer msgsRegionsize) {
+  public static void verifyRegionSize(final Integer regionSize, final Integer msgsRegionsize) {
     WaitCriterion wc = new WaitCriterion() {
       String excuse;
+      @Override
       public boolean done() {
         try {
           // Get the clientMessagesRegion and check the size.
@@ -1124,11 +1105,12 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
           return false;
         }
       }
+      @Override
       public String description() {
         return excuse;
       }
     };
-    Wait.waitForCriterion(wc, 120 * 1000, 1000, true);
+    waitForCriterion(wc, 120 * 1000, 1000, true);
   }
 
   public static void verifyHaContainerType(Boolean isRegion, Integer port) {
@@ -1169,7 +1151,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       while (iter.hasNext()) {
         rName = ((Region)iter.next()).getName();
         if (cmrName.equals(rName)) {
-          throw new TestException(
+          throw new AssertionError(
               "Cache.rootRegions() method should not return the client_messages_region.");
         }
         logger.fine("Region name returned from cache.rootRegions(): " + rName);
@@ -1180,30 +1162,33 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     }
   }
 
-  public static void verifyUpdatesReceived(final Integer num, Boolean isUpdate,
-      Long waitLimit) {
+  public static void verifyUpdatesReceived(final Integer num, Boolean isUpdate, Long waitLimit) {
     try {
       if (isUpdate.booleanValue()) {
         WaitCriterion ev = new WaitCriterion() {
+          @Override
           public boolean done() {
             return num.intValue() == numOfUpdates;
           }
+          @Override
           public String description() {
             return null;
           }
         };
-        Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+        waitForCriterion(ev, waitLimit.longValue(), 200, true);
       }
       else {
         WaitCriterion ev = new WaitCriterion() {
+          @Override
           public boolean done() {
             return num.intValue() == numOfInvalidates; 
           }
+          @Override
           public String description() {
             return null;
           }
         };
-        Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+        waitForCriterion(ev, waitLimit.longValue(), 200, true);
       }
     }
     catch (Exception e) {
@@ -1228,14 +1213,16 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       }
       final Map m = haContainer;
       WaitCriterion ev = new WaitCriterion() {
+        @Override
         public boolean done() {
           return m.size() == 0;
         }
+        @Override
         public String description() {
           return null;
         }
       };
-      Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+      waitForCriterion(ev, waitLimit.longValue(), 200, true);
     }
     catch (Exception e) {
       fail("failed in waitTillMessagesAreDispatched()" + e);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
index 194ce89..3f90b36 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
@@ -16,9 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
-import junit.framework.Assert;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -30,20 +33,20 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.HARegion;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test to verify :
  * 
  * 1)put() on a mirrored HARegion does not propagate 2)localDestroy() allowed on
  * a mirrored region 3) GII happens normally
- * 
- * 
  */
-public class HARegionDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HARegionDUnitTest extends JUnit4DistributedTestCase {
+  
   VM vm0 = null;
 
   VM vm1 = null;
@@ -52,8 +55,8 @@ public class HARegionDUnitTest extends DistributedTestCase
   private static final String REGION_NAME = "HARegionDUnitTest_region" ;
 
   /** constructor */
-  public HARegionDUnitTest(String name) {
-    super(name);
+  public HARegionDUnitTest() {
+    super();
   }
 
   /**
@@ -102,6 +105,7 @@ public class HARegionDUnitTest extends DistributedTestCase
    * assert put in VM2 was successful by doing a get
    * 
    */
+  @Test
   public void testLocalPut()
   {
     vm0.invoke(() -> HARegionDUnitTest.createRegion());
@@ -123,6 +127,7 @@ public class HARegionDUnitTest extends DistributedTestCase
    * key has not been destroyed in VM2
    * 
    */
+  @Test
   public void testLocalDestroy()
   {
     vm0.invoke(() -> HARegionDUnitTest.createRegion());
@@ -144,6 +149,7 @@ public class HARegionDUnitTest extends DistributedTestCase
    * through GII 6) do a put in VM2 7) assert put in VM2 was successful
    * 
    */
+  @Test
   public void testGII()
   {
     vm0.invoke(() -> HARegionDUnitTest.createRegion());
@@ -163,6 +169,7 @@ public class HARegionDUnitTest extends DistributedTestCase
    * through GII 6) do a put in VM2 7) assert put in VM2 was successful
    * 
    */
+  @Test
   public void testLocalDestroyRegion()
   {
     vm0.invoke(() -> HARegionDUnitTest.createRegion());
@@ -187,7 +194,7 @@ public class HARegionDUnitTest extends DistributedTestCase
    */
   public static void verifyRegionNotDestroyed()
   {
-    Assert.assertTrue(cache.getRegion(REGION_NAME) != null);
+    assertTrue(cache.getRegion(REGION_NAME) != null);
   }
   
   /**
@@ -197,6 +204,7 @@ public class HARegionDUnitTest extends DistributedTestCase
    * through GII 6) do a put in VM2 7) assert put in VM2 was successful
    * 
    */
+  @Test
   public void testQRM()
   {
     vm0.invoke(() -> HARegionDUnitTest.createRegionQueue());
@@ -219,7 +227,7 @@ public class HARegionDUnitTest extends DistributedTestCase
 
   public static void createRegion() throws Exception
   {
-    HARegionDUnitTest test = new HARegionDUnitTest(REGION_NAME);
+    HARegionDUnitTest test = new HARegionDUnitTest();
     cache = test.createCache();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -239,7 +247,7 @@ public class HARegionDUnitTest extends DistributedTestCase
 
   public static void createRegionQueue() throws Exception
   {
-    HARegionDUnitTest test = new HARegionDUnitTest(REGION_NAME);
+    HARegionDUnitTest test = new HARegionDUnitTest();
     cache = test.createCache();
     /*AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -258,10 +266,10 @@ public class HARegionDUnitTest extends DistributedTestCase
 
   public static void verifyAddingDispatchMesgs()
   {
-    Assert.assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting()
+    assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting()
         .isEmpty());
     hrq.addDispatchedMessage(new ThreadIdentifier(new byte[1],1),1);
-    Assert.assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting()
+    assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting()
         .isEmpty());
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
index d98b3c7..6c027ea 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
@@ -16,40 +16,56 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.internal.cache.EntryEventImpl;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.HARegion;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.io.IOException;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.GatewayException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionExistsException;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.internal.cache.EntryEventImpl;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Test verifies the properties of a HARegion which allows localPuts and
  * localDestroys on a MirroredRegion
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class HARegionJUnitTest
-{
+public class HARegionJUnitTest {
+
+  /**
+   * cache
+   */
+  private Cache cache = null;
 
   /**
    * create the cache
    */
   @Before
-  public void setUp() throws Exception
-  {
+  public void setUp() throws Exception {
     cache = createCache();
   }
 
@@ -57,49 +73,21 @@ public class HARegionJUnitTest
    * close the cache in tear down
    */
   @After
-  public void tearDown() throws Exception
-  {
+  public void tearDown() throws Exception {
     cache.close();
   }
 
   /**
-   * cache
-   */
-  private Cache cache = null;
-
-  /**
-   * 
    * create the cache
-   * 
-   * @throws TimeoutException
-   * @throws CacheWriterException
-   * @throws GatewayException
-   * @throws CacheExistsException
-   * @throws RegionExistsException
    */
-  private Cache createCache() throws TimeoutException, CacheWriterException,
-       GatewayException, CacheExistsException,
-      RegionExistsException
-  {
+  private Cache createCache() throws TimeoutException, CacheWriterException, GatewayException, CacheExistsException, RegionExistsException {
     return new CacheFactory().set(MCAST_PORT, "0").create();
   }
 
   /**
    * create the HARegion
-   * 
-   * @throws TimeoutException
-   * @throws CacheWriterException
-   * @throws GatewayException
-   * @throws CacheExistsException
-   * @throws RegionExistsException
-   * @throws IOException
-   * @throws ClassNotFoundException
    */
-  private Region createHARegion() throws TimeoutException,
-      CacheWriterException,  GatewayException,
-      CacheExistsException, RegionExistsException, IOException,
-      ClassNotFoundException
-  {
+  private Region createHARegion() throws TimeoutException, CacheWriterException,  GatewayException, CacheExistsException, RegionExistsException, IOException, ClassNotFoundException {
     AttributesFactory factory = new AttributesFactory();
     factory.setDataPolicy(DataPolicy.REPLICATE);
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -108,8 +96,8 @@ public class HARegionJUnitTest
     factory.setStatisticsEnabled(true);
     ;
     factory.setCacheListener(new CacheListenerAdapter() {
-      public void afterInvalidate(EntryEvent event)
-      {
+      @Override
+      public void afterInvalidate(EntryEvent event) {
       }
     });
     RegionAttributes ra = factory.create();
@@ -117,88 +105,56 @@ public class HARegionJUnitTest
         null, ra);
     region.getAttributesMutator().setEntryTimeToLive(ea);
     return region;
-
   }
 
   /**
    * test no exception being thrown while creating an HARegion
-   *  
    */
   @Test
-  public void testRegionCreation()
-  {
-    try {
-      createHARegion();
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      fail("Test failed due to " + e);
-    }
+  public void testRegionCreation() throws Exception {
+    createHARegion();
   }
 
   /**
    * test no exception being thrown while put is being done on an HARegion
-   *  
    */
   @Test
-  public void testPut()
-  {
-    try {
-      Region region = createHARegion();
-      region.put("key1", "value1");
-      Assert.assertEquals(region.get("key1"), "value1");
-    }
-    catch (Exception e) {
-      fail("put failed due to " + e);
-    }
+  public void testPut() throws Exception {
+    Region region = createHARegion();
+    region.put("key1", "value1");
+    assertEquals(region.get("key1"), "value1");
   }
 
   /**
    * test no exception being thrown while doing a localDestroy on a HARegion
-   *  
    */
   @Test
-  public void testLocalDestroy()
-  {
-    try {
-      Region region = createHARegion();
-      region.put("key1", "value1");
-      region.localDestroy("key1");
-      Assert.assertEquals(region.get("key1"), null);
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      fail("put failed due to " + e);
-    }
+  public void testLocalDestroy() throws Exception {
+    Region region = createHARegion();
+    region.put("key1", "value1");
+    region.localDestroy("key1");
+    assertEquals(region.get("key1"), null);
   }
+
   /**
    * Test to verify event id exists when evict destroy happens.
-   * 
    */
   @Test
-  public void testEventIdSetForEvictDestroy()
-  { 
-    try{
-      AttributesFactory factory = new AttributesFactory();    
-      
-      factory.setCacheListener(new CacheListenerAdapter(){        
-        public void afterDestroy(EntryEvent event){          
-          assertTrue("eventId has not been set for "+ event, ((EntryEventImpl)event).getEventId() != null);          
-        }
-       });
-      
-      EvictionAttributes evAttr = EvictionAttributes.createLRUEntryAttributes(1,EvictionAction.LOCAL_DESTROY);
-      factory.setEvictionAttributes(evAttr);   
-            
-      RegionAttributes attrs = factory.createRegionAttributes();
-      Region region = cache.createVMRegion("TEST_REGION", attrs);
-      region.put("key1", "value1");
-      region.put("key2", "value2");
-    }
-    catch (Exception e) {      
-    }
-    
-    
-  }
+  public void testEventIdSetForEvictDestroy() throws Exception {
+    AttributesFactory factory = new AttributesFactory();
 
+    factory.setCacheListener(new CacheListenerAdapter(){
+      public void afterDestroy(EntryEvent event){
+        assertTrue("eventId has not been set for "+ event, ((EntryEventImpl)event).getEventId() != null);
+      }
+     });
+
+    EvictionAttributes evAttr = EvictionAttributes.createLRUEntryAttributes(1,EvictionAction.LOCAL_DESTROY);
+    factory.setEvictionAttributes(evAttr);
+
+    RegionAttributes attrs = factory.createRegionAttributes();
+    Region region = cache.createVMRegion("TEST_REGION", attrs);
+    region.put("key1", "value1");
+    region.put("key2", "value2");
+  }
 }


[02/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PutAllCSDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PutAllCSDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PutAllCSDUnitTest.java
index c4d2a44..08b047a 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PutAllCSDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PutAllCSDUnitTest.java
@@ -16,16 +16,62 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.client.ServerOperationException;
 import com.gemstone.gemfire.cache.persistence.PartitionOfflineException;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.CqAttributes;
+import com.gemstone.gemfire.cache.query.CqAttributesFactory;
+import com.gemstone.gemfire.cache.query.CqClosedException;
+import com.gemstone.gemfire.cache.query.CqEvent;
+import com.gemstone.gemfire.cache.query.CqException;
+import com.gemstone.gemfire.cache.query.CqExistsException;
+import com.gemstone.gemfire.cache.query.CqListener;
+import com.gemstone.gemfire.cache.query.CqQuery;
+import com.gemstone.gemfire.cache.query.QueryInvalidException;
+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.Struct;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
@@ -33,62 +79,62 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests putAll for c/s. Also tests removeAll
  * 
  * @since GemFire 5.0.23
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
 public class PutAllCSDUnitTest extends ClientServerTestCase {
 
   final int numberOfEntries = 100;
-  
   final int testEndPointSwitchNumber = 200;
-  
   final int thousandEntries = 1000;
-  
   final int TOTAL_BUCKETS = 10;
 
   static Object lockObject = new Object();
-
   static Object lockObject2 = new Object();
-  
   static Object lockObject3 = new Object();
-  
   static Object lockObject4 = new Object();
   
   final String expectedExceptions = PutAllPartialResultException.class.getName()+"||"
   + ServerConnectivityException.class.getName()+"||"+RegionDestroyedException.class.getName()+"||java.net.ConnectException";
 
-  // public static void caseTearDown() throws Exception {
-  // disconnectAllFromDS();
-  // }
+  List<VersionTag> client1Versions = null;
+  List<VersionTag> client2Versions = null;
 
-  /**
-   * Creates a new <code>GemFireMemberStatusDUnitTest</code>
-   */
-  public PutAllCSDUnitTest(String name) {
-    super(name);
-  }
+  List<VersionTag> client1RAVersions = null;
+  List<VersionTag> client2RAVersions = null;
 
-  // ////// Test Methods
+  List<String> expectedVersions = null;
+  List<String> actualVersions = null;
+
+  List<String> expectedRAVersions = null;
+  List<String> actualRAVersions = null;
 
   private static void checkRegionSize(final Region region, final int expectedSize) {
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         return region.size() == expectedSize; 
       }
+      @Override
       public String description() {
         return null;
       }
@@ -99,10 +145,9 @@ public class PutAllCSDUnitTest extends ClientServerTestCase {
   
   /**
    * Tests putAll to one server.
-   * 
-   * @throws InterruptedException
    */
-public void testOneServer() throws CacheException, InterruptedException {
+  @Test
+  public void testOneServer() throws CacheException, InterruptedException {
     final String title = "testOneServer:";
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -117,6 +162,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createClient(client2, regionName, serverHost, new int[] {serverPort}, -1, -1, false, true, true);
 
     server.invoke(new CacheSerializableRunnable(title+"server add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -124,6 +170,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 registerInterest and add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -135,6 +182,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 create local region and run putAll") {
+      @Override
       public void run2() throws CacheException {
         AttributesFactory factory2 = new AttributesFactory();
         factory2.setScope(Scope.LOCAL);
@@ -147,9 +195,10 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
         
     AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(title+"client1 create CQ") {
+      @Override
       public void run2() throws CacheException {
         // create a CQ for key 10-20
- 	Region localregion = getRootRegion().getSubregion("localsave");
+ 	      Region localregion = getRootRegion().getSubregion("localsave");
         CqAttributesFactory cqf1 = new CqAttributesFactory();
         EOCQEventListener EOCQListener = new EOCQEventListener(localregion);
         cqf1.addCqListener(EOCQListener);
@@ -198,6 +247,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     server.invoke(new CacheSerializableRunnable(title+"verify Bridge Server") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries, region.size());
@@ -210,6 +260,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // verify CQ is ready
     client1.invoke(new CacheSerializableRunnable(title+"verify CQ is ready") {
+      @Override
       public void run2() throws CacheException {
         Region localregion = getRootRegion().getSubregion("localsave");
         waitTillNotify(lockObject, 10000, (localregion.size()>0));
@@ -219,6 +270,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // verify registerInterest result at client2
     client2.invoke(new CacheSerializableRunnable(title+"verify client2") {
+      @Override
       public void run2() throws CacheException {
         final Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -240,6 +292,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     // verify CQ result at client1
     client1.invoke(new CacheSerializableRunnable(title+"Verify client1") {
+      @Override
       public void run2() throws CacheException {
         Region localregion = getRootRegion().getSubregion("localsave");
         for (int i=10; i<15; i++) {
@@ -262,6 +315,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });
     client2.invoke(new CacheSerializableRunnable(title+"verify client2") {
+      @Override
       public void run2() throws CacheException {
         final Region region = getRootRegion().getSubregion(regionName);
         LinkedHashMap map = new LinkedHashMap();
@@ -273,6 +327,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     // verify CQ result at client1
     client1.invoke(new CacheSerializableRunnable(title+"Verify client1") {
+      @Override
       public void run2() throws CacheException {
         Region localregion = getRootRegion().getSubregion("localsave");
         for (int i=10; i<20; i++) {
@@ -325,6 +380,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Test Exception handling
     // verify CQ is ready
     client1.invoke(new CacheSerializableRunnable(title+"test exception handling") {
+      @Override
       public void run2() throws CacheException {
     	Region region = getRootRegion().getSubregion(regionName);
         Map m = null;
@@ -367,9 +423,8 @@ public void testOneServer() throws CacheException, InterruptedException {
 
   /**
    * Tests putAll afterUpdate event contained oldValue.
-   * 
-   * @throws InterruptedException
    */
+  @Test
   public void testOldValueInEvent() throws CacheException, InterruptedException {
     final String title = "testOldValueInEvent:";
     final Host host = Host.getHost(0);
@@ -388,6 +443,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createClient(client2, regionName, serverHost, new int[] {serverPort2}, -1, -1, false, true, true);
   
     client2.invoke(new CacheSerializableRunnable(title+"client2 registerInterest and add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -399,6 +455,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
   
     client1.invoke(new CacheSerializableRunnable(title+"client1 create local region and run putAll") {
+      @Override
       public void run2() throws CacheException {
         // create keys
         Region region = getRootRegion().getSubregion(regionName);
@@ -414,6 +471,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     // verify 41890, the local PUTALL_UPDATE event should contain old value
     client1.invoke(new CacheSerializableRunnable(title+"verify after update events") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         waitTillNotify(lockObject, 20000, (region.size() == numberOfEntries));
@@ -421,6 +479,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
         
     client2.invoke(new CacheSerializableRunnable(title+"verify after update events") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         waitTillNotify(lockObject, 20000, (region.size() == numberOfEntries));
@@ -436,9 +495,9 @@ public void testOneServer() throws CacheException, InterruptedException {
    * client to a replicated region 2) putAll from a multi-threaded client to a
    * replicated region 3)
    */
+  @Test
   public void test2Server() throws CacheException, InterruptedException {
     final String title = "test2Server:";
-//    disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -457,6 +516,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createBridgeClient(client2, regionName, serverHost, new int[] {serverPort2}, -1, -1, true);
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -464,6 +524,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -479,6 +540,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().setCacheWriter(new MyWriter("key-"));
@@ -493,6 +555,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().setCacheWriter(new MyWriter("key-"));
@@ -505,6 +568,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -517,6 +581,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         doRemoveAll(regionName, "key-", numberOfEntries);
@@ -527,6 +592,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -539,6 +605,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -550,6 +617,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -560,12 +628,14 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute client putAll from multithread client
     AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(
         title + "async putAll1 from client1") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "async1key-", numberOfEntries);
       }
     });
     AsyncInvocation async2 = client1.invokeAsync(new CacheSerializableRunnable(
         title + "async putAll2 from client1") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "async2key-", numberOfEntries);
       }
@@ -577,6 +647,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     client1.invoke(new CacheSerializableRunnable(title
         + "verify client 1 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries*2, region.size());
@@ -599,6 +670,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1 for asyn keys
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries*2, region.size());
@@ -620,6 +692,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2 for asyn keys
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries*2, region.size());
@@ -639,6 +712,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify async putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries*2);
@@ -659,12 +733,14 @@ public void testOneServer() throws CacheException, InterruptedException {
       // Execute client removeAll from multithread client
       AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(
           title + "async putAll1 from client1") {
+        @Override
         public void run2() throws CacheException {
           doRemoveAll(regionName, "async1key-", numberOfEntries);
         }
       });
       AsyncInvocation async2 = client1.invokeAsync(new CacheSerializableRunnable(
           title + "async putAll2 from client1") {
+        @Override
         public void run2() throws CacheException {
           doRemoveAll(regionName, "async2key-", numberOfEntries);
         }
@@ -675,6 +751,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     }
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         doRemoveAll(regionName, "key-", numberOfEntries);
@@ -685,6 +762,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify async removeAll Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -694,6 +772,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify async removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -701,6 +780,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify async removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -710,6 +790,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute p2p putAll
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 execute P2P putAll") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "p2pkey-", numberOfEntries);
         Region region = getRootRegion().getSubregion(regionName);
@@ -727,6 +808,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2 for p2p keys
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2 for p2p keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         long ts1 = 0;
@@ -740,6 +822,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify p2p putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -751,6 +834,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });   
     client1.invoke(new CacheSerializableRunnable(title+"client1 verify p2p putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -765,6 +849,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute p2p removeAll
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 execute P2P removeAll") {
+      @Override
       public void run2() throws CacheException {
         doRemoveAll(regionName, "p2pkey-", numberOfEntries);
         Region region = getRootRegion().getSubregion(regionName);
@@ -774,6 +859,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify p2p removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -781,6 +867,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify p2p removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -788,6 +875,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 verify p2p removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -797,6 +885,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // putAll at client2 to trigger local-invalidates at client1
     client2.invoke(new CacheSerializableRunnable(title
         + "execute putAll on client2 for key 0-10") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "key-", 10);
       }
@@ -805,15 +894,18 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify client 2 for key 0-10
     client1.invoke(new CacheSerializableRunnable(title
         + "verify client1 for local invalidate") {
+      @Override
       public void run2() throws CacheException {
         final Region region = getRootRegion().getSubregion(regionName);
         for (int i = 0; i < 10; i++) {
           final int ii = i;
           WaitCriterion ev = new WaitCriterion() {
+            @Override
             public boolean done() {
               Entry entry = region.getEntry("key-" + ii);
               return entry != null  &&  entry.getValue() == null;
             }
+            @Override
             public String description() {
               return null;
             }
@@ -832,10 +924,10 @@ public void testOneServer() throws CacheException, InterruptedException {
     stopBridgeServers(getCache());
   }
 
-  
   /* same as test2Server(), but all the servers are using policy normal */
   private int createServerRegion(VM vm, final String regionName, final boolean CCE) {
     SerializableCallable createRegion = new SerializableCallable() {
+      @Override
       public Object call() throws Exception {
         AttributesFactory af = new AttributesFactory();
         af.setConcurrencyChecksEnabled(CCE);
@@ -858,7 +950,6 @@ public void testOneServer() throws CacheException, InterruptedException {
   
   public void doTest2NormalServerCCE(boolean CCE) throws CacheException, InterruptedException {
     final String title = "doTest2NormalServerCCE="+CCE+":";
-//    disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -876,6 +967,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createBridgeClient(client2, regionName, serverHost, new int[] {serverPort2}, -1, 59000, true);
     
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -884,6 +976,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // test case 1: putAll and removeAll to server1
     client1.invoke(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -900,6 +993,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().setCacheWriter(new MyWriter("case1-"));
@@ -914,6 +1008,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().setCacheWriter(new MyWriter("case1-"));
@@ -923,6 +1018,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         LocalRegion region = (LocalRegion)getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries+1, region.size());
@@ -936,6 +1032,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -948,6 +1045,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -959,6 +1057,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -967,6 +1066,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // test case 2: putAll to server1, removeAll to server2
     client1.invoke(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         doPutAll(regionName, "case2-", numberOfEntries);
@@ -981,6 +1081,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries, region.size());
@@ -993,6 +1094,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // normal policy will not distribute create events
@@ -1001,6 +1103,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         doRemoveAll(regionName, "case2-", numberOfEntries);
@@ -1010,6 +1113,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(100, region.size());
@@ -1018,6 +1122,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server2.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1025,6 +1130,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 verify removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 100);
@@ -1034,6 +1140,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // test case 3: removeAll a list with duplicated keys 
     client1.invoke(new CacheSerializableRunnable(title+"put 3 keys then removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.put("case3-1", "case3-1");
@@ -1053,6 +1160,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1063,14 +1171,16 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Stop server
     stopBridgeServers(getCache());
   }
-  
+
+  @Test
   public void test2NormalServerCCE() throws CacheException, InterruptedException {
     doTest2NormalServerCCE(true);
     disconnectAllFromDS();
     doTest2NormalServerCCE(false);
     disconnectAllFromDS();
   }
-  
+
+  @Test
   public void testPRServerRVDuplicatedKeys() throws CacheException, InterruptedException {
     doRVDuplicatedKeys(true, 1);
     disconnectAllFromDS();
@@ -1082,7 +1192,6 @@ public void testOneServer() throws CacheException, InterruptedException {
   
   public void doRVDuplicatedKeys(final boolean isPR, final int redundantCopies) throws CacheException, InterruptedException {
     final String title = "doRVDuplicatedKeys:";
-    //  disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1101,6 +1210,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createBridgeClient(client2, regionName, serverHost, new int[] {serverPort2}, -1, 59000, false);
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1108,6 +1218,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1122,6 +1233,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // test case 3: removeAll a list with duplicated keys 
     client1.invoke(new CacheSerializableRunnable(title+"put 3 keys then removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.put("case3-1", "case3-1");
@@ -1132,6 +1244,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     client2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Wait.pause(5000);
         Region region = getRootRegion().getSubregion(regionName);
@@ -1145,6 +1258,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"put 3 keys then removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         ArrayList keys = new ArrayList();
@@ -1164,6 +1278,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         Region.Entry re = region.getEntry("case3-1");
@@ -1177,6 +1292,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         Region.Entry re = region.getEntry("case3-1");
@@ -1190,6 +1306,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     client2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Wait.pause(5000);
         Region region = getRootRegion().getSubregion(regionName);
@@ -1206,12 +1323,14 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Stop server
     stopBridgeServers(getCache());
   }
-  
+
+  @Test
   public void testBug51725() throws CacheException, InterruptedException {
     doBug51725(false);
     disconnectAllFromDS();
   }
 
+  @Test
   public void testBug51725_singlehup() throws CacheException, InterruptedException {
     doBug51725(true);
     disconnectAllFromDS();
@@ -1229,8 +1348,6 @@ public void testOneServer() throws CacheException, InterruptedException {
     int server1Size;
     int server2Size;
 
-//    disconnectAllFromDS();
-
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
     final VM server2 = host.getVM(1);
@@ -1253,6 +1370,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     client2.invoke(addExceptionTag1(expectedExceptions));
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1263,6 +1381,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     client1.invoke(new CacheSerializableRunnable(title+"put 3 keys then removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1274,6 +1393,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     closeCache(server2);
     client1.invoke(new CacheSerializableRunnable(title+"putAll from client again") {
+      @Override
       public void run2() throws CacheException {
         LocalRegion region = (LocalRegion)getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1312,6 +1432,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     client2.invoke(new CacheSerializableRunnable(title+"verify entries from client2") {
+      @Override
       public void run2() throws CacheException {
         Wait.pause(5000);
         Region region = getRootRegion().getSubregion(regionName);
@@ -1330,9 +1451,9 @@ public void testOneServer() throws CacheException, InterruptedException {
   /**
    * Tests putAll to 2 PR servers.
    */
+  @Test
   public void testPRServer() throws CacheException, InterruptedException {
     final String title = "testPRServer:";
-//    disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1350,6 +1471,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createBridgeClient(client2, regionName, serverHost, new int[] {serverPort2}, -1, 59000, false);
     
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1357,6 +1479,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
     
     client1.invoke(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1372,6 +1495,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().setCacheWriter(new MyWriter("key-"));
@@ -1386,6 +1510,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().setCacheWriter(new MyWriter("key-"));
@@ -1398,6 +1523,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     client2.invoke(new CacheSerializableRunnable(title
         + "verify client2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -1410,6 +1536,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         doRemoveAll(regionName, "key-", numberOfEntries);
@@ -1420,6 +1547,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1433,6 +1561,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1444,6 +1573,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -1452,25 +1582,28 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // Execute client putAll from multithread client
     {
-    AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(
-        title + "async putAll1 from client1") {
-      public void run2() throws CacheException {
-        doPutAll(regionName, "async1key-", numberOfEntries);
-      }
-    });
-    AsyncInvocation async2 = client1.invokeAsync(new CacheSerializableRunnable(
-        title + "async putAll2 from client1") {
-      public void run2() throws CacheException {
-        doPutAll(regionName, "async2key-", numberOfEntries);
-      }
-    });
+      AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(
+          title + "async putAll1 from client1") {
+        @Override
+        public void run2() throws CacheException {
+          doPutAll(regionName, "async1key-", numberOfEntries);
+        }
+      });
+      AsyncInvocation async2 = client1.invokeAsync(new CacheSerializableRunnable(
+          title + "async putAll2 from client1") {
+        @Override
+        public void run2() throws CacheException {
+          doPutAll(regionName, "async2key-", numberOfEntries);
+        }
+      });
 
-    ThreadUtils.join(async1, 30 * 1000);
-    ThreadUtils.join(async2, 30 * 1000);
+      ThreadUtils.join(async1, 30 * 1000);
+      ThreadUtils.join(async2, 30 * 1000);
     }
-    
+
     client1.invoke(new CacheSerializableRunnable(title
         + "verify client 1 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(numberOfEntries*2, region.size());
@@ -1493,6 +1626,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2 for asyn keys
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         long ts1 = 0, ts2 = 0;
@@ -1512,6 +1646,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify async putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries*2);
@@ -1532,12 +1667,14 @@ public void testOneServer() throws CacheException, InterruptedException {
       // Execute client removeAll from multithread client
       AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(
           title + "async putAll1 from client1") {
+        @Override
         public void run2() throws CacheException {
           doRemoveAll(regionName, "async1key-", numberOfEntries);
         }
       });
       AsyncInvocation async2 = client1.invokeAsync(new CacheSerializableRunnable(
           title + "async putAll2 from client1") {
+        @Override
         public void run2() throws CacheException {
           doRemoveAll(regionName, "async2key-", numberOfEntries);
         }
@@ -1548,6 +1685,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     }
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         doRemoveAll(regionName, "key-", numberOfEntries);
@@ -1558,6 +1696,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 1, its data are from client
     server1.invoke(new CacheSerializableRunnable(title
         + "verify async removeAll Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1567,6 +1706,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify async removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1574,6 +1714,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify async removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -1583,6 +1724,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute p2p putAll
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 execute P2P putAll") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "p2pkey-", numberOfEntries);
         Region region = getRootRegion().getSubregion(regionName);
@@ -1600,6 +1742,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2 for p2p keys
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         long ts1 = 0;
@@ -1613,6 +1756,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify p2p putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -1624,6 +1768,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });   
     client1.invoke(new CacheSerializableRunnable(title+"client1 verify p2p putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, numberOfEntries);
@@ -1638,6 +1783,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute p2p removeAll
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 execute P2P removeAll") {
+      @Override
       public void run2() throws CacheException {
         doRemoveAll(regionName, "p2pkey-", numberOfEntries);
         Region region = getRootRegion().getSubregion(regionName);
@@ -1647,6 +1793,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2, because its data are from distribution
     server2.invoke(new CacheSerializableRunnable(title
         + "verify p2p removeAll Bridge Server 2") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         assertEquals(0, region.size());
@@ -1654,6 +1801,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 verify p2p removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -1661,6 +1809,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 verify p2p removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         checkRegionSize(region, 0);
@@ -1670,6 +1819,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // putAll at client2 to trigger local-invalidates at client1
     client2.invoke(new CacheSerializableRunnable(title
         + "execute putAll on client2 for key 0-10") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "key-", 10);
       }
@@ -1678,15 +1828,18 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify client 2 for key 0-10
     client1.invoke(new CacheSerializableRunnable(title
         + "verify client1 for local invalidate") {
+      @Override
       public void run2() throws CacheException {
         final Region region = getRootRegion().getSubregion(regionName);
         for (int i = 0; i < 10; i++) {
           final int ii = i;
           WaitCriterion ev = new WaitCriterion() {
+            @Override
             public boolean done() {
               Entry entry = region.getEntry("key-" + ii);
               return entry != null && entry.getValue() == null;
             }
+            @Override
             public String description() {
               return null;
             }
@@ -1703,9 +1856,12 @@ public void testOneServer() throws CacheException, InterruptedException {
     stopBridgeServers(getCache());
   }
 
-  // Checks to see if a client does a destroy that throws an exception from CacheWriter beforeDestroy
-  // that the size of the region is still correct.
-  // See bug 51583.
+  /**
+   * Checks to see if a client does a destroy that throws an exception from CacheWriter beforeDestroy
+   * that the size of the region is still correct.
+   * See bug 51583.
+   */
+  @Test
   public void testClientDestroyOfUncreatedEntry() throws CacheException, InterruptedException {
     final String title = "testClientDestroyOfUncreatedEntry:";
 
@@ -1725,6 +1881,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add cacheWriter") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // Install cacheWriter that causes the very first destroy to fail
@@ -1734,6 +1891,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     assertEquals(0, getRegionSize(server1, regionName));
     client1.invoke(new CacheSerializableRunnable(title+"client1 destroy") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         try {
@@ -1755,9 +1913,9 @@ public void testOneServer() throws CacheException, InterruptedException {
   /**
    * Tests partial key putAll and removeAll to 2 servers with local region
    */
+  @Test
   public void testPartialKeyInLocalRegion() throws CacheException, InterruptedException {
     final String title = "testPartialKeyInLocalRegion:";
-//    disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
@@ -1781,6 +1939,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add cacheWriter") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // let the server to trigger exception after created 15 keys
@@ -1789,6 +1948,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1799,6 +1959,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
 
@@ -1816,9 +1977,11 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     {
     WaitCriterion waitForSizes = new WaitCriterion() {
+      @Override
       public String description() {
         return "waiting for conditions to be met";
       }
+      @Override
       public boolean done() {
         int c1Size = getRegionSize(client1, regionName);
         int c2Size = getRegionSize(client2, regionName);
@@ -1852,6 +2015,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // reset cacheWriter's count to allow another 15 keys to be created
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add cacheWriter") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // let the server to trigger exception after created 15 keys
@@ -1861,6 +2025,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // p2p putAll on DR and expect exception
     server2.invoke(new CacheSerializableRunnable(title+"server2 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1880,9 +2045,11 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     {
       WaitCriterion waitForSizes = new WaitCriterion() {
+        @Override
         public String description() {
           return "waiting for conditions to be met";
         }
+        @Override
         public boolean done() {
           int c1Size = getRegionSize(client1, regionName);
           int c2Size = getRegionSize(client2, regionName);
@@ -1914,6 +2081,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // now do a removeAll that is not allowed to remove everything
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add cacheWriter") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // server triggers exception after destroying 5 keys
@@ -1921,6 +2089,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });
     client1.invoke(new CacheSerializableRunnable(title+"client1 removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
 
@@ -1937,9 +2106,11 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
     {
       WaitCriterion waitForSizes = new WaitCriterion() {
+        @Override
         public String description() {
           return "waiting for conditions to be met";
         }
+        @Override
         public boolean done() {
           int c1Size = getRegionSize(client1, regionName);
           int c2Size = getRegionSize(client2, regionName);
@@ -1971,6 +2142,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // reset cacheWriter's count to allow another 5 keys to be destroyed
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add cacheWriter") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // server triggers exception after destroying 5 keys
@@ -1980,6 +2152,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // p2p putAll on DR and expect exception
     server2.invoke(new CacheSerializableRunnable(title+"server2 add listener and removeAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -1996,9 +2169,11 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     {
       WaitCriterion waitForSizes = new WaitCriterion() {
+        @Override
         public String description() {
           return "waiting for conditions to be met";
         }
+        @Override
         public boolean done() {
           int c1Size = getRegionSize(client1, regionName);
           int c2Size = getRegionSize(client2, regionName);
@@ -2040,9 +2215,9 @@ public void testOneServer() throws CacheException, InterruptedException {
    * side is different between PR and LR. PR does it in postPutAll.
    * It's not running in singleHop putAll
    */
+  @Test
   public void testPartialKeyInPR() throws CacheException, InterruptedException {
     final String title = "testPartialKeyInPR:";
-//    disconnectAllFromDS();
 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2066,6 +2241,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2076,6 +2252,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     server2.invoke(new CacheSerializableRunnable(title
         + "server2 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(server2, true, sc_server2, 10));
@@ -2083,6 +2260,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2093,6 +2271,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
 
     AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2125,7 +2304,6 @@ public void testOneServer() throws CacheException, InterruptedException {
     int client2Size = getRegionSize(client2, regionName);
     int server1Size = getRegionSize(server1, regionName);
     LogWriterUtils.getLogWriter().info("region sizes: "+client1Size+","+client2Size+","+server1Size);
-//    assertIndexDetailsEquals(server1Size, client1Size);
 
     // restart server2
     createBridgeServer(server2, regionName, serverPort2, true, 0, "ds1");
@@ -2139,6 +2317,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     closeCache(server2);
     server1Size = getRegionSize(server1, regionName);
     client1.invoke(new CacheSerializableRunnable(title+"client1 does putAll again") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
 
@@ -2172,6 +2351,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // add a cacheWriter for server to stop after created 15 keys
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 execute P2P putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         // let the server to trigger exception after created 15 keys
@@ -2181,6 +2361,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // p2p putAll on PR and expect exception
     server2.invoke(new CacheSerializableRunnable(title+"server2 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         // create keys
         try {
@@ -2212,6 +2393,7 @@ public void testOneServer() throws CacheException, InterruptedException {
    * side is different between PR and LR. PR does it in postPutAll.
    * This is a singlehop putAll test.
    */
+  @Test
   public void testPartialKeyInPRSingleHop() throws CacheException, InterruptedException {
     final String title = "testPartialKeyInPRSingleHop_";
     final int cacheWriterAllowedKeyNum = 16;
@@ -2238,6 +2420,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     try {
       client2.invoke(new CacheSerializableRunnable(title + "client2 add listener") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2248,16 +2431,19 @@ public void testOneServer() throws CacheException, InterruptedException {
       });
 
       client1.invoke(new CacheSerializableRunnable(title + "do some putAll to get ClientMetaData for future putAll") {
+        @Override
         public void run2() throws CacheException {
           doPutAll(regionName, "key-", numberOfEntries);
         }
       });
 
       WaitCriterion waitForSizes = new WaitCriterion() {
+        @Override
         public String description() {
           return "waiting for conditions to be met";
         }
 
+        @Override
         public boolean done() {
           int c1Size = getRegionSize(client1, regionName);
           int c2Size = getRegionSize(client2, regionName);
@@ -2287,6 +2473,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
       server1.invoke(new CacheSerializableRunnable(title
         + "server1 add slow listener") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2297,6 +2484,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       final SharedCounter sc_server2 = new SharedCounter("server2");
       server2.invoke(new CacheSerializableRunnable(title
         + "server2 add slow listener") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator().addCacheListener(new MyListener(server2, true, sc_server2, 10));
@@ -2304,6 +2492,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       });
 
       AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(title + "client1 add listener and putAll") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2325,7 +2514,6 @@ public void testOneServer() throws CacheException, InterruptedException {
         Assert.fail("putAll client threw an exception", async1.getException());
       }
 
-
       // restart server2
       System.out.println("restarting server 2");
       createBridgeServer(server2, regionName, serverPort2, true, 0, "ds1");
@@ -2338,6 +2526,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       // close a server to re-run the test
       closeCache(server2);
       client1.invoke(new CacheSerializableRunnable(title + "client1 does putAll again") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
 
@@ -2360,6 +2549,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       // add a cacheWriter for server to fail putAll after it created cacheWriterAllowedKeyNum keys
       server1.invoke(new CacheSerializableRunnable(title
         + "server1 add cachewriter to throw exception after created some keys") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator().setCacheWriter(new MyWriter(cacheWriterAllowedKeyNum));
@@ -2367,6 +2557,7 @@ public void testOneServer() throws CacheException, InterruptedException {
       });
 
       client1.invoke(new CacheSerializableRunnable(title + "client1 does putAll once more") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(regionName);
 
@@ -2391,9 +2582,10 @@ public void testOneServer() throws CacheException, InterruptedException {
   }
 
   /**
-   * Set redundency=1 to see if retry succeeded after PRE
+   * Set redundancy=1 to see if retry succeeded after PRE
    * This is a singlehop putAll test.
    */
+  @Test
   public void testPartialKeyInPRSingleHopWithRedundency() throws CacheException, InterruptedException {
     final String title = "testPartialKeyInPRSingleHopWithRedundency_";
     int client1Size;
@@ -2401,8 +2593,6 @@ public void testOneServer() throws CacheException, InterruptedException {
     int server1Size;
     int server2Size;
 
-//    disconnectAllFromDS();
-
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
     final VM server2 = host.getVM(1);
@@ -2424,6 +2614,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     client2.invoke(addExceptionTag1(expectedExceptions));
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 add listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2434,15 +2625,18 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     client1.invoke(new CacheSerializableRunnable(title+"do some putAll to get ClientMetaData for future putAll") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "key-", numberOfEntries);
       }
     });
     
     WaitCriterion waitForSizes = new WaitCriterion() {
+      @Override
       public String description() {
         return "waiting for conditions to be met";
       }
+      @Override
       public boolean done() {
         int c1Size = getRegionSize(client1, regionName);
         int c2Size = getRegionSize(client2, regionName);
@@ -2477,6 +2671,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2486,6 +2681,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     final SharedCounter sc_server2 = new SharedCounter("server2");
     server2.invoke(new CacheSerializableRunnable(title
         + "server2 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(server2, true, sc_server2, 10));
@@ -2493,6 +2689,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2532,6 +2729,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     closeCache(server2);
     server1Size = getRegionSize(server1, regionName);
     client1.invoke(new CacheSerializableRunnable(title+"client1 does putAll again") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, title+"again:", numberOfEntries);
       }
@@ -2554,11 +2752,10 @@ public void testOneServer() throws CacheException, InterruptedException {
    * Tests bug 41403: let 2 sub maps both failed with partial key applied. 
    * This is a singlehop putAll test.
    */
+  @Test
   public void testEventIdMisorderInPRSingleHop() throws CacheException, InterruptedException {
     final String title = "testEventIdMisorderInPRSingleHop_";
 
-//    disconnectAllFromDS();
-
     final Host host = Host.getHost(0);
     final VM server1 = host.getVM(0);
     final VM server2 = host.getVM(1);
@@ -2609,6 +2806,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     addExceptionTag1(expectedExceptions);
     
     client1.invoke(new CacheSerializableRunnable(title+"do some putAll to get ClientMetaData for future putAll") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "key-", numberOfEntries);
       }
@@ -2622,6 +2820,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server1.invoke(new CacheSerializableRunnable(title
         + "server1 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region r = getRootRegion().getSubregion(regionName);
         r.getAttributesMutator().addCacheListener(new MyListener(server1, true, sc_server1, 10));
@@ -2630,6 +2829,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server2.invoke(new CacheSerializableRunnable(title
         + "server2 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region r = getRootRegion().getSubregion(regionName);
         r.getAttributesMutator().addCacheListener(new MyListener(server2, true, sc_server2, 10));
@@ -2638,6 +2838,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     server3.invoke(new CacheSerializableRunnable(title
         + "server3 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region r = getRootRegion().getSubregion(regionName);
         r.getAttributesMutator().addCacheListener(new MyListener(true, sc_server3));
@@ -2651,6 +2852,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     LogWriterUtils.getLogWriter().info("region sizes: "+client1Size+","+server1Size+","+server2Size+","+server3Size);
 
     AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(title+"client1 add listener and putAll") {
+      @Override
       public void run2() throws CacheException {
         Region r = getRootRegion().getSubregion(regionName);
         r.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2667,6 +2869,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     server3.invoke(new CacheSerializableRunnable(title
         + "server3 print counter") {
+      @Override
       public void run2() throws CacheException {
         Region r = getRootRegion().getSubregion(regionName);
         MyListener l = (MyListener)r.getAttributes().getCacheListeners()[0];
@@ -2676,7 +2879,6 @@ public void testOneServer() throws CacheException, InterruptedException {
       }
     });
 
-
     LogWriterUtils.getLogWriter().info("event counters : "+myListener.sc);
     assertEquals(numberOfEntries, myListener.sc.num_create_event);
     assertEquals(0, myListener.sc.num_update_event);
@@ -2695,14 +2897,13 @@ public void testOneServer() throws CacheException, InterruptedException {
    * Tests while putAll to 2 distributed servers, one server failed over Add a
    * listener to slow down the processing of putAll
    */
-  public void test2FailOverDistributedServer() throws CacheException,
-      InterruptedException {
+  @Test
+  public void test2FailOverDistributedServer() throws CacheException, InterruptedException {
     IgnoredException.addIgnoredException("Broken pipe");
     IgnoredException.addIgnoredException("Connection reset");
     IgnoredException.addIgnoredException("Unexpected IOException");
     final String title = "test2FailOverDistributedServer:";
-//    disconnectAllFromDS();
-    
+
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
@@ -2720,6 +2921,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createBridgeClient(client2, regionName, serverHost, new int[] {serverPort2, serverPort1}, -1, -1, true);
 
     server1.invoke(new CacheSerializableRunnable(title+"server1 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2727,6 +2929,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
     
     server2.invoke(new CacheSerializableRunnable(title+"server2 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2734,6 +2937,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });   
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 registerInterest") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2745,6 +2949,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 registerInterest") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2758,6 +2963,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute client putAll from multithread client
     AsyncInvocation async1 = client1.invokeAsync(new CacheSerializableRunnable(
         title + "async putAll1 from client1") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, "async1key-", numberOfEntries);
       }
@@ -2767,6 +2973,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     Wait.pause(2000);
     server1.invoke(new CacheSerializableRunnable(title
         + "stop Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         stopOneBridgeServer(serverPort1);
       }
@@ -2777,6 +2984,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify bridge server 2 for asyn keys
     server2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge Server 2 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         long ts1 = 0;
@@ -2797,6 +3005,7 @@ public void testOneServer() throws CacheException, InterruptedException {
   /**
    * Tests while putAll timeout's exception
    */
+  @Test
   public void testClientTimeOut() throws CacheException, InterruptedException {
     final String title = "testClientTimeOut:";
     disconnectAllFromDS();
@@ -2818,6 +3027,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     createBridgeClient(client2, regionName, serverHost, new int[] {serverPort2, serverPort1}, -1, -1, true);
 
     server1.invoke(new CacheSerializableRunnable(title+"server1 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2825,6 +3035,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     server2.invoke(new CacheSerializableRunnable(title+"server2 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2835,6 +3046,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Execute client putAll
     client1.invoke(new CacheSerializableRunnable(title
         + "client1 execute putAll") {
+      @Override
       public void run2() throws CacheException {
         boolean exceptionTriggered = false;
         try {
@@ -2855,6 +3067,7 @@ public void testOneServer() throws CacheException, InterruptedException {
   /**
    * Tests while putAll timeout at endpoint1 and switch to endpoint2
    */
+  @Test
   public void testEndPointSwitch() throws CacheException, InterruptedException {
     IgnoredException.addIgnoredException("Broken pipe");
     IgnoredException.addIgnoredException("Connection reset");
@@ -2880,6 +3093,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // only add slow listener to server1, because we wish it to succeed 
     server1.invoke(new CacheSerializableRunnable(title+"server1 add slow listener") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(true));
@@ -2888,6 +3102,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // only register interest on client2
     client2.invoke(new CacheSerializableRunnable(title+"client2 registerInterest") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2898,6 +3113,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     
     // Execute client1 putAll
     client1.invoke(new CacheSerializableRunnable(title + "putAll from client1") {
+      @Override
       public void run2() throws CacheException {
         try {
           doPutAll(regionName, title, testEndPointSwitchNumber);
@@ -2910,6 +3126,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify client 2 for all keys
     client2.invoke(new CacheSerializableRunnable(title
         + "verify Bridge client2 for keys arrived finally") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         waitTillNotify(lockObject3, 100000, (region.size() == testEndPointSwitchNumber));
@@ -2922,11 +3139,11 @@ public void testOneServer() throws CacheException, InterruptedException {
     stopBridgeServers(getCache());
   }
 
-
   /**
    * Tests while putAll to 2 distributed servers, one server failed over Add a
    * listener to slow down the processing of putAll
    */
+  @Test
   public void testHADRFailOver() throws CacheException, InterruptedException {
     final String title = "testHADRFailOver:";
     disconnectAllFromDS();
@@ -2953,6 +3170,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     client2.invoke(addExceptionTag1(expectedExceptions));
 
     client1.invoke(new CacheSerializableRunnable(title+"client1 registerInterest") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.registerInterest("ALL_KEYS");
@@ -2961,6 +3179,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     });
 
     client2.invoke(new CacheSerializableRunnable(title+"client2 registerInterest") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         region.getAttributesMutator().addCacheListener(new MyListener(false));
@@ -2972,6 +3191,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // Server2 do a putAll to use HARegionQueues
     AsyncInvocation async1 = server2.invokeAsync(new CacheSerializableRunnable(
         title + "async putAll1 from server2") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, title+"1:", thousandEntries);
       }
@@ -2980,6 +3200,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // client1 do a putAll to start HARegionQueues
     AsyncInvocation async2 = client1.invokeAsync(new CacheSerializableRunnable(
         title + "async putAll1 from client1") {
+      @Override
       public void run2() throws CacheException {
         doPutAll(regionName, title+"2:", thousandEntries);
       }
@@ -2988,6 +3209,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     Wait.pause(2000);
     server1.invoke(new CacheSerializableRunnable(title
         + "stop Bridge Server 1") {
+      @Override
       public void run2() throws CacheException {
         stopOneBridgeServer(serverPort1);
       }
@@ -2999,6 +3221,7 @@ public void testOneServer() throws CacheException, InterruptedException {
     // verify client 2 for asyn keys
     client2.invokeAsync(new CacheSerializableRunnable(title
         + "verify Bridge client2 for async keys") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(regionName);
         waitTillNotify(lockObject4, 100000, (region.size() == thousandEntries*2));
@@ -3020,7 +3243,9 @@ public void testOneServer() throws CacheException, InterruptedException {
    * Test TX for putAll. There's no TX for c/s. We only test P2P
    * This is disabled because putAll in TX is disabled.
    */
-  public void no_testTX() throws CacheException, InterruptedException {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testTX() throws CacheException, InterruptedException {
     final String title = "testTX:";
     disconnectAllFromDS();
     final Host host = Host.getHost(0);
@@ -3038,6 +3263,7 @@ public void testOneServer() throws CacheException, InterruptedException {
 
     // add slow liste

<TRUNCATED>


[29/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
index be41318..7596b82 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -38,14 +47,15 @@ import com.gemstone.gemfire.test.dunit.VM;
  * Tests interrupting gemfire threads during a put operation to see what happens
  *
  */
-public class InterruptsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class InterruptsDUnitTest extends JUnit4CacheTestCase {
 
   private static volatile Thread puttingThread;
   private static final long MAX_WAIT = 60 * 1000;
   private static AtomicBoolean doInterrupt = new AtomicBoolean(false);
 
-  public InterruptsDUnitTest(String name) {
-    super(name);
+  public InterruptsDUnitTest() {
+    super();
   }
   
   
@@ -62,22 +72,12 @@ public class InterruptsDUnitTest extends CacheTestCase {
     });
   }
   
-  public void _testLoop() throws Throwable {
-    for(int i=0; i < 10; i++) {
-      System.err.println("i=" +i);
-      System.out.println("i=" +i);
-      testDRPutWithInterrupt();
-      tearDown();
-      setUp();
-    }
-  }
-
-
   /**
    * A simple test case that we are actually
    * persisting with a PR.
    * @throws Throwable 
    */
+  @Test
   public void testDRPutWithInterrupt() throws Throwable {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IteratorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IteratorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IteratorDUnitTest.java
index 8d5184c..5421c20 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IteratorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IteratorDUnitTest.java
@@ -19,6 +19,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.RegionShortcut;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache30.CacheTestCase;
@@ -32,15 +41,17 @@ import java.util.Iterator;
  * Test that keys iterator do not returned keys with removed token as its values
  *
  */
-public class IteratorDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class IteratorDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * @param name
    */
-  public IteratorDUnitTest(String name) {
-    super(name);
+  public IteratorDUnitTest() {
+    super();
   }
 
+  @Test
   public void testKeysIteratorOnLR() throws Exception {
     final String regionName = getUniqueName();
     Region r = getGemfireCache().createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
@@ -60,6 +71,7 @@ public class IteratorDUnitTest extends CacheTestCase {
     assertEquals(2, numKeys);
   }
   
+  @Test
   public void testKeysIteratorOnPR() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
index 7c227d8..6a88662 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
@@ -21,76 +21,42 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.test.dunit.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 
-/**
- * 
- *  
- */
-public class MapClearGIIDUnitTest extends CacheTestCase {
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class MapClearGIIDUnitTest extends JUnit4CacheTestCase {
 
   protected static boolean wasGIIInProgressDuringClear = false;
 
-  public MapClearGIIDUnitTest(String name) {
-    super(name);
-  } 
   volatile static Region region;
-  /*
-  public void setUp() {
-    super.setUp();
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    VM vm1 = host.getVM(1);
-    vm0.invoke(() -> MapClearGIIDUnitTest.createCacheVM0());
-    vm1.invoke(() -> MapClearGIIDUnitTest.createCacheVM1());
-    System.out.println("Cache created in successfully");
-  }*/
-/*
-  public void tearDown() {
-    Host host = Host.getHost(0);
-    VM vm0 = host.getVM(0);
-    VM vm1 = host.getVM(1);
-    vm0.invoke(() -> MapClearGIIDUnitTest.closeCache());
-    vm1.invoke(() -> MapClearGIIDUnitTest.closeCache());
-  }*/
-
-/*  public static void createCacheVM0() throws Exception {
-    InitialImageOperation.slowImageProcessing = 200;
-    Properties mprops = new Properties();
-    // mprops.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "7777");
-    
-    ds = (new MapClearGIIDUnitTest("Clear")).getSystem(mprops);
-    //ds = DistributedSystem.connect(props);
-    cache = CacheFactory.create(ds);
-    CacheObserverImpl observer = new CacheObserverImpl();
-    CacheObserverHolder.setInstance(observer);
-    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
-  } //end of create cache for VM0
-
-  public static void createCacheVM1() throws Exception {
-    Properties mprops = new Properties();
-    // mprops.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "7777");
-    ds = (new MapClearGIIDUnitTest("Clear")).getSystem(mprops);
-    // ds = DistributedSystem.connect(null);
-    cache = CacheFactory.create(ds);
-    AttributesFactory factory = new AttributesFactory();
-    factory.setScope(Scope.DISTRIBUTED_ACK);
-    factory.setDataPolicy(DataPolicy.REPLICATE);
-    RegionAttributes attr = factory.create();
-    region = cache.createRegion("map", attr);
-    //region = region.createSubregion("map",attr);
-    for (int i = 0; i < 10000; ++i) {
-      region.put("" + i, "" + i);
-    }
-  }*/
 
   public static boolean checkImageStateFlag() throws Exception {
-    Region rgn = new MapClearGIIDUnitTest("dumb object to get cache").getCache().getRegion("/map");
+    Region rgn = new MapClearGIIDUnitTest().getCache().getRegion("/map");
     if (rgn == null) {
       fail("Map region not yet created");
     }
@@ -124,21 +90,10 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
     factory.setConcurrencyChecksEnabled(true);
     RegionAttributes attr = factory.create();
 
-    region = new MapClearGIIDUnitTest("dumb object to get cache").getCache().createRegion("map", attr);
+    region = new MapClearGIIDUnitTest().getCache().createRegion("map", attr);
 
-    // region = region.createSubregion("map",attr);
     LogWriterUtils.getLogWriter().info("Region in VM0 created ");
   }
-/*
-  public static void closeCache() {
-    try {
-      cache.close();
-      ds.disconnect();
-    }
-    catch (Exception ex) {
-      ex.printStackTrace();
-    }
-  }*/
 
   public static void clearRegionInVm1() {
     // wait for profile of getInitialImage cache to show up
@@ -161,6 +116,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
   }
 
   //test methods
+  @Test
   public void testClearImageStateFlag() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java
index 7b24f96..911f6ca 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java
@@ -16,26 +16,37 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
 public class MapInterfaceJUnitTest {
 
+  protected boolean hasBeenNotified = false;
+
+  protected Region region2 = null;
+  protected int counter = 0;
+
   @Test
   public void testLocalClear() {
     Properties props = new Properties();
@@ -53,14 +64,14 @@ public class MapInterfaceJUnitTest {
           .create());
     }
     catch (Exception e) {
-      fail(" failed due to " + e);
+      throw new AssertionError(" failed due to ", e);
     }
     for (int i = 0; i < 100; i++) {
       region.put(new Integer(i), new Integer(i));
     }
-    Assert.assertEquals(new Integer(50), region.get(new Integer(50)));
+    assertEquals(new Integer(50), region.get(new Integer(50)));
     region.localClear();
-    Assert.assertEquals(null, region.get(new Integer(50)));
+    assertEquals(null, region.get(new Integer(50)));
     region.close();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -69,7 +80,7 @@ public class MapInterfaceJUnitTest {
           .create());
     }
     catch (Exception e) {
-      fail(" failed in creating region due to " + e);
+      throw new AssertionError(" failed in creating region due to ", e);
     }
     boolean exceptionOccured = false;
     try {
@@ -106,7 +117,7 @@ public class MapInterfaceJUnitTest {
           .create());
     }
     catch (Exception e) {
-      fail(" failed due to " + e);
+      throw new AssertionError(" failed due to ", e);
     }
     HashMap m = new HashMap();
     m.put("aKey", "aValue");
@@ -117,9 +128,9 @@ public class MapInterfaceJUnitTest {
     for (int i = 0; i < 100; i++) {
       region.put(new Integer(i), new Integer(i));
     }
-    Assert.assertEquals(new Integer(50), region.get(new Integer(50)));
+    assertEquals(new Integer(50), region.get(new Integer(50)));
     region.localClear();
-    Assert.assertEquals(null, region.get(new Integer(50)));
+    assertEquals(null, region.get(new Integer(50)));
     region.close();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -128,7 +139,7 @@ public class MapInterfaceJUnitTest {
           .create());
     }
     catch (Exception e) {
-      fail(" failed in creating region due to " + e);
+      throw new AssertionError(" failed in creating region due to ", e);
     }
     boolean exceptionOccured = false;
     try {
@@ -145,11 +156,8 @@ public class MapInterfaceJUnitTest {
     ds.disconnect();
   }
  
-  protected boolean hasBeenNotified = false;
-
   @Test
   public void testBeforeRegionClearCallBack() {
-   
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -163,6 +171,7 @@ public class MapInterfaceJUnitTest {
       factory.setScope(Scope.LOCAL);
       factory.setCacheWriter(new CacheWriterAdapter() {
 
+        @Override
         public void beforeRegionClear(RegionEvent event) throws CacheWriterException {
           synchronized (this) {
             this.notify();
@@ -184,14 +193,14 @@ public class MapInterfaceJUnitTest {
       }
     }
     catch (Exception e) {
-      fail(" failed due to " + e);
+      throw new AssertionError(" failed due to ", e);
     }
     for (int i = 0; i < 100; i++) {
       region.put(new Integer(i), new Integer(i));
     }
-    Assert.assertEquals(new Integer(50), region.get(new Integer(50)));
+    assertEquals(new Integer(50), region.get(new Integer(50)));
     region.localClear();
-    Assert.assertEquals(null, region.get(new Integer(50)));
+    assertEquals(null, region.get(new Integer(50)));
     region.close();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -200,7 +209,7 @@ public class MapInterfaceJUnitTest {
           .create());
     }
     catch (Exception e) {
-      fail(" failed in creating region due to " + e);
+      throw new AssertionError(" failed in creating region due to ", e);
     }
     boolean exceptionOccured = false;
     try {
@@ -217,11 +226,8 @@ public class MapInterfaceJUnitTest {
     ds.disconnect();
   }
 
-  protected Region region2 = null; 
-  protected int counter = 0;
   @Test
   public void testSetValue() {
-
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -235,6 +241,7 @@ public class MapInterfaceJUnitTest {
       factory.setScope(Scope.LOCAL);
       factory.setCacheWriter(new CacheWriterAdapter() {
 
+        @Override
         public void beforeUpdate(EntryEvent event) throws CacheWriterException {
           synchronized (this) {
             this.notify();
@@ -259,12 +266,11 @@ public class MapInterfaceJUnitTest {
         fail(" beforeCreate call back did not come");
       }
       
-      Assert.assertEquals(counter,1);
+      assertEquals(counter,1);
     }
     catch (Exception e) {
-      fail(" failed due to " + e);
+      throw new AssertionError(" failed due to ", e);
     }
-   
   }
   
   class DoesClear implements Runnable {
@@ -275,6 +281,7 @@ public class MapInterfaceJUnitTest {
       this.region = reg;
     }
 
+    @Override
     public void run() {
       this.region.clear();
     }
@@ -282,10 +289,10 @@ public class MapInterfaceJUnitTest {
   
   class DoesPut implements Runnable {
 
-  
     DoesPut() {
     }
 
+    @Override
     public void run() {
      ((Map.Entry)(MapInterfaceJUnitTest.this.region2.entrySet().iterator().next())).setValue(new Integer(8));
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java
index 4a5967e..825dd3f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java
@@ -16,39 +16,39 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
+import static org.junit.Assert.*;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * The test will verify <br>
  * 1. Multiple oplogs are being rolled at once <br>
  * 2. The Number of entries getting logged to the HTree are taking care of creation 
- * 
  */
 @Category(IntegrationTest.class)
-public class MultipleOplogsRollingFeatureJUnitTest extends
-    DiskRegionTestingBase
-{
+public class MultipleOplogsRollingFeatureJUnitTest extends DiskRegionTestingBase {
 
-  protected Object mutex = new Object();
+  private volatile boolean FLAG = false;
 
-  protected boolean CALLBACK_SET = false;
+  private Object mutex = new Object();
 
-  protected volatile boolean FLAG = false;
+  private boolean CALLBACK_SET = false;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @After
-  public void tearDown() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
-    super.tearDown();
+  }
+
+  @Override
+  protected final void postTearDown() throws Exception {
+    System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION");
     diskProps.setDiskDirs(dirs);
   }
 
@@ -58,21 +58,21 @@ public class MultipleOplogsRollingFeatureJUnitTest extends
    * 2. The Number of entries are properly conflated
    */
   @Test
-  public void testMultipleRolling()
-  {
+  public void testMultipleRolling() throws Exception {
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION", "17");
+
+    deleteFiles();
+    diskProps.setMaxOplogSize(450);
+    diskProps.setCompactionThreshold(100);
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
+        diskProps, Scope.LOCAL);
+    assertNotNull(region);
+    DiskRegion diskRegion = ((LocalRegion)region).getDiskRegion();
+    assertNotNull(diskRegion);
+    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
+    CacheObserverHolder.setInstance(getCacheObserver());
+
     try {
-      deleteFiles();
-      diskProps.setMaxOplogSize(450);
-      diskProps.setCompactionThreshold(100);
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
-          diskProps, Scope.LOCAL);
-      assertNotNull(region);
-      DiskRegion diskRegion = ((LocalRegion)region).getDiskRegion();
-      assertNotNull(diskRegion);
-      LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
-      CacheObserverHolder.setInstance(getCacheObserver());
-      try {
 
       CALLBACK_SET = true;
 
@@ -85,7 +85,7 @@ public class MultipleOplogsRollingFeatureJUnitTest extends
       waitForCompactor(3000/*wait for forceRolling to finish */);
       logWriter.info("testMultipleRolling after waitForCompactor");
       // the compactor copied two tombstone and 1 entry to oplog #2
-      // The total oplog size will become 429, that why we need to 
+      // The total oplog size will become 429, that why we need to
       // set oplogmaxsize to be 450. After compaction, the size become 151
       // the compactor thread is now stuck waiting for mutex.notify
 
@@ -127,42 +127,33 @@ public class MultipleOplogsRollingFeatureJUnitTest extends
       region.forceRolling();
       assertEquals(3, diskRegion.getOplogToBeCompacted().length);
 
-      } finally {
+    } finally {
       synchronized (mutex) {
         // let the compactor go
         CALLBACK_SET = false;
         FLAG = false;
         logWriter.info("testMultipleRolling letting compactor go");
         mutex.notify();
-
-      }
       }
-      
-      // let the main thread sleep so that rolling gets over
-      waitForCompactor(5000);
-
-      assertTrue(
-          "Number of Oplogs to be rolled is not null : this is unexpected",
-          diskRegion.getOplogToBeCompacted() == null);
-      cache.close();
-      cache = createCache();
-      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
-          diskProps, Scope.LOCAL);
-      assertTrue("Recreated region size is not 1 ", region.size() == 1);
-
-      closeDown();
-      deleteFiles();
-    }
-    catch (Exception ex) {
-      ex.printStackTrace();
-      fail("testMultipleRolling: test failed due to " + ex);
-    } finally {
-      System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION");
     }
+
+    // let the main thread sleep so that rolling gets over
+    waitForCompactor(5000);
+
+    assertTrue(
+        "Number of Oplogs to be rolled is not null : this is unexpected",
+        diskRegion.getOplogToBeCompacted() == null);
+    cache.close();
+    cache = createCache();
+    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
+        diskProps, Scope.LOCAL);
+    assertTrue("Recreated region size is not 1 ", region.size() == 1);
+
+    closeDown();
+    deleteFiles();
   }
 
-  private void waitForCompactor(long maxWaitingTime)
-  {
+  private void waitForCompactor(long maxWaitingTime) {
     long maxWaitTime = maxWaitingTime;
     long start = System.currentTimeMillis();
     while (!FLAG) { // wait until
@@ -179,8 +170,7 @@ public class MultipleOplogsRollingFeatureJUnitTest extends
     }
   }
 
-  private void addEntries(int opLogNum, int valueSize)
-  {
+  private void addEntries(int opLogNum, int valueSize) {
     assertNotNull(region);
     byte[] val = new byte[valueSize];
     for (int i = 0; i < valueSize; ++i) {
@@ -217,8 +207,7 @@ public class MultipleOplogsRollingFeatureJUnitTest extends
     }
   }
 
-  private CacheObserver getCacheObserver()
-  {
+  private CacheObserver getCacheObserver() {
     return (new CacheObserverAdapter() {
 
       public void beforeGoingToCompact()
@@ -251,6 +240,5 @@ public class MultipleOplogsRollingFeatureJUnitTest extends
 
       }
     });
-
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
index 1b63aec..98d52a0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
@@ -16,22 +16,40 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
 import com.gemstone.gemfire.internal.cache.SearchLoadAndWriteProcessor.NetSearchRequestMessage;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
 
-public class NetSearchMessagingDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class NetSearchMessagingDUnitTest extends JUnit4CacheTestCase {
 
-  public NetSearchMessagingDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testOneMessageWithReplicates() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -90,6 +108,7 @@ public class NetSearchMessagingDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-1155: time sensitive, waitForCriterion
+  @Test
   public void testNetSearchNormals() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -147,6 +166,7 @@ public class NetSearchMessagingDUnitTest extends CacheTestCase {
    * demonstrate that a netsearch that gets the value of an overflow entry
    * does not update the LRU status of that entry.
    */
+  @Test
   public void testNetSearchNoLRU() {
     Host host = Host.getHost(0);
     VM vm2 = host.getVM(2);
@@ -208,6 +228,7 @@ public class NetSearchMessagingDUnitTest extends CacheTestCase {
    * Make sure that even if we start out by net searching replicates,
    * we'll fall back to net searching normal members.
    */
+  @Test
   public void testNetSearchFailoverFromReplicate() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -259,6 +280,7 @@ public class NetSearchMessagingDUnitTest extends CacheTestCase {
     
   }
   
+  @Test
   public void testNetSearchFailoverFromOneReplicateToAnother() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
index 3d094a0..7c16568 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
@@ -16,26 +16,34 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
 import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Performs eviction dunit tests for off-heap memory.
  */
+@Category(DistributedTest.class)
 public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
-  public OffHeapEvictionDUnitTest(String name) {
-    super(name);
-  }  
-  
+
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
@@ -59,6 +67,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
     return properties;
   }
 
+  @Override
   public void createCache() {
     try {
       Properties props = new Properties();
@@ -80,6 +89,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
     }
   }
 
+  @Override
   public void raiseFakeNotification(VM vm, final String prName,
       final int noOfExpectedEvictions) {
     vm.invoke(new CacheSerializableRunnable("fakeNotification") {
@@ -117,12 +127,14 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
   @Override
   public boolean getOffHeapEnabled() {
     return true;
-  }    
+  }
 
+  @Override
   public HeapEvictor getEvictor() {
     return ((GemFireCacheImpl)cache).getOffHeapEvictor();
-  }  
+  }
 
+  @Override
   public ResourceType getResourceType() {
     return ResourceType.OFFHEAP_MEMORY;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
index 7ac1a9a..35697d8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
@@ -16,28 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Performs eviction stat dunit tests for off-heap regions.
+ *
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
 
-  public OffHeapEvictionStatsDUnitTest(String name) {
-    super(name);
-    // TODO Auto-generated constructor stub
-  }
-
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
@@ -61,6 +62,7 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
     return properties;
   }
 
+  @Override
   public void createCache() {
     try {
       Properties props = new Properties();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapTestUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapTestUtil.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapTestUtil.java
index f9d2c2a..2d74ab9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapTestUtil.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapTestUtil.java
@@ -16,11 +16,11 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.Collections;
 import java.util.List;
 
-import junit.framework.Assert;
-
 import com.gemstone.gemfire.cache.CacheClosedException;
 import com.gemstone.gemfire.internal.offheap.MemoryBlock;
 import com.gemstone.gemfire.internal.offheap.RefCountChangeInfo;
@@ -30,7 +30,7 @@ import com.gemstone.gemfire.internal.offheap.MemoryAllocatorImpl;
 @SuppressWarnings("deprecation")
 public class OffHeapTestUtil {
 
-  public static void checkOrphans() { // TODO:KIRK: need to do something special to guarantee proper tearDown
+  public static void checkOrphans() {
     MemoryAllocatorImpl allocator = null;
     try {
       allocator = MemoryAllocatorImpl.getAllocator();
@@ -57,7 +57,7 @@ public class OffHeapTestUtil {
       System.out.println("Sample orphan: " + orphans.get(0));
       System.out.println("Orphan info: " + info);
     }
-    Assert.assertEquals(Collections.emptyList(), orphans);
+    assertEquals(Collections.emptyList(), orphans);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java
index 748588f..639d7ea 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java
@@ -16,8 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.HashMap;
+import java.util.Map;
+
 import com.examples.snapshot.MyObject;
 import com.examples.snapshot.MyPdxSerializer;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.DiskStore;
@@ -26,20 +38,10 @@ import com.gemstone.gemfire.cache.snapshot.RegionGenerator;
 import com.gemstone.gemfire.cache.snapshot.RegionGenerator.RegionType;
 import com.gemstone.gemfire.cache.snapshot.RegionGenerator.SerializationType;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 @Category(IntegrationTest.class)
 public class OfflineSnapshotJUnitTest {
+
   private RegionGenerator rgen;
   
   private Cache cache;
@@ -88,7 +90,7 @@ public class OfflineSnapshotJUnitTest {
     }
   }
   
-  public Map<Integer, MyObject> createExpected(SerializationType type, int count) {
+  private Map<Integer, MyObject> createExpected(SerializationType type, int count) {
     Map<Integer, MyObject> expected = new HashMap<Integer, MyObject>();
     for (int i = 0; i < count; i++) {
       expected.put(i, rgen.createData(type, i, "The number is " + i));
@@ -118,7 +120,7 @@ public class OfflineSnapshotJUnitTest {
     }
   }
 
-  public void reset() {
+  private void reset() {
     CacheFactory cf = new CacheFactory()
         .set(MCAST_PORT, "0")
         .set(LOG_LEVEL, "error")

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
index d1be04d..b283ec3 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
@@ -16,12 +16,7 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -36,10 +31,10 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.IntStream;
 
+import com.jayway.awaitility.Awaitility;
 import org.apache.commons.io.FileUtils;
-import org.junit.After;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -62,13 +57,13 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import com.jayway.awaitility.Awaitility;
 
 /**
  * Testing Oplog API's
  */
 @Category(IntegrationTest.class)
 public class OplogJUnitTest extends DiskRegionTestingBase {
+
   boolean proceed = false;
 
   private final DiskRegionProperties diskProps = new DiskRegionProperties();
@@ -117,17 +112,13 @@ public class OplogJUnitTest extends DiskRegionTestingBase {
   protected volatile Thread rollerThread = null;
 
   @Override
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = true;
   }
 
   @Override
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
+  protected final void postTearDown() throws Exception {
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = false;
   }
 
@@ -2297,10 +2288,10 @@ public class OplogJUnitTest extends DiskRegionTestingBase {
   /**
    * Tests if buffer size is set but time is not set , the asynch writer gets
    * awakened on buffer size basis
-   *
    */
-  public void DARREL_DISABLE_testAsynchWriterAttribBehaviour2()
-  {
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsynchWriterAttribBehaviour2() {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
     ((DiskStoreFactoryImpl)dsf).setMaxOplogSizeInBytes(10000);
     dsf.setQueueSize(2);
@@ -2449,8 +2440,9 @@ public class OplogJUnitTest extends DiskRegionTestingBase {
    */
   //Now we preallocate spaces for if files and also crfs and drfs. So the below test is not valid
   // any more. See revision: r42359 and r42320. So disabling this test.
-  public void _testPreblowErrorCondition()
-  {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testPreblowErrorCondition() {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
     ((DiskStoreFactoryImpl)dsf).setMaxOplogSizeInBytes(100000000L * 1024L * 1024L * 1024L);
     dsf.setAutoCompact(false);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
index d9260a6..28ddd12 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
@@ -16,29 +16,40 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DeltaTestImpl;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.tcp.ConnectionTable;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * Tests the P2P delta propagation functionality.
- * 
  */
-public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class P2PDeltaPropagationDUnitTest extends JUnit4DistributedTestCase {
 
   static VM server1 = null;
 
@@ -72,17 +83,12 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   private static boolean check = false;
 
   protected static Object waitLock = new Object();
-  /**
-   * Constructor
-   */
-  public P2PDeltaPropagationDUnitTest(String name) {
-    super(name);
-  }
-  
+
   /*
    * Delta gets distributed in P2P D-ACK.
    */
     
+  @Test
   public void testP2PDeltaPropagationEnableScopeDAck() throws Exception
   {
     Object args[] = new Object[] { Boolean.TRUE, DataPolicy.REPLICATE,
@@ -102,6 +108,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
    * Delta gets distributed in P2P GLOBAL.
    */
     
+  @Test
   public void testP2PDeltaPropagationEnableScopeGlobal() throws Exception
   {
     Object args[] = new Object[] { Boolean.TRUE, DataPolicy.REPLICATE,
@@ -118,6 +125,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   /*
    * Full object gets resend in P2P D-ACK if delta can not be applied.
    */
+  @Test
   public void testP2PDACKInvalidDeltaException() throws Exception
   {
     server1.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.TRUE));
@@ -136,6 +144,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   /*
    *  Full object will be send in case of P2P D-ACK(direct-ack = true). 
    */
+  @Test
   public void testP2PDeltaPropagationEnableDirectAckTrue() throws Exception
   {
     
@@ -154,6 +163,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   /*
    * Full object will be send in case of P2P D-NO-ACK 
    */
+  @Test
   public void testP2PDeltaPropagationEnableScopeDNoAck()throws Exception
   {
     Object args[] = new Object[] { Boolean.TRUE, DataPolicy.NORMAL,
@@ -169,6 +179,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   /*
    * Check for full object gets distributed when DS level delta property is OFF.
    */
+  @Test
   public void testP2PDeltaPropagationDisable() throws Exception
   {
     server1.invoke(() -> P2PDeltaPropagationDUnitTest.createServerCache(Boolean.FALSE));
@@ -180,6 +191,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   /*
    * Delta gets distributed in P2P D-ACK with data policy empty on feeder.
    */
+  @Test
   public void testP2PDeltaPropagationEnableScopeDAckDataPolicyEmpty()
       throws Exception {
     Object args[] = new Object[] { Boolean.TRUE, DataPolicy.REPLICATE,
@@ -202,6 +214,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   /*
    * Full Onject is gets distributed in P2P D-ACK with data policy empty on feeder when its uses regions create API.
    */
+  @Test
   public void testP2PDeltaPropagationEnableScopeDAckDataPolicyEmptyWithRegionsCreateApi()
       throws Exception {
     Object args[] = new Object[] { Boolean.TRUE, DataPolicy.REPLICATE,
@@ -226,6 +239,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoFailurePeer());
   }
 
+  @Test
   public void testPeerWithEmptyRegionIterestPolicyALLReceivesNoDelta() throws Exception {
     // 1. Setup three peers, one with a region data policy set to EMPTY.
     // 2. Do delta feeds on any one of the two peers with non-EMPTY region data policy.
@@ -250,6 +264,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoDeltaReceived( Integer.valueOf(3) ));
   }
 
+  @Test
   public void testPeerWithEmptyRegionDefaultIterestPolicyReceivesNoEvents() throws Exception {
     // 1. Setup three peers, one with a region data policy set to EMPTY.
     // 2. Do delta feeds on any one of the two peers with non-EMPTY region data policy.
@@ -274,6 +289,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
     server3.invoke(() -> P2PDeltaPropagationDUnitTest.verifyNoDeltaReceived( Integer.valueOf(0/* no events */) ));
   }
 
+  @Test
   public void testPeerWithEmptyRegionAndNoCacheServerReceivesOnlyFullValue() throws Exception {
     // 1. Setup three peers, two with region data policy set to EMPTY.
     // 2. Of these two EMPTY peers, only one has a cache server.
@@ -436,7 +452,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
   public static void createServerCache(Boolean flag, DataPolicy policy,
       Scope scope, Boolean listener, Boolean interestPolicyAll,
       Integer port) throws Exception {
-    P2PDeltaPropagationDUnitTest test = new P2PDeltaPropagationDUnitTest("temp");
+    P2PDeltaPropagationDUnitTest test = new P2PDeltaPropagationDUnitTest();
     Properties props = new Properties();
     if (!flag) {
       props.setProperty(DELTA_PROPAGATION, "false");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
index e26b0ae..9ab247e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.*;
 
 import com.gemstone.gemfire.*;
@@ -37,12 +46,10 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  * 
  */
-public class PRBadToDataDUnitTest extends CacheTestCase {
-
-  public PRBadToDataDUnitTest(final String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class PRBadToDataDUnitTest extends JUnit4CacheTestCase {
 
+  @Test
   public void testBadToData() {
     final Host host = Host.getHost(0);
     final VM vm1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java
index c28a54d..fe2ca3f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java
@@ -16,29 +16,33 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Tests memory allocation operations on a PartitionedRegion on a single node.
- *
  */
 @Category(IntegrationTest.class)
 public class PRDataStoreMemoryJUnitTest {
   
-  static DistributedSystem sys;
+  private static DistributedSystem sys;
   
-  static Cache cache;
+  private static Cache cache;
 
   @Before
   public void setUp() throws Exception {
@@ -71,8 +75,7 @@ public class PRDataStoreMemoryJUnitTest {
   }
   
   @Test
-  public void testCurrentAllocatedMemory() throws Exception
-  {
+  public void testCurrentAllocatedMemory() throws Exception {
     PartitionedRegion regionAck1 = (PartitionedRegion)defineRegionFactory()
       .create("testCurrentAllocatedemory");
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionListenerDUnitTest.java
index 3eb3b7d..ec2cd65 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionListenerDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 java.util.Collection;
 import java.util.Collections;
@@ -38,12 +47,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
 @SuppressWarnings({"serial", "rawtypes", "deprecation", "unchecked"})
-public class PartitionListenerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionListenerDUnitTest extends JUnit4CacheTestCase {
   
-  public PartitionListenerDUnitTest(String name) {
-    super(name);
+  public PartitionListenerDUnitTest() {
+    super();
   }
 
+  @Test
   public void testAfterBucketRemovedCreated() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java
index 8882238..b53aa5a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java
@@ -20,25 +20,23 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
 
 import java.util.Properties;
 
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Test all the PartitionedRegion api calls when ConserveSockets is set to false
+ *
  * @since GemFire 5.0
  * @see com.gemstone.gemfire.distributed.DistributedSystem#setThreadsSocketPolicy(boolean)
  */
-public class PartitionedRegionAPIConserveSocketsFalseDUnitTest extends
-    PartitionedRegionAPIDUnitTest
-{
+@Category(DistributedTest.class)
+public class PartitionedRegionAPIConserveSocketsFalseDUnitTest extends PartitionedRegionAPIDUnitTest {
 
-  public PartitionedRegionAPIConserveSocketsFalseDUnitTest(String name) {
-    super(name);
-  }
-
-
-  public Properties getDistributedSystemProperties()
-  {
+  @Override
+  public Properties getDistributedSystemProperties() {
     Properties ret = new Properties();
     ret.setProperty(CONSERVE_SOCKETS, "false");
     return ret; 
   }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
index a23baf6..45e784a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Properties;
@@ -50,10 +59,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  * functionality. This test is performed for different region scopes - D_ACK and
  * D_NO_ACK for PartitionedRegion.
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCase {
 
-	public PartitionedRegionAPIDUnitTest(String name) {
-		super(name);
+	public PartitionedRegionAPIDUnitTest() {
+		super();
 	}
 
 	Properties props = new Properties();
@@ -1259,7 +1269,8 @@ public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCas
 	 * This is a PartitionedRegion test for scope = D_ACK. 4 VMs are used to
 	 * create the PR with and without(Only Accessor) the DataStore.
 	 */
-	public void testPartitionedRegionOperationsScopeDistAck() throws Exception {
+  @Test
+  public void testPartitionedRegionOperationsScopeDistAck() throws Exception {
 	  Host host = Host.getHost(0);
 	  // create the VM(0 - 4)
 	  vm0 = host.getVM(0);
@@ -1296,6 +1307,7 @@ public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCas
    * for scope = D_ACK. 4 VMs are used to
    * create the PR with and without(Only Accessor) the DataStore.
    */
+  @Test
   public void testPartitionedRegionConcurrentOperations() throws Exception {
     Host host = Host.getHost(0);
     // create the VM(0 - 4)
@@ -1320,6 +1332,7 @@ public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCas
    * 
    * @throws Exception
    */
+  @Test
   public void testPartitionedRegionsOperationsScopeDistEarlyAck()
   		throws Exception {
   	final String rName = getUniqueName();
@@ -1384,6 +1397,7 @@ public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCas
    * 
    * @throws Exception
    */
+  @Test
   public void testBug36685() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1429,7 +1443,8 @@ public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCas
 		});
 	}
 
-	public void testCacherLoaderHelper() throws Exception
+  @Test
+  public void testCacherLoaderHelper() throws Exception
 	{
 	  final String rName = getUniqueName();
 	  Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAsSubRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAsSubRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAsSubRegionDUnitTest.java
index d8f7c21..fa47bf2 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAsSubRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAsSubRegionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Cache;
 import com.gemstone.gemfire.cache.CacheException;
@@ -34,13 +43,14 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionAsSubRegionDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
 
   //////constructor //////////
-  public PartitionedRegionAsSubRegionDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionAsSubRegionDUnitTest() {
+    super();
   }//end of constructor
 
   public static final String PR_PREFIX = "PR";
@@ -222,6 +232,7 @@ public class PartitionedRegionAsSubRegionDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testSubRegionDestroyRegion() throws Exception
   {
 
@@ -254,6 +265,7 @@ public class PartitionedRegionAsSubRegionDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testSubRegionLocalDestroyRegion() throws Exception
   {
 
@@ -283,6 +295,7 @@ public class PartitionedRegionAsSubRegionDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testSubRegionClose() throws Exception
   {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
index bb41d50..f451b01 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
@@ -16,25 +16,53 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionedRegionStorageException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * This class tests bucket Creation and distribution for the multiple Partition
  * regions.
  */
-public class PartitionedRegionBucketCreationDistributionDUnitTest extends
-    PartitionedRegionDUnitTestCase
-{
+@Category(DistributedTest.class)
+public class PartitionedRegionBucketCreationDistributionDUnitTest extends PartitionedRegionDUnitTestCase {
 
   /** Prefix is used in name of Partition Region */
   protected static String prPrefix = null;
@@ -54,11 +82,6 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
   /** to store references of 4 vms */
   VM vm[] = new VM[4];
 
-  /** constructor */
-  public PartitionedRegionBucketCreationDistributionDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * This test performs following operations <br>
    * 1. Validate bucket2Node region of the partition regions.</br><br>
@@ -77,6 +100,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * (c) In case of the partition regions with redundancy > 0 no two bucket
    * regions with same bucketId should not be present on the same node.</br>
    */
+  @Test
   public void testBucketCreationInMultiplePartitionRegion() throws Throwable
   {
     Host host = Host.getHost(0);
@@ -126,6 +150,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * 3. Validates bucket distribution over all the nodes for multiple partition
    * regions.</br>
    */
+  @Test
   public void testBucketCreationInPRPutFromOneNode() throws Throwable
   {
     Host host = Host.getHost(0);
@@ -182,6 +207,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * 3. Validates bucket distribution over all the nodes for multiple partition
    * regions.</br>
    */
+  @Test
   public void testBucketCreationInMultiplePartitionRegionFromAllNodes()
       throws Throwable
   {
@@ -242,6 +268,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * to enIndexForRegion.</br><br>
    * 5. Validate bucket creation on new node.</br>
    */
+  @Test
   public void testBucketDistributionAfterNodeAdditionInPR() throws Throwable
   {
     Host host = Host.getHost(0);
@@ -317,6 +344,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * for the keys in the range 0 to 100 4.test number of buckets created. It
    * should be = 11
    */
+  @Test
   public void testTotalNumBucketProperty() throws Throwable
   {
     Host host = Host.getHost(0);
@@ -362,8 +390,9 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * 2. do put() operations so that size of the objects that were put >
    * localMaxMemory of partition region
    */
-  public void _testLocalMaxMemoryInPartitionedRegion() throws Throwable
-  {
+  @Ignore("TODO")
+  @Test
+  public void testLocalMaxMemoryInPartitionedRegion() throws Throwable {
     Host host = Host.getHost(0);
     /** creating 4 VMs */
     createVMs(host);
@@ -399,6 +428,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * different reasons, in this case VMs may refuse because they are above
    * their maximum.
    */
+  @Test
   public void testCompleteBucketAllocation() throws Exception {
     final String regionName = getUniqueName();
     final int maxBuckets = 23;
@@ -446,6 +476,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
    * enforce-unique-host = true
    * redundancy-zone = "zone"
    */
+  @Test
   public void testEnforceUniqueHostForLonerDistributedSystem() {
 	  Cache myCache = createLonerCacheWithEnforceUniqueHost();
     try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
index 17085c7..be8eef6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Set;
 
 import com.gemstone.gemfire.LogWriter;
@@ -43,13 +52,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionCacheCloseDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
 
   //////constructor //////////
-  public PartitionedRegionCacheCloseDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionCacheCloseDUnitTest() {
+    super();
   }//end of constructor
 
   final static int MAX_REGIONS = 1;
@@ -57,6 +67,7 @@ public class PartitionedRegionCacheCloseDUnitTest extends
   final int totalNumBuckets = 5;
   
   //////////test methods ////////////////
+  @Test
   public void testCacheClose() throws Exception, Throwable
   {
     final String rName = getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForRootRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForRootRegion.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForRootRegion.java
index 3e9ac02..b9aa48a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForRootRegion.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForRootRegion.java
@@ -16,9 +16,9 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.util.Properties;
+import static org.junit.Assert.*;
 
-import junit.framework.Assert;
+import java.util.Properties;
 
 import com.gemstone.gemfire.cache.CacheLoader;
 import com.gemstone.gemfire.cache.CacheLoaderException;
@@ -28,18 +28,17 @@ import com.gemstone.gemfire.cache.Declarable;
 /**
  * This class is CacheLoader for partition region
  */
-public class PartitionedRegionCacheLoaderForRootRegion implements CacheLoader,
-		Declarable {
+public class PartitionedRegionCacheLoaderForRootRegion implements CacheLoader, Declarable {
 
+  @Override
 	public Object load(LoaderHelper helper) throws CacheLoaderException {
 
 		/* checking the attributes set in xml file. */
 		PartitionedRegion pr = (PartitionedRegion) helper.getRegion();
 		if (pr.getAttributes().getPartitionAttributes().getRedundantCopies() != 1)
-			Assert
-					.fail("Redundancy of the partition region is not 1");
+			fail("Redundancy of the partition region is not 1");
 
-		Assert.assertEquals(
+		assertEquals(
                     pr.getAttributes().getPartitionAttributes().getLocalMaxMemory(), 200);
 
 		/*
@@ -47,15 +46,14 @@ public class PartitionedRegionCacheLoaderForRootRegion implements CacheLoader,
 		 * not
 		 */
 		return helper.getKey();
-
 	}
 
+  @Override
 	public void close() {
-
 	}
 
+  @Override
 	public void init(Properties props) {
-
 	}
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForSubRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForSubRegion.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForSubRegion.java
index e0ba2c2..f824ab5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForSubRegion.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheLoaderForSubRegion.java
@@ -16,9 +16,9 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.util.Properties;
+import static org.junit.Assert.*;
 
-import junit.framework.Assert;
+import java.util.Properties;
 
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.CacheLoader;
@@ -31,34 +31,33 @@ import com.gemstone.gemfire.cache.Declarable;
  */
 public class PartitionedRegionCacheLoaderForSubRegion implements CacheLoader, Declarable {
 
+  @Override
 	public Object load(LoaderHelper helper) throws CacheLoaderException {
 
 		/* checking the attributes set in xml file */
 		PartitionedRegion pr = (PartitionedRegion) helper.getRegion();
 		if (pr.getAttributes().getPartitionAttributes().getRedundantCopies() != 1)
-			Assert
-					.fail("Redundancy of the partition region is not 1");
+			fail("Redundancy of the partition region is not 1");
 		
-		Assert.assertEquals(pr.getAttributes()
+		assertEquals(pr.getAttributes()
 				.getPartitionAttributes().getGlobalProperties().getProperty(
 						PartitionAttributesFactory.GLOBAL_MAX_BUCKETS_PROPERTY),
 				"11");
-		Assert.assertEquals(pr.getAttributes()
+		assertEquals(pr.getAttributes()
 				.getPartitionAttributes().getLocalMaxMemory(), 200);
 		/*
 		 * Returning the same key. This is to check CaccheLoader is invoked or
 		 * not
 		 */
 		return helper.getKey();
-
 	}
 
+  @Override
 	public void close() {
-
 	}
 
+  @Override
 	public void init(Properties props) {
-
 	}
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
index a480b4c..63c46f1 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
@@ -16,31 +16,33 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-import java.util.Properties;
-
 /**
  * This class tests regions created by xml files
  */
-public class PartitionedRegionCacheXMLExampleDUnitTest extends
-		PartitionedRegionDUnitTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionCacheXMLExampleDUnitTest extends PartitionedRegionDUnitTestCase {
 
 	protected static Cache cache;
 
-	public PartitionedRegionCacheXMLExampleDUnitTest(String name) {
-		super(name);
-	}
-
-	public void testExampleWithBothRootRegion() {
+  @Test
+  public void testExampleWithBothRootRegion() {
 		Host host = Host.getHost(0);
 		VM vm0 = host.getVM(0);
 		VM vm1 = host.getVM(1);
@@ -94,7 +96,8 @@ public class PartitionedRegionCacheXMLExampleDUnitTest extends
 		vm1.invoke(validateRegion);		
 	}
 
-	public void testExampleWithSubRegion() {
+  @Test
+  public void testExampleWithSubRegion() {
 		Host host = Host.getHost(0);
 		VM vm2 = host.getVM(2);
 		VM vm3 = host.getVM(3);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
index e8ce840..6c89ab7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Properties;
 
 import org.junit.experimental.categories.Category;
@@ -46,15 +55,16 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * vm scenario. This will verify the functionality under distributed scenario.
  */
 @SuppressWarnings("serial")
+@Category(DistributedTest.class)
 public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTestCase {
   /**
    * constructor
    * 
    * @param name
    */
-  public PartitionedRegionCreationDUnitTest(String name) {
+  public PartitionedRegionCreationDUnitTest() {
 
-    super(name);
+    super();
   }
 
   static Properties props = new Properties();
@@ -66,6 +76,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * This tests creates partition regions with scope = DISTRIBUTED_ACK and then
    * validating thoes partition regions
    */
+  @Test
   public void testSequentialCreation() throws Exception
   {
     LogWriterUtils.getLogWriter().info("*****CREATION TEST ACK STARTED*****");
@@ -102,6 +113,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    */
   // TODO: fix the hang that concurent creation often runs into -- mthomas
   // 2/8/06
+  @Test
   public void testConcurrentCreation() throws Throwable
   {
     LogWriterUtils.getLogWriter().info("*****CREATION TEST NO_ACK STARTED*****");
@@ -148,6 +160,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * 
    * @throws Exception
    */
+  @Test
   public void testConcurrentCreation_2() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -275,6 +288,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * Test Partitioned Region names that contain spaces
    * @throws Exception
    */
+  @Test
   public void testPartitionedRegionNameWithSpaces() throws Exception 
   {
     final String rName = getUniqueName() + " with some spaces";
@@ -305,6 +319,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * Test whether partition region creation is preveented when
    * an instance is created that has the incorrect redundancy
    */
+  @Test
   public void testPartitionedRegionRedundancyConflict() throws Exception
   {
     Host host = Host.getHost(0);
@@ -420,6 +435,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-1104: time sensitive, async actions
+  @Test
   public void testPartitionRegionInitialization() throws Throwable
   {
     final String name = getUniqueName();
@@ -475,6 +491,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * 
    * @throws Exception
    */
+  @Test
   public void testPartitionRegionRegistration() throws Throwable
   {
     final String name = getUniqueName();
@@ -534,6 +551,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * 
    * @throws Exception
    */
+  @Test
   public void testPartitionRegionPersistenceConflicts() throws Throwable
   {
     IgnoredException.addIgnoredException("IllegalStateException");
@@ -903,6 +921,7 @@ public class PartitionedRegionCreationDUnitTest extends PartitionedRegionDUnitTe
    * 
    * @throws Exception
    */
+  @Test
   public void testTotalNumberOfBuckets() throws Exception
   {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
index d964e5d..0cbab39 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
@@ -16,6 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.EvictionAction;
@@ -33,15 +39,18 @@ import com.gemstone.gemfire.internal.logging.PureLogWriter;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class is extended by some PartitionedRegion related DUnit test cases 
- *
  */
-public class PartitionedRegionDUnitTestCase extends CacheTestCase
-{
+@Category(DistributedTest.class)
+public class PartitionedRegionDUnitTestCase extends JUnit4CacheTestCase {
+
   static int oldLogLevel;
+
   public void setVMInfoLogLevel() {
     SerializableRunnable runnable = new SerializableRunnable() {
       public void run() {
@@ -63,6 +72,7 @@ public class PartitionedRegionDUnitTestCase extends CacheTestCase
       Host.getHost(0).getVM(i).invoke(runnable);
     }
   }
+
   /**
    * Sets the loglevel for the provided log writer
    * @param l  the {@link LogWriter}
@@ -84,10 +94,6 @@ public class PartitionedRegionDUnitTestCase extends CacheTestCase
     return ret;
   }
 
-  public PartitionedRegionDUnitTestCase(String name) {
-    super(name);
-  }
-
   /**
    * Tear down a PartitionedRegionTestCase by cleaning up the existing cache (mainly
    * because we want to destroy any existing PartitionedRegions)
@@ -101,12 +107,15 @@ public class PartitionedRegionDUnitTestCase extends CacheTestCase
   
   protected void preTearDownPartitionedRegionDUnitTest() throws Exception {
   }
-  
+
+  @BeforeClass
   public static void caseSetUp() {
     DUnitLauncher.launchIfNeeded();
     // this makes sure we don't have any connection left over from previous tests
     disconnectAllFromDS();
   }
+
+  @AfterClass
   public static void caseTearDown() {
     // this makes sure we don't leave anything for the next tests
     disconnectAllFromDS();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
index 6a2512f..bdadd8a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -38,10 +47,11 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 @SuppressWarnings("synthetic-access")
-public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionDelayedRecoveryDUnitTest extends JUnit4CacheTestCase {
   
-  public PartitionedRegionDelayedRecoveryDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionDelayedRecoveryDUnitTest() {
+    super();
   }
   
   @Override
@@ -54,6 +64,7 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
     InternalResourceManager.setResourceObserver(null);
   }
 
+  @Test
   public void testNoRecovery() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -127,6 +138,7 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-860: time sensitive, thread unsafe test hook, CountDownLatch, 1 minute timeout, waitForBucketRecovery loops eating InterruptedException
+  @Test
   public void testDelay() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -193,6 +205,7 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-757: time sensitive, fails because event occurs 2 millis too soon, waitForBucketRecovery wait loop eats InterruptedException, thread unsafe test hook
+  @Test
   public void testStartupDelay() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);



[06/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
index 22c39d3..d0fb8cb 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.HashSet;
 import java.util.concurrent.CountDownLatch;
 
@@ -55,12 +64,13 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * This includes the test with different data activities.
  *
  */
-public class CqDataDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqDataDUnitTest extends JUnit4CacheTestCase {
 
-  protected CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest("CqDataDUnitTest");
+  protected CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest();
   
-  public CqDataDUnitTest(String name) {
-    super(name);
+  public CqDataDUnitTest() {
+    super();
   }
 
   @Override
@@ -87,6 +97,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testClientWithFeederAndCQ() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -129,6 +140,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ Fail over/HA with redundancy level set.
    * @throws Exception
    */
+  @Test
   public void testCQHAWithState() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -250,6 +262,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testCQWithDestroysAndInvalidates() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -321,6 +334,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * bug 37295.
    * 
    */
+  @Test
   public void testCQWithMultipleClients() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -390,6 +404,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ when region is populated with net load.
    * @throws Exception
    */
+  @Test
   public void testCQWithLoad() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -441,6 +456,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ when entries are evicted from region.
    * @throws Exception
    */
+  @Test
   public void testCQWithEviction() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -511,6 +527,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ with ConnectionPool.
    * @throws Exception
    */
+  @Test
   public void testCQWithConnectionPool() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -569,6 +586,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ with BridgeClient.
    * @throws Exception
    */
+  @Test
   public void testCQWithBridgeClient() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -624,6 +642,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ with ConnectionPool.
    * @throws Exception
    */
+  @Test
   public void testCQWithPool() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -678,6 +697,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Test for CQ with establishCallBackConnection.
    * @throws Exception
    */
+  @Test
   public void testCQWithEstablishCallBackConnection() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -743,6 +763,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * Region invalidate triggers cqEvent with query op region invalidate.
    * @throws Exception
    */
+  @Test
   public void testRegionEvents() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -824,6 +845,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * thus making the query data and region data inconsistent.
    * @throws Exception
    */
+  @Test
   public void testEventsDuringQueryExecution() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -959,6 +981,7 @@ public class CqDataDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testMultipleExecuteWithInitialResults() throws Exception {
     final int numObjects = 200;
     final int totalObjects = 500;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
index 89e1554..4bf36f4 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
@@ -26,10 +35,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  *
  */
+@Category(DistributedTest.class)
 public class CqDataOptimizedExecuteDUnitTest extends CqDataDUnitTest {
 
-  public CqDataOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqDataOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
index b94c7e4..53d473e 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
@@ -16,45 +16,71 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.CqAttributes;
+import com.gemstone.gemfire.cache.query.CqAttributesFactory;
+import com.gemstone.gemfire.cache.query.CqEvent;
+import com.gemstone.gemfire.cache.query.CqException;
+import com.gemstone.gemfire.cache.query.CqExistsException;
+import com.gemstone.gemfire.cache.query.CqListener;
+import com.gemstone.gemfire.cache.query.CqQuery;
+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.Struct;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.cq.CqQueryImpl;
 import com.gemstone.gemfire.cache.query.internal.cq.CqQueryImpl.TestHook;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-import util.TestException;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * This class tests the ContiunousQuery mechanism in GemFire.
+ * This class tests the ContinuousQuery mechanism in GemFire.
  * This includes the test with different data activities.
- *
  */
-public class CqDataUsingPoolDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqDataUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
-  protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqDataUsingPoolDUnitTest");
-  
-  public CqDataUsingPoolDUnitTest(String name) {
-    super(name);
-  }
+  protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest(); // TODO: don't do this!
 
   @Override
   public final void postSetUp() throws Exception {
@@ -62,6 +88,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // system before creating ConnectionPools
     getSystem();
     Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
+      @Override
       public void run() {
         getSystem();
       }
@@ -77,9 +104,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
    * Added wrt bug 37161.
    * In case of InterestList the events are not sent back to the client
    * if its the originator, this is not true for cq.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testClientWithFeederAndCQ() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -93,7 +119,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     String poolName = "testClientWithFeederAndCQ";
     cqDUnitTest.createPool(client, poolName, host0, port);
-    
+
     // Create client.
     cqDUnitTest.createClient(client, port, host0);
 
@@ -114,40 +140,38 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    
+
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server);
-    
   }
 
   /**
    * Test for CQ Fail over/HA with redundancy level set.
-   * @throws Exception
    */
+  @Test
   public void testCQHAWithState() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
     VM server3 = host.getVM(2);
-    
+
     VM client = host.getVM(3);
-    
+
     cqDUnitTest.createServer(server1);
-    
+
     final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
-    
+
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    
+
     cqDUnitTest.createServer(server2, ports[0]);
     final int port2 = server2.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
-            
+
     // Create client - With 3 server endpoints and redundancy level set to 2.
-    
+
     // Create client with redundancyLevel 1
-    //cqDUnitTest.createClient(client, new int[] {port1, port2, ports[1]}, host0, "1");
-    
+
     String poolName = "testCQHAWithState";
     cqDUnitTest.createPool(client, poolName, new String[] {host0, host0, host0}, new int[] {port1, port2, ports[1]}, "1");
 
@@ -158,94 +182,91 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       cqDUnitTest.createCQ(client, poolName, "testCQHAWithState_" + i, cqDUnitTest.cqs[i]);
       cqDUnitTest.executeCQ(client, "testCQHAWithState_" + i, false, null);
     }
-    
+
     Wait.pause(1 * 1000);
-    
+
     int size = 10;
-    
+
     // CREATE.
     cqDUnitTest.createValues(server1, cqDUnitTest.regions[0], size);
     cqDUnitTest.createValues(server1, cqDUnitTest.regions[1], size);
-    
+
     for (int i=1; i <= size; i++) {
       cqDUnitTest.waitForCreated(client, "testCQHAWithState_0", CqQueryUsingPoolDUnitTest.KEY + i);
     }
-    
+
     // Clients expected initial result.
     int[] resultsCnt = new int[] {10, 1, 2};
 
     for (int i=0; i < numCQs; i++) {
       cqDUnitTest.validateCQ(client, "testCQHAWithState_" + i, CqQueryUsingPoolDUnitTest.noTest, resultsCnt[i], 0, 0);
-    }    
+    }
 
     // Close server1.
     // To maintain the redundancy; it will make connection to endpoint-3.
     cqDUnitTest.closeServer(server1);
     Wait.pause(3 * 1000);
-    
-    
+
+
     // UPDATE-1.
     cqDUnitTest.createValues(server2, cqDUnitTest.regions[0], 10);
     cqDUnitTest.createValues(server2, cqDUnitTest.regions[1], 10);
-    
+
     for (int i=1; i <= size; i++) {
       cqDUnitTest.waitForUpdated(client, "testCQHAWithState_0", CqQueryUsingPoolDUnitTest.KEY + size);
     }
-    
+
     for (int i=0; i < numCQs; i++) {
       cqDUnitTest.validateCQ(client, "testCQHAWithState_" + i, CqQueryUsingPoolDUnitTest.noTest, resultsCnt[i], resultsCnt[i], CqQueryUsingPoolDUnitTest.noTest);
-    }    
+    }
 
     //Stop cq.
     cqDUnitTest.stopCQ(client, "testCQHAWithState_0");
-    
+
     Wait.pause(2 * 1000);
-    
+
     // UPDATE with stop.
     cqDUnitTest.createServer(server3, ports[1]);
     server3.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     Wait.pause(2 * 1000);
-    
+
     cqDUnitTest.clearCQListenerEvents(client, "testCQHAWithState_0");
-    
-    cqDUnitTest.createValues(server2, cqDUnitTest.regions[0], 10);    
+
+    cqDUnitTest.createValues(server2, cqDUnitTest.regions[0], 10);
     cqDUnitTest.createValues(server2, cqDUnitTest.regions[1], 10);
-    
+
     // Wait for events at client.
     try {
       cqDUnitTest.waitForUpdated(client, "testCQHAWithState_0", CqQueryUsingPoolDUnitTest.KEY + 1);
       fail("Events not expected since CQ is in stop state.");
-    } catch (Exception ex) {
+    } catch (Exception expected) {
       // Success.
     }
-    
+
     cqDUnitTest.executeCQ(client, "testCQHAWithState_0", false, null);
 
-    // Update - 2 
-    cqDUnitTest.createValues(server3, cqDUnitTest.regions[0], 10);    
+    // Update - 2
+    cqDUnitTest.createValues(server3, cqDUnitTest.regions[0], 10);
     cqDUnitTest.createValues(server3, cqDUnitTest.regions[1], 10);
-    
+
     for (int i=1; i <= size; i++) {
       cqDUnitTest.waitForUpdated(client, "testCQHAWithState_0", CqQueryUsingPoolDUnitTest.KEY + size);
     }
 
     for (int i=0; i < numCQs; i++) {
       cqDUnitTest.validateCQ(client, "testCQHAWithState_" + i, CqQueryUsingPoolDUnitTest.noTest, resultsCnt[i], resultsCnt[i] * 2, CqQueryUsingPoolDUnitTest.noTest);
-    }    
-    
+    }
+
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server2);
     cqDUnitTest.closeServer(server3);
   }
 
-  
-  
   /**
    * Tests propogation of invalidates and destorys to the clients. Bug 37242.
-   * 
-   * @throws Exception
    */
+  @Test
   public void testCQWithDestroysAndInvalidates() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -261,7 +282,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     // Create client.
     //cqDUnitTest.createClient(client, port, host0);
-    
+
     // producer is not doing any thing.
     cqDUnitTest.createClient(producer, port, host0);
 
@@ -271,9 +292,10 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createCQ(client, poolName, name, cqDUnitTest.cqs[4]);
     cqDUnitTest.executeCQ(client, name, true, null);
-    
+
     // do destroys and invalidates.
     server.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException
       {
         Region region1 = getRootRegion().getSubregion(cqDUnitTest.regions[0]);
@@ -291,11 +313,12 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     for (int i = 1; i <= 5; i++) {
       cqDUnitTest.waitForCreated(client, name , CqQueryUsingPoolDUnitTest.KEY+i);
     }
-    
+
     // do more puts to push first five key-value to disk.
     cqDUnitTest.createValues(server, cqDUnitTest.regions[0], 10);
     // do invalidates on fisrt five keys.
     server.invoke(new CacheSerializableRunnable("Create values") {
+      @Override
       public void run2() throws CacheException
       {
         Region region1 = getRootRegion().getSubregion(cqDUnitTest.regions[0]);
@@ -308,27 +331,25 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     for (int i = 1; i <= 5; i++) {
       cqDUnitTest.waitForInvalidated(client, name , CqQueryUsingPoolDUnitTest.KEY+i);
     }
-        
+
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server);
-  
   }
-  
+
   /**
    * Tests make sure that the second client doesnt get more
-   * events then there should be. This will test the fix for 
+   * events then there should be. This will test the fix for
    * bug 37295.
-   * 
    */
+  @Test
   public void testCQWithMultipleClients() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client1 = host.getVM(1);
     VM client2 = host.getVM(2);
     VM client3 = host.getVM(3);
-    
+
     /* Create Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
@@ -339,28 +360,23 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     cqDUnitTest.createPool(client1, poolName1, host0, port);
     cqDUnitTest.createPool(client2, poolName2, host0, port);
-    
-    //cqDUnitTest.createClient(client1, port, host0);
-    //cqDUnitTest.createClient(client2, port, host0);
-    
+
     /* Create CQs. and initialize the region */
-    // this should statisfy every thing since id is always greater than 
+    // this should stasify every thing since id is always greater than
     // zero.
     cqDUnitTest.createCQ(client1, poolName1, "testCQWithMultipleClients_0", cqDUnitTest.cqs[0]);
     cqDUnitTest.executeCQ(client1, "testCQWithMultipleClients_0", false, null);
     // should only satisfy one key-value pair in the region.
     cqDUnitTest.createCQ(client2, poolName2, "testCQWithMultipleClients_0", cqDUnitTest.cqs[1]);
     cqDUnitTest.executeCQ(client2, "testCQWithMultipleClients_0", false, null);
-    
+
     int size = 10;
-    
+
     // Create Values on Server.
     cqDUnitTest.createValues(server, cqDUnitTest.regions[0], size);
-    
-    
+
     cqDUnitTest.waitForCreated(client1, "testCQWithMultipleClients_0", CqQueryUsingPoolDUnitTest.KEY + 10);
-    
-    
+
     /* Validate the CQs */
     cqDUnitTest.validateCQ(client1, "testCQWithMultipleClients_0",
         /* resultSize: */ CqQueryUsingPoolDUnitTest.noTest,
@@ -371,11 +387,9 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    
-    
+
     cqDUnitTest.waitForCreated(client2, "testCQWithMultipleClients_0", CqQueryUsingPoolDUnitTest.KEY + 2 );
-    
-    
+
     cqDUnitTest.validateCQ(client2, "testCQWithMultipleClients_0",
         /* resultSize: */ CqQueryUsingPoolDUnitTest.noTest,
         /* creates: */ 1,
@@ -385,8 +399,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ 1);
-         
-        
+
     /* Close Server and Client */
     cqDUnitTest.closeClient(client2);
     cqDUnitTest.closeClient(client3);
@@ -395,38 +408,39 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
   /**
    * Test for CQ when region is populated with net load.
-   * @throws Exception
    */
+  @Test
   public void testCQWithLoad() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
-    
+
     VM client = host.getVM(2);
-    
+
     cqDUnitTest.createServer(server1, 0, false, MirrorType.KEYS_VALUES);
     cqDUnitTest.createServer(server2, 0, false, MirrorType.KEYS);
-        
+
     final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
-    
+
     String poolName = "testCQWithLoad";
     cqDUnitTest.createPool(client, poolName, host0, port1);
 
     //cqDUnitTest.createClient(client, port1, host0);
-    
+
     // Create CQs.
-    cqDUnitTest.createCQ(client, poolName, "testCQWithLoad_0", cqDUnitTest.cqs[0]);  
-    cqDUnitTest.executeCQ(client, "testCQWithLoad_0", false, null); 
-    
+    cqDUnitTest.createCQ(client, poolName, "testCQWithLoad_0", cqDUnitTest.cqs[0]);
+    cqDUnitTest.executeCQ(client, "testCQWithLoad_0", false, null);
+
     Wait.pause(1 * 1000);
-    
+
     final int size = 10;
-    
+
     // CREATE VALUES.
     cqDUnitTest.createValues(server2, cqDUnitTest.regions[0], size);
-    
+
     server1.invoke(new CacheSerializableRunnable("Load from second server") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
         for (int i=1; i <= size; i++){
@@ -434,13 +448,13 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         }
       }
     });
-    
+
     for (int i=1; i <= size; i++) {
       cqDUnitTest.waitForCreated(client, "testCQWithLoad_0", CqQueryUsingPoolDUnitTest.KEY + i);
     }
-        
+
     cqDUnitTest.validateCQ(client, "testCQWithLoad_0", CqQueryUsingPoolDUnitTest.noTest, size, 0, 0);
-        
+
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server1);
@@ -449,19 +463,18 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
   /**
    * Test for CQ when entries are evicted from region.
-   * @throws Exception
    */
+  @Test
   public void testCQWithEviction() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
-    
+
     VM client = host.getVM(2);
-    
-    //cqDUnitTest.createServer(server1, 0, false, MirrorType.NONE);
 
     final int evictionThreshold = 5;
     server1.invoke(new CacheSerializableRunnable("Create Cache Server") {
+      @Override
       public void run2() throws CacheException {
         LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
         AttributesFactory factory = new AttributesFactory();
@@ -470,53 +483,53 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
         // setting the eviction attributes.
         factory.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(evictionThreshold));
-        for (int i = 0; i < cqDUnitTest.regions.length; i++) { 
+        for (int i = 0; i < cqDUnitTest.regions.length; i++) {
           Region region = createRegion(cqDUnitTest.regions[i], factory.createRegionAttributes());
           // Set CacheListener.
-          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));  
-        } 
+          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+        }
         Wait.pause(2000);
-        
+
         try {
           cqDUnitTest.startBridgeServer(0, true);
         } catch (Exception ex) {
           Assert.fail("While starting CacheServer", ex);
         }
         Wait.pause(2000);
-
       }
     });
 
     cqDUnitTest.createServer(server2, 0, false, MirrorType.NONE);
-        
+
     final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
-      
+
     String poolName = "testCQWithEviction";
     cqDUnitTest.createPool(client, poolName, host0, port1);
 
     //cqDUnitTest.createClient(client, port1, host0);
-    
+
     // Create CQs.
-    cqDUnitTest.createCQ(client, poolName, "testCQWithEviction_0", cqDUnitTest.cqs[0]);  
+    cqDUnitTest.createCQ(client, poolName, "testCQWithEviction_0", cqDUnitTest.cqs[0]);
 
     // This should fail as Region is not replicated.
     // There is a bug37966 filed on this.
     try {
-      cqDUnitTest.executeCQ(client, "testCQWithEviction_0", false, "CqException"); 
+      cqDUnitTest.executeCQ(client, "testCQWithEviction_0", false, "CqException");
       fail("Should have thrown exception, cq not supported on Non-replicated region.");
-    } catch (Exception ex) {
+    } catch (Exception expected) {
       // Ignore  expected.
     }
-    
+
     Wait.pause(1 * 1000);
-    
+
     final int size = 10;
-    
+
     // CREATE VALUES.
     cqDUnitTest.createValues(server2, cqDUnitTest.regions[0], size);
-    
+
     server1.invoke(new CacheSerializableRunnable("Load from second server") {
+      @Override
       public void run2() throws CacheException {
         Region region1 = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
         for (int i=1; i <= size; i++){
@@ -524,23 +537,20 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         }
       }
     });
-    
-    //for (int i=1; i <= size; i++) {
-    //  cqDUnitTest.waitForCreated(client, "testCQWithEviction_0", cqDUnitTest.KEY + i);
-    //}
-        
+
     Wait.pause(2 * 1000);
-    
+
     server1.invoke(new CacheSerializableRunnable("validate destroy") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(cqDUnitTest.regions[0]);
         assertNotNull(region);
-        
+
         Set keys = region.entrySet();
         int keyCnt= size - evictionThreshold;
-        assertEquals("Mismatch, number of keys in local region is not equal to the expected size", 
+        assertEquals("Mismatch, number of keys in local region is not equal to the expected size",
           keyCnt, keys.size());
-        
+
         CertifiableTestCacheListener ctl = (CertifiableTestCacheListener) region.getAttributes().getCacheListener();
         for (int i = 1; i <= keyCnt; i++) {
           ctl.waitForDestroyed(CqQueryUsingPoolDUnitTest.KEY+i);
@@ -549,20 +559,16 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       }
     });
 
-    // There should not be any destroy events.
-    //cqDUnitTest.validateCQ(client, "testCQWithEviction_0", cqDUnitTest.noTest, size, 0, 0);
-        
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server1);
     cqDUnitTest.closeServer(server2);
   }
-  
-  
+
   /**
    * Test for CQ with establishCallBackConnection.
-   * @throws Exception
    */
+  @Test
   public void testCQWithEstablishCallBackConnection() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -573,31 +579,29 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     final int port1 = server1.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String serverHost = NetworkUtils.getServerHostName(server1.getHost());
 
-//    final String[] regions = cqDUnitTest.regions;
-//    final int[] serverPorts = new int[] {port1};
-
     final String poolName = "testCQWithEstablishCallBackConnection";
 
     client.invoke(new CacheSerializableRunnable("createPool :" + poolName) {
+      @Override
       public void run2() throws CacheException {
         // Create Cache.
         getCache();
-        
+
         PoolFactory cpf = PoolManager.createFactory();
-        cpf.setSubscriptionEnabled(false);        
+        cpf.setSubscriptionEnabled(false);
         cpf.addServer(serverHost, port1);
         cpf.create(poolName);
       }
-    });   
+    });
 
     // Create CQs.
-    cqDUnitTest.createCQ(client, poolName, "testCQWithEstablishCallBackConnection_0", cqDUnitTest.cqs[0]);  
+    cqDUnitTest.createCQ(client, poolName, "testCQWithEstablishCallBackConnection_0", cqDUnitTest.cqs[0]);
 
     // This should fail.
     try {
       cqDUnitTest.executeCQ(client, "testCQWithEstablishCallBackConnection_0", false, "CqException");
       fail("Test should have failed with connection with establishCallBackConnection not found.");
-    } catch (Exception ex) {
+    } catch (Exception expected) {
       // Expected.
     }
 
@@ -605,39 +609,39 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server1);
   }
-  
+
   /**
    * Test for:
    * Region destroy, calls close on the server.
    * Region clear triggers cqEvent with query op region clear.
    * Region invalidate triggers cqEvent with query op region invalidate.
-   * @throws Exception
    */
+  @Test
   public void testRegionEvents() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client = host.getVM(1);
-    
+
     cqDUnitTest.createServer(server);
     final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
-    
+
     String poolName = "testRegionEvents";
     cqDUnitTest.createPool(client, poolName, host0, port);
 
     //cqDUnitTest.createClient(client, port, host0);
-    
+
     // Create CQ on regionA
     cqDUnitTest.createCQ(client, poolName, "testRegionEvents_0", cqDUnitTest.cqs[0]);
     cqDUnitTest.executeCQ(client, "testRegionEvents_0", false, null);
-    
+
     // Create CQ on regionB
     cqDUnitTest.createCQ(client, poolName, "testRegionEvents_1", cqDUnitTest.cqs[2]);
     cqDUnitTest.executeCQ(client, "testRegionEvents_1", false, null);
 
     // Test for Event on Region Clear.
     server.invoke(new CacheSerializableRunnable("testRegionEvents"){
+      @Override
       public void run2()throws CacheException {
         LogWriterUtils.getLogWriter().info("### Clearing the region on the server ###");
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
@@ -647,11 +651,12 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         region.clear();
       }
     });
-    
+
     cqDUnitTest.waitForRegionClear(client,"testRegionEvents_0");
 
     // Test for Event on Region invalidate.
     server.invoke(new CacheSerializableRunnable("testRegionEvents"){
+      @Override
       public void run2()throws CacheException {
         LogWriterUtils.getLogWriter().info("### Invalidate the region on the server ###");
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
@@ -666,6 +671,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     // Test for Event on Region destroy.
     server.invoke(new CacheSerializableRunnable("testRegionEvents"){
+      @Override
       public void run2()throws CacheException {
         LogWriterUtils.getLogWriter().info("### Destroying the region on the server ###");
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[1]);
@@ -681,43 +687,41 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     //cqDUnitTest.waitForClose(client,"testRegionEvents_1");
     cqDUnitTest.validateCQCount(client,1);
 
-        
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server);
-
   }
 
   /**
    * Test for events created during the CQ query execution.
-   * When CQs are executed using executeWithInitialResults 
+   * When CQs are executed using executeWithInitialResults
    * there may be possibility that the region changes during
    * that time may not be reflected in the query result set
    * thus making the query data and region data inconsistent.
-   * @throws Exception
    */
+  @Test
   public void testEventsDuringQueryExecution() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     final VM client = host.getVM(1);
     final String cqName = "testEventsDuringQueryExecution_0";
     cqDUnitTest.createServer(server);
-    
+
     final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
- 
+
     String poolName = "testEventsDuringQueryExecution";
     cqDUnitTest.createPool(client, poolName, host0, port);
-    
+
     // create CQ.
     cqDUnitTest.createCQ(client, poolName, cqName, cqDUnitTest.cqs[0]);
 
     final int numObjects = 200;
     final int totalObjects = 500;
-    
+
     // initialize Region.
     server.invoke(new CacheSerializableRunnable("Update Region"){
+      @Override
       public void run2()throws CacheException {
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
         for (int i = 1; i <= numObjects; i++) {
@@ -726,13 +730,14 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         }
       }
     });
-    
+
     // First set testhook in executeWithInitialResults so that queued events
-    // are not drained before we verify there number.    
-    client.invoke(setTestHook());    
-    
+    // are not drained before we verify there number.
+    client.invoke(setTestHook());
+
     // Execute CQ while update is in progress.
     AsyncInvocation executeCq = client.invokeAsync(new CacheSerializableRunnable("Execute CQ AsyncInvoke") {
+      @Override
       public void run2()throws CacheException {
         QueryService cqService = getCache().getQueryService();
         // Get CqQuery object.
@@ -755,26 +760,26 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           public boolean done() {
             return testHook.numQueuedEvents() > 0;
           }
-          
+
           @Override
           public String description() {
             return "No queued events found.";
           }
         }, 3000, 5, true);
-        
+
         getCache().getLogger().fine("Queued Events Size" + testHook.numQueuedEvents());
         // Make sure CQEvents are queued during execute with initial results.
-        
+
         CqQueryTestListener cqListener = (CqQueryTestListener)cq1.getCqAttributes().getCqListener();
         // Wait for the last key to arrive.
         cqListener.waitForCreated("" + totalObjects);
-        
+
         // Check if the events from CqListener are in order.
         int oldId = 0;
-        for (Object cqEvent : cqListener.events.toArray()) { 
+        for (Object cqEvent : cqListener.events.toArray()) {
           int newId = new Integer(cqEvent.toString()).intValue();
           if (oldId > newId){
-            fail("Queued events for CQ Listener during execution with " + 
+            fail("Queued events for CQ Listener during execution with " +
                 "Initial results is not in the order in which they are created.");
           }
           oldId = newId;
@@ -782,7 +787,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
         // Check if all the IDs are present as part of Select Results and CQ Events.
         HashSet ids = new HashSet(cqListener.events);
-    
+
         for (Object o : cqResults.asList()) {
           Struct s = (Struct)o;
           ids.add(s.get("key"));
@@ -796,7 +801,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
             missingIds.add(key);
           }
         }
-        
+
         if (!missingIds.isEmpty()) {
           fail("Missing Keys in either ResultSet or the Cq Event list. " +
               " Missing keys : [size : " + missingIds.size() + "]" + missingIds +
@@ -807,9 +812,11 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     // Keep updating region (async invocation).
     server.invoke(new CacheSerializableRunnable("Update Region"){
+      @Override
       public void run2()throws CacheException {
         Wait.pause(200);
         client.invoke(new CacheSerializableRunnable("Releasing the latch") {
+          @Override
           public void run2()throws CacheException {
             // Now release the testhook so that CQListener can proceed.
             final TestHook testHook = CqQueryImpl.testHook;
@@ -827,9 +834,9 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // Close.
     cqDUnitTest.closeClient(client);
     cqDUnitTest.closeServer(server);
-
   }
 
+  @Test
   public void testCqStatInitializationTimingIssue() {
     disconnectAllFromDS();
 
@@ -841,35 +848,37 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     VM server = host.getVM(0);
     VM client = host.getVM(1);
     VM client2 = host.getVM(2);
- 
+
     // Start server 1
     final int server1Port = ((Integer) server.invoke(() -> CacheServerTestUtil.createCacheServer(regionName, new Boolean(true))))
         .intValue();
-    
+
     // Start a  client
     client.invoke(() -> CacheServerTestUtil.createCacheClient(getClientPool(NetworkUtils.getServerHostName(client.getHost()), server1Port), regionName));
-    
+
     // Start a pub client
     client2.invoke(() -> CacheServerTestUtil.createCacheClient(getClientPool(NetworkUtils.getServerHostName(client2.getHost()), server1Port), regionName));
-    
+
     //client has thread that invokes new and remove cq over and over
     client.invokeAsync(new CacheSerializableRunnable("Register cq") {
+      @Override
       public void run2() throws CacheException {
         for (int i = 0; i < 10000; i++) {
           CqQuery query = createCq(regionName, cq1Name);
           if (query != null) {
-            try {              
+            try {
               query.close();
             }
             catch (Exception e) {
-              System.out.println("exception while closing cq:" + e);
+              fail("exception while closing cq:", e);
             }
           }
         }
       }
     });
-    
+
     client2.invokeAsync(new CacheSerializableRunnable("pub updates") {
+      @Override
       public void run2() throws CacheException {
         Region region = CacheServerTestUtil.getCache().getRegion(regionName);
         while (true) {
@@ -879,8 +888,9 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         }
       }
     });
-    
+
     server.invokeAsync(new CacheSerializableRunnable("pub updates") {
+      @Override
       public void run2() throws CacheException {
         Region region = CacheServerTestUtil.getCache().getRegion(regionName);
         while (true) {
@@ -890,42 +900,45 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         }
       }
     });
-    
+
     //client has another thread that retrieves cq map and checks stat over and over
     client.invoke(new CacheSerializableRunnable("Check Stats") {
+      @Override
       public void run2() throws CacheException {
         for (int i = 0; i < 10000; i++) {
           checkCqStats(cq1Name);
         }
       }
     });
-    
+
     client.invoke(() -> CacheServerTestUtil.closeCache());
     client2.invoke(() -> CacheServerTestUtil.closeCache());
     server.invoke(() -> CacheServerTestUtil.closeCache());
   }
-  
+
+  @Test
   public void testGetDurableCQsFromPoolOnly() throws Exception {
     final String regionName = "regionA";
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client1 = host.getVM(1);
     VM client2 = host.getVM(2);
-    
+
     /* Create Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
-  
+
     final String poolName1 = "pool1";
     final String poolName2 = "pool2";
-  
+
     cqDUnitTest.createPool(client1, poolName1, host0, port);
     cqDUnitTest.createPool(client2, poolName2, host0, port);
-    
+
     client1.invoke(new CacheSerializableRunnable("Register cq for client 1") {
+      @Override
       public void run2() throws CacheException {
-    
+
         QueryService queryService = null;
         try {
           queryService = (PoolManager.find(poolName1)).getQueryService();
@@ -941,26 +954,21 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           queryService.newCq("client1NoDC2", "Select * From /root/" + regionName + " where id = 3", attributes, false).execute();
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqExistsException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (RegionNotFoundException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
       }
     });
-    
+
     client2.invoke(new CacheSerializableRunnable("Register cq for client 2") {
+      @Override
       public void run2() throws CacheException {
-    
+
         QueryService queryService = null;
         try {
           queryService = (PoolManager.find(poolName2)).getQueryService();
@@ -976,24 +984,19 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           queryService.newCq("client2DCQ4", "Select * From /root/" + regionName + " where id = 3", attributes, true).execute();
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqExistsException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (RegionNotFoundException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
       }
     });
-    
+
     client2.invoke(new CacheSerializableRunnable("test getDurableCQsFromServer for client2") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = null;
         try {
@@ -1001,14 +1004,12 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         } catch (Exception cqe) {
           Assert.fail("Failed to getCQService.", cqe);
         }
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         assertEquals(4, list.size());
         assertTrue(list.contains("client2DCQ1"));
@@ -1017,8 +1018,9 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         assertTrue(list.contains("client2DCQ4"));
       }
     });
-    
+
     client1.invoke(new CacheSerializableRunnable("test getDurableCQsFromServer for client1") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = null;
         try {
@@ -1026,41 +1028,41 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         } catch (Exception cqe) {
           Assert.fail("Failed to getCQService.", cqe);
         }
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         assertEquals(2, list.size());
         assertTrue(list.contains("client1DCQ1"));
         assertTrue(list.contains("client1DCQ2"));
       }
     });
-    
+
     cqDUnitTest.closeClient(client2);
     cqDUnitTest.closeClient(client1);
     cqDUnitTest.closeServer(server);
   }
-  
+
+  @Test
   public void testGetDurableCQsFromServerWithEmptyList() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
     VM client1 = host.getVM(1);
-    
+
     /* Create Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invoke(() -> CqQueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server.getHost());
-  
+
     final String poolName1 = "pool1";
-  
+
     cqDUnitTest.createPool(client1, poolName1, host0, port);
-    
+
     client1.invoke(new CacheSerializableRunnable("test getDurableCQsFromServer for client1") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = null;
         try {
@@ -1068,25 +1070,24 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         } catch (Exception cqe) {
           Assert.fail("Failed to getCQService.", cqe);
         }
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         assertEquals(0, list.size());
         assertFalse(list.contains("client1DCQ1"));
         assertFalse(list.contains("client1DCQ2"));
       }
     });
-    
+
     cqDUnitTest.closeClient(client1);
     cqDUnitTest.closeServer(server);
   }
   
+  @Test
   public void testGetDurableCqsFromServer() {
     disconnectAllFromDS();
 
@@ -1111,14 +1112,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     createClient2CqsAndDurableCqs(client2, regionName);
     
     client2.invoke(new CacheSerializableRunnable("check durable cqs for client 2") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {};
+          fail("failed", e);
         }
         assertEquals(4, list.size());
         assertTrue(list.contains("client2DCQ1"));
@@ -1129,14 +1131,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     });
     
     client1.invoke(new CacheSerializableRunnable("check durable cqs for client 1") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {};
+          fail("failed", e);
         }
         assertEquals(2, list.size());
         assertTrue(list.contains("client1DCQ1"));
@@ -1149,6 +1152,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     server.invoke(() -> CacheServerTestUtil.closeCache());
   }
   
+  @Test
   public void testGetDurableCqsFromServerCycleClients() {
     disconnectAllFromDS();
 
@@ -1175,14 +1179,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cycleDurableClient(client2, "client2_dc", server1Port, regionName, timeout);
     
     client2.invoke(new CacheSerializableRunnable("check durable cqs for client 2") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {};
+          fail("failed", e);
         }
         assertEquals(4, list.size());
         assertTrue(list.contains("client2DCQ1"));
@@ -1193,14 +1198,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     });
     
     client1.invoke(new CacheSerializableRunnable("check durable cqs for client 1") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {};
+          fail("failed", e);
         }
         assertEquals(2, list.size());
         assertTrue(list.contains("client1DCQ1"));
@@ -1213,6 +1219,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     server.invoke(() -> CacheServerTestUtil.closeCache());
   }
   
+  @Test
   public void testGetDurableCqsFromServerCycleClientsAndMoreCqs() {
     final String regionName = "testGetAllDurableCqsFromServerCycleClients";
     final Host host = Host.getHost(0);
@@ -1238,6 +1245,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cycleDurableClient(client2, "client2_dc", server1Port, regionName, timeout);
     
     client1.invoke(new CacheSerializableRunnable("Register more cq for client 1") {
+      @Override
       public void run2() throws CacheException {
         //register the cq's
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
@@ -1250,24 +1258,19 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           queryService.newCq("client1MoreNoDC2", "Select * From /" + regionName + " where id = 3", attributes, false).execute();
         }
         catch (RegionNotFoundException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqExistsException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
       }
     });
     
     client2.invoke(new CacheSerializableRunnable("Register more cq for client 2") {
+      @Override
       public void run2() throws CacheException {
         //register the cq's
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
@@ -1280,19 +1283,13 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           queryService.newCq("client2MoreDCQ4", "Select * From /" + regionName + " where id = 3", attributes, true).execute();
         }
         catch (RegionNotFoundException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqExistsException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
       }
     });
@@ -1302,14 +1299,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cycleDurableClient(client2, "client2_dc", server1Port, regionName, timeout);
     
     client2.invoke(new CacheSerializableRunnable("check durable cqs for client 2") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {};
+          fail("failed", e);
         }
         assertEquals(8, list.size());
         assertTrue(list.contains("client2DCQ1"));
@@ -1324,14 +1322,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     });
     
     client1.invoke(new CacheSerializableRunnable("check durable cqs for client 1") {
+      @Override
       public void run2() throws CacheException {
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
-        List<String> list;
+        List<String> list = null;
         try {
           list = queryService.getAllDurableCqsFromServer();
         }
         catch (CqException e) {
-          throw new CacheException(e) {};
+          fail("failed", e);
         }
         assertEquals(4, list.size());
         assertTrue(list.contains("client1DCQ1"));
@@ -1358,6 +1357,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   //helper to create durable cqs to test out getAllDurableCqs functionality
   private void createClient1CqsAndDurableCqs(VM client, final String regionName) {
     client.invoke(new CacheSerializableRunnable("Register cq for client 1") {
+      @Override
       public void run2() throws CacheException {
         //register the cq's
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
@@ -1370,19 +1370,13 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           queryService.newCq("client1NoDC2", "Select * From /" + regionName + " where id = 3", attributes, false).execute();
         }
         catch (RegionNotFoundException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqExistsException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
       }
     });
@@ -1390,6 +1384,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   
   private void createClient2CqsAndDurableCqs(VM client, final String regionName) {
     client.invoke(new CacheSerializableRunnable("Register cq for client 2") {
+      @Override
       public void run2() throws CacheException {
         //register the cq's
         QueryService queryService = CacheServerTestUtil.getCache().getQueryService();
@@ -1402,19 +1397,13 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           queryService.newCq("client2DCQ4", "Select * From /" + regionName + " where id = 3", attributes, true).execute();
         }
         catch (RegionNotFoundException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
         catch (CqExistsException e) {
-          throw new CacheException(e) {
-            
-          };
+          fail("failed", e);
         }
 
       }
@@ -1423,6 +1412,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   
   private void cycleDurableClient(VM client, final String dcName, final int serverPort, final String regionName, final int durableClientTimeout) {
     client.invoke(new CacheSerializableRunnable("cycle client") {
+      @Override
       public void run2() throws CacheException {
         CacheServerTestUtil.closeCache(true);
       }
@@ -1430,7 +1420,6 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     client.invoke(() -> CacheServerTestUtil.createClientCache(getClientPool(NetworkUtils.getServerHostName(client.getHost()), serverPort), regionName, getDurableClientProperties(dcName, durableClientTimeout)));
   }
-  
 
   private CqQuery createCq(String regionName, String cqName) {
     // Create CQ Attributes.
@@ -1438,19 +1427,15 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     // Initialize and set CqListener.
     CqListener[] cqListeners = { new CqListener() {
-
       @Override
       public void close() {
       }
-
       @Override
       public void onEvent(CqEvent aCqEvent) {
       }
-
       @Override
       public void onError(CqEvent aCqEvent) {
       }
-      
     }};
     cqAf.initCqListeners(cqListeners);
     CqAttributes cqa = cqAf.create();
@@ -1464,14 +1449,14 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       query.execute();
     }
     catch (CqExistsException e) {
-      fail("Could not find specified region:" + regionName + ":" + e);
+      fail("Could not find specified region:" + regionName + ":", e);
     }
     catch (CqException e) {
-      fail("Could not find specified region:" + regionName + ":" + e);
+      fail("Could not find specified region:" + regionName + ":", e);
 
     }
     catch (RegionNotFoundException e) {
-      fail("Could not find specified region:" + regionName + ":" + e);
+      fail("Could not find specified region:" + regionName + ":", e);
     }
     return query;
   }
@@ -1492,10 +1477,10 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       .setSubscriptionAckInterval(1).setSubscriptionEnabled(true);
     return ((PoolFactoryImpl)pf).getPoolAttributes();
   }
-  
 
   public CacheSerializableRunnable setTestHook() {
     SerializableRunnable sr = new CacheSerializableRunnable("TestHook") {
+      @Override
       public void run2() {
         class CqQueryTestHook implements CqQueryImpl.TestHook {
 
@@ -1503,27 +1488,30 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
           private int numEvents = 0;
           Cache cache = GemFireCacheImpl.getInstance();
           
+          @Override
           public void pauseUntilReady() {
             try {
               cache.getLogger().fine("CqQueryTestHook: Going to wait on latch until ready is called.");
               if (!latch.await(10, TimeUnit.SECONDS)) {
-                throw new TestException("query was never unlatched");
+                fail("query was never unlatched");
               }
             } catch (Exception e) {
-              e.printStackTrace();
-              Thread.currentThread().interrupt();
+              fail("interrupted", e);
             }
           }
 
+          @Override
           public void ready() {
             latch.countDown();
             cache.getLogger().fine("CqQueryTestHook: The latch has been released.");
           }
 
+          @Override
           public int numQueuedEvents() {
             return numEvents;
           }
           
+          @Override
           public void setEventCount(int count) {
             cache.getLogger().fine("CqQueryTestHook: Setting numEVents to: " + count);
             numEvents = count;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
index 03bc48b..6d66ed7 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
@@ -26,10 +35,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  *
  */
+@Category(DistributedTest.class)
 public class CqDataUsingPoolOptimizedExecuteDUnitTest extends CqDataUsingPoolDUnitTest {
 
-  public CqDataUsingPoolOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqDataUsingPoolOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
index fe8e23e..20b2a52 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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 java.util.Collection;
 import java.util.HashMap;
@@ -51,12 +60,13 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * This class tests the ContiunousQuery mechanism in GemFire.
  * This includes the test with diffetent data activities.
  */
-public class CqPerfDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqPerfDUnitTest extends JUnit4CacheTestCase {
 
-  protected CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest("CqPerfDUnitTest");
+  protected CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest();
   
-  public CqPerfDUnitTest(String name) {
-    super(name);
+  public CqPerfDUnitTest() {
+    super();
   }
 
   @Override
@@ -181,6 +191,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
    * Test for maintaining keys for update optimization.
    * @throws Exception
    */
+  @Test
   public void testKeyMaintainance() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -402,6 +413,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-1164: random ports, thread sleeps, time sensitive, eats exceptions (fixed 1), async behavior
+  @Test
   public void testMatchingCqs() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -513,6 +525,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
    * To test the changes relating to, executing CQ only once for all similar CQs.
    * @throws Exception
    */
+  @Test
   public void testMatchingCQWithMultipleClients() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -672,6 +685,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
    * Test for CQ Fail over.
    * @throws Exception
    */
+  @Test
   public void testMatchingCQsWithMultipleServers() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -832,6 +846,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
    * Test for CQ Fail over.
    * @throws Exception
    */
+  @Test
   public void testMatchingCQsOnDataNodeWithMultipleServers() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
index 2a91abb..0168419 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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 java.util.Collection;
 import java.util.HashMap;
@@ -51,12 +60,13 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * This class tests the ContiunousQuery mechanism in GemFire.
  * This includes the test with diffetent data activities.
  */
-public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CqPerfUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
-  protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqPerfUsingPoolDUnitTest"); // TODO: get rid of this!
+  protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest(); // TODO: get rid of this!
   
-  public CqPerfUsingPoolDUnitTest(String name) {
-    super(name);
+  public CqPerfUsingPoolDUnitTest() {
+    super();
   }
 
   @Override
@@ -181,6 +191,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
    * Test for maintaining keys for update optimization.
    * @throws Exception
    */
+  @Test
   public void testKeyMaintenance() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -402,6 +413,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-988: random ports, time sensitive, waitForCriterion, 20 second timeouts
+  @Test
   public void testMatchingCqs() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -516,6 +528,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
    * To test the changes relating to, executing CQ only once for all similar CQs.
    * @throws Exception
    */
+  @Test
   public void testMatchingCQWithMultipleClients() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -679,6 +692,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
    * Test for CQ Fail over.
    * @throws Exception
    */
+  @Test
   public void testMatchingCQsWithMultipleServers() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
index 5c993ce..25d3380 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
@@ -16,14 +16,50 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.query.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.query.CqAttributes;
+import com.gemstone.gemfire.cache.query.CqAttributesFactory;
+import com.gemstone.gemfire.cache.query.CqAttributesMutator;
+import com.gemstone.gemfire.cache.query.CqClosedException;
+import com.gemstone.gemfire.cache.query.CqExistsException;
+import com.gemstone.gemfire.cache.query.CqListener;
+import com.gemstone.gemfire.cache.query.CqQuery;
+import com.gemstone.gemfire.cache.query.Query;
+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.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.CqStateImpl;
 import com.gemstone.gemfire.cache.query.internal.DefaultQueryService;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
@@ -32,23 +68,26 @@ import com.gemstone.gemfire.internal.cache.DistributedRegion;
 import com.gemstone.gemfire.internal.cache.DistributedTombstoneOperation;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the ContiunousQuery mechanism in GemFire.
  * It does so by creating a cache server with a cache and a pre-defined region and
  * a data loader. The client creates the same region and attaches the connection pool.
- * 
- *
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class CqQueryDUnitTest extends CacheTestCase {
+public class CqQueryDUnitTest extends JUnit4CacheTestCase {
   
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
@@ -133,10 +172,6 @@ public class CqQueryDUnitTest extends CacheTestCase {
   // 11 - Test for "short" number type
   "SELECT ALL * FROM /root/" + regions[0] + " p where p.shortID IN SET(1,2,3,4,5)" };
 
-  public CqQueryDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     // avoid IllegalStateException from HandShake by connecting all vms tor
@@ -1575,6 +1610,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * bug #47494 - CQs were destroyed when a server did a tombstone GC 
    */
+  @Test
   public void testCQRemainsWhenServerGCs() throws Exception {
 
     final Host host = Host.getHost(0);
@@ -1621,6 +1657,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for InterestList and CQ registered from same clients.
    * @throws Exception
    */
+  @Test
   public void testInterestListAndCQs() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -1790,6 +1827,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for CQ register and UnRegister.
    * @throws Exception
    */
+  @Test
   public void testCQStopExecute() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -1874,6 +1912,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for CQ Attributes Mutator functions
    * @throws Exception
    */
+  @Test
   public void testCQAttributesMutator() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -1969,6 +2008,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for CQ register and UnRegister.
    * @throws Exception
    */
+  @Test
   public void testCQCreateClose() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -2156,6 +2196,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * The CQs on the destroy region needs to be closed.
    *
    */
+  @Test
   public void testRegionDestroy() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2237,6 +2278,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * Test for CQ with multiple clients.
    */
+  @Test
   public void testCQWithMultipleClients() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -2389,6 +2431,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * Test for CQ ResultSet.
    */
+  @Test
   public void testCQResultSet() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -2460,6 +2503,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for CQ Listener events.
    *
    */
+  @Test
   public void testCQEvents() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -2557,6 +2601,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
     closeServer(server);
   }
   
+  @Test
   public void testCQMapValues() throws Exception {
 
     final Host host = Host.getHost(0);
@@ -2647,6 +2692,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for stopping and restarting CQs.
    * @throws Exception
    */
+  @Test
   public void testEnableDisableCQ() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2789,6 +2835,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for Complex queries.
    * @throws Exception
    */
+  @Test
   public void testQuery() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2830,6 +2877,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for CQ Fail over.
    * @throws Exception
    */
+  @Test
   public void testCQFailOver() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2916,6 +2964,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * Test for CQ Fail over/HA with redundancy level set.
    * @throws Exception
    */
+  @Test
   public void testCQHA() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3015,6 +3064,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * no CQService intiated.
    * @throws Exception
    */
+  @Test
   public void testWithoutCQs() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3077,6 +3127,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * Test getCQs for a regions
    */
+  @Test
   public void testGetCQsForARegionName() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -3144,6 +3195,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * Test exception message thrown when replicate region with local destroy is used
    */
+  @Test
   public void testCqExceptionForReplicateRegionWithEvictionLocalDestroy() throws Exception {
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -3179,6 +3231,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testQueryWithNULLInWhereClause() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -3228,6 +3281,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testForSupportedRegionAttributes() throws Exception
   {
     final Host host = Host.getHost(0);
@@ -3330,6 +3384,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * 
    */
+  @Test
   public void testCQWhereCondOnShort() throws Exception {
        
        final Host host = Host.getHost(0);
@@ -3362,6 +3417,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * 
    */
+  @Test
   public void testCQEquals() throws Exception {
        
        final Host host = Host.getHost(0);
@@ -3414,6 +3470,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /**
    * 
    */
+  @Test
   public void testCQEqualsWithIndex() throws Exception {
        
        final Host host = Host.getHost(0);
@@ -3465,6 +3522,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
 
   
   //Tests that cqs get an onCqDisconnect and onCqConnect
+  @Test
   public void testCQAllServersCrash() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3512,6 +3570,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   }
 
   //Tests that we receive both an onCqConnected and a onCqDisconnected message
+  @Test
   public void testCQAllServersLeave() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3557,6 +3616,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   //Test cqstatus listeners, onCqDisconnect should trigger when All servers leave
   //and onCqConnect should trigger when a cq is first connected and when the pool
   //goes from no primary queue to having a primary
+  @Test
   public void testCQAllServersLeaveAndRejoin() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3617,6 +3677,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   /*
    * Tests that the cqs do not get notified if primary leaves and a new primary is elected
    */
+  @Test
   public void testCQPrimaryLeaves() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3663,6 +3724,7 @@ public class CqQueryDUnitTest extends CacheTestCase {
   // Each cq uses a different pool and the servers are shutdown.
   // The listeners for each cq should receive a connect and disconnect
   // when their respective servers are shutdown
+  @Test
   public void testCQAllServersLeaveMultiplePool() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -3715,7 +3777,8 @@ public class CqQueryDUnitTest extends CacheTestCase {
   }  
 
   
-public void testCqCloseAndExecuteWithInitialResults() throws Exception {
+  @Test
+  public void testCqCloseAndExecuteWithInitialResults() throws Exception {
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -3744,7 +3807,8 @@ public void testCqCloseAndExecuteWithInitialResults() throws Exception {
    closeServer(server);    
  }
 
-public void testCQEventsWithNotEqualsUndefined() throws Exception {
+  @Test
+  public void testCQEventsWithNotEqualsUndefined() throws Exception {
  
   final Host host = Host.getHost(0);
   VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
index 57d6adf..d63ffd7 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
@@ -31,10 +40,11 @@ import com.gemstone.gemfire.test.dunit.*;
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  *
  */
+@Category(DistributedTest.class)
 public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest {
 
-  public CqQueryOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public CqQueryOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override
@@ -56,6 +66,7 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest {
     });
   }
   
+  @Test
   public void testCqExecuteWithoutQueryExecution() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -148,6 +159,7 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest {
     closeServer(server);    
   }
 
+  @Test
   public void testCqExecuteWithoutQueryExecutionAndNoRSCaching() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -251,6 +263,7 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest {
   // Each cq uses a different pool and the servers are shutdown.
   // The listeners for each cq should receive a connect and disconnect
   // when their respective servers are shutdown
+  @Test
   public void testCQAllServersLeaveMultiplePool() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(1);


[23/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
index 502fa1d..a18ec3e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
@@ -16,6 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -24,23 +34,21 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
-import java.util.Properties;
+@Category(IntegrationTest.class)
+public class BlockingHARegionJUnitTest {
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
+  private static Cache cache = null;
 
-@Category(IntegrationTest.class)
-public class BlockingHARegionJUnitTest
-{
-  static Cache cache = null;
+  /** boolean to record an exception occurence in another thread**/
+  private static volatile boolean exceptionOccured = false;
+  /** StringBuffer to store the exception**/
+  private static StringBuffer exceptionString = new StringBuffer();
+  /** boolen to quit the for loop**/
+  private static volatile boolean quitForLoop = false;
 
   @Before
-  public void setUp() throws Exception
-  {
+  public void setUp() throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     if (cache != null) {
@@ -50,43 +58,34 @@ public class BlockingHARegionJUnitTest
       .connect(props));
   }
 
-/**
- * This test has a scenario where the HAReqionQueue capacity is just 1. There will
- * be two thread. One doing a 1000 puts and the other doing a 1000 takes. The validation
- * for this test is that it should not encounter any exceptions
- *
- */
+  /**
+   * This test has a scenario where the HAReqionQueue capacity is just 1. There will
+   * be two thread. One doing a 1000 puts and the other doing a 1000 takes. The validation
+   * for this test is that it should not encounter any exceptions
+   */
   @Test
-  public void testBoundedPuts()
-  {
-    try {
-      exceptionOccured = false;
-      HARegionQueueAttributes harqa = new HARegionQueueAttributes();
-      harqa.setBlockingQueueCapacity(1);
-      HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
-          "BlockingHARegionJUnitTest_Region", cache, harqa,
-          HARegionQueue.BLOCKING_HA_QUEUE, false);
-      hrq.setPrimary(true);//fix for 40314 - capacity constraint is checked for primary only.
-      Thread thread1 = new DoPuts(hrq,1000);
-      Thread thread2 = new DoTake(hrq,1000);
-
-      thread1.start();
-      thread2.start();
+  public void testBoundedPuts() throws Exception {
+    exceptionOccured = false;
+    HARegionQueueAttributes harqa = new HARegionQueueAttributes();
+    harqa.setBlockingQueueCapacity(1);
+    HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
+        "BlockingHARegionJUnitTest_Region", cache, harqa,
+        HARegionQueue.BLOCKING_HA_QUEUE, false);
+    hrq.setPrimary(true);//fix for 40314 - capacity constraint is checked for primary only.
+    Thread thread1 = new DoPuts(hrq,1000);
+    Thread thread2 = new DoTake(hrq,1000);
 
-      ThreadUtils.join(thread1, 30 * 1000);
-      ThreadUtils.join(thread2, 30 * 1000);
+    thread1.start();
+    thread2.start();
 
-      if (exceptionOccured) {
-        fail(" Test failed due to " + exceptionString);
-      }
-      
-      cache.close();
+    ThreadUtils.join(thread1, 30 * 1000);
+    ThreadUtils.join(thread2, 30 * 1000);
 
-    }
-    catch (Exception e) {
-      fail(" Test encountered an exception "+e);
+    if (exceptionOccured) {
+      fail(" Test failed due to " + exceptionString);
     }
 
+    cache.close();
   }
 
   /**
@@ -97,67 +96,60 @@ public class BlockingHARegionJUnitTest
    * is started. This will cause the region size to come down by one and the put thread waiting
    * will go ahead and do the put. The thread should then die and the region size should be validated
    * to reflect that.
-   *
    */
   @Test
-  public void testPutBeingBlocked()
-  {
-    try {
-      exceptionOccured = false;
-      quitForLoop = false;
-      HARegionQueueAttributes harqa = new HARegionQueueAttributes();
-      harqa.setBlockingQueueCapacity(1);
-      final HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
-          "BlockingHARegionJUnitTest_Region", cache, harqa,
-          HARegionQueue.BLOCKING_HA_QUEUE, false);
-      hrq.setPrimary(true);//fix for 40314 - capacity constraint is checked for primary only.
-      final Thread thread1 = new DoPuts(hrq,2);
-      thread1.start();
-      WaitCriterion ev = new WaitCriterion() {
-        public boolean done() {
-          return hrq.region.size() == 2;
-        }
-        public String description() {
-          return null;
-        }
-      };
-      Wait.waitForCriterion(ev, 1000, 200, true);
-      assertTrue(thread1.isAlive()); //thread should still be alive (in wait state)
-      
-      Thread thread2 = new DoTake(hrq,1);
-      thread2.start(); //start take thread
-      ev = new WaitCriterion() {
-        public boolean done() {
-          return hrq.region.size() == 3;
-        }
-        public String description() {
-          return null;
-        }
-      };
-      //sleep. take will proceed and so will sleeping put
-      Wait.waitForCriterion(ev, 3 * 1000, 200, true);
+  public void testPutBeingBlocked() throws Exception {
+    exceptionOccured = false;
+    quitForLoop = false;
+    HARegionQueueAttributes harqa = new HARegionQueueAttributes();
+    harqa.setBlockingQueueCapacity(1);
+    final HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
+        "BlockingHARegionJUnitTest_Region", cache, harqa,
+        HARegionQueue.BLOCKING_HA_QUEUE, false);
+    hrq.setPrimary(true);//fix for 40314 - capacity constraint is checked for primary only.
+    final Thread thread1 = new DoPuts(hrq,2);
+    thread1.start();
+    WaitCriterion ev = new WaitCriterion() {
+      public boolean done() {
+        return hrq.region.size() == 2;
+      }
+      public String description() {
+        return null;
+      }
+    };
+    Wait.waitForCriterion(ev, 1000, 200, true);
+    assertTrue(thread1.isAlive()); //thread should still be alive (in wait state)
 
-      // thread should have died since put should have proceeded
-      ev = new WaitCriterion() {
-        public boolean done() {
-          return !thread1.isAlive();
-        }
-        public String description() {
-          return "thread1 still alive";
-        }
-      };
-      Wait.waitForCriterion(ev, 30 * 1000, 1000, true);
-      
-      ThreadUtils.join(thread1, 30 * 1000); // for completeness
-      ThreadUtils.join(thread2, 30 * 1000);
-      if (exceptionOccured) {
-        fail(" Test failed due to " + exceptionString);
+    Thread thread2 = new DoTake(hrq,1);
+    thread2.start(); //start take thread
+    ev = new WaitCriterion() {
+      public boolean done() {
+        return hrq.region.size() == 3;
       }
-      cache.close();
-    }
-    catch (Exception e) {
-      fail(" Test encountered an exception "+e);
+      public String description() {
+        return null;
+      }
+    };
+    //sleep. take will proceed and so will sleeping put
+    Wait.waitForCriterion(ev, 3 * 1000, 200, true);
+
+    // thread should have died since put should have proceeded
+    ev = new WaitCriterion() {
+      public boolean done() {
+        return !thread1.isAlive();
+      }
+      public String description() {
+        return "thread1 still alive";
+      }
+    };
+    Wait.waitForCriterion(ev, 30 * 1000, 1000, true);
+
+    ThreadUtils.join(thread1, 30 * 1000); // for completeness
+    ThreadUtils.join(thread2, 30 * 1000);
+    if (exceptionOccured) {
+      fail(" Test failed due to " + exceptionString);
     }
+    cache.close();
   }
 
   
@@ -167,72 +159,65 @@ public class BlockingHARegionJUnitTest
    * put simultaneously. They will reach a state where the queue is full and they will all
    * go in a wait state. the region size would be verified to be 20000 (10000 puts and 10000 DACE objects).
    * then the threads are interrupted and made to quit the loop
-   *
    */
   @Test
-  public void testConcurrentPutsNotExceedingLimit()
-  {
-    try {
-      exceptionOccured = false;
-      quitForLoop = false;
-      HARegionQueueAttributes harqa = new HARegionQueueAttributes();
-      harqa.setBlockingQueueCapacity(10000);
-      final HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
-          "BlockingHARegionJUnitTest_Region", cache, harqa,
-          HARegionQueue.BLOCKING_HA_QUEUE, false);      
-      hrq.setPrimary(true);//fix for 40314 - capacity constraint is checked for primary only.
-      Thread thread1 = new DoPuts(hrq,20000,1);
-      Thread thread2 = new DoPuts(hrq,20000,2);
-      Thread thread3 = new DoPuts(hrq,20000,3);
-      Thread thread4 = new DoPuts(hrq,20000,4);
-      Thread thread5 = new DoPuts(hrq,20000,5);
-      
-      thread1.start();
-      thread2.start();
-      thread3.start();
-      thread4.start();
-      thread5.start();
-      
-      WaitCriterion ev = new WaitCriterion() {
-        public boolean done() {
-          return hrq.region.size() == 20000;
-        }
-        public String description() {
-          return null;
-        }
-      };
-      Wait.waitForCriterion(ev, 30 * 1000, 200, true);
-      
-      assertTrue(thread1.isAlive());
-      assertTrue(thread2.isAlive());
-      assertTrue(thread3.isAlive());
-      assertTrue(thread4.isAlive());
-      assertTrue(thread5.isAlive());
-      
-      assertTrue(hrq.region.size()==20000);
-      
-      quitForLoop = true;
-      Thread.sleep(20000);
-      
-      thread1.interrupt();
-      thread2.interrupt();
-      thread3.interrupt();
-      thread4.interrupt();
-      thread5.interrupt();
-      
-      Thread.sleep(2000);
-      
-      ThreadUtils.join(thread1, 5 * 60 * 1000);
-      ThreadUtils.join(thread2, 5 * 60 * 1000);
-      ThreadUtils.join(thread3, 5 * 60 * 1000);
-      ThreadUtils.join(thread4, 5 * 60 * 1000);
-      ThreadUtils.join(thread5, 5 * 60 * 1000);
-      
-      cache.close();
-    }
-    catch (Exception e) {
-      fail(" Test encountered an exception "+e);
-    }
+  public void testConcurrentPutsNotExceedingLimit() throws Exception {
+    exceptionOccured = false;
+    quitForLoop = false;
+    HARegionQueueAttributes harqa = new HARegionQueueAttributes();
+    harqa.setBlockingQueueCapacity(10000);
+    final HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
+        "BlockingHARegionJUnitTest_Region", cache, harqa,
+        HARegionQueue.BLOCKING_HA_QUEUE, false);
+    hrq.setPrimary(true);//fix for 40314 - capacity constraint is checked for primary only.
+    Thread thread1 = new DoPuts(hrq,20000,1);
+    Thread thread2 = new DoPuts(hrq,20000,2);
+    Thread thread3 = new DoPuts(hrq,20000,3);
+    Thread thread4 = new DoPuts(hrq,20000,4);
+    Thread thread5 = new DoPuts(hrq,20000,5);
+
+    thread1.start();
+    thread2.start();
+    thread3.start();
+    thread4.start();
+    thread5.start();
+
+    WaitCriterion ev = new WaitCriterion() {
+      public boolean done() {
+        return hrq.region.size() == 20000;
+      }
+      public String description() {
+        return null;
+      }
+    };
+    Wait.waitForCriterion(ev, 30 * 1000, 200, true);
+
+    assertTrue(thread1.isAlive());
+    assertTrue(thread2.isAlive());
+    assertTrue(thread3.isAlive());
+    assertTrue(thread4.isAlive());
+    assertTrue(thread5.isAlive());
+
+    assertTrue(hrq.region.size()==20000);
+
+    quitForLoop = true;
+    Thread.sleep(20000);
+
+    thread1.interrupt();
+    thread2.interrupt();
+    thread3.interrupt();
+    thread4.interrupt();
+    thread5.interrupt();
+
+    Thread.sleep(2000);
+
+    ThreadUtils.join(thread1, 5 * 60 * 1000);
+    ThreadUtils.join(thread2, 5 * 60 * 1000);
+    ThreadUtils.join(thread3, 5 * 60 * 1000);
+    ThreadUtils.join(thread4, 5 * 60 * 1000);
+    ThreadUtils.join(thread5, 5 * 60 * 1000);
+
+    cache.close();
   }
   
   /**
@@ -241,95 +226,87 @@ public class BlockingHARegionJUnitTest
    * put simultaneously. They will reach a state where the queue is full and they will all
    * go in a wait state. the region size would be verified to be 20000 (10000 puts and 10000 DACE objects).
    * then the threads are interrupted and made to quit the loop
-   *
-   *TODO:
-   *
    */
-  public void _testConcurrentPutsTakesNotExceedingLimit()
-  {
-    try {
-      exceptionOccured = false;
-      quitForLoop = false;
-      HARegionQueueAttributes harqa = new HARegionQueueAttributes();
-      harqa.setBlockingQueueCapacity(10000);
-      final HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
-          "BlockingHARegionJUnitTest_Region", cache, harqa,
-          HARegionQueue.BLOCKING_HA_QUEUE, false);
-      Thread thread1 = new DoPuts(hrq,40000,1);
-      Thread thread2 = new DoPuts(hrq,40000,2);
-      Thread thread3 = new DoPuts(hrq,40000,3);
-      Thread thread4 = new DoPuts(hrq,40000,4);
-      Thread thread5 = new DoPuts(hrq,40000,5);
-      
-      Thread thread6 = new DoTake(hrq,5000);
-      Thread thread7 = new DoTake(hrq,5000);
-      Thread thread8 = new DoTake(hrq,5000);
-      Thread thread9 = new DoTake(hrq,5000);
-      Thread thread10 = new DoTake(hrq,5000);
-      
-      thread1.start();
-      thread2.start();
-      thread3.start();
-      thread4.start();
-      thread5.start();
-      
-      thread6.start();
-      thread7.start();
-      thread8.start();
-      thread9.start();
-      thread10.start();
-      
-      ThreadUtils.join(thread6, 30 * 1000);
-      ThreadUtils.join(thread7, 30 * 1000);
-      ThreadUtils.join(thread8, 30 * 1000);
-      ThreadUtils.join(thread9, 30 * 1000);
-      ThreadUtils.join(thread10, 30 * 1000);
-      
-      WaitCriterion ev = new WaitCriterion() {
-        public boolean done() {
-          return hrq.region.size() == 20000;  
-        }
-        public String description() {
-          return null;
-        }
-      };
-      Wait.waitForCriterion(ev, 30 * 1000, 200, true);
-      
-      assertTrue(thread1.isAlive());
-      assertTrue(thread2.isAlive());
-      assertTrue(thread3.isAlive());
-      assertTrue(thread4.isAlive());
-      assertTrue(thread5.isAlive());
-      
-      assertTrue(hrq.region.size()==20000);
-      
-      quitForLoop = true;
-      
-      Thread.sleep(2000);
-      
-      thread1.interrupt();
-      thread2.interrupt();
-      thread3.interrupt();
-      thread4.interrupt();
-      thread5.interrupt();
-      
-      Thread.sleep(2000);
-      
-      
-      ThreadUtils.join(thread1, 30 * 1000);
-      ThreadUtils.join(thread2, 30 * 1000);
-      ThreadUtils.join(thread3, 30 * 1000);
-      ThreadUtils.join(thread4, 30 * 1000);
-      ThreadUtils.join(thread5, 30 * 1000);
-      
-      cache.close();
-    }
-    catch (Exception e) {
-      fail(" Test encountered an exception "+e);
-    }
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testConcurrentPutsTakesNotExceedingLimit() throws Exception {
+    exceptionOccured = false;
+    quitForLoop = false;
+    HARegionQueueAttributes harqa = new HARegionQueueAttributes();
+    harqa.setBlockingQueueCapacity(10000);
+    final HARegionQueue hrq = HARegionQueue.getHARegionQueueInstance(
+        "BlockingHARegionJUnitTest_Region", cache, harqa,
+        HARegionQueue.BLOCKING_HA_QUEUE, false);
+    Thread thread1 = new DoPuts(hrq,40000,1);
+    Thread thread2 = new DoPuts(hrq,40000,2);
+    Thread thread3 = new DoPuts(hrq,40000,3);
+    Thread thread4 = new DoPuts(hrq,40000,4);
+    Thread thread5 = new DoPuts(hrq,40000,5);
+
+    Thread thread6 = new DoTake(hrq,5000);
+    Thread thread7 = new DoTake(hrq,5000);
+    Thread thread8 = new DoTake(hrq,5000);
+    Thread thread9 = new DoTake(hrq,5000);
+    Thread thread10 = new DoTake(hrq,5000);
+
+    thread1.start();
+    thread2.start();
+    thread3.start();
+    thread4.start();
+    thread5.start();
+
+    thread6.start();
+    thread7.start();
+    thread8.start();
+    thread9.start();
+    thread10.start();
+
+    ThreadUtils.join(thread6, 30 * 1000);
+    ThreadUtils.join(thread7, 30 * 1000);
+    ThreadUtils.join(thread8, 30 * 1000);
+    ThreadUtils.join(thread9, 30 * 1000);
+    ThreadUtils.join(thread10, 30 * 1000);
+
+    WaitCriterion ev = new WaitCriterion() {
+      public boolean done() {
+        return hrq.region.size() == 20000;
+      }
+      public String description() {
+        return null;
+      }
+    };
+    Wait.waitForCriterion(ev, 30 * 1000, 200, true);
+
+    assertTrue(thread1.isAlive());
+    assertTrue(thread2.isAlive());
+    assertTrue(thread3.isAlive());
+    assertTrue(thread4.isAlive());
+    assertTrue(thread5.isAlive());
+
+    assertTrue(hrq.region.size()==20000);
+
+    quitForLoop = true;
+
+    Thread.sleep(2000);
+
+    thread1.interrupt();
+    thread2.interrupt();
+    thread3.interrupt();
+    thread4.interrupt();
+    thread5.interrupt();
+
+    Thread.sleep(2000);
+
+
+    ThreadUtils.join(thread1, 30 * 1000);
+    ThreadUtils.join(thread2, 30 * 1000);
+    ThreadUtils.join(thread3, 30 * 1000);
+    ThreadUtils.join(thread4, 30 * 1000);
+    ThreadUtils.join(thread5, 30 * 1000);
+
+    cache.close();
   }
-  
-  
+
   /**
    * Tests the bug in HARegionQueue where the take side put permit is not being
    * incremented   when the event arriving at the queue which has optimistically
@@ -337,11 +314,9 @@ public class BlockingHARegionJUnitTest
    * has a sequence ID less than the last dispatched sequence ID. This event is
    * rightly rejected from entering the queue but the take permit also needs to
    * increase & a notify issued  
-   * 
-   */  
+   */
   @Test
-  public void testHARQMaxCapacity_Bug37627()
-  {
+  public void testHARQMaxCapacity_Bug37627() throws Exception {
     try {
       exceptionOccured = false;
       quitForLoop = false;
@@ -379,50 +354,39 @@ public class BlockingHARegionJUnitTest
         fail(" Test failed due to " + exceptionString);
       }
     }
-    catch (Exception e) {
-      fail(" Test failed due to " + e);
-    }
     finally {
       if (cache != null) {
         cache.close();
       }
     }
-
   }
   
-  
-
-  /** boolean to record an exception occurence in another thread**/
-  static volatile boolean exceptionOccured = false;
-/** StringBuffer to store the exception**/
-  static StringBuffer exceptionString = new StringBuffer();
-  /** boolen to quit the for loop**/
-  static volatile boolean quitForLoop = false;
-
   /**
    * class which does specified number of puts on the queue
-   *
    */
-  static class DoPuts extends Thread
-  {
+  private static class DoPuts extends Thread {
+
     HARegionQueue regionQueue = null;
     final int numberOfPuts;
+
     DoPuts(HARegionQueue haRegionQueue, int numberOfPuts) {
       this.regionQueue = haRegionQueue;
       this.numberOfPuts = numberOfPuts;
     }
-/**
- * region id can be specified to generate Thread unique events
- */
+
+    /**
+     * region id can be specified to generate Thread unique events
+     */
     int regionId = 0;
+
     DoPuts(HARegionQueue haRegionQueue, int numberOfPuts, int regionId) {
       this.regionQueue = haRegionQueue;
       this.numberOfPuts = numberOfPuts;
       this.regionId = regionId;
     }
-    
-    public void run()
-    {
+
+    @Override
+    public void run() {
       for (int i = 0; i < numberOfPuts; i++) {
         try {
           this.regionQueue.put(new ConflatableObject("" + i, "" + i,
@@ -445,10 +409,9 @@ public class BlockingHARegionJUnitTest
 
   /**
    * class which does a specified number of takes
-   *
    */
-  static class DoTake extends Thread
-  {
+  private static class DoTake extends Thread {
+
     final HARegionQueue regionQueue;
     final int numberOfTakes;
 
@@ -457,8 +420,8 @@ public class BlockingHARegionJUnitTest
       this.numberOfTakes = numberOfTakes;
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       for (int i = 0; i < numberOfTakes; i++) {
         try {
           assertNotNull(this.regionQueue.take());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
index a48b949..4f76c7a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
@@ -16,7 +16,22 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.CacheTestCase;
@@ -24,13 +39,13 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.Assert;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is a bug test for 36853 (Expiry logic in HA is used to expire early data
@@ -44,29 +59,27 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * is set for delayed start. This will make some of the events in the queue
  * expire before dispatcher can start picking them up for delivery to the
  * client.
- * 
- * 
  */
-public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
-{
+@Category(DistributedTest.class)
+public class Bug36853EventsExpiryDUnitTest extends JUnit4CacheTestCase {
 
   /** Cache-server */
-  VM server = null;
+  private VM server = null;
 
   /** Client , connected to Cache-server */
-  VM client = null;
+  private VM client = null;
 
   /** Name of the test region */
-  private static final String REGION_NAME = "Bug36853EventsExpiryDUnitTest_region";
+  private static final String REGION_NAME = Bug36853EventsExpiryDUnitTest.class.getSimpleName() + "_region";
 
   /** The cache instance for test cases */
-  protected static Cache cache = null;
+  private static Cache cache = null;
 
   /** Boolean to indicate the client to proceed for validation */
-  protected static volatile boolean proceedForValidation = false;
+  private static volatile boolean proceedForValidation = false;
 
   /** Counter to indicate number of puts recieved by client */
-  protected static volatile int putsRecievedByClient;
+  private static volatile int putsRecievedByClient;
 
   /** The last key for operations, to notify for proceeding to validation */
   private static final String LAST_KEY = "LAST_KEY";
@@ -77,21 +90,6 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
   /** Number of puts done for the test */
   private static final int TOTAL_PUTS = 5;
 
-  /**
-   * Constructor
-   * 
-   * @param name
-   */
-  public Bug36853EventsExpiryDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
-   * Sets up the cache-server and client for the test
-   * 
-   * @throws Exception -
-   *           thrown in any problem occurs in setUp
-   */
   @Override
   public final void preSetUp() throws Exception {
     disconnectAllFromDS();
@@ -126,12 +124,12 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
   /**
    * Creates cache and starts the bridge-server
    */
-  public static Integer createServerCache() throws Exception
+  private static Integer createServerCache() throws Exception
   {
     System.setProperty(HARegionQueue.REGION_ENTRY_EXPIRY_TIME, "1");
     System.setProperty("slowStartTimeForTesting", String
         .valueOf(DISPATCHER_SLOWSTART_TIME));
-    new Bug36853EventsExpiryDUnitTest("temp").createCache(new Properties());
+    new Bug36853EventsExpiryDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -156,12 +154,12 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    * @throws Exception -
    *           thrown if any problem occurs in setting up the client
    */
-  public static void createClientCache(String hostName, Integer port)
+  private static void createClientCache(String hostName, Integer port)
     throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new Bug36853EventsExpiryDUnitTest("temp").createCache(props);
+    new Bug36853EventsExpiryDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     ClientServerTestCase.configureConnectionPool(factory, hostName, port.intValue(),-1, true, -1, 2, null);
@@ -203,7 +201,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    * @throws Exception -
    *           thrown if any problem occurs in put operation
    */
-  public static void generateEvents() throws Exception
+  private static void generateEvents() throws Exception
   {
     String regionName = Region.SEPARATOR + REGION_NAME;
     Region region = cache.getRegion(regionName);
@@ -230,6 +228,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    * @throws Exception -
    *           thrown if any exception occurs in test
    */
+  @Test
   public void testEventsExpiryBug() throws Exception
   {
     IgnoredException.addIgnoredException("Unexpected IOException");
@@ -242,7 +241,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    * Waits for the listener to receive all events and validates that no
    * exception occured in client
    */
-  public static void validateEventCountAtClient() throws Exception
+  private static void validateEventCountAtClient() throws Exception
   {
     if (!proceedForValidation) {
       synchronized (Bug36853EventsExpiryDUnitTest.class) {
@@ -258,7 +257,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
       }
     }
     LogWriterUtils.getLogWriter().info("Starting validation on client2");
-    Assert.assertEquals(
+    assertEquals(
         "Puts recieved by client not equal to the puts done at server.",
         TOTAL_PUTS, putsRecievedByClient);
     LogWriterUtils.getLogWriter()
@@ -271,7 +270,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    * Closes the cache
    * 
    */
-  public static void unSetExpiryTimeAndCloseCache()
+  private static void unSetExpiryTimeAndCloseCache()
   {    
     System.clearProperty(HARegionQueue.REGION_ENTRY_EXPIRY_TIME);
     CacheTestCase.closeCache();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
index 15094bb..70bd8b4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
@@ -17,8 +17,20 @@
 package com.gemstone.gemfire.internal.cache.ha;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import com.gemstone.gemfire.cache.*;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -30,31 +42,28 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public class Bug48571DUnitTest extends DistributedTestCase {
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class Bug48571DUnitTest extends JUnit4DistributedTestCase {
 
   private static VM server = null;
   private VM client = null;
   private static GemFireCacheImpl cache = null;
   
-  private static final String region = "Bug48571DUnitTest_region";
+  private static final String region = Bug48571DUnitTest.class.getSimpleName() + "_region";
   private static int numOfCreates = 0;
   private static int numOfUpdates = 0;
   private static int numOfInvalidates = 0;
   private static boolean lastKeyReceived = false;
 
-  public Bug48571DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -99,13 +108,13 @@ public class Bug48571DUnitTest extends DistributedTestCase {
       }
       @Override
       public String description() {
-        // TODO Auto-generated method stub
         return "Proxy has not paused yet";
       }
     };
     Wait.waitForCriterion(criterion, 15 * 1000, 200, true);
   }
   
+  @Test
   public void testStatsMatchWithSize() throws Exception {
     IgnoredException.addIgnoredException("Unexpected IOException||Connection reset");
     // start a server
@@ -128,7 +137,6 @@ public class Bug48571DUnitTest extends DistributedTestCase {
     server.invoke(() -> Bug48571DUnitTest.verifyStats());
   }
 
-
   public static int createServerCache() throws Exception {
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
@@ -139,7 +147,7 @@ public class Bug48571DUnitTest extends DistributedTestCase {
     props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
     CacheFactory cf = new CacheFactory(props);
 
-    DistributedSystem ds = new Bug48571DUnitTest("Bug48571DUnitTest").getSystem(props);
+    DistributedSystem ds = new Bug48571DUnitTest().getSystem(props);
     ds.disconnect();
 
     cache = (GemFireCacheImpl)cf.create();
@@ -178,7 +186,7 @@ public class Bug48571DUnitTest extends DistributedTestCase {
     ccf.setPoolSubscriptionRedundancy(0);
     ccf.addPoolServer(host.getHostName(), port);
 
-    DistributedSystem ds = new Bug48571DUnitTest("Bug48571DUnitTest").getSystem(props);
+    DistributedSystem ds = new Bug48571DUnitTest().getSystem(props);
     ds.disconnect();
 
     cache = (GemFireCacheImpl) ccf.create();
@@ -267,7 +275,6 @@ public class Bug48571DUnitTest extends DistributedTestCase {
     Wait.waitForCriterion(wc, 60*1000, 500, true);
   }
 
-
   public static void verifyStats() throws Exception {
     CacheClientNotifier ccn = CacheClientNotifier.getInstance();
     CacheClientProxy ccp = ccn.getClientProxies().iterator().next();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
index c26cc59..2e5feec 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
@@ -17,6 +17,12 @@
 package com.gemstone.gemfire.internal.cache.ha;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -33,14 +39,14 @@ import com.gemstone.gemfire.internal.OSProcess;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class Bug48879DUnitTest extends DistributedTestCase {
+public class Bug48879DUnitTest extends JUnit4DistributedTestCase {
 
   private static VM vm0 = null;
   private static VM vm1 = null;
@@ -51,8 +57,8 @@ public class Bug48879DUnitTest extends DistributedTestCase {
 
   public static final int SLEEP_TIME = 40000;
 
-  public Bug48879DUnitTest(String name) {
-    super(name);
+  public Bug48879DUnitTest() {
+    super();
   }
 
   @Override
@@ -85,9 +91,8 @@ public class Bug48879DUnitTest extends DistributedTestCase {
   }
 
   @SuppressWarnings({ "unused", "deprecation" })
-  public static Integer createCacheServer()
-      throws Exception {
-    Bug48879DUnitTest test = new Bug48879DUnitTest("Bug48879DUnitTest");
+  public static Integer createCacheServer() throws Exception {
+    Bug48879DUnitTest test = new Bug48879DUnitTest();
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "MessageTimeToLive", "30");
     cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
     HARegionQueue.threadIdExpiryTime = (SLEEP_TIME/1000) - 10;
@@ -113,7 +118,7 @@ public class Bug48879DUnitTest extends DistributedTestCase {
         + ".gfs");
     props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
 
-    DistributedSystem ds = new Bug48879DUnitTest("Bug48879DUnitTest").getSystem(props);
+    DistributedSystem ds = new Bug48879DUnitTest().getSystem(props);
     ds.disconnect();
     ClientCacheFactory ccf = new ClientCacheFactory(props);
     ccf.setPoolSubscriptionEnabled(doRI);
@@ -201,6 +206,7 @@ public class Bug48879DUnitTest extends DistributedTestCase {
         actualTids >= expectedTids);
   }
 
+  @Test
   public void testThreadIdentfiersExpiry() throws Exception {
     // create server1 and server2
     // create client with redundancy = 1

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
index 00c488a..9eb0982 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
@@ -16,6 +16,27 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -29,6 +50,12 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.EventIDHolder;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.dunit.*;
 
 import java.util.Iterator;
@@ -49,11 +76,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * sent to server-1 and then to server-2 via p2p and then finally to client-2.
  * It is verified that client-2 recieves the same values for thread-id and
  * sequence-id.
- * 
- * 
  */
-public class EventIdOptimizationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class EventIdOptimizationDUnitTest extends JUnit4DistributedTestCase {
 
   /** Cache-server1 */
   VM server1 = null;
@@ -135,17 +160,6 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
       new EventID(new byte[] { 1, 1 }, ID_VALUE_LONG, ID_VALUE_INT),
       new EventID(new byte[] { 1, 1 }, ID_VALUE_LONG, ID_VALUE_LONG) };
 
-  /** Constructor */
-  public EventIdOptimizationDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
-   * Sets up the cache-servers and clients for the test
-   * 
-   * @throws Exception -
-   *           thrown in any problem occurs in setUp
-   */
   @Override
   public final void postSetUp() throws Exception  {
     disconnectAllFromDS();
@@ -181,7 +195,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
   /** Creates cache and starts the bridge-server */
   public static Integer createServerCache() throws Exception
   {
-    new EventIdOptimizationDUnitTest("temp").createCache(new Properties());
+    new EventIdOptimizationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setMirrorType(MirrorType.KEYS_VALUES);
@@ -215,7 +229,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new EventIdOptimizationDUnitTest("temp").createCache(props);
+    new EventIdOptimizationDUnitTest().createCache(props);
 
     AttributesFactory factory = new AttributesFactory();
     ClientServerTestCase.configureConnectionPool(factory, hostName, port.intValue(),-1, true, -1, 2, null);
@@ -238,7 +252,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new EventIdOptimizationDUnitTest("temp").createCache(props);
+    new EventIdOptimizationDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     ClientServerTestCase.configureConnectionPool(factory, hostName, port.intValue(),-1, true, -1, 2, null);
     
@@ -368,6 +382,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
    * @throws Exception -
    *           thrown if any exception occurs in test
    */
+  @Test
   public void testEventIdOptimizationByPutOperation() throws Exception
   {
     client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByPutOperation());
@@ -383,6 +398,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
    * @throws Exception -
    *           thrown if any exception occurs in test
    */
+  @Test
   public void testEventIdOptimizationByDestroyEntryOperation() throws Exception
   {
     client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByDestroyEntryOperation());
@@ -397,6 +413,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
    * @throws Exception -
    *           thrown if any exception occurs in test
    */
+  @Test
   public void testEventIdOptimizationByDestroyRegionOperation()
       throws Exception
   {
@@ -412,6 +429,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
    * @throws Exception -
    *           thrown if any exception occurs in test
    */
+  @Test
   public void testEventIdOptimizationByClearRegionOperation() throws Exception
   {
     client1.invoke(() -> EventIdOptimizationDUnitTest.generateEventsByClearRegionOperation());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
index 300ad4b..9e59ba7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
@@ -16,7 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -28,24 +44,23 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
- *  Dunit test to verify HA feature. Have 2 nodes S1 & S2. Client is connected to S1 & S2 with S1 as the primary end point.
- *  Do some puts on S1 .The expiry is on high side. Stop S1 , the client is failing to S2.During fail over duration do some
- *  puts on S1. The client on failing to S2 may receive duplicate events but should not miss any events.
- *
- *
+ * Dunit test to verify HA feature. Have 2 nodes S1 & S2. Client is connected to S1 & S2 with S1 as the primary end point.
+ * Do some puts on S1 .The expiry is on high side. Stop S1 , the client is failing to S2.During fail over duration do some
+ * puts on S1. The client on failing to S2 may receive duplicate events but should not miss any events.
  */
-public class FailoverDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class FailoverDUnitTest extends JUnit4DistributedTestCase {
+
   protected static Cache cache = null;
   //server
   private static VM vm0 = null;
@@ -57,11 +72,6 @@ public class FailoverDUnitTest extends DistributedTestCase
 
   private static final String regionName = "interestRegion";
 
-  /** constructor */
-  public FailoverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -88,6 +98,7 @@ public class FailoverDUnitTest extends DistributedTestCase
     }
   }
 
+  @Test
   public void testFailover()
   {
     createEntries();
@@ -117,19 +128,8 @@ public class FailoverDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new FailoverDUnitTest("temp").createCache(props);
-
-    /*props.setProperty("retryAttempts", "5");
-    props.setProperty("endpoints", "ep1=" + hostName + ":"+PORT1+",ep2="
-        + hostName + ":"+PORT2);
-    props.setProperty("redundancyLevel", "-1");
-    props.setProperty("establishCallbackConnection", "true");
-    props.setProperty("LBPolicy", "RoundRobin");
-    props.setProperty("readTimeout", "250");
-    props.setProperty("socketBufferSize", "32768");
-    props.setProperty("retryInterval", "1000");
-    props.setProperty("connectionsPerServer", "2");
-*/
+    new FailoverDUnitTest().createCache(props);
+
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     ClientServerTestCase.configureConnectionPoolWithName(factory, hostName, new int[] {PORT1,PORT2}, true, -1, 2, null, "FailoverPool");
@@ -147,7 +147,7 @@ public class FailoverDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new FailoverDUnitTest("temp").createCache(new Properties());
+    new FailoverDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -217,7 +217,6 @@ public class FailoverDUnitTest extends DistributedTestCase
     }
   }
 
-
   public static void stopServer()
   {
     try {
@@ -228,7 +227,7 @@ public class FailoverDUnitTest extends DistributedTestCase
       }
     }
     catch (Exception e) {
-      fail("failed while stopServer()" + e);
+      fail("failed while stopServer()", e);
     }
   }
 
@@ -275,7 +274,7 @@ public class FailoverDUnitTest extends DistributedTestCase
           PoolImpl.BEFORE_PRIMARY_IDENTIFICATION_FROM_BACKUP_CALLBACK_FLAG = false;
         }
     });
-}
+  }
 
   public static void putDuringFailover()
   {
@@ -308,7 +307,6 @@ public class FailoverDUnitTest extends DistributedTestCase
     assertEquals("value-4", r.getEntry("key-4").getValue());
   }
 
-
   @Override
   public final void preTearDown() throws Exception {
     // close the clients first

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
index ecce913..c16d7a0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
@@ -16,52 +16,53 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This Dunit test is to verify the bug in put() operation. When the put is invoked on the server
  * and NotifyBySubscription is false then it follows normal path and then again calls put of region
- * on which regionqueue is based. so recurssion is happening.
- *
+ * on which region queue is based. so recurssion is happening.
  */
+@Category(DistributedTest.class)
+public class HABugInPutDUnitTest extends JUnit4DistributedTestCase {
 
-public class HABugInPutDUnitTest extends DistributedTestCase
-{
-
-  VM server1 = null;
+  private static final String REGION_NAME = HABugInPutDUnitTest.class.getSimpleName() + "_region";
 
-  VM server2 = null;
-
-  VM client1 = null;
-
-  VM client2 = null;
-
-  private static final String REGION_NAME = "HABugInPutDUnitTest_region";
+  private VM server1 = null;
+  private VM server2 = null;
+  private VM client1 = null;
+  private VM client2 = null;
 
   final static String KEY1 = "KEY1";
-
   final static String VALUE1 = "VALUE1";
 
   protected static Cache cache = null;
 
-  public HABugInPutDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
 	  final Host host = Host.getHost(0);
@@ -118,7 +119,7 @@ public class HABugInPutDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new HABugInPutDUnitTest("temp").createCache(new Properties());
+    new HABugInPutDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -141,7 +142,7 @@ public class HABugInPutDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HABugInPutDUnitTest("temp").createCache(props);
+    new HABugInPutDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1,PORT2}, true, -1, 2, null);
@@ -150,9 +151,9 @@ public class HABugInPutDUnitTest extends DistributedTestCase
     Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(region);
     region.registerInterest(KEY1);
-
   }
 
+  @Test
   public void testBugInPut() throws Exception
   {
     client1.invoke(new CacheSerializableRunnable("putFromClient1") {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
index 2235ca2..4c42a36 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
@@ -16,7 +16,24 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@ -27,22 +44,19 @@ import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is the Dunit test to verify clear and destroyRegion operation in
  * Client-Server configuration.
- *
- *
  */
-
-public class HAClearDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HAClearDUnitTest extends JUnit4DistributedTestCase {
 
   static VM server1 = null;
 
@@ -70,10 +84,6 @@ public class HAClearDUnitTest extends DistributedTestCase
 
   static boolean gotDestroyRegionCallback = false;
 
-  public HAClearDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -100,12 +110,14 @@ public class HAClearDUnitTest extends DistributedTestCase
     closeCache();
   }
 
-  /* The test perorms following operations
+  /**
+   * The test perorms following operations
    * 1. Create 2 servers and 3 client
    * 2. Perform put operations for knows set of keys directy from the client1.
    * 3. Perform clear operation from client1
    * 4. verify the result of operation for other clients and other servers.
    */
+  @Test
   public void testClearWithOperationFromClient() throws Exception
   {
     createClientServerConfigurationForClearTest();
@@ -171,12 +183,14 @@ public class HAClearDUnitTest extends DistributedTestCase
     server2.invoke(checkSizeRegion(regionSize));
   }
 
-  /* The test perorms following operations
+  /**
+   * The test performs following operations
    * 1. Create 2 servers and 3 clients
    * 2. Perform put operations for known set of keys directy from the server1.
    * 3. Perform clear operation from server1
    * 4. verify the result of operation for other clients and other servers.
    */
+  @Test
   public void testClearWithOperationFromServer() throws Exception
   {
     createClientServerConfigurationForClearTest();
@@ -260,12 +274,14 @@ public class HAClearDUnitTest extends DistributedTestCase
   }
 
 
-  /* The test perorms following operations
+  /**
+   * The test performs following operations
    * 1. Create 2 servers and 3 client
    * 2. Perform put operations for knows set of keys directy from the client1.
    * 3. Perform destroyRegion operation from client1
    * 4. verify the result of operation for other clients and other servers.
    */
+  @Test
   public void testDestroyRegionWithOperationFromClient() throws Exception
   {
     createClientServerConfigurationForClearTest();
@@ -334,12 +350,14 @@ public class HAClearDUnitTest extends DistributedTestCase
   }
 
 
-  /* The test perorms following operations
+  /**
+   * The test performs following operations
    * 1. Create 2 servers and 3 clients
    * 2. Perform put operations for known set of keys directy from the server1.
    * 3. Perform destroyRegion operation from server1
    * 4. verify the result of operation for other clients and other servers.
    */
+  @Test
   public void testDestroyRegionWithOperationFromServer() throws Exception
   {
     createClientServerConfigurationForClearTest();
@@ -556,7 +574,7 @@ public class HAClearDUnitTest extends DistributedTestCase
   public static Integer createServerCache()
       throws Exception
   {
-    new HAClearDUnitTest("temp").createCache(new Properties());
+    new HAClearDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -590,7 +608,7 @@ public class HAClearDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAClearDUnitTest("temp").createCache(props);
+    new HAClearDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1,PORT2}, true, -1, 2, null);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
index 33b84d9..dca557c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
@@ -16,20 +16,37 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is Targetted conflation Dunit test.
@@ -42,12 +59,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *  3) Do create , then update, update, invalidate. The client should receive 3 callbacks, one for create one for the last update
  *     and one for the invalidate.
  *  4) Do a create , update , update & destroy. The client should receive 3 callbacks ( craete , conflated update & destroy).
- *
- *
  */
-
-public class HAConflationDUnitTest extends CacheTestCase
-{
+@Category(DistributedTest.class)
+public class HAConflationDUnitTest extends JUnit4CacheTestCase {
 
   VM server1 = null;
 
@@ -55,19 +69,19 @@ public class HAConflationDUnitTest extends CacheTestCase
 
   private static final String regionName = "HAConflationDUnitTest_region";
 
-  final static String KEY1 = "KEY1";
+  static final String KEY1 = "KEY1";
 
-  final static String KEY2 = "KEY2";
+  static final String KEY2 = "KEY2";
 
-  final static String KEY3 = "KEY3";
+  static final String KEY3 = "KEY3";
 
-  final static String VALUE1 = "VALUE1";
+  static final String VALUE1 = "VALUE1";
 
-  final static String VALUE2 = "VALUE2";
+  static final String VALUE2 = "VALUE2";
 
-  final static String VALUE3 = "VALUE3";
+  static final String VALUE3 = "VALUE3";
 
-  final static String LAST_KEY = "lastkey";
+  static final String LAST_KEY = "lastkey";
 
   static final String LAST_VALUE = "lastvalue";
 
@@ -79,8 +93,8 @@ public class HAConflationDUnitTest extends CacheTestCase
 
   static int actualNoEvents = 0;
 
-  public HAConflationDUnitTest(String name) {
-    super(name);
+  public HAConflationDUnitTest() {
+    super();
   }
 
   @Override
@@ -119,6 +133,7 @@ public class HAConflationDUnitTest extends CacheTestCase
    * @throws Exception
    */
 
+  @Test
   public void testConflationCreateUpdate() throws Exception
   {
     server1.invoke(putFromServer(KEY1, VALUE1));
@@ -134,6 +149,7 @@ public class HAConflationDUnitTest extends CacheTestCase
    * The client should receive 2 callbacks , one for create & one for the last update.
    * @throws Exception
    */
+  @Test
   public void testConflationUpdate() throws Exception
   {
 
@@ -158,6 +174,7 @@ public class HAConflationDUnitTest extends CacheTestCase
    * and one for the invalidate.
    * @throws Exception
    */
+  @Test
   public void testConflationCreateUpdateInvalidate() throws Exception
   {
 
@@ -176,6 +193,7 @@ public class HAConflationDUnitTest extends CacheTestCase
    * The client should receive 3 callbacks ( craete , conflated update & destroy).
    * @throws Exception
    */
+  @Test
   public void testConflationCreateUpdateDestroy() throws Exception
   {
 
@@ -297,7 +315,7 @@ public class HAConflationDUnitTest extends CacheTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAConflationDUnitTest("temp").createCache(props);
+    new HAConflationDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     ClientServerTestCase.configureConnectionPool(factory, host, new int[] { PORT1 }, true, -1, -1, null);
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -323,7 +341,7 @@ public class HAConflationDUnitTest extends CacheTestCase
   public static Integer createServerCache(Boolean isListenerPresent)
       throws Exception
   {
-    new HAConflationDUnitTest("temp").createCache(new Properties());
+    new HAConflationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableConflation(true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
index b6100b3..54f18cd 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
@@ -16,21 +16,40 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is the Dunit test to verify the duplicates after the fail over
@@ -39,12 +58,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * 2. Perform put operations for knows set of keys directy from the server1.
  * 3. Stop the server1 so that fail over happens
  * 4. Validate the duplicates received by the client1
- *
- *
  */
-
-public class HADuplicateDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HADuplicateDUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -72,10 +88,6 @@ public class HADuplicateDUnitTest extends DistributedTestCase
 
   static Map storeEvents = new HashMap();
 
-  public HADuplicateDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -98,8 +110,9 @@ public class HADuplicateDUnitTest extends DistributedTestCase
     server2.invoke(() -> HADuplicateDUnitTest.closeCache());
   }
 
-  public void _testDuplicate() throws Exception
-  {
+  @Ignore("TODO")
+  @Test
+  public void testDuplicate() throws Exception {
     createClientServerConfiguration();
     server1.invoke(putForKnownKeys());
     server1.invoke(stopServer());
@@ -138,10 +151,9 @@ public class HADuplicateDUnitTest extends DistributedTestCase
     server1.invoke(() -> HADuplicateDUnitTest.reSetQRMslow());
   }
 
-
+  @Test
   public void testSample() throws Exception
   {
-
     IgnoredException.addIgnoredException("IOException");
     IgnoredException.addIgnoredException("Connection reset");
     createClientServerConfiguration();
@@ -155,10 +167,8 @@ public class HADuplicateDUnitTest extends DistributedTestCase
 
     }
     });
-
   }
 
-
   // function to perform put operations for the known set of keys.
   private CacheSerializableRunnable putForKnownKeys()
   {
@@ -196,8 +206,6 @@ public class HADuplicateDUnitTest extends DistributedTestCase
     return stopserver;
   }
 
-
-
   // function to create 2servers and 1 clients
   private void createClientServerConfiguration()
   {
@@ -222,7 +230,7 @@ public class HADuplicateDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new HADuplicateDUnitTest("temp").createCache(new Properties());
+    new HADuplicateDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -255,7 +263,7 @@ public class HADuplicateDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HADuplicateDUnitTest("temp").createCache(props);
+    new HADuplicateDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1,PORT2}, true, -1, 2, null);
     
@@ -278,9 +286,10 @@ public class HADuplicateDUnitTest extends DistributedTestCase
       cache.getDistributedSystem().disconnect();
     }
   }
-
 }
 
+// TODO: move these classes to be inner static classes
+
 // Listener class for the validation purpose
 class HAValidateDuplicateListener extends CacheListenerAdapter
 {
@@ -288,7 +297,6 @@ class HAValidateDuplicateListener extends CacheListenerAdapter
   {
     System.out.println("After Create");
     HADuplicateDUnitTest.storeEvents.put(event.getKey(), event.getNewValue());
-
   }
 
   public void afterUpdate(EntryEvent event)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
index a5e9b41..d45e66e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
@@ -16,7 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
@@ -30,25 +53,23 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.RegionEventImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
  * Test to verify correct propagation of EventID from server to client
  *
  * @since GemFire 5.1
  */
-
-public class HAEventIdPropagationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HAEventIdPropagationDUnitTest extends JUnit4DistributedTestCase {
 
   /** server VM * */
   VM server1 = null;
@@ -57,7 +78,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   VM client1 = null;
 
   /** region name* */
-  private static final String REGION_NAME = "HAEventIdPropagationDUnitTest_Region";
+  private static final String REGION_NAME = HAEventIdPropagationDUnitTest.class.getSimpleName() + "_Region";
 
   /** cache * */
   private static Cache cache = null;
@@ -65,11 +86,6 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   /** server * */
   static CacheServerImpl server = null;
 
-  /** test constructor * */
-  public HAEventIdPropagationDUnitTest(String name) {
-    super(name);
-  }
-
   /** get the hosts and the VMs * */
   @Override
   public final void postSetUp() throws Exception {
@@ -114,7 +130,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   /** create the server * */
   public static Integer createServerCache() throws Exception
   {
-    new HAEventIdPropagationDUnitTest("temp").createCache(new Properties());
+    new HAEventIdPropagationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
@@ -151,7 +167,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAEventIdPropagationDUnitTest("temp").createCache(props);
+    new HAEventIdPropagationDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     PoolImpl pi = (PoolImpl)ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1}, true, -1, 2, null);
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -177,7 +193,6 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
     }
   }
 
-
   /**
    * function to assert that the ThreadIdtoSequence id Map is not Null but is
    * empty *
@@ -202,7 +217,6 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       LogWriterUtils.getLogWriter().info("assertThreadIdToSequenceIdMapisNotNullButEmpty: map size is " + map.size());
       assertTrue(map.size() == 1);
     }
-
   }
 
   /**
@@ -293,9 +307,8 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
    * server 5) asserts that the ThreadIdToSequenceIdMap is not null and has one
    * entry (on the client side) and returns the eventId stored in the map 6)
    * verifies the equality of the two event ids
-   *
-   * @throws Exception
    */
+  @Test
   public void testEventIDPropagation() throws Exception
   {
     try {
@@ -353,7 +366,6 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
         }
       }
 
-
       client1.invoke(() -> HAEventIdPropagationDUnitTest.setReceivedOperationToFalse());
       eventId1 = server1.invoke(() -> HAEventIdPropagationDUnitTest.removePUTALL_KEY1());
       assertNotNull(eventId1);
@@ -385,6 +397,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   }
 
 
+  @Test
   public void testEventIDPropagationForClear() throws Exception
   {
     createClientServerConfiguration();
@@ -400,12 +413,11 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
     if (!eventId1.equals(eventId2)) {
       fail("Test failed as the clear eventIds are not equal");
     }
-
   }
 
-
-  public void _testEventIDPropagationForDestroyRegion() throws Exception
-  {
+  @Ignore("TODO: test is disabled but passes when run")
+  @Test
+  public void testEventIDPropagationForDestroyRegion() throws Exception {
     createClientServerConfiguration();
     client1.invoke(() -> HAEventIdPropagationDUnitTest.setReceivedOperationToFalse());
     Object eventId1 = server1.invoke(() -> HAEventIdPropagationDUnitTest.destroyRegion());
@@ -418,8 +430,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
     if (!eventId1.equals(eventId2)) {
       fail("Test failed as the eventIds are not equal");
     }
- }
-
+  }
 
   public static void setReceivedOperationToFalse()
   {
@@ -440,7 +451,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("put failed due to " + e);
+      fail("put failed due to ", e);
     }
     return null;
   }
@@ -459,7 +470,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("put failed due to " + e);
+      fail("put failed due to ", e);
     }
     return null;
   }
@@ -496,7 +507,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return evids;
     }
     catch (Exception e) {
-      fail("put failed due to " + e);
+      fail("put failed due to ", e);
     }
     return null;
   }
@@ -515,7 +526,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("put failed due to " + e);
+      fail("put failed due to ", e);
     }
     return null;
   }
@@ -534,7 +545,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("put failed due to " + e);
+      fail("put failed due to ", e);
     }
     return null;
   }
@@ -554,7 +565,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("put failed due to " + e);
+      fail("put failed due to ", e);
     }
     return null;
   }
@@ -573,7 +584,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("clear failed due to " + e);
+      fail("clear failed due to ", e);
     }
     return null;
   }
@@ -595,7 +606,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       return eventId;
     }
     catch (Exception e) {
-      fail("Destroy failed due to " + e);
+      fail("Destroy failed due to ", e);
     }
     return null;
   }
@@ -618,7 +629,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
           lockObject.wait(10000);
         }
         catch (InterruptedException e) {
-          fail("interrupted");
+          fail("interrupted", e);
         }
       }
       if (!receivedOperation) {
@@ -631,14 +642,12 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   /**
    * Listener which sends a notification after create to waiting threads and
    * also extracts teh event id storing it in a static variable
-   *
    */
-  static class HAEventIdPropagationListenerForClient extends
-      CacheListenerAdapter
-  {
+  static class HAEventIdPropagationListenerForClient extends CacheListenerAdapter {
 
     private int putAllReceivedCount = 0;
 
+    @Override
     public void afterCreate(EntryEvent event)
     {
       LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
@@ -678,6 +687,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterUpdate(EntryEvent event)
     {
       synchronized (lockObject) {
@@ -686,6 +696,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterInvalidate(EntryEvent event)
     {
       synchronized (lockObject) {
@@ -694,6 +705,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterDestroy(EntryEvent event)
     {
       synchronized (lockObject) {
@@ -702,6 +714,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterRegionDestroy(RegionEvent event)
     {
       synchronized (lockObject) {
@@ -711,6 +724,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterRegionClear(RegionEvent event)
     {
       synchronized (lockObject) {
@@ -724,14 +738,12 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   /**
    * Listener which sends a notification after create to waiting threads and
    * also extracts teh event id storing it in a static variable
-   *
    */
-  static class HAEventIdPropagationListenerForServer extends
-      CacheListenerAdapter
-  {
+  static class HAEventIdPropagationListenerForServer extends CacheListenerAdapter {
 
     private int putAllReceivedCount = 0;
 
+    @Override
     public void afterCreate(EntryEvent event)
     {
       LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
@@ -778,6 +790,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterUpdate(EntryEvent event)
     {
       eventId = ((EntryEventImpl)event).getEventId();
@@ -788,6 +801,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterInvalidate(EntryEvent event)
     {
       eventId = ((EntryEventImpl)event).getEventId();
@@ -798,6 +812,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterDestroy(EntryEvent event)
     {
       eventId = ((EntryEventImpl)event).getEventId();
@@ -808,6 +823,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterRegionDestroy(RegionEvent event)
     {
       LogWriterUtils.getLogWriter().info("Before Regionestroy in Server");
@@ -820,6 +836,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
       LogWriterUtils.getLogWriter().info("After RegionDestroy in Server");
     }
 
+    @Override
     public void afterRegionClear(RegionEvent event)
     {
       eventId = ((RegionEventImpl)event).getEventId();



[04/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
index f306cb9..2b34dbd 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
@@ -17,10 +17,14 @@
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
 
 import java.io.IOException;
 import java.util.HashSet;
 
+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.CacheException;
@@ -43,7 +47,6 @@ import com.gemstone.gemfire.cache.query.Struct;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.test.dunit.Assert;
@@ -53,26 +56,25 @@ import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test class for Partitioned Region and CQs
  * 
  * @since GemFire 5.5
  */
-public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionCqQueryDUnitTest extends JUnit4CacheTestCase {
 
-  public PartitionedRegionCqQueryDUnitTest(String name) {
-    super(name);
-  }
-  
-  static public final String[] regions = new String[] {
+  public static final String[] regions = new String[] {
       "regionA",
       "regionB"
   };
+
+  public static final String KEY = "key-";
   
-  static public final String KEY = "key-";
-  
-  protected final CqQueryDUnitTest cqHelper = new CqQueryDUnitTest("HelperPartitonedRegionCqTest");
+  protected final CqQueryDUnitTest cqHelper = new CqQueryDUnitTest();
   
   public final String[] cqs = new String [] {
       //0 - Test for ">" 
@@ -109,11 +111,11 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   public final String[] cqsWithoutRoot = new String [] {
       //0 - Test for ">" 
       "SELECT ALL * FROM /" + regions[0] + " p where p.ID > 0"
-      
   };
   
   private static int bridgeServerPort;
   
+  @Test
   public void testCQLeakWithPartitionedRegion() throws Exception {
     // creating servers.
     final Host host = Host.getHost(0);
@@ -124,8 +126,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server1);       
     createServer(server2);    
        
-    
-    // create client 
+    // create client
     
     final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
@@ -155,8 +156,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    
-    
+
     int cc1 = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
     int cc2 = server2.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
     assertEquals("Should have one", 1, cc1);
@@ -166,7 +166,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     cqHelper.closeClient(client);
     Wait.pause(10 * 1000);
-    //cc1 = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
     cc2 = server2.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCqCountFromRegionProfile());
     
     //assertIndexDetailsEquals("Should have one", 0, cc1);
@@ -176,6 +175,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     //cqHelper.closeServer(server1);
   }
   
+  @Test
   public void testCQAndPartitionedRegion() throws Exception {
     // creating servers.
     final Host host = Host.getHost(0);
@@ -218,8 +218,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(server1, regions[0], size);
     
@@ -236,16 +234,14 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ (size+size));
     
-    
     // destroy all the values.
     int numDestroys = size;
     cqHelper.deleteValues(server2,regions[0], numDestroys);
     
     cqHelper.waitForDestroyed(client, "testCQEvents_0", KEY+numDestroys);
     
-    // validate cqs after destroyes on server2.
+    // validate cqs after destroys on server2.
  
-        
     cqHelper.validateCQ(client, "testCQEvents_0",
         /* resultSize: */ CqQueryDUnitTest.noTest,
         /* creates: */ size,
@@ -256,30 +252,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ numDestroys,
         /* totalEvents: */ (size+size+numDestroys));
     
-    // invalidate some entries.
-    /*final int numInvalidates = 5;
-    
-    server2.invoke(new CacheSerializableRunnable("Invalidate values") {
-      public void run2() throws CacheException {
-        Region region1 = getRootRegion().getSubregion(regions[0]);
-        for (int i = numInvalidates; i <= (numInvalidates+4); i++) {
-          region1.invalidate(KEY+i);
-        }
-      }
-    });
-     
-    cqHelper.waitForInvalidated(client, "testCQEvents_0", KEY+(numInvalidates+4));
-    */
-   // cqHelper.validateCQ(client, "testCQEvents_0",
-    //    /* resultSize: */ cqHelper.noTest,
-    //    /* creates: */ size,
-    //    /* updates: */ size,
-    //    /* deletes; */ (numDestroys+numInvalidates),
-    //    /* queryInserts: */ size,
-     //   /* queryUpdates: */ size,
-     //   /* queryDeletes: */ (numDestroys+numInvalidates),
-    //    /* totalEvents: */ (size+size+numDestroys + numInvalidates));
-    
     cqHelper.closeClient(client);
     cqHelper.closeServer(server2);
     cqHelper.closeServer(server1);
@@ -288,8 +260,9 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   /**
    * test for registering cqs on a bridge server with local max memory zero.
    */
+  @Test
   public void testPartitionedCqOnAccessorBridgeServer() throws Exception {
- // creating servers.
+    // creating servers.
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
@@ -333,8 +306,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(server1, regions[0], size);
     
@@ -362,9 +333,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
       cqHelper.waitForDestroyed(client, "testCQEvents_0", KEY+i);
     }
     
-    // validate cqs after destroyes on server2.
+    // validate cqs after destroys on server2.
  
-        
     cqHelper.validateCQ(client, "testCQEvents_0",
         /* resultSize: */ CqQueryDUnitTest.noTest,
         /* creates: */ size,
@@ -385,10 +355,10 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
    * will generate all the events locally and should always have the old value 
    * and should not sent the profile update on wire.
    */
+  @Test
   public void testPartitionedCqOnSingleBridgeServer() throws Exception { 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
-//    VM server2 = host.getVM(1);
     VM client = host.getVM(2);
     
     // creating an accessor vm with Bridge Server installed.
@@ -424,8 +394,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(server1, regions[0], size);
     
@@ -444,7 +412,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ (size+size));
     
-    
     // destroy all the values.
     int numDestroys = size;
     cqHelper.deleteValues(server1,regions[0], numDestroys);
@@ -453,9 +420,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
       cqHelper.waitForDestroyed(client, "testCQEvents_0", KEY+i);
     }
     
-    // validate cqs after destroyes on server2.
- 
-        
+    // validate cqs after destroys on server2.
+
     cqHelper.validateCQ(client, "testCQEvents_0",
         /* resultSize: */ CqQueryDUnitTest.noTest,
         /* creates: */ size,
@@ -468,7 +434,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     cqHelper.closeClient(client);
     cqHelper.closeServer(server1);
-    
   }
   
   /**
@@ -476,6 +441,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
    * will generate all the events locally but the puts, updates and destroys originate
    * at an accessor vm.
    */
+  @Test
   public void testPRCqOnSingleBridgeServerUpdatesOriginatingAtAccessor() throws Exception { 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -522,8 +488,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(server1, regions[0], size);
     
@@ -541,8 +505,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryUpdates: */ size,
         /* queryDeletes: */ 0,
         /* totalEvents: */ (size+size));
-    
-    
+
     // destroy all the values.
     int numDestroys = size;
     cqHelper.deleteValues(server1,regions[0], numDestroys);
@@ -551,9 +514,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
       cqHelper.waitForDestroyed(client, "testCQEvents_0", KEY+i);
     }
     
-    // validate cqs after destroyes on server2.
- 
-        
+    // validate cqs after destroys on server2.
+
     cqHelper.validateCQ(client, "testCQEvents_0",
         /* resultSize: */ CqQueryDUnitTest.noTest,
         /* creates: */ size,
@@ -572,6 +534,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   /**
    * test to check invalidates on bridge server hosting datastores as well.
    */
+  @Test
   public void testPRCqWithInvalidatesOnBridgeServer()  {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -585,7 +548,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // create another server with data store.
     createServer(server2);
     
-    
     final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
@@ -617,8 +579,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(server1, regions[0], size);
     
@@ -637,7 +597,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ (size+size));
     
-    
     // invalidate all the values.
     int numInvalidates = size;
     cqHelper.invalidateValues(server2,regions[0], numInvalidates);
@@ -665,10 +624,9 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   
   /**
    * test cqs with invalidates on bridge server not hosting datastores.
-   * 
    */
+  @Test
   public void testPRCqWithInvalidatesOnAccessorBridgeServer() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
@@ -680,8 +638,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
      
     // create another server with data store.
     createServer(server2);
-    
-    
+
     final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
@@ -713,8 +670,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(server1, regions[0], size);
     
@@ -732,8 +687,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryUpdates: */ size,
         /* queryDeletes: */ 0,
         /* totalEvents: */ (size+size));
-    
-    
+
     // invalidate all the values.
     int numInvalidates = size;
     cqHelper.invalidateValues(server1,regions[0], numInvalidates);
@@ -762,8 +716,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
    * test cqs with create updates and destroys from client on bridge server
    * hosting datastores.
    */
+  @Test
   public void testPRCqWithUpdatesFromClients() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
@@ -777,7 +731,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // create another server with data store.
     createServer(server2, false , 1);
     
-    
     final int port = server1.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
@@ -810,8 +763,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    //size = 2;
-    
     // do updates
     createValues(client2, regions[0], size);
     
@@ -830,7 +781,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ (size+size));
     
-    
     // invalidate all the values.
     int numDelets = size;
     
@@ -860,10 +810,9 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   
   /**
    * test cqs on multiple partitioned region hosted by bridge servers.
-   * 
    */
+  @Test
   public void testPRCqWithMultipleRegionsOnServer() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
@@ -924,14 +873,10 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    
-    //size = 2;
-    
     // do updates
     createValues(client2, regions[0], size);
     createValues(client2, regions[1], size);
-    
- 
+
     for (int i=1; i <= size; i++){
       cqHelper.waitForUpdated(client, "testCQEvents_0", KEY+i);
       cqHelper.waitForUpdated(client, "testCQEvents_1", KEY+i);
@@ -964,13 +909,11 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     cqHelper.deleteValues(client2,regions[0], numInvalidates);
     cqHelper.deleteValues(client2,regions[1], numInvalidates);
     
-
     for (int i=1; i <= numInvalidates; i++){
       cqHelper.waitForDestroyed(client, "testCQEvents_0", KEY+i);
       cqHelper.waitForDestroyed(client, "testCQEvents_1", KEY+i);
     }
-    
-    
+
     // validate cqs after invalidates on server2.
          
     cqHelper.validateCQ(client, "testCQEvents_0",
@@ -982,8 +925,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryUpdates: */ size,
         /* queryDeletes: */ numInvalidates,
         /* totalEvents: */ (size+size+numInvalidates));
-    
-    
+
     cqHelper.validateCQ(client, "testCQEvents_1",
         /* resultSize: */ CqQueryDUnitTest.noTest,
         /* creates: */ size,
@@ -1003,10 +945,9 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   /**
    * tests multiple cqs on partitioned region on bridge servers with profile update 
    * for not requiring old values.
-   * 
    */
+  @Test
   public void testPRWithCQsAndProfileUpdates() throws Exception {
-    
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
     VM server2 = host.getVM(1);
@@ -1065,9 +1006,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
     
-    
-    //size = 2;
-    
     // do updates
     createValues(client2, regions[0], size);
     createValues(client2, regions[1], size);
@@ -1108,8 +1046,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
       cqHelper.waitForDestroyed(client,"testPRWithCQsAndProfileUpdates_0",KEY+i);
       cqHelper.waitForDestroyed(client,"testPRWithCQsAndProfileUpdates_1",KEY+i);
     }
-    
-    
+
     // validate cqs after invalidates on server2.
          
     cqHelper.validateCQ(client, "testPRWithCQsAndProfileUpdates_0",
@@ -1121,8 +1058,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryUpdates: */ size,
         /* queryDeletes: */ numInvalidates,
         /* totalEvents: */ (size+size+numInvalidates));
-    
-    
+
     cqHelper.validateCQ(client, "testPRWithCQsAndProfileUpdates_1",
         /* resultSize: */ CqQueryDUnitTest.noTest,
         /* creates: */ size,
@@ -1133,86 +1069,9 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         /* queryDeletes: */ numInvalidates,
         /* totalEvents: */ (size+size+numInvalidates));
     
-    // check for requries old value set.
-    /*
-    server1.invoke(new CacheSerializableRunnable("Check requires old value") {
-      public void run2()
-      {
-        Cache cc = getCache();
-        PartitionedRegion region1 = (PartitionedRegion)cc
-            .getRegion("/root/regionA");
-        Set requiresOldValue = region1.getRegionAdvisor()
-            .adviseRequiresOldValue();
-        getLogWriter().info(
-            "ize of requires old value at server1 before closing cqs : "
-                + requiresOldValue.size());
-        assertTrue("The size of requiresOldValue shoule be zero on server1",
-            (0 == requiresOldValue.size()));
-      }
-    });
-
-    server2.invoke(new CacheSerializableRunnable("Check requires old value") {
-      public void run2()
-      {
-        Cache cc = getCache();
-        PartitionedRegion region1 = (PartitionedRegion)cc
-            .getRegion("/root/regionA");
-        Set requiresOldValue = region1.getRegionAdvisor()
-            .adviseRequiresOldValue();
-        getLogWriter().info(
-            "size of requires old value at server2 before closing cqs :"
-                + requiresOldValue.size());
-        assertTrue("The size of requiresOldValue should be one on server2 ",
-            (1 == requiresOldValue.size()));
-      }
-    });
-    */
-    
     cqHelper.closeCQ(client, "testPRWithCQsAndProfileUpdates_0");
     cqHelper.closeCQ(client, "testPRWithCQsAndProfileUpdates_1");
     
-    
-    // check for requires old value set after closing all the cqs.
-    /*
-    REQUIRES OLD VALUES requirement is removed in the eventFilterOpt_dev_Jun09 
-    branch. The old values are no more sent to the peer, instead CQs are processed
-    at the source (where change happens). Replace requiresOldValue test with 
-    appropriate test.
-    
-    server1.invoke(new CacheSerializableRunnable("Check requires old value") {
-      public void run2()
-      {
-        Cache cc = getCache();
-        PartitionedRegion region1 = (PartitionedRegion)cc
-            .getRegion("/root/regionA");
-        Set requiresOldValue = region1.getRegionAdvisor()
-            .adviseRequiresOldValue();
-        getLogWriter().info(
-            "size of requires old value set at the end server1 : "
-                + requiresOldValue.size());
-        assertTrue("The size of requiresOldValue shoule be zero on server1",
-            (0 == requiresOldValue.size()));
-      }
-    });
-    
-    
-    server2.invoke(new CacheSerializableRunnable("Check requires old value") {
-      public void run2()
-      {
-        Cache cc = getCache();
-        PartitionedRegion region1 = (PartitionedRegion)cc
-            .getRegion("/root/regionA");
-        Set requiresOldValue = region1.getRegionAdvisor()
-            .adviseRequiresOldValue();
-        getLogWriter().info(
-            " size of requires old value set at the end server2 : "
-                + requiresOldValue.size());
-        assertTrue(
-            "The size of requiresOldValue shoule be zero on server2 as well after closing all the cqs",
-            (0 == requiresOldValue.size()));
-      }
-    });
-    */
     cqHelper.closeClient(client);
     cqHelper.closeClient(client2);
     cqHelper.closeServer(server2);
@@ -1225,8 +1084,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
    * there may be possibility that the region changes during
    * that time may not be reflected in the query result set
    * thus making the query data and region data inconsistent.
-   * @throws Exception
    */
+  @Test
   public void testEventsDuringQueryExecution() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1289,14 +1148,9 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         try {
           cqResults = cq1.executeWithInitialResults();
         } catch (Exception ex){
-          AssertionError err = new AssertionError("Failed to execute  CQ " + cqName);
-          err.initCause(ex);
-          throw err;
+          fail("Failed to execute  CQ " + cqName, ex);
         }
         
-        //getLogWriter().info("initial result size = " + cqResults.size());
-        
-        
         CqQueryTestListener cqListener = (CqQueryTestListener)cq1.getCqAttributes().getCqListener();
         // Wait for the last key to arrive.
         for (int i=0; i < 4; i++) {
@@ -1330,13 +1184,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           ids.add(s.get("key"));
         }
 
-        //Iterator iter = cqResults.asSet().iterator();
-        //while (iter.hasNext()) {
-        //  Portfolio p = (Portfolio)iter.next();
-        //  ids.add(p.getPk());
-        //  //getLogWriter().info("Result set value : " + p.getPk());
-        //}
-        
         HashSet missingIds = new HashSet();
         String key = "";
         for (int i = 1; i <= totalObjects; i++) {
@@ -1351,8 +1198,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
               " Missing keys : [size : " + missingIds.size() + "]" + missingIds +
               " Ids in ResultSet and CQ Events :" + ids);
         }
-        
-      } 
+      }
     });
     
     cqHelper.closeClient(client);
@@ -1360,8 +1206,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     cqHelper.closeServer(server1);    
   }
 
-  
-  
+  @Test
   public void testDestroyRegionEventOnClientsWithCQRegistered() throws Exception{
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -1394,7 +1239,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           region.put("KEY-"+i, p);
         }
       }
-      
     });
     
     client1.invokeAsync(new CacheSerializableRunnable("Wait for CqEvent") {
@@ -1409,7 +1253,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         assertNotNull(cqListener);
         
         cqListener.waitForTotalEvents(numObjects + 1 /*Destroy region event*/);
-                
       }
     });
     
@@ -1447,7 +1290,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
               "Region is still available on client1 even after performing destroyRegion from client2 on server."
                   + "Client1 must have received destroyRegion message from server with CQ parts in it.",
               getCache().getRegion("/" + regions[0]));
-
         }
       }
     });
@@ -1455,8 +1297,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     cqHelper.closeServer(server);
   }
   
-  // helper methods.
-  
   /**
    * create bridge server with default attributes for partitioned region.
    */
@@ -1496,36 +1336,27 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         "Create Cache Server") {
       public void run2() throws CacheException
       {
-          LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
-          //AttributesFactory factory = new AttributesFactory();
-          //factory.setScope(Scope.DISTRIBUTED_ACK);
-          //factory.setMirrorType(MirrorType.KEYS_VALUES);
-          
-          //int maxMem = 0;
-          AttributesFactory attr = new AttributesFactory();
-          //attr.setValueConstraint(valueConstraint);
-          PartitionAttributesFactory paf = new PartitionAttributesFactory();
-          if (isAccessor){
-            paf.setLocalMaxMemory(0);
-          }
-          PartitionAttributes prAttr = paf.setTotalNumBuckets(197).setRedundantCopies(redundantCopies).create();
-          attr.setPartitionAttributes(prAttr);
-          
-          assertFalse(getSystem().isLoner());
-          //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
-          for (int i = 0; i < regions.length; i++) {
-            Region r = createRegion(regions[i], attr.create());
-            LogWriterUtils.getLogWriter().info("Server created the region: "+r);
-          }
-//          pause(2000);
-          try {
-            startBridgeServer(port, true);
-          }
-          catch (Exception ex) {
-            Assert.fail("While starting CacheServer", ex);
-          }
-//          pause(2000);
-       
+        LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
+        AttributesFactory attr = new AttributesFactory();
+        PartitionAttributesFactory paf = new PartitionAttributesFactory();
+        if (isAccessor){
+          paf.setLocalMaxMemory(0);
+        }
+        PartitionAttributes prAttr = paf.setTotalNumBuckets(197).setRedundantCopies(redundantCopies).create();
+        attr.setPartitionAttributes(prAttr);
+
+        assertFalse(getSystem().isLoner());
+        //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
+        for (int i = 0; i < regions.length; i++) {
+          Region r = createRegion(regions[i], attr.create());
+          LogWriterUtils.getLogWriter().info("Server created the region: "+r);
+        }
+        try {
+          startBridgeServer(port, true);
+        }
+        catch (Exception ex) {
+          Assert.fail("While starting CacheServer", ex);
+        }
       }
     };
 
@@ -1545,35 +1376,27 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         "Create Cache Server") {
       public void run2() throws CacheException
       {
-          LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
-          //AttributesFactory factory = new AttributesFactory();
-          //factory.setScope(Scope.DISTRIBUTED_ACK);
-          //factory.setMirrorType(MirrorType.KEYS_VALUES);
-          
-          //int maxMem = 0;
-          AttributesFactory attr = new AttributesFactory();
-          //attr.setValueConstraint(valueConstraint);
-          PartitionAttributesFactory paf = new PartitionAttributesFactory();
-          if (isAccessor){
-            paf.setLocalMaxMemory(0);
-          }
-          PartitionAttributes prAttr = paf.setTotalNumBuckets(1).setRedundantCopies(redundantCopies).create();
-          attr.setPartitionAttributes(prAttr);
-          
-          assertFalse(getSystem().isLoner());
-          //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
-          for (int i = 0; i < regions.length; i++) {
-            Region r = createRegionWithoutRoot(regions[i], attr.create());
-            LogWriterUtils.getLogWriter().info("Server created the region: "+r);
-          }
-//          pause(2000);
-          try {
-            startBridgeServer(port, true);
-          }
-          catch (Exception ex) {
-            Assert.fail("While starting CacheServer", ex);
-          }
-//          pause(2000);
+        LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
+        AttributesFactory attr = new AttributesFactory();
+        PartitionAttributesFactory paf = new PartitionAttributesFactory();
+        if (isAccessor){
+          paf.setLocalMaxMemory(0);
+        }
+        PartitionAttributes prAttr = paf.setTotalNumBuckets(1).setRedundantCopies(redundantCopies).create();
+        attr.setPartitionAttributes(prAttr);
+
+        assertFalse(getSystem().isLoner());
+        //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
+        for (int i = 0; i < regions.length; i++) {
+          Region r = createRegionWithoutRoot(regions[i], attr.create());
+          LogWriterUtils.getLogWriter().info("Server created the region: "+r);
+        }
+        try {
+          startBridgeServer(port, true);
+        }
+        catch (Exception ex) {
+          Assert.fail("While starting CacheServer", ex);
+        }
       }
 
       private Region createRegionWithoutRoot(String regionName,
@@ -1585,6 +1408,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
 
     server.invoke(createServer);
   }
+
   /**
    * Starts a bridge server on the given port, using the given
    * deserializeValues and notifyBySubscription to serve up the
@@ -1594,7 +1418,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
    */
   protected void startBridgeServer(int port, boolean notifyBySubscription)
   throws IOException {
-    
     Cache cache = getCache();
     CacheServer bridge = cache.addCacheServer();
     bridge.setPort(port);
@@ -1608,8 +1431,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     int[] serverPorts = new int[] {serverPort};
     createClient(client, serverPorts, serverHost, null); 
   }
-  
-  
+
   /* Create Client */
   public void createClient(VM client, final int[] serverPorts, final String serverHost, final String redundancyLevel) {
     SerializableRunnable createQService =
@@ -1624,8 +1446,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         try {
           getCache().getQueryService();
         } catch (Exception cqe) {
-          cqe.printStackTrace();
-          fail("Failed to getCQService.");
+          fail("Failed to getCQService.", cqe);
         }
         
         AttributesFactory regionFactory = new AttributesFactory();
@@ -1640,7 +1461,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         for (int i=0; i < regions.length; i++) {        
           Region clientRegion = createRegion(regions[i], regionFactory.createRegionAttributes());
           LogWriterUtils.getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
-          //region1.getAttributesMutator().setCacheListener(new CqListener());
         }
       }
     };
@@ -1651,18 +1471,14 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   public void createCQ(VM vm, final String cqName, final String queryStr) {
     vm.invoke(new CacheSerializableRunnable("Create CQ :" + cqName) {
       public void run2() throws CacheException {
-        //pause(60 * 1000);
-        //getLogWriter().info("### DEBUG CREATE CQ START ####");
-        //pause(20 * 1000);
-        
+
         LogWriterUtils.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {
           cqService = getCache().getQueryService();
         } catch (Exception cqe) {
-          cqe.printStackTrace();
-          fail("Failed to getCQService.");
+          fail("Failed to getCQService.", cqe);
         }
         // Create CQ Attributes.
         CqAttributesFactory cqf = new CqAttributesFactory();
@@ -1678,16 +1494,13 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           assertTrue("newCq() state mismatch", cq1.getState().isStopped());
           LogWriterUtils.getLogWriter().info("Created a new CqQuery : "+cq1);
         } catch (Exception ex){
-          AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
-          err.initCause(ex);
-          LogWriterUtils.getLogWriter().info("CqService is :" + cqService, err);
-          throw err;
+          fail("Failed to create CQ " + cqName, ex);
         }
       }
     });   
   } 
   
-  /* Returs Cache Server Port */
+  /** Return Cache Server Port */
   protected static int getCacheServerPort() {
     return bridgeServerPort;
   }
@@ -1705,9 +1518,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   }
   
   private static int getCqCountFromRegionProfile() {
-    
     LocalRegion region1 = (LocalRegion)CacheFactory.getAnyInstance().getRegion("/root/regionA");
-    
     return region1.getFilterProfile().getCqCount();
   }
   
@@ -1737,8 +1548,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
       }
     });
   }
-  
-  
+
   public void createCacheClient(VM client, final int serverPort, final String serverHost){
     createCacheClient(client, new String[]{serverHost}, new int[]{serverPort}, null);
   }
@@ -1762,8 +1572,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         try {
           getCache().getQueryService();
         } catch (Exception cqe) {
-          cqe.printStackTrace();
-          fail("Failed to getCQService.");
+          fail("Failed to getCQService.", cqe);
         }
         
         AttributesFactory regionFactory = new AttributesFactory();
@@ -1779,7 +1588,6 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           Region clientRegion = ((ClientCache)getCache()).createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
           .create(regions[i]);
           LogWriterUtils.getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
-          //region1.getAttributesMutator().setCacheListener(new CqListener());
         }
       }
     });   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
index 7b25430..730aec9 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
@@ -26,10 +35,11 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.dunit.*;
 
+@Category(DistributedTest.class)
 public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends PartitionedRegionCqQueryDUnitTest{
 
-  public PartitionedRegionCqQueryOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionCqQueryOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override
@@ -51,6 +61,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
     });
   }
   
+  @Test
   public void testCqExecuteWithoutQueryExecution() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);
@@ -142,6 +153,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
     cqHelper.closeServer(server);    
   }
   
+  @Test
   public void testCqExecuteWithoutQueryExecutionAndNoRSCaching() throws Exception {
     final Host host = Host.getHost(0);
     final VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
index 0af556f..8ab74da 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.IOException;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -58,10 +67,11 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * 
  * @since GemFire 5.5
  */
-public class PrCqUsingPoolDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PrCqUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
-  public PrCqUsingPoolDUnitTest(String name) {
-    super(name);
+  public PrCqUsingPoolDUnitTest() {
+    super();
   }
   
   static public final String[] regions = new String[] {
@@ -71,9 +81,9 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
   
   static public final String KEY = "key-";
   
-  private final CqQueryUsingPoolDUnitTest cqHelper = new CqQueryUsingPoolDUnitTest("HelperPartitonedRegionCqTest");
+  private final CqQueryUsingPoolDUnitTest cqHelper = new CqQueryUsingPoolDUnitTest();
   
-  private final CqStatsDUnitTest cqStatsHelper = new CqStatsDUnitTest("HelperPrCqUsingPool");
+  private final CqStatsDUnitTest cqStatsHelper = new CqStatsDUnitTest();
 
   public final String[] cqs = new String [] {
       //0 - Test for ">" 
@@ -109,6 +119,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
   
   private static int bridgeServerPort;
   
+  @Test
   public void testCQAndPartitionedRegion() throws Exception {
     // creating servers.
     final Host host = Host.getHost(0);
@@ -223,6 +234,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
   /**
    * test for registering cqs on a bridge server with local max memory zero.
    */
+  @Test
   public void testPartitionedCqOnAccessorBridgeServer() throws Exception {
  // creating servers.
     final Host host = Host.getHost(0);
@@ -386,6 +398,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * will generate all the events locally and should always have the old value 
    * and should not sent the profile update on wire.
    */
+  @Test
   public void testPartitionedCqOnSingleBridgeServer() throws Exception { 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -479,6 +492,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * will generate all the events locally but the puts, updates and destroys originate
    * at an accessor vm.
    */
+  @Test
   public void testPRCqOnSingleBridgeServerUpdatesOriginatingAtAccessor() throws Exception { 
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -578,6 +592,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
   /**
    * test to check invalidates on bridge server hosting datastores as well.
    */
+  @Test
   public void testPRCqWithInvalidatesOnBridgeServer()  {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -677,6 +692,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * test cqs with invalidates on bridge server not hosting datastores.
    * 
    */
+  @Test
   public void testPRCqWithInvalidatesOnAccessorBridgeServer() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -777,6 +793,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * test cqs with create updates and destroys from client on bridge server
    * hosting datastores.
    */
+  @Test
   public void testPRCqWithUpdatesFromClients() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -884,6 +901,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * test cqs on multiple partitioned region hosted by bridge servers.
    * 
    */
+  @Test
   public void testPRCqWithMultipleRegionsOnServer() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -1030,6 +1048,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * for not requiring old values.
    * 
    */
+  @Test
   public void testPRWithCQsAndProfileUpdates() throws Exception {
     
     final Host host = Host.getHost(0);
@@ -1256,6 +1275,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-1181: random ports, eats exceptions (fixed some), async behavior
+  @Test
   public void testEventsDuringQueryExecution() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1384,6 +1404,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
 
   }
 
+  @Test
   public void testCQsWithPutalls() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1478,6 +1499,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     cqHelper.closeServer(server1);   
   }
   
+  @Test
   public void testCQsWithPutallsValidateStats() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1580,6 +1602,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     cqHelper.closeServer(server1);   
   }
   
+  @Test
   public void testCQsWithPutallsWithTx() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1702,6 +1725,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
   
   }
   
+  @Test
   public void testCQsWithPutallsWithTxValidateStats() throws Exception {
     final Host host = Host.getHost(0);
     VM server1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
index bc552aa..d788b77 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
+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.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -24,10 +33,11 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
  * Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
  *
  */
+@Category(DistributedTest.class)
 public class PrCqUsingPoolOptimizedExecuteDUnitTest extends PrCqUsingPoolDUnitTest {
 
-  public PrCqUsingPoolOptimizedExecuteDUnitTest(String name) {
-    super(name);
+  public PrCqUsingPoolOptimizedExecuteDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
index 8180b31..ac60c14 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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 java.util.List;
 
@@ -46,15 +55,17 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 
 
+@Category(DistributedTest.class)
 public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
 
-  public PdxQueryCQDUnitTest(String name) {
-    super(name);
+  public PdxQueryCQDUnitTest() {
+    super();
   }
   
   /**
    * Tests client-server query on PdxInstance.
    */
+  @Test
   public void testCq() throws CacheException {
     
     final Host host = Host.getHost(0);
@@ -234,6 +245,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
    * Tests client-server query on PdxInstance.
    */
   
+  @Test
   public void testCqAndInterestRegistrations() throws CacheException {
     
     final Host host = Host.getHost(0);
@@ -429,6 +441,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
   /**
    * Tests client-server query on PdxInstance.
    */
+  @Test
   public void testCqAndInterestRegistrationsWithFailOver() throws CacheException {
     
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
index ab4c203..06f1383 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
@@ -16,16 +16,36 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.CacheUtils;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.Struct;
 import com.gemstone.gemfire.cache.query.data.PortfolioPdx;
 import com.gemstone.gemfire.cache.query.data.PositionPdx;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.compression.Compressor;
 import com.gemstone.gemfire.compression.SnappyCompressor;
 import com.gemstone.gemfire.i18n.LogWriterI18n;
@@ -37,14 +57,9 @@ import com.gemstone.gemfire.test.dunit.Assert;
 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;
 
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public abstract class PdxQueryCQTestBase extends CacheTestCase {
+public abstract class PdxQueryCQTestBase extends JUnit4CacheTestCase {
 
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
@@ -93,8 +108,8 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
 
   public void createPool(VM vm, String poolName, String server, int port,
       boolean subscriptionEnabled) {
-        createPool(vm, poolName, new String[]{server}, new int[]{port}, subscriptionEnabled);  
-      }
+      createPool(vm, poolName, new String[]{server}, new int[]{port}, subscriptionEnabled);
+    }
 
   public void createPool(VM vm, String poolName, String server, int port) {
     createPool(vm, poolName, new String[]{server}, new int[]{port}, false);  
@@ -477,8 +492,8 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
         bridgeServerPort = bridge.getPort();
       }
 
-  public PdxQueryCQTestBase(String name) {
-    super(name);
+  public PdxQueryCQTestBase() {
+    super();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
index 476caf1..bb417c2 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -59,7 +68,8 @@ import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
  * 
  *
  */
-public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
+@Category(DistributedTest.class)
+public class QueryIndexUpdateRIDUnitTest extends JUnit4CacheTestCase{
 
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
@@ -76,8 +86,8 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
   private static final String ROOT = "root";
   
-  public QueryIndexUpdateRIDUnitTest(String name) {
-    super(name);
+  public QueryIndexUpdateRIDUnitTest() {
+    super();
   }
 
   /* Test creates 1 Client and 1 Server. Client and Server create same region in their cache.
@@ -85,9 +95,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
    * Query must fail as registerInterest does not update indexes on client.
    */
 
+  @Test
   public void testClientIndexUpdateWithRIOnKeys() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqRegisterInterestIndexUpdateDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -130,9 +141,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
    * with client region on register interest.
    * @throws Exception
    */
+  @Test
   public void testClientIndexUpdateWithRIOnOverlapKeys() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqRegisterInterestIndexUpdateDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -180,9 +192,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     cqDUnitTest.closeServer(server);
   }
 
+  @Test
   public void testClientIndexUpdateWithRIOnRegion() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("CqRegisterInterestIndexUpdateDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -220,9 +233,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     cqDUnitTest.closeServer(server);
   }
 
+  @Test
   public void testClientIndexUpdateWithRIOnRegEx() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("QueryIndexUpdateRIDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -266,9 +280,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
    * 
    * @throws Exception
    */
+  @Test
   public void testClientIndexUpdateWithRIOnClearedRegion() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("QueryIndexUpdateRIDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -322,9 +337,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
    * Same tests as above using Partitioned Regions. 
    */
 
+  @Test
   public void testClientIndexUpdateWithRIOnPRRegion() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("QueryIndexUpdateRIDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -362,9 +378,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     cqDUnitTest.closeServer(server);
   }
 
+  @Test
   public void testClientIndexUpdateWithRIOnPRKeys() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("QueryIndexUpdateRIDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -402,9 +419,10 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     cqDUnitTest.closeServer(server);
   }
 
+  @Test
   public void testClientIndexUpdateWithRIOnPRRegEx() throws Exception{
     
-    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest("QueryIndexUpdateRIDunitTest");
+    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();
     
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
index 8153ab2..98f5721 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
@@ -16,7 +16,27 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -34,27 +54,34 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
 
 /**
  * Tests for QueryMonitoring service.
+ *
  * @since GemFire 6.0
  */
-public class QueryMonitorDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class QueryMonitorDUnitTest extends JUnit4CacheTestCase {
 
   private static int bridgeServerPort;
 
   private final String exampleRegionName = "exampleRegion";
   private final String exampleRegionName2 = "exampleRegion2";
   private final String poolName = "serverConnectionPool";
-  
-  
+
   /* Some of the queries are commented out as they were taking less time */
   String[]  queryStr = {
       "SELECT ID FROM /root/exampleRegion p WHERE  p.ID > 100",
@@ -117,29 +144,34 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   
   private int numServers;
 
-  public QueryMonitorDUnitTest(String name) {
-    super(name);
+  @Override
+  public final void preTearDownCacheTestCase() throws Exception {
+    Host host = Host.getHost(0);
+    disconnectFromDS();
+    // shut down clients before servers
+    for (int i=numServers; i<4; i++) {
+      host.getVM(i).invoke(() -> CacheTestCase.disconnectFromDS());
+    }
   }
 
   public void setup(int numServers) throws Exception {
-    super.setUp();
     Host host = Host.getHost(0);
     this.numServers = numServers;
-    
+
     // avoid IllegalStateException from HandShake by connecting all vms tor
     // system before creating connection pools
     getSystem();
-    
+
     SerializableRunnable r = new SerializableRunnable("getSystem") {
       public void run() {
         getSystem();
       }
     };
-    
+
     for (int i=0; i<numServers; i++) {
       host.getVM(i).invoke(r);
     }
-    
+
     r = new SerializableRunnable("getClientSystem") {
       public void run() {
         Properties props = DistributedTestUtils.getAllDistributedSystemProperties(new Properties());
@@ -147,22 +179,12 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
         getSystem(props);
       }
     };
-    
+
     for (int i=numServers; i<4; i++) {
       host.getVM(i).invoke(r);
     }
   }
-  
-  @Override
-  public final void preTearDownCacheTestCase() throws Exception {
-    Host host = Host.getHost(0);
-    disconnectFromDS();
-    // shut down clients before servers
-    for (int i=numServers; i<4; i++) {
-      host.getVM(i).invoke(() -> CacheTestCase.disconnectFromDS());
-    }
-  }
-  
+
   public void createRegion(VM vm){
     createRegion(vm, false, null);
   }
@@ -290,6 +312,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution from client to server (single server).
    */
+  @Test
   public void testQueryMonitorClientServer() throws Exception {
 
     setup(1);
@@ -366,6 +389,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution from client to server (multi server).
    */
+  @Test
   public void testQueryMonitorMultiClientMultiServer() throws Exception {
 
     setup(2);
@@ -456,6 +480,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
    * Tests query execution on local vm.
    */
   @Category(FlakyTest.class) // GEODE-577: eats exceptions
+  @Test
   public void testQueryExecutionLocally() throws Exception {
 
     setup(2);
@@ -534,6 +559,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution on local vm.
    */
+  @Test
   public void testQueryExecutionLocallyAndCacheOp() throws Exception {
 
     setup(2);
@@ -620,6 +646,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution from client to server (multiple server) on Partition Region .
    */
+  @Test
   public void testQueryMonitorOnPR() throws Exception {
 
     setup(2);
@@ -703,6 +730,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution on Partition Region, executes query locally.
    */
+  @Test
   public void testQueryMonitorWithLocalQueryOnPR() throws Exception {
 
     setup(2);
@@ -776,7 +804,9 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution from client to server (multiple server) with eviction to disk.
    */
-  public void BUG46770WORKAROUNDtestQueryMonitorRegionWithEviction() throws CacheException {
+  @Ignore("TODO:BUG46770WORKAROUND: test is disabled")
+  @Test
+  public void testQueryMonitorRegionWithEviction() throws CacheException {
 
     final Host host = Host.getHost(0);
     
@@ -858,6 +888,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests query execution on region with indexes.
    */
+  @Test
   public void testQueryMonitorRegionWithIndex() throws Exception {
 
     setup(2);
@@ -984,13 +1015,14 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   }
   
   
-  protected CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest("CqDataDUnitTest");
+  protected CqQueryDUnitTest cqDUnitTest = new CqQueryDUnitTest();
 
   /**
    * The following CQ test is added to make sure TEST_MAX_QUERY_EXECUTION_TIME is reset
    * and is not affecting other query related tests.
    * @throws Exception
    */
+  @Test
   public void testCQWithDestroysAndInvalidates() throws Exception
   {
     setup(1);
@@ -1068,6 +1100,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
   /**
    * Tests cache operation right after query cancellation.
    */
+  @Test
   public void testCacheOpAfterQueryCancel() throws Exception {
 
     setup(4);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
index 9d487dc..327de28 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
@@ -16,9 +16,23 @@
  */
 package com.gemstone.gemfire.cache.snapshot;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import com.examples.snapshot.MyObject;
 import com.examples.snapshot.MyPdxSerializer;
-import com.gemstone.gemfire.cache.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -30,26 +44,25 @@ import com.gemstone.gemfire.cache.snapshot.SnapshotOptions.SnapshotFormat;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.cache.util.CqListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.io.File;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class ClientSnapshotDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClientSnapshotDUnitTest extends JUnit4CacheTestCase {
 
   private transient Region<Integer, MyObject> region;
-  
-  public ClientSnapshotDUnitTest(String name) {
-    super(name);
+
+  @Override
+  public final void postSetUp() throws Exception {
+    loadCache();
   }
 
+  @Test
   public void testExport() throws Exception {
     int count = 10000;
     for (int i = 0; i < count; i++) {
@@ -82,6 +95,7 @@ public class ClientSnapshotDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testImport() throws Exception {
     int count = 1000;
     for (int i = 0; i < count; i++) {
@@ -153,6 +167,7 @@ public class ClientSnapshotDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testClientCallbacks() throws Exception {
     int count = 1000;
     for (int i = 0; i < count; i++) {
@@ -206,6 +221,7 @@ public class ClientSnapshotDUnitTest extends CacheTestCase {
     region.getSnapshotService().load(f, SnapshotFormat.GEMFIRE);
   }
   
+  @Test
   public void testInvalidate() throws Exception {
     SerializableCallable invalid = new SerializableCallable() {
       @Override
@@ -230,11 +246,6 @@ public class ClientSnapshotDUnitTest extends CacheTestCase {
     assertNull(region.get(1));
   }
 
-  @Override
-  public final void postSetUp() throws Exception {
-    loadCache();
-  }
-  
   @SuppressWarnings("serial")
   public void loadCache() throws Exception {
     CacheFactory cf = new CacheFactory().setPdxSerializer(new MyPdxSerializer());


[17/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
index 71c15d9..0f5045c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
@@ -16,6 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.InterestResultPolicy;
 import com.gemstone.gemfire.cache.Region;
@@ -25,13 +33,15 @@ import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerOperationException;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
+@Category(DistributedTest.class)
+public class Bug36829DUnitTest extends JUnit4DistributedTestCase {
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class Bug36829DUnitTest extends DistributedTestCase {
   private VM serverVM;
 
   private VM ClientVM;
@@ -40,10 +50,6 @@ public class Bug36829DUnitTest extends DistributedTestCase {
 
   private int PORT;
 
-  public Bug36829DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -53,8 +59,8 @@ public class Bug36829DUnitTest extends DistributedTestCase {
     CacheServerTestUtil.disableShufflingOfEndpoints();
   }
 
+  @Test
   public void testBug36829() {
-
     // Step 1: Starting the servers
     final String durableClientId = getName() + "_client";
 
@@ -80,64 +86,36 @@ public class Bug36829DUnitTest extends DistributedTestCase {
     // If exception is not thrown then the test fails.
     this.ClientVM.invoke(() -> Bug36829DUnitTest.registerKey( "Key1" ));
 
-
-    // creating REgion on the Server
+    // creating Region on the Server
 /*    this.serverVM.invoke(() -> CacheServerTestUtil.createRegion( regionName ));
      // should be successful.
     this.ClientVM.invoke(() -> Bug36829DUnitTest.registerKeyAfterRegionCreation( "Key1" ));*/
 
-
     // Stop the durable client
     this.ClientVM.invoke(() -> CacheServerTestUtil.closeCache());
 
     // Stop server 1
     this.serverVM.invoke(() -> CacheServerTestUtil.closeCache());
-
   }
 
-  
   private static void registerKey(String key) throws Exception {
+    // Get the region
+    Region region = CacheServerTestUtil.getCache().getRegion(Bug36829DUnitTest.class.getName() + "_region");
+    assertNotNull(region);
     try {
-      // Get the region
-      Region region = CacheServerTestUtil.getCache().getRegion(
-          Bug36829DUnitTest.class.getName() + "_region");
-      // Region region =
-      // CacheServerTestUtil.getCache().getRegion(regionName);
-      assertNotNull(region);
-      try {
-        region.registerInterest(key, InterestResultPolicy.NONE);
-        fail("expected ServerOperationException");
-      }
-      catch (ServerOperationException expected) {
-      }
+      region.registerInterest(key, InterestResultPolicy.NONE);
+      fail("expected ServerOperationException");
     }
-    catch (Exception ex) {
-      Assert.fail("failed while registering interest in registerKey function", ex);
+    catch (ServerOperationException expected) {
     }
   }
 
-  private static void registerKeyAfterRegionCreation(String key)
-      throws Exception {
-    try {
-      // Get the region
-      Region region = CacheServerTestUtil.getCache().getRegion(
-          Bug36829DUnitTest.class.getName() + "_region");
-      // Region region =
-      // CacheServerTestUtil.getCache().getRegion(regionName);
-      assertNotNull(region);
-      try {
-        region.registerInterest(key, InterestResultPolicy.NONE);
-      }
-      catch (Exception e) {
-        fail("unexpected Exception while registerInterest inspite of region present on the server."
-            + " Details of Exception:" + "\ne.getCause:" + e.getCause()
-            + "\ne.getMessage:" + e.getMessage());
-      }
-    }
+  private static void registerKeyAfterRegionCreation(String key) throws Exception {
+    // Get the region
+    Region region = CacheServerTestUtil.getCache().getRegion(Bug36829DUnitTest.class.getName() + "_region");
+    assertNotNull(region);
 
-    catch (Exception ex) {
-      Assert.fail("failed while registering interest in registerKey function", ex);
-    }
+    region.registerInterest(key, InterestResultPolicy.NONE);
   }
 
   private Pool getClientPool(String host, int server1Port,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
index ba57fb9..4a05668 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+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.CacheFactory;
@@ -26,16 +35,18 @@ import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class Bug36995DUnitTest extends JUnit4DistributedTestCase {
 
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public class Bug36995DUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
 
   private static VM server1 = null;
@@ -46,12 +57,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
 
   protected static PoolImpl pool = null;
 
-  private static final String regionName = "Bug36995DUnitTest_Region";
-
-  /** constructor */
-  public Bug36995DUnitTest(String name) {
-    super(name);
-  }
+  private static final String regionName = Bug36995DUnitTest.class.getSimpleName() + "_Region";
 
   @Override
   public final void postSetUp() throws Exception {
@@ -77,7 +83,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
       Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
-      new Bug36995DUnitTest("temp").createCache(props);
+      new Bug36995DUnitTest().createCache(props);
       PoolImpl p = (PoolImpl)PoolManager.createFactory()
         .addServer(host, port1)
         .addServer(host, port2)
@@ -95,7 +101,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
       pool = p;
     }
     catch (Exception e) {
-      fail("Test failed due to " + e);
+      fail("Test failed due to ", e);
     }
   }
 
@@ -106,7 +112,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
       Properties props = new Properties();
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(LOCATORS, "");
-      new Bug36995DUnitTest("temp").createCache(props);
+      new Bug36995DUnitTest().createCache(props);
       PoolImpl p = (PoolImpl)PoolManager.createFactory()
         .addServer(host, port1)
         .addServer(host, port2)
@@ -119,13 +125,13 @@ public class Bug36995DUnitTest extends DistributedTestCase
       pool = p;
     }
     catch (Exception e) {
-      fail("Test failed due to " + e);
+      fail("Test failed due to ", e);
     }
   }
 
   public static Integer createServerCache() throws Exception
   {
-    new Bug36995DUnitTest("temp").createCache(new Properties());
+    new Bug36995DUnitTest().createCache(new Properties());
     // no region is created on server 
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     CacheServer server1 = cache.addCacheServer();
@@ -153,6 +159,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
   /**
    * Tests messageTrackingTimeout is set correctly to default or not if not specified
    */
+  @Test
   public void testBug36995_Default()
   {
     Integer port1 = ((Integer)server1.invoke(() -> Bug36995DUnitTest.createServerCache()));
@@ -168,6 +175,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
   /**
    * Tests messageTrackingTimeout is set correctly as pwr user specified
    */
+  @Test
   public void testBug36995_UserSpecified()
   {
     //work around GEODE-507
@@ -183,6 +191,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
   /**
    * BugTest for 36526 : 
    */
+  @Test
   public void testBug36526()
   {
     Integer port1 = ((Integer)server1.invoke(() -> Bug36995DUnitTest.createServerCache()));
@@ -205,7 +214,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
       }
     }
     catch (Exception e) {
-      fail("failed while stopServer()" + e);
+      fail("failed while stopServer()", e);
     }
   }
 
@@ -222,30 +231,5 @@ public class Bug36995DUnitTest extends DistributedTestCase
       }
     };
     Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
-    
-    // we no longer verify dead servers; just live
-//     while (proxy.getDeadServers().size() != expectedDeadServers) { // wait
-//       // until
-//       // condition
-//       // is
-//       // met
-//       assertTrue(
-//           "Waited over "
-//               + maxWaitTime
-//               + "for dead servers to become : "
-//               + expectedDeadServers
-//               + " This issue can occur on Solaris as DSM thread get stuck in connectForServer() call, and hence not recovering any newly started server This may be beacuase of tcp_ip_abort_cinterval kernal level property on solaris which has 3 minutes as a default value",
-//           (System.currentTimeMillis() - start) < maxWaitTime);
-//       try {
-//         Thread.yield();
-//         synchronized (delayLock) {
-//           delayLock.wait(2000);
-//         }
-//       }
-//       catch (InterruptedException ie) {
-//         fail("Interrupted while waiting ", ie);
-//       }
-//     }
-//     start = System.currentTimeMillis();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
index 2fe3d67..a132881 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
@@ -16,7 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -24,24 +40,22 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This tests the fix for bug 73210. Reason for the bug was that HARegionQueue's
  * destroy was not being called on CacheClientProxy's closure. As a result,
  * stats were left open.
- * 
- * 
  */
-public class Bug37210DUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class Bug37210DUnitTest extends JUnit4DistributedTestCase {
+
   /** the cache server */
   VM server = null;
 
@@ -58,16 +72,6 @@ public class Bug37210DUnitTest extends DistributedTestCase
   private static final String REGION_NAME = "Bug37210DUnitTest_Region";
 
   /**
-   * Constructor
-   * 
-   * @param name -
-   *                name for this test instance
-   */
-  public Bug37210DUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Creates the cache server and sets the port
    * 
    * @throws Exception -
@@ -133,6 +137,7 @@ public class Bug37210DUnitTest extends DistributedTestCase
    * @throws Exception -
    *                 thrown if any problem occurs in test execution
    */
+  @Test
   public void testHAStatsCleanup() throws Exception
   {
     Host host = Host.getHost(0);
@@ -159,7 +164,7 @@ public class Bug37210DUnitTest extends DistributedTestCase
    */
   public static Integer createServerCache() throws Exception
   {
-    Bug37210DUnitTest test = new Bug37210DUnitTest("temp");
+    Bug37210DUnitTest test = new Bug37210DUnitTest();
     Properties props = new Properties();
     cache = test.createCache(props);
     AttributesFactory factory = new AttributesFactory();
@@ -191,7 +196,7 @@ public class Bug37210DUnitTest extends DistributedTestCase
    */
   public static void createClientCache(String host, Integer port) throws Exception
   {
-    Bug37210DUnitTest test = new Bug37210DUnitTest("temp");
+    Bug37210DUnitTest test = new Bug37210DUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
index d6905d9..e35a172 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
@@ -16,6 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.Pool;
@@ -24,26 +34,18 @@ import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.internal.cache.HARegion;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
- *
  * The test is written to verify that the rootRegion() in GemfireCache.java
  * doesn't return any metaRegions or HA Regions.
- * 
  */
-
-public class Bug37805DUnitTest extends DistributedTestCase{
+@Category(DistributedTest.class)
+public class Bug37805DUnitTest extends JUnit4DistributedTestCase {
 
   private VM server1VM;
 
@@ -53,10 +55,6 @@ public class Bug37805DUnitTest extends DistributedTestCase{
 
   private int PORT1;
 
-  public Bug37805DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -73,6 +71,7 @@ public class Bug37805DUnitTest extends DistributedTestCase{
     CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
   }
   
+  @Test
   public void testFunctionality() {
  // Step 1: Starting the servers
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
index 893354c..bce5711 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
@@ -16,9 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.Statistics;
 import com.gemstone.gemfire.StatisticsType;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.NoAvailableServersException;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -30,48 +44,34 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
 /**
  * Make sure max-connections on cache server is enforced
- *
- *
  */
 @Category(IntegrationTest.class)
-public class CacheServerMaxConnectionsJUnitTest
+public class CacheServerMaxConnectionsJUnitTest {
+
+  private static final int MAX_CNXS = 100;
 
-{
+  private static int PORT;
+
+  /** name of the region created */
+  private final String regionName = "region1";
 
   /** connection proxy object for the client */
-  PoolImpl proxy = null;
+  private PoolImpl proxy = null;
 
   /** the distributed system instance for the test */
-  DistributedSystem system;
+  private DistributedSystem system;
 
   /** the cache instance for the test */
-  Cache cache;
-
-  /** name of the region created */
-  final String regionName = "region1";
-
-  private static int PORT;
+  private Cache cache;
 
   /**
    * Close the cache and disconnects from the distributed system
    */
   @After
-  public void tearDown() throws Exception
-
-  {
+  public void tearDown() throws Exception {
     this.cache.close();
     this.system.disconnect();
   }
@@ -85,59 +85,41 @@ public class CacheServerMaxConnectionsJUnitTest
 
   /**
    * Initializes proxy object and creates region for client
-   *
    */
-  private void createProxyAndRegionForClient()
-  {
-    try {
-      //props.setProperty("retryAttempts", "0");
-      PoolFactory pf = PoolManager.createFactory();
-      pf.addServer("localhost", PORT);
-      pf.setMinConnections(0);
-      pf.setPingInterval(10000);
-      pf.setThreadLocalConnections(true);
-      pf.setReadTimeout(2000);
-      pf.setSocketBufferSize(32768);
-      proxy = (PoolImpl)pf.create("junitPool");
-      AttributesFactory factory = new AttributesFactory();
-      factory.setScope(Scope.DISTRIBUTED_ACK);
-      factory.setPoolName("junitPool");
-      RegionAttributes attrs = factory.createRegionAttributes();
-      cache.createVMRegion(regionName, attrs);
-    }
-    catch (Exception ex) {
-      ex.printStackTrace();
-      fail("Failed to initialize client");
-    }
+  private void createProxyAndRegionForClient() {
+    //props.setProperty("retryAttempts", "0");
+    PoolFactory pf = PoolManager.createFactory();
+    pf.addServer("localhost", PORT);
+    pf.setMinConnections(0);
+    pf.setPingInterval(10000);
+    pf.setThreadLocalConnections(true);
+    pf.setReadTimeout(2000);
+    pf.setSocketBufferSize(32768);
+    proxy = (PoolImpl)pf.create("junitPool");
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.DISTRIBUTED_ACK);
+    factory.setPoolName("junitPool");
+    RegionAttributes attrs = factory.createRegionAttributes();
+    cache.createVMRegion(regionName, attrs);
   }
 
-  private final static int MAX_CNXS = 100;
-
   /**
    * Creates and starts the server instance
-   *
    */
-  private int createServer()
-  {
+  private int createServer() throws IOException {
     CacheServer server = null;
-    try {
-      Properties p = new Properties();
-      // make it a loner
-      p.put(MCAST_PORT, "0");
-      p.put(LOCATORS, "");
-      this.system = DistributedSystem.connect(p);
-      this.cache = CacheFactory.create(system);
-      server = this.cache.addCacheServer();
-      int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-      server.setMaxConnections(MAX_CNXS);
-      server.setMaxThreads(getMaxThreads());
-      server.setPort(port);
-      server.start();
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      fail("Failed to create server");
-    }
+    Properties p = new Properties();
+    // make it a loner
+    p.put(MCAST_PORT, "0");
+    p.put(LOCATORS, "");
+    this.system = DistributedSystem.connect(p);
+    this.cache = CacheFactory.create(system);
+    server = this.cache.addCacheServer();
+    int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    server.setMaxConnections(MAX_CNXS);
+    server.setMaxThreads(getMaxThreads());
+    server.setPort(port);
+    server.start();
     return server.getPort();
   }
 
@@ -153,8 +135,7 @@ public class CacheServerMaxConnectionsJUnitTest
    * the put that the Connection object used was new one.
    */
   @Test
-  public void testMaxCnxLimit() throws Exception
-  {
+  public void testMaxCnxLimit() throws Exception {
     PORT = createServer();
     createProxyAndRegionForClient();
     StatisticsType st = this.system.findType("CacheServerStats");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java
index bae4e50..c131442 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java
@@ -17,9 +17,30 @@
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.*;
+import java.io.File;
+import java.net.InetSocketAddress;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.client.Pool;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.query.CqEvent;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -31,25 +52,14 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl.PoolAttributes;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 
-import java.io.File;
-import java.net.InetSocketAddress;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Properties;
+public class CacheServerTestUtil extends JUnit4DistributedTestCase {
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-/**
- *
- *
- */
-public class CacheServerTestUtil extends DistributedTestCase
-{
   private static Cache cache = null;
   private static IgnoredException expected;
 
@@ -60,17 +70,11 @@ public class CacheServerTestUtil extends DistributedTestCase
   protected final static int TYPE_INVALIDATE = 2;
   protected final static int TYPE_DESTROY = 3;
 
-  public CacheServerTestUtil(String name) {
-    super(name);
-  }
-
-  public static void createCacheClient(Pool poolAttr, String regionName)
-      throws Exception {
+  public static void createCacheClient(Pool poolAttr, String regionName) throws Exception {
     createCacheClient(poolAttr, regionName, getClientProperties(), Boolean.FALSE);
   }
 
-  public static void createCacheClient(Pool poolAttr, String regionName,
-      Properties dsProperties) throws Exception {
+  public static void createCacheClient(Pool poolAttr, String regionName, Properties dsProperties) throws Exception {
     createCacheClient(poolAttr, regionName, dsProperties, Boolean.FALSE);
   }
 
@@ -78,8 +82,7 @@ public class CacheServerTestUtil extends DistributedTestCase
     createClientCache(poolAttr, regionName, getClientProperties());
   }
 
-  public static void createClientCache(Pool poolAttr, String regionName,
-    Properties dsProperties) throws Exception {
+  public static void createClientCache(Pool poolAttr, String regionName, Properties dsProperties) throws Exception {
     ClientCacheFactory ccf = new ClientCacheFactory(dsProperties);
     if (poolAttr != null) {
       ccf
@@ -108,70 +111,60 @@ public class CacheServerTestUtil extends DistributedTestCase
         ccf.addPoolServer(server.getHostName(), server.getPort());
       }
     }
-    new CacheServerTestUtil("temp").createClientCache(dsProperties, ccf);
+    new CacheServerTestUtil().createClientCache(dsProperties, ccf);
     ClientCache cc = (ClientCache)cache;
     cc.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create(regionName);
     pool = (PoolImpl)((GemFireCacheImpl)cc).getDefaultPool();
   }
 
-  
-  
   public static void createPool(PoolAttributes poolAttr) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     
-    DistributedSystem ds = new CacheServerTestUtil("tmp").getSystem(props);;
-    
-      PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
-      pf.init(poolAttr);
-      PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil");
-      AttributesFactory factory = new AttributesFactory();
-      factory.setScope(Scope.LOCAL);
-      factory.setPoolName(p.getName());
+    DistributedSystem ds = new CacheServerTestUtil().getSystem(props);;
     
-      RegionAttributes attrs = factory.create();
-      pool = p;
-    }
-  
-  
-  
-  
-  
-  
-  
-  public static void createCacheClient(Pool poolAttr, String regionName,
-    Properties dsProperties, Boolean addControlListener) throws Exception {
+    PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
+    pf.init(poolAttr);
+    PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil");
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.LOCAL);
+    factory.setPoolName(p.getName());
+
+    RegionAttributes attrs = factory.create();
+    pool = p;
+  }
+
+  public static void createCacheClient(Pool poolAttr, String regionName, Properties dsProperties, Boolean addControlListener) throws Exception {
   	createCacheClient(poolAttr, regionName, dsProperties, addControlListener, null);
   }
   
-  public static void createCacheClient(Pool poolAttr, String regionName,
-      Properties dsProperties, Boolean addControlListener, Properties javaSystemProperties) throws Exception {  		
-      new CacheServerTestUtil("temp").createCache(dsProperties);
-      IgnoredException.addIgnoredException("java.net.ConnectException||java.net.SocketException");
-      
-      if (javaSystemProperties != null && javaSystemProperties.size() > 0) {
-      	Enumeration e = javaSystemProperties.propertyNames();
+  public static void createCacheClient(Pool poolAttr, String regionName, Properties dsProperties, Boolean addControlListener, Properties javaSystemProperties) throws Exception {
+    new CacheServerTestUtil().createCache(dsProperties);
+    IgnoredException.addIgnoredException("java.net.ConnectException||java.net.SocketException");
 
-        while (e.hasMoreElements()) {
-          String key = (String) e.nextElement();
-          System.setProperty(key, javaSystemProperties.getProperty(key));
-        }
-  	  }
-      
-      PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
-      pf.init(poolAttr);
-      PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil");
-      AttributesFactory factory = new AttributesFactory();
-      factory.setScope(Scope.LOCAL);
-      factory.setPoolName(p.getName());
-      if (addControlListener.booleanValue()) {
-        factory.addCacheListener(new ControlListener());
+    if (javaSystemProperties != null && javaSystemProperties.size() > 0) {
+      Enumeration e = javaSystemProperties.propertyNames();
+
+      while (e.hasMoreElements()) {
+        String key = (String) e.nextElement();
+        System.setProperty(key, javaSystemProperties.getProperty(key));
       }
-      RegionAttributes attrs = factory.create();
-      cache.createRegion(regionName, attrs);
-      pool = p;
     }
+
+    PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
+    pf.init(poolAttr);
+    PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil");
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.LOCAL);
+    factory.setPoolName(p.getName());
+    if (addControlListener.booleanValue()) {
+      factory.addCacheListener(new ControlListener());
+    }
+    RegionAttributes attrs = factory.create();
+    cache.createRegion(regionName, attrs);
+    pool = p;
+  }
   
   public static void unsetJavaSystemProperties(Properties javaSystemProperties) {
   	if (javaSystemProperties != null && javaSystemProperties.size() > 0) {
@@ -184,10 +177,8 @@ public class CacheServerTestUtil extends DistributedTestCase
 	  }
   }
   
-  public static void createCacheClient(Pool poolAttr, String regionName1,
-      String regionName2) throws Exception
-  {
-    new CacheServerTestUtil("temp").createCache(getClientProperties());
+  public static void createCacheClient(Pool poolAttr, String regionName1, String regionName2) throws Exception {
+    new CacheServerTestUtil().createCache(getClientProperties());
     PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
     pf.init(poolAttr);
     PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil");
@@ -275,10 +266,8 @@ public class CacheServerTestUtil extends DistributedTestCase
   /**
    * Create client regions
    */
-  public static void createCacheClients(Pool poolAttr, String regionName1,
-      String regionName2, Properties dsProperties) throws Exception
-  {
-    new CacheServerTestUtil("temp").createCache(dsProperties);
+  public static void createCacheClients(Pool poolAttr, String regionName1, String regionName2, Properties dsProperties) throws Exception {
+    new CacheServerTestUtil().createCache(dsProperties);
 
     // Initialize region1
     PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
@@ -297,29 +286,25 @@ public class CacheServerTestUtil extends DistributedTestCase
     cache.createRegion(regionName2, factory2.create());
   }
 
-  private static Properties getClientProperties()
-  {
+  private static Properties getClientProperties() {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     return props;
   }
   
-  private static Properties getClientProperties(boolean durable)
-  {
+  private static Properties getClientProperties(boolean durable) {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     return props;
   }
 
-  public static Integer createCacheServer(String regionName,
-      Boolean notifyBySubscription) throws Exception
-  {
+  public static Integer createCacheServer(String regionName, Boolean notifyBySubscription) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
-    new CacheServerTestUtil("temp").createCache(props);
+    new CacheServerTestUtil().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableBridgeConflation(true);
@@ -334,14 +319,11 @@ public class CacheServerTestUtil extends DistributedTestCase
     return new Integer(server1.getPort());
   }
 
-  public static Integer[] createCacheServerReturnPorts(String regionName,
-      Boolean notifyBySubscription) throws Exception
-  {
+  public static Integer[] createCacheServerReturnPorts(String regionName, Boolean notifyBySubscription) throws Exception {
     Properties props = new Properties();
-//    int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
-    new CacheServerTestUtil("temp").createCache(props);
+    new CacheServerTestUtil().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableBridgeConflation(true);
@@ -356,13 +338,11 @@ public class CacheServerTestUtil extends DistributedTestCase
     return new Integer[] {port, 0};
   }
 
-  public static void createCacheServer(String regionName,
-      Boolean notifyBySubscription, Integer serverPort)
-      throws Exception {
+  public static void createCacheServer(String regionName, Boolean notifyBySubscription, Integer serverPort) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
-    new CacheServerTestUtil("temp").createCache(props);
+    new CacheServerTestUtil().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableBridgeConflation(true);
@@ -375,10 +355,8 @@ public class CacheServerTestUtil extends DistributedTestCase
     server.start();
   }
 
-  public static Integer createCacheServer(String regionName1,
-      String regionName2, Boolean notifyBySubscription) throws Exception
-  {
-    new CacheServerTestUtil("temp").createCache(new Properties());
+  public static Integer createCacheServer(String regionName1, String regionName2, Boolean notifyBySubscription) throws Exception {
+    new CacheServerTestUtil().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableBridgeConflation(true);
@@ -398,8 +376,7 @@ public class CacheServerTestUtil extends DistributedTestCase
     return new Integer(server1.getPort());
   }
 
-  private void createCache(Properties props) throws Exception
-  {
+  private void createCache(Properties props) throws Exception {
     DistributedSystem ds = getSystem(props);
     assertNotNull(ds);
     ds.disconnect();
@@ -408,8 +385,7 @@ public class CacheServerTestUtil extends DistributedTestCase
     assertNotNull(cache);
   }
 
-  private void createClientCache(Properties props, ClientCacheFactory ccf) throws Exception
-  {
+  private void createClientCache(Properties props, ClientCacheFactory ccf) throws Exception {
     DistributedSystem ds = getSystem(props);
     assertNotNull(ds);
     ds.disconnect();
@@ -420,8 +396,7 @@ public class CacheServerTestUtil extends DistributedTestCase
     expected = IgnoredException.addIgnoredException("java.net.ConnectionException||java.net.SocketException");
   }
 
-  public static void closeCache()
-  {
+  public static void closeCache() {
     if (expected != null) {
       expected.remove();
       expected = null;
@@ -432,8 +407,7 @@ public class CacheServerTestUtil extends DistributedTestCase
     }
   }
 
-  public static void closeCache(boolean keepalive)
-  {
+  public static void closeCache(boolean keepalive) {
     if (expected != null) {
       expected.remove();
       expected = null;
@@ -448,18 +422,15 @@ public class CacheServerTestUtil extends DistributedTestCase
     cache = null;
   }
   
-  public static void setClientCrash(boolean crashOnClose)
-  {
+  public static void setClientCrash(boolean crashOnClose) {
     com.gemstone.gemfire.cache.client.internal.ConnectionImpl.setTEST_DURABLE_CLIENT_CRASH(crashOnClose);
   }
   
-  public static void disconnectClient()
-  {
+  public static void disconnectClient() {
     pool.endpointsNetDownForDUnitTest();
   }
   
-  public static void reconnectClient()
-  {
+  public static void reconnectClient() {
     if(pool != null) {
       pool.endpointsNetUpForDUnitTest();
     }
@@ -487,32 +458,28 @@ public class CacheServerTestUtil extends DistributedTestCase
     }
   }
 
-  public static Cache getCache()
-  {
+  public static Cache getCache() {
     return cache;
   }
 
-  public static PoolImpl getPool()
-  {
+  public static PoolImpl getPool() {
     return pool;
   }
 
   /**
    * Disables the shuffling of endpoints for a client
-   *
    */
-  public static void disableShufflingOfEndpoints()
-  {
+  public static void disableShufflingOfEndpoints() {
     // TODO DISABLE_RANDOM doesn't seem to be used anywhere
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.DISABLE_RANDOM", "true");
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true");
   }
+
   /**
    * Enables the shuffling of endpoints for a client
    * @since GemFire 5.7
    */
-  public static void enableShufflingOfEndpoints()
-  {
+  public static void enableShufflingOfEndpoints() {
     // TODO DISABLE_RANDOM doesn't seem to be used anywhere
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.DISABLE_RANDOM", "false");
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false");
@@ -520,13 +487,11 @@ public class CacheServerTestUtil extends DistributedTestCase
 
   /**
    * Resets the 'disableShufflingOfEndpoints' flag
-   * 
    */
-  public static void resetDisableShufflingOfEndpointsFlag()
-  {
+  public static void resetDisableShufflingOfEndpointsFlag() {
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false");
   }
-  
+
   public static class EventWrapper {
     public final EntryEvent event;
     public final Object key;
@@ -540,6 +505,7 @@ public class CacheServerTestUtil extends DistributedTestCase
       this.arg = ee.getCallbackArgument();
       this.type = type;
     }
+    @Override
     public String toString() {
       return "EventWrapper: event=" + event + ", type=" + type;
     }
@@ -572,6 +538,7 @@ public class CacheServerTestUtil extends DistributedTestCase
       } // synchronized
     }
 
+    @Override
     public void afterCreate(EntryEvent e) {
       synchronized(this.CONTROL_LOCK) {
         this.events.add(new EventWrapper(e, TYPE_CREATE));
@@ -579,6 +546,7 @@ public class CacheServerTestUtil extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterUpdate(EntryEvent e) {
       synchronized(this.CONTROL_LOCK) {
         this.events.add(new EventWrapper(e, TYPE_UPDATE));
@@ -586,6 +554,7 @@ public class CacheServerTestUtil extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterInvalidate(EntryEvent e) {
       synchronized(this.CONTROL_LOCK) {
         this.events.add(new EventWrapper(e, TYPE_INVALIDATE));
@@ -593,6 +562,7 @@ public class CacheServerTestUtil extends DistributedTestCase
       }
     }
 
+    @Override
     public void afterDestroy(EntryEvent e) {
       synchronized(this.CONTROL_LOCK) {
         this.events.add(new EventWrapper(e, TYPE_DESTROY));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
index e416b3c..8315019 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
@@ -16,7 +16,25 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -24,24 +42,23 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests behaviour of transactions in client server model
  */
-public class CacheServerTransactionsDUnitTest extends DistributedTestCase
-{
-  /** constructor */
-  public CacheServerTransactionsDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class CacheServerTransactionsDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final int PAUSE = 5 * 1000;
 
   private static Cache cache = null;
 
@@ -77,8 +94,6 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
 
   private static VM client2 = null;
 
-//  private static RegionAttributes attrs = null;
-
   protected static boolean destroyed = false;
   
   protected static boolean invalidated = false;
@@ -92,13 +107,11 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
     client2 = host.getVM(3);
   }
 
-  private static final int PAUSE = 5 * 1000;
-
   /**
    * Test for update propagation to the clients when there is one server and two
    * clients connected to the server.
-   * 
    */
+  @Test
   public void testOneServerToClientTransactionsPropagation()
   {
     Integer port1 = initServerCache(server1);
@@ -124,13 +137,11 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
     client2.invoke(() -> CacheServerTransactionsDUnitTest.verifyUpdates());
   }
 
-  
-
   /**
    * Test for update propagation to the clients when there are  2 servers and two
    * clients connected to both the servers.
-   * 
    */
+  @Test
   public void testServerToClientTransactionsPropagation()
   {
     Integer port1 = initServerCache(server1);
@@ -163,8 +174,8 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
   /**
    * Test for update propagation to the clients when there are  2 servers and two
    * clients connected to separate server.
-   * 
    */
+  @Test
   public void testServerToClientTransactionsPropagationWithOneClientConnectedToOneServer()
   {
     Integer port1 = initServerCache(server1);
@@ -198,6 +209,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
    * Test for invalidate propagation to the clients when there is one server and two
    * clients connected to the server.
    */
+  @Test
   public void testInvalidatesOneServerToClientTransactionsPropagation()
   {
     Integer port1 = initServerCache(server1);
@@ -222,6 +234,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
    * Test for invalidate propagation to the clients when there are  2 servers and two
    * clients connected to both servers.
    */
+  @Test
   public void testInvalidatesServerToClientTransactionsPropagation()
   {
     Integer port1 = initServerCache(server1);
@@ -248,8 +261,8 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
   /**
    * Test for invalidate propagation to the clients when there are  2 servers and two
    * clients connected to separate servers.
-   * 
    */
+  @Test
   public void testInvalidatesServerToClientTransactionsPropagationWithOneConnection()
   {
     Integer port1 = initServerCache(server1);
@@ -277,8 +290,8 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
   /**
    * Test for destroy propagation to the clients when there is one server and two
    * clients connected to the server.
-   * 
    */
+  @Test
   public void testDestroysOneServerToClientTransactionsPropagation()
   {
     Integer port1 = initServerCache(server1);
@@ -303,6 +316,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
    * Test for destroy propagation to the clients when there are  2 servers and two
    * clients connected to both servers.
    */
+  @Test
   public void testDestroysServerToClientTransactionsPropagation()
   {
     Integer port1 = initServerCache(server1);
@@ -331,6 +345,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
    * Test for destroy propagation to the clients when there are  2 servers and two
    * clients connected to sepatate servers.
    */
+  @Test
   public void testDestroysServerToClientTransactionsPropagationWithOneConnection()
   {
     Integer port1 = initServerCache(server1);
@@ -635,7 +650,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new CacheServerTransactionsDUnitTest("temp").createCache(props);
+    new CacheServerTransactionsDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, port.intValue())
       .setSubscriptionEnabled(true)
@@ -670,7 +685,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new CacheServerTransactionsDUnitTest("temp").createCache(props);
+    new CacheServerTransactionsDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, port1.intValue())
       .addServer(host, port2.intValue())
@@ -714,7 +729,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache(Integer maxThreads) throws Exception
   {
-    new CacheServerTransactionsDUnitTest("temp").createCache(new Properties());
+    new CacheServerTransactionsDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsSelectorDUnitTest.java
index 24945ea..9632bb6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsSelectorDUnitTest.java
@@ -16,16 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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;
+
 /**
  * Just like CacheServerTransactionsDUnitTest but configures bridge server
  * with thread pool (i.e. selector).
  */
+@Category(DistributedTest.class)
 public class CacheServerTransactionsSelectorDUnitTest
   extends CacheServerTransactionsDUnitTest
 {
   /** constructor */
-  public CacheServerTransactionsSelectorDUnitTest(String name) {
-    super(name);
+  public CacheServerTransactionsSelectorDUnitTest() {
+    super();
   }
 
   protected int getMaxThreads() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
index 8e25607..29fb164 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
@@ -16,7 +16,25 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -31,24 +49,20 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
 import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
 import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is the DUnit Test to verify clear and DestroyRegion operation in
  * Client-Server Configuration.
- *
- *
  */
-
-public class ClearPropagationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class ClearPropagationDUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -71,8 +85,8 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
   protected static boolean gotDestroyed = false;
 
   /** constructor */
-  public ClearPropagationDUnitTest(String name) {
-    super(name);
+  public ClearPropagationDUnitTest() {
+    super();
   }
 
   @Override
@@ -121,6 +135,7 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
    * the update
    *
    */
+  @Test
   public void testVerifyClearNotReceivedBySenderReceivedByOthers()
   {
 	  CacheSerializableRunnable resetFlags = new CacheSerializableRunnable(
@@ -172,6 +187,7 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
    * the update
    *
    */
+  @Test
   public void testEventIdGeneratedInDestroyRegionOperation() throws Exception
   {
 	CacheSerializableRunnable resetFlags = new CacheSerializableRunnable(
@@ -346,7 +362,7 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new ClearPropagationDUnitTest("temp").createCache(props);
+    new ClearPropagationDUnitTest().createCache(props);
     CacheServerTestUtil.disableShufflingOfEndpoints();
     Pool p;
     try {
@@ -390,7 +406,7 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new ClearPropagationDUnitTest("temp").createCache(new Properties());
+    new ClearPropagationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
index e05f9ff..47524bd 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
@@ -16,7 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -29,12 +45,15 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test verifies the per-client queue conflation override functionality
@@ -42,8 +61,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 5.7
  */
-public class ClientConflationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class ClientConflationDUnitTest extends JUnit4DistributedTestCase {
+
   VM vm0 = null; // server
   VM vm1 = null; // client
   private static Cache cacheClient = null;
@@ -54,11 +74,6 @@ public class ClientConflationDUnitTest extends DistributedTestCase
   private static final String REGION_NAME1 = "ClientConflationDUnitTest_region1" ;
   private static final String REGION_NAME2 = "ClientConflationDUnitTest_region2" ;
 
-  /** constructor */
-  public ClientConflationDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -91,6 +106,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
     System.setProperty("slowStartTimeForTesting","15000");
   }
 
+  @Test
   public void testConflationDefault() {
     try {
       performSteps(DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_DEFAULT);
@@ -100,6 +116,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
     }
   }
   
+  @Test
   public void testConflationOn() {
     try {
       performSteps(DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_ON);
@@ -109,6 +126,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
     }
   }
   
+  @Test
   public void testConflationOff() {
     try {
       performSteps(DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_OFF);
@@ -170,7 +188,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
    */
   public static void createClientCache(String host, Integer port, String conflation) throws Exception
   {
-    ClientConflationDUnitTest test = new ClientConflationDUnitTest("temp");
+    ClientConflationDUnitTest test = new ClientConflationDUnitTest();
     cacheClient = test.createCache(createProperties1(conflation));
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -215,7 +233,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
 
   public static void createClientCacheFeeder(String host, Integer port) throws Exception
   {
-    ClientConflationDUnitTest test = new ClientConflationDUnitTest("temp");
+    ClientConflationDUnitTest test = new ClientConflationDUnitTest();
     cacheFeeder = test.createCache(createProperties1(DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_DEFAULT));
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -391,7 +409,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
   {
     Properties props = new Properties();
     props.setProperty(DELTA_PROPAGATION, "false");
-    ClientConflationDUnitTest test = new ClientConflationDUnitTest("temp");
+    ClientConflationDUnitTest test = new ClientConflationDUnitTest();
     cacheServer = test.createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
index 7e51fe4..4261568 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
@@ -16,6 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
@@ -26,6 +46,15 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.dunit.*;
 import com.jayway.awaitility.Awaitility;
 
@@ -42,8 +71,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 6.0.3
  */
-public class ClientInterestNotifyDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class ClientInterestNotifyDUnitTest extends JUnit4DistributedTestCase {
+
   class EventListener extends CacheListenerAdapter
   {
     public EventListener(String name)
@@ -130,11 +160,6 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
   // Region 3 does NOT register any interest
   private static final String REGION_NAME3 = "ClientInterestNotifyDUnitTest_region3" ;
 
-  /** constructor */
-  public ClientInterestNotifyDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -156,13 +181,9 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
     return cache;
   }
 
-  public void testInterestNotify() {
-    try {
-      performSteps();
-    }
-    catch( Exception e ) {
-      Assert.fail("testInterestNotify failed due to exception", e);
-    }
+  @Test
+  public void testInterestNotify() throws Exception {
+    performSteps();
   }
   
   private void performSteps() throws Exception {
@@ -302,7 +323,7 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
   public static void createClientCache(String host, Integer port, /*String nbs,*/
       String name) throws Exception
   {
-    ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest("temp");
+    ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest();
     Cache cacheClient = test.createCache(createProperties1(/*nbs*/));
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -331,7 +352,7 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
   
   public static void createClientCacheFeeder(String host, Integer port) throws Exception
   {
-    ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest("temp");
+    ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest();
     Cache cacheFeeder = test.createCache(createProperties1(
         /*DistributionConfig.NOTIFY_BY_SUBSCRIPTION_OVERRIDE_PROP_VALUE_DEFAULT*/));
     AttributesFactory factory = new AttributesFactory();
@@ -412,7 +433,7 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
    */
   public static Integer createServerCache() throws Exception
   {
-    ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest("temp");
+    ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest();
     Properties props = new Properties();
     props.setProperty(DELTA_PROPAGATION, "false");
     cacheServer = test.createCache(props);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java
index 04a8568..2f10dc1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java
@@ -16,14 +16,34 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.cache.client.NoAvailableServersException;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.AbstractRegionMap;
@@ -34,22 +54,14 @@ import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
-import org.apache.logging.log4j.Logger;
-
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static com.jayway.awaitility.Awaitility.with;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests client server FORCE_INVALIDATE
  */
-public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
-{
-  private static final long serialVersionUID = 1L;
+@Category(DistributedTest.class)
+public class ClientServerForceInvalidateDUnitTest extends JUnit4CacheTestCase {
 
   private static final Logger logger = LogService.getLogger();
 
@@ -62,14 +74,8 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
   private static VM server1;
   private static VM server2;
 
-  /** constructor */
-  public ClientServerForceInvalidateDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
-  public final void postSetUp() throws Exception
-  {
+  public final void postSetUp() throws Exception {
     host = Host.getHost(0);
     server1 = host.getVM(0);
     server2 = host.getVM(1);
@@ -79,27 +85,35 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
     return vm.invoke(() -> createServerCache(concurrencyChecksEnabled, partitioned, 0));
   }
 
+  @Test
   public void testForceInvalidateOnCachingProxyWithConcurrencyChecks() throws Exception {
     dotestForceInvalidate(true, true, false, true);
   }
+  @Test
   public void testForceInvalidateOnCachingProxyWithConcurrencyChecksOnlyOnServer() throws Exception {
     dotestForceInvalidate(true, false, false, true);
   }
+  @Test
   public void testForceInvalidateOnCachingProxyWithConcurrencyChecksOnlyOnClient() throws Exception {
     dotestForceInvalidate(false, true, false, true);
   }
+  @Test
   public void testForceInvalidateOnProxyWithConcurrencyChecks() throws Exception {
     dotestForceInvalidate(true, true, true, true);
   }
+  @Test
   public void testForceInvalidateOnProxyWithConcurrencyChecksOnlyOnServer() throws Exception {
     dotestForceInvalidate(true, false, true, true);
   }
+  @Test
   public void testForceInvalidateOnProxyWithConcurrencyChecksOnlyOnClient() throws Exception {
     dotestForceInvalidate(false, true, true, true);
   }
+  @Test
   public void testForceInvalidateOnCachingProxyWithConcurrencyChecksServerReplicated() throws Exception {
     dotestForceInvalidate(true, true, false, false);
   }
+  @Test
   public void testForceInvalidateOnProxyWithConcurrencyChecksServerReplicated() throws Exception {
     dotestForceInvalidate(true, true, true, false);
   }
@@ -116,6 +130,7 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
    *    It will arrive late and not be done because of concurrency checks.
    * 7. verify that afterInvalidate was invoked on the client.
    */
+  @Test
   public void testInvalidateLosingOnConcurrencyChecks() throws Exception {
     try {
       setupServerAndClientVMs(true, true, false, false);
@@ -230,7 +245,6 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
       }
     }
     return false;
-    
   }
 
   private boolean hasClientListenerAfterInvalidateBeenInvoked() {
@@ -246,11 +260,11 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
     }
     return false;
   }
-  private static Integer createServerCache(Boolean concurrencyChecksEnabled, Boolean partitioned, Integer maxThreads)
-  throws Exception {
+
+  private static Integer createServerCache(Boolean concurrencyChecksEnabled, Boolean partitioned, Integer maxThreads) throws Exception {
     AbstractRegionMap.FORCE_INVALIDATE_EVENT = true;
     Properties props = new Properties();
-    Cache cache = new ClientServerForceInvalidateDUnitTest("temp").createCacheV(props);
+    Cache cache = new ClientServerForceInvalidateDUnitTest().createCacheV(props);
     RegionFactory<String, String> factory = cache.createRegionFactory();
     if (partitioned) {
       factory.setDataPolicy(DataPolicy.PARTITION);
@@ -277,13 +291,12 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
 
   }
   
-  public static void createClientCache(String h, int port1, int port2, boolean empty, boolean concurrenctChecksEnabled)
-  throws Exception  {
+  public static void createClientCache(String h, int port1, int port2, boolean empty, boolean concurrenctChecksEnabled) throws Exception  {
     AbstractRegionMap.FORCE_INVALIDATE_EVENT = true;
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    Cache cache = new ClientServerForceInvalidateDUnitTest("temp").createCacheV(props);
+    Cache cache = new ClientServerForceInvalidateDUnitTest().createCacheV(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(h, port1)
       .addServer(h, port2)
@@ -342,27 +355,27 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
   static class ClientListener extends CacheListenerAdapter<String, String> {
     public boolean afterInvalidateInvoked;
     @Override
-      public void afterCreate(EntryEvent<String, String> event) {
-        super.afterCreate(event);
-        logger.info("afterCreate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis());
-      }
-      @Override
-      public void afterUpdate(EntryEvent<String, String> event) {
-        super.afterUpdate(event);
-        logger.info("afterUpdate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis());
-      }
-      @Override
-      public void afterInvalidate(final EntryEvent<String, String> event) {
-        super.afterInvalidate(event);
-        afterInvalidateInvoked = true;
-        String prefix = "";
-        if (!event.isOriginRemote()) {
-          prefix = "    ";
-        }
-        logger.info(prefix + "afterInvalidate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis());
-
+    public void afterCreate(EntryEvent<String, String> event) {
+      super.afterCreate(event);
+      logger.info("afterCreate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis());
+    }
+    @Override
+    public void afterUpdate(EntryEvent<String, String> event) {
+      super.afterUpdate(event);
+      logger.info("afterUpdate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis());
+    }
+    @Override
+    public void afterInvalidate(final EntryEvent<String, String> event) {
+      super.afterInvalidate(event);
+      afterInvalidateInvoked = true;
+      String prefix = "";
+      if (!event.isOriginRemote()) {
+        prefix = "    ";
       }
+      logger.info(prefix + "afterInvalidate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis());
+    }
   }
+
   static class ServerListener extends CacheListenerAdapter<String, String> {
     boolean afterInvalidateInvoked;
     @Override
@@ -396,7 +409,7 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase
   private static void closeForceInvalidateCache()
   {
     AbstractRegionMap.FORCE_INVALIDATE_EVENT = false;
-    Cache cache = new ClientServerForceInvalidateDUnitTest("temp").getCache();
+    Cache cache = new ClientServerForceInvalidateDUnitTest().getCache();
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();


[40/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
index 877c611..3794b37 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
@@ -20,37 +20,62 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+import static org.junit.Assume.*;
+
+import java.net.UnknownHostException;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.internal.DistributionAdvisor;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.NetMember;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.DistributedCacheOperation;
+import com.gemstone.gemfire.internal.cache.DistributedRegion;
+import com.gemstone.gemfire.internal.cache.EntryEventImpl;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.InitialImageOperation;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.RegionClearedException;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
+import com.gemstone.gemfire.internal.cache.TombstoneService;
+import com.gemstone.gemfire.internal.cache.UpdateOperation;
+import com.gemstone.gemfire.internal.cache.VersionTagHolder;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.cache.versions.VMVersionTag;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
 import com.gemstone.gemfire.internal.cache.vmotion.VMotionObserver;
 import com.gemstone.gemfire.internal.cache.vmotion.VMotionObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.net.UnknownHostException;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
+@Category(DistributedTest.class)
 public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitTest {
 
-  public DistributedAckRegionCCEDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Override
   protected boolean supportsTransactions() {
     return true;
   }
-  
 
   @Override
   public Properties getDistributedSystemProperties() {
@@ -62,10 +87,10 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
     return p;
   }
 
-
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
+  @Override
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -73,6 +98,8 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
     factory.setConcurrencyChecksEnabled(true);
     return factory.create();
   }
+
+  @Override
   protected RegionAttributes getRegionAttributes(String type) {
     RegionAttributes ra = getCache().getRegionAttributes(type);
     if (ra == null) {
@@ -84,44 +111,37 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
     return factory.create();
   }
 
+  @Ignore("replicates don't allow local destroy")
   @Override
+  @Test
   public void testLocalDestroy() throws InterruptedException {
     // replicates don't allow local destroy
   }
 
-//  public void testRepeatedClearWithConcurrentEvents() throws Exception {
-//    for (int i=0; i<50; i++) {
-//      getLogWriter().info("running test #"+i);
-//      z_versionTestClearWithConcurrentEvents(true);
-//      tearDown();
-//      setUp();
-//    }
-//  }
-
-
+  @Ignore("replicates don't allow local destroy")
   @Override
+  @Test
   public void testEntryTtlLocalDestroy() throws InterruptedException {
     // replicates don't allow local destroy
   }
 
-  
   /**
    * This test creates a server cache in vm0 and a peer cache in vm1.
    * It then tests to see if GII transferred tombstones to vm1 like it's supposed to.
    * A client cache is created in vm2 and the same sort of check is performed
    * for register-interest.
    */
-
+  @Test
   public void testGIISendsTombstones() throws Exception {
     versionTestGIISendsTombstones();
   }
 
-
   /**
    * test for bug #45564.  a create() is received by region creator and then
    * a later destroy() is received in initial image and while the version info
    * from the destroy is recorded we keep the value from the create event
    */
+  @Test
   public void testConcurrentOpWithGII() {
     if (this.getClass() != DistributedAckRegionCCEDUnitTest.class) {
       return; // not really a scope-related thing
@@ -238,7 +258,6 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
     }
   }  
 
-  
   protected void do_version_recovery_if_necessary(final VM vm0, final VM vm1, final VM vm2, final Object[] params) {
     // do nothing here
   }
@@ -247,24 +266,30 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
    * This tests the concurrency versioning system to ensure that event conflation
    * happens correctly and that the statistic is being updated properly
    */
+  @Test
   public void testConcurrentEvents() throws Exception {
     versionTestConcurrentEvents();
   }
   
   @Category(FlakyTest.class) // GEODE-720: time sensitive, async actions, thread sleeps
+  @Test
   public void testClearWithConcurrentEvents() throws Exception {
     z_versionTestClearWithConcurrentEvents(true);
   }
 
   @Category(FlakyTest.class) // GEODE-599 and GEODE-1046: async actions, thread sleeps -- // GEODE-1046: this may be hitting a product bug!
+  @Test
   public void testClearWithConcurrentEventsAsync() throws Exception {
     versionTestClearWithConcurrentEventsAsync();
   }
 
+  @Category(FlakyTest.class) // bug #45704
+  @Test
   public void testClearOnNonReplicateWithConcurrentEvents() throws Exception {
     versionTestClearOnNonReplicateWithConcurrentEvents();
   }
 
+  @Test
   public void testTombstones() {
     versionTestTombstones();
   }
@@ -274,6 +299,7 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
    * a tombstone has been reaped is accepted by another member that has yet to
    * reap the tombstone
    */
+  @Test
   public void testTombstoneExpirationRace() {
     VM vm0 = Host.getHost(0).getVM(0);
     VM vm1 = Host.getHost(0).getVM(1);
@@ -330,17 +356,15 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
       });
     disconnectAllFromDS();
   }
-  
-  
 
   /**
    * Test for bug #46087 and #46089 where the waiting thread pool is flooded with
    * threads performing distributed-GC.  This could be moved to a JUnit test class.
    */
+  @Test
   public void testAggressiveTombstoneReaping() {
-    if (this.getClass() != DistributedAckRegionCCEDUnitTest.class) {
-      return; // not really a scope-related thing
-    }
+    assumeTrue(getClass() == DistributedAckRegionCCEDUnitTest.class);
+
     final String name = this.getUniqueName() + "-CC";
 
 
@@ -380,40 +404,33 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
     }
   }
 
-  
-  
-  
-  
-  
   /**
    * This tests the concurrency versioning system to ensure that event conflation
    * happens correctly and that the statistic is being updated properly
    */
+  @Test
   public void testConcurrentEventsOnEmptyRegion() {
     versionTestConcurrentEventsOnEmptyRegion();
   }
-  
-  
-  
-  
+
   /**
    * This tests the concurrency versioning system to ensure that event conflation
    * happens correctly and that the statistic is being updated properly
    */
+  @Test
   public void testConcurrentEventsOnNonReplicatedRegion() {
     versionTestConcurrentEventsOnNonReplicatedRegion();
   }
-  
-  
+
+  @Test
   public void testGetAllWithVersions() {
     versionTestGetAllWithVersions();
   }
 
-  
+  @Test
   public void testEntryVersionRollover() throws Exception {
-    if (this.getClass() != DistributedAckRegionCCEDUnitTest.class) {
-      return;
-    }
+    assumeTrue(getClass() == DistributedAckRegionCCEDUnitTest.class);
+
     final String name = this.getUniqueName() + "-CC";
     final int numEntries = 1;
     SerializableRunnable createRegion = new SerializableRunnable("Create Region") {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
index e766a49..739da00 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
@@ -16,14 +16,18 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Distributed Ack Region with ConcurrencyChecksEnabled and OffHeap memory.
@@ -31,12 +35,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * @since Geode 1.0
  */
 @SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
 public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegionCCEDUnitTest {
 
-  public DistributedAckRegionCCEOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
@@ -59,8 +60,8 @@ public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegio
     return props;
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
+  @SuppressWarnings({ "rawtypes", "unchecked" })
   protected RegionAttributes getRegionAttributes() {
     RegionAttributes attrs = super.getRegionAttributes();
     AttributesFactory factory = new AttributesFactory(attrs);
@@ -68,8 +69,8 @@ public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegio
     return factory.create();
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
+  @SuppressWarnings({ "rawtypes", "unchecked" })
   protected RegionAttributes getRegionAttributes(String type) {
     RegionAttributes ra = super.getRegionAttributes(type);
     AttributesFactory factory = new AttributesFactory(ra);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCompressionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCompressionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCompressionDUnitTest.java
index b4517a9..f50a30e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCompressionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCompressionDUnitTest.java
@@ -16,25 +16,23 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.compression.Compressor;
 import com.gemstone.gemfire.compression.SnappyCompressor;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Distributed Ack Region with compression.
  * 
  * @since GemFire 8.0
  */
+@Category(DistributedTest.class)
 @SuppressWarnings({ "deprecation", "serial" })
-public class DistributedAckRegionCompressionDUnitTest extends
-    DistributedAckRegionDUnitTest {
+public class DistributedAckRegionCompressionDUnitTest extends DistributedAckRegionDUnitTest {
   
-  public DistributedAckRegionCompressionDUnitTest(String name) {
-    super(name);
-  }
-
   @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
   protected RegionAttributes getRegionAttributes() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
index 1587179..48a97c9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
@@ -17,24 +17,35 @@
 package com.gemstone.gemfire.cache30;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.test.dunit.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * This class tests the functionality of a cache {@link Region region}
  * that has a scope of {@link Scope#DISTRIBUTED_ACK distributed ACK}.
  *
  * @since GemFire 3.0
  */
+@Category(DistributedTest.class)
 public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
 
-  public DistributedAckRegionDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
@@ -54,14 +65,13 @@ public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
     return p;
   }
 
-  //////////////////////  Test Methods  //////////////////////
-
   /**
    * Tests the compatibility of creating certain kinds of subregions
    * of a local region.
    *
    * @see Region#createSubregion
    */
+  @Test
   public void testIncompatibleSubregions()
     throws CacheException, InterruptedException {
 
@@ -122,7 +132,4 @@ public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
         }
       });
   } 
-  
-
-  
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
index 89b32d5..388a6e3 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
@@ -16,28 +16,28 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Distributed Ack Region with OffHeap memory.
  * 
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 @SuppressWarnings({ "deprecation", "serial" })
 public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDUnitTest {
 
-  public DistributedAckRegionOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
@@ -60,8 +60,8 @@ public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDU
     return props;
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
+  @SuppressWarnings({ "rawtypes", "unchecked" })
   protected RegionAttributes getRegionAttributes() {
     RegionAttributes attrs = super.getRegionAttributes();
     AttributesFactory factory = new AttributesFactory(attrs);
@@ -69,8 +69,8 @@ public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDU
     return factory.create();
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
+  @SuppressWarnings({ "rawtypes", "unchecked" })
   protected RegionAttributes getRegionAttributes(String type) {
     RegionAttributes ra = super.getRegionAttributes(type);
     AttributesFactory factory = new AttributesFactory(ra);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
index a2bee79..5776158 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
@@ -16,7 +16,22 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.InternalLocator;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
@@ -25,15 +40,16 @@ import com.gemstone.gemfire.pdx.PdxReader;
 import com.gemstone.gemfire.pdx.PdxSerializable;
 import com.gemstone.gemfire.pdx.PdxSerializationException;
 import com.gemstone.gemfire.pdx.PdxWriter;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DistributedMulticastRegionDUnitTest extends JUnit4CacheTestCase {
 
   static int locatorVM = 3;
   static String mcastport = "42786";
@@ -41,10 +57,6 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
   
   private int locatorPort;
 
-  public DistributedMulticastRegionDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preSetUp() throws Exception {
     clean();
@@ -65,6 +77,7 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
     Invoke.invokeInEveryVM(cleanVM);    
   }
   
+  @Test
   public void testMulticastEnabled() {
     final String name = "mcastRegion";
     SerializableRunnable create =
@@ -120,7 +133,7 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
       closeLocator();      
   }
   
-  public class TestObjectThrowsException implements PdxSerializable {
+  private static class TestObjectThrowsException implements PdxSerializable {
     String name = "TestObjectThrowsException";
 
     @Override
@@ -130,12 +143,11 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
 
     @Override
     public void fromData(PdxReader reader) {
-      throw new RuntimeException("Unable to desrialize message ");
-      //name = reader.readString("name");
+      throw new RuntimeException("Unable to deserialize message ");
     }
-    
   }
   
+  @Test
   public void testMulticastWithRegionOpsException() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -260,30 +272,30 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
   }
   
   private int startLocator() {
-  final int [] ports = AvailablePortHelper.getRandomAvailableTCPPorts(3);
-  final int locatorPort = ports[0];
-  
-  VM locator1Vm = Host.getHost(0).getVM(locatorVM);;
-    locator1Vm.invoke(new SerializableCallable() {
-      @Override
-      public Object call() {
-        final File locatorLogFile = new File(getTestMethodName() + "-locator-" + locatorPort + ".log");
-        final Properties locatorProps = new Properties();
-        locatorProps.setProperty(NAME, "LocatorWithMcast");
-        locatorProps.setProperty(MCAST_PORT, mcastport);
-        locatorProps.setProperty(MCAST_TTL, mcastttl);
-        locatorProps.setProperty(LOG_LEVEL, "info");
-        //locatorProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "true");
-        try {
-          final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locatorPort, null, null,
-              locatorProps);
-          System.out.println("test Locator started " + locatorPort);
-           } catch (IOException ioex) {
-          fail("Unable to create a locator with a shared configuration");
+    final int [] ports = AvailablePortHelper.getRandomAvailableTCPPorts(3);
+    final int locatorPort = ports[0];
+
+    VM locator1Vm = Host.getHost(0).getVM(locatorVM);
+      locator1Vm.invoke(new SerializableCallable() {
+        @Override
+        public Object call() {
+          final File locatorLogFile = new File(getTestMethodName() + "-locator-" + locatorPort + ".log");
+          final Properties locatorProps = new Properties();
+          locatorProps.setProperty(NAME, "LocatorWithMcast");
+          locatorProps.setProperty(MCAST_PORT, mcastport);
+          locatorProps.setProperty(MCAST_TTL, mcastttl);
+          locatorProps.setProperty(LOG_LEVEL, "info");
+          //locatorProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "true");
+          try {
+            final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locatorPort, null, null,
+                locatorProps);
+            System.out.println("test Locator started " + locatorPort);
+             } catch (IOException ioex) {
+            fail("Unable to create a locator with a shared configuration");
+          }
+
+          return null;
         }
-  
-        return null;
-      }
     });
     return locatorPort;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
index 35660a6..8720fcc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
@@ -16,27 +16,43 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.*;
-import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.Map;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EntryNotFoundException;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.FlakyTest;
+
+@Category(DistributedTest.class)
 public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDUnitTest {
   
   static volatile boolean ListenerBlocking;
 
-  public DistributedNoAckRegionCCEDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public Properties getDistributedSystemProperties() {
     Properties p = super.getDistributedSystemProperties();
@@ -48,7 +64,6 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
     return p;
   }
 
-
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
@@ -84,15 +99,18 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
 
 
   @Override
+  @Test
   public void testLocalDestroy() throws InterruptedException {
     // replicates don't allow local destroy
   }
 
   @Override
+  @Test
   public void testEntryTtlLocalDestroy() throws InterruptedException {
     // replicates don't allow local destroy
   }
 
+  @Test
   public void testClearWithManyEventsInFlight() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -224,6 +242,7 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
    * for register-interest.
    */
 
+  @Test
   public void testGIISendsTombstones() throws Exception {
     versionTestGIISendsTombstones();
   }
@@ -237,24 +256,29 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
    * This tests the concurrency versioning system to ensure that event conflation
    * happens correctly and that the statistic is being updated properly
    */
+  @Test
   public void testConcurrentEvents() throws Exception {
     versionTestConcurrentEvents();
   }
   
   
+  @Test
   public void testClearWithConcurrentEvents() throws Exception {
     // need to figure out how to flush clear() ops for verification steps
   }
 
+  @Test
   public void testClearWithConcurrentEventsAsync() throws Exception {
     // need to figure out how to flush clear() ops for verification steps
   }
 
+  @Test
   public void testClearOnNonReplicateWithConcurrentEvents() throws Exception {
     // need to figure out how to flush clear() ops for verification steps
   }
   
   
+  @Test
   public void testTombstones() throws Exception {
 //    for (int i=0; i<1000; i++) {
 //      System.out.println("starting run #"+i);
@@ -272,6 +296,7 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
   
   
   
+  @Test
   public void testOneHopKnownIssues() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -349,6 +374,7 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
    * happens correctly and that the statistic is being updated properly
    */
   @Category(FlakyTest.class) // GEODE-976: time sensitive, thread sleeps, relies on stat values
+  @Test
   public void testConcurrentEventsOnEmptyRegion() {
     versionTestConcurrentEventsOnEmptyRegion();
   }
@@ -357,11 +383,13 @@ public class DistributedNoAckRegionCCEDUnitTest extends DistributedNoAckRegionDU
    * This tests the concurrency versioning system to ensure that event conflation
    * happens correctly and that the statistic is being updated properly
    */
+  @Test
   public void testConcurrentEventsOnNonReplicatedRegion() {
     versionTestConcurrentEventsOnNonReplicatedRegion();
   }
   
   
+  @Test
   public void testGetAllWithVersions() {
     versionTestGetAllWithVersions();
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
index 9980e56..c871632 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
@@ -16,28 +16,28 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Distributed Ack Region with ConcurrencyChecksEnabled and OffHeap memory.
  * 
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 @SuppressWarnings({ "deprecation", "serial" })
 public class DistributedNoAckRegionCCEOffHeapDUnitTest extends DistributedNoAckRegionCCEDUnitTest {
 
-  public DistributedNoAckRegionCCEOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
index 454d0ce..aecce60 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
@@ -16,9 +16,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.Arrays;
 import java.util.Set;
 
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -37,6 +43,7 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the functionality of a cache {@link Region region}
@@ -45,12 +52,9 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  *
  * @since GemFire 3.0
  */
+@Category(DistributedTest.class)
 public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
 
-  public DistributedNoAckRegionDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
@@ -62,12 +66,12 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
     return factory.create();
   }
 
-  //////////////////////  Test Methods  //////////////////////
-
-  /** Tests creating a distributed subregion of a local scope region,
+  /**
+   * Tests creating a distributed subregion of a local scope region,
    * which should fail.
    */
-  public void testDistSubregionOfLocalRegion() throws CacheException {
+  @Test
+  public void testDistSubregionOfLocalRegion() throws Exception {
     // creating a distributed subregion of a LOCAL region is illegal.
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -87,8 +91,8 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
    *
    * @see Region#createSubregion
    */
-  public void testIncompatibleSubregions()
-    throws CacheException, InterruptedException {
+  @Test
+  public void testIncompatibleSubregions() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -121,17 +125,16 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
             try {
               createRootRegion( "INCOMPATIBLE_ROOT", factory.create());
               fail("Should have thrown an IllegalStateException");
-//              createRegion(name, factory.create());
             } catch (IllegalStateException ex) {
               // pass...
             }
-//            assertNull(getRootRegion());
 
           } catch (CacheException ex) {
             Assert.fail("While creating GLOBAL Region", ex);
           }
         }
       });
+
     vm1.invoke(new SerializableRunnable("Create ACK Region") {
         public void run() {
           try {
@@ -142,11 +145,9 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
             try {
               createRootRegion( "INCOMPATIBLE_ROOT", factory.create());
               fail("Should have thrown an IllegalStateException");
-//              createRegion(name, factory.create());
             } catch (IllegalStateException ex) {
               // pass...
             }
-//            assertNull(getRootRegion());
 
           } catch (CacheException ex) {
             Assert.fail("While creating ACK Region", ex);
@@ -156,6 +157,7 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
   }
 
   private static final int CHUNK_SIZE = 500 * 1024; // == InitialImageOperation.CHUNK_SIZE_IN_BYTES
+
   // use sizes so it completes in < 15 sec, but hangs if bug exists
   private static final int NUM_ENTRIES_VM = 15000;
   private static final int VALUE_SIZE_VM = CHUNK_SIZE * 150 / NUM_ENTRIES_VM;
@@ -170,7 +172,9 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
    * and GII is now non-blocking (bug 30705 was caused blocking gii).
    * This test can take a long time to run on disk regions.
    */
-  public void disabled_testBug30705() throws InterruptedException {    
+  @Ignore("TODO")
+  @Test
+  public void testBug30705() throws Exception {
     final String name = this.getUniqueName();
     final int numEntries = NUM_ENTRIES_VM;
     final int valueSize = VALUE_SIZE_VM;
@@ -213,7 +217,6 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
         }
     };
 
-
     vm0.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Put data") {
@@ -263,12 +266,6 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
             }
           };
           Wait.waitForCriterion(ev, 30 * 1000, 200, true);
-//          pause(100);
-//           try {
-//             getRootRegion().getSubregion(name).destroyRegion();
-//           } catch (OperationAbortedException ignore) {
-//           }
-//           closeCache();
         }
        });
     } // finally
@@ -297,13 +294,13 @@ public class DistributedNoAckRegionDUnitTest extends MultiVMRegionTestCase {
 
   /**
    * The number of milliseconds to try repeating validation code in the
-   * event that AssertionFailedError is thrown.  For DISTRIBUTED_NO_ACK 
+   * event that AssertionError is thrown.  For DISTRIBUTED_NO_ACK
    * scopes, a repeat timeout is used to account for the fact that a
    * previous operation may have not yet completed.
    */
   @Override
   protected long getRepeatTimeoutMs() {
-    return 5000;
+    return 120*1000;
   }
   
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
index 73f5201..b74956c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
@@ -16,25 +16,30 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 /**
  * Tests Distributed NoAck Region with OffHeap memory.
  * 
  * @since Geode 1.0
  */
 @SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
 public class DistributedNoAckRegionOffHeapDUnitTest extends DistributedNoAckRegionDUnitTest {
 
-  public DistributedNoAckRegionOffHeapDUnitTest(String name) {
-    super(name);
+  public DistributedNoAckRegionOffHeapDUnitTest() {
+    super();
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
index 472546f..046df3d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.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.util.Properties;
 
@@ -40,12 +49,13 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 4.3
  */
-public class DynamicRegionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DynamicRegionDUnitTest extends JUnit4CacheTestCase {
 
   // Specify oplog size in MB
   private static final int OPLOG_SIZE = 1;
-  public DynamicRegionDUnitTest(String name) {
-    super(name);
+  public DynamicRegionDUnitTest() {
+    super();
   }
 
   // this test has special config of its distributed system so
@@ -215,6 +225,7 @@ public class DynamicRegionDUnitTest extends CacheTestCase {
   /**
    * Make sure dynamic regions work on peers
    */
+  @Test
   public void testPeerRegion() {
     assertEquals(true, DynamicRegionFactory.get().isOpen());
     createParentRegion("parent", true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalLockingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalLockingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalLockingDUnitTest.java
index 0830b7e..09b1613 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalLockingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalLockingDUnitTest.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.util.concurrent.locks.Lock;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -35,12 +44,13 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  * This class tests distributed locking of global region entries.
  */
-public class GlobalLockingDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class GlobalLockingDUnitTest extends JUnit4CacheTestCase {
 
   public static Region region_testBug32356;
   
-  public GlobalLockingDUnitTest(String name) {
-    super(name);
+  public GlobalLockingDUnitTest() {
+    super();
   }
 
   /**
@@ -71,6 +81,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /** 
    * Tests for 32356 R2 tryLock w/ 0 timeout broken in Distributed Lock Service
    */
+  @Test
   public void testBug32356() throws Exception {
     LogWriterUtils.getLogWriter().fine("[testBug32356]");
     Host host = Host.getHost(0);
@@ -107,6 +118,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testNonGlobalRegion() throws CacheException {
     String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory(getGlobalAttrs());
@@ -136,6 +148,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testSingleVMLockUnlock() throws CacheException {
     String name = this.getUniqueName() + "-GLOBAL";
     Region region = getOrCreateRootRegion().createSubregion(name, getGlobalAttrs());
@@ -145,6 +158,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
     lock.unlock();
   }
   
+  @Test
   public void testIsLockGrantorAttribute() throws Exception {
     String name = this.getUniqueName() + "-testIsLockGrantorAttribute";
     AttributesFactory factory = new AttributesFactory(getGlobalAttrs());
@@ -161,6 +175,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * Get the lock in one VM, try to create in other
    */
+  @Test
   public void testCreateLockTimeout() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -193,6 +208,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * get the lock in one VM, try to put() in other
    */
+  @Test
   public void testPutLockTimeout() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -224,6 +240,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * get lock in one VM, try to invoke loader in other
    */
+  @Test
   public void testLoadLockTimeout() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -265,6 +282,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * get lock in one VM, try to invalidate in other
    */
+  @Test
   public void testInvalidateLockTimeout() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -296,6 +314,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * get lock in one VM, try to destroy in other
    */
+  @Test
   public void testDestroyLockTimeout() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -329,6 +348,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * get the lock, region.get(), region.put(), release lock
    */
+  @Test
   public void testLockGetPut() throws CacheException {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -379,6 +399,7 @@ public class GlobalLockingDUnitTest extends CacheTestCase {
   /**
    * Test Region.getRegionDistributedLock(), calling lock() and then unlock()
    */
+  @Test
   public void testRegionDistributedLockSimple() throws CacheException
   {
     final String name = this.getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
index deefac4..9a8f0e0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
@@ -20,7 +20,21 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.RegionClearedException;
 import com.gemstone.gemfire.internal.cache.RegionEntry;
@@ -30,27 +44,16 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
-import org.junit.Ignore;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This test is only for GLOBAL REPLICATE Regions. Tests are
  * similar to {@link DistributedAckRegionCCEDUnitTest}.
- *
- * 
  */
+@Category(DistributedTest.class)
 public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
 
-  /**
-   * @param name
-   */
-  public GlobalRegionCCEDUnitTest(String name) {
-    super(name);
-  }
-
+  @Override
   protected boolean supportsTransactions() {
     return true;
   }
@@ -69,6 +72,7 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
+  @Override
   protected RegionAttributes getRegionAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.GLOBAL);
@@ -77,6 +81,7 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
     return factory.create();
   }
 
+  @Override
   protected RegionAttributes getRegionAttributes(String type) {
     RegionAttributes ra = getCache().getRegionAttributes(type);
     if (ra == null) {
@@ -89,12 +94,16 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
     return factory.create();
   }
 
+  @Ignore("replicates don't allow local destroy")
   @Override
+  @Test
   public void testLocalDestroy() throws InterruptedException {
     // replicates don't allow local destroy
   }
 
+  @Ignore("replicates don't allow local destroy")
   @Override
+  @Test
   public void testEntryTtlLocalDestroy() throws InterruptedException {
     // replicates don't allow local destroy
   }
@@ -105,10 +114,12 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
    * client cache is created in vm2 and the same sort of check is performed for
    * register-interest.
    */
+  @Test
   public void testGIISendsTombstones() throws Exception {
     versionTestGIISendsTombstones();
   }
 
+  // TODO: delete this unused method
   protected void do_version_recovery_if_necessary(final VM vm0, final VM vm1,
       final VM vm2, final Object[] params) {
     // do nothing here
@@ -119,24 +130,33 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
    * conflation happens correctly and that the statistic is being updated
    * properly
    */
+  @Test
   public void testConcurrentEvents() throws Exception {
     versionTestConcurrentEvents();
   }
 
   // these tests for clear() take too long with global regions and cause false dunit hangs
   // on older machines
-//  public void testClearWithConcurrentEvents() throws Exception {
-//    z_versionTestClearWithConcurrentEvents(true);
-//  }
-//
-//  public void testClearWithConcurrentEventsAsync() throws Exception {
-//    versionTestClearWithConcurrentEventsAsync();
-//  }
-//
-//  public void testClearOnNonReplicateWithConcurrentEvents() throws Exception {
-//    versionTestClearOnNonReplicateWithConcurrentEvents();
-//  }
 
+  @Ignore("TODO: takes too long with global regions and cause false dunit hangs")
+  @Test
+  public void testClearWithConcurrentEvents() throws Exception {
+    z_versionTestClearWithConcurrentEvents(true);
+  }
+
+  @Ignore("TODO: takes too long with global regions and cause false dunit hangs")
+  @Test
+  public void testClearWithConcurrentEventsAsync() throws Exception {
+    versionTestClearWithConcurrentEventsAsync();
+  }
+
+  @Ignore("TODO: takes too long with global regions and cause false dunit hangs")
+  @Test
+  public void testClearOnNonReplicateWithConcurrentEvents() throws Exception {
+    versionTestClearOnNonReplicateWithConcurrentEvents();
+  }
+
+  @Test
   public void testTombstones() {
     versionTestTombstones();
   }
@@ -146,6 +166,7 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
    * tombstone has been reaped is accepted by another member that has yet to
    * reap the tombstone
    */
+  @Test
   public void testTombstoneExpirationRace() {
     VM vm0 = Host.getHost(0).getVM(0);
     VM vm1 = Host.getHost(0).getVM(1);
@@ -216,7 +237,8 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
    * properly
    */
   @Ignore("Disabling due to bug #52347")
-  public void DISABLED_testConcurrentEventsOnEmptyRegion() {
+  @Test
+  public void testConcurrentEventsOnEmptyRegion() {
     versionTestConcurrentEventsOnEmptyRegion();
   }
 
@@ -225,15 +247,17 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
    * conflation happens correctly and that the statistic is being updated
    * properly
    */
+  @Ignore("TODO: reenable this test")
+  @Test
   public void testConcurrentEventsOnNonReplicatedRegion() {
     // Shobhit: Just commenting out for now as it is being fixed by Bruce.
     // TODO: uncomment the test asa the bug is fixed.
     //versionTestConcurrentEventsOnNonReplicatedRegion();
   }
 
+  @Test
   public void testGetAllWithVersions() {
     versionTestGetAllWithVersions();
   }
 
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
index 0c7b17d..dddc2e5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
@@ -16,6 +16,17 @@
  */
 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.util.Properties;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
@@ -31,13 +42,10 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * 
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 @SuppressWarnings({ "deprecation", "serial" })
 public class GlobalRegionCCEOffHeapDUnitTest extends GlobalRegionCCEDUnitTest {
 
-  public GlobalRegionCCEOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
index 8c40d6f..b105354 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
@@ -16,10 +16,15 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -38,6 +43,7 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the functionality of a cache {@link Region region}
@@ -45,12 +51,9 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 3.0
  */
+@Category(DistributedTest.class)
 public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
 
-  public GlobalRegionDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
@@ -70,6 +73,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
    *
    * @see Region#createSubregion
    */
+  @Test
   public void testIncompatibleSubregions()
     throws CacheException, InterruptedException {
 
@@ -145,6 +149,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
    * Tests that a value in a remote cache will be fetched by
    * <code>netSearch</code> and that no loaders are invoked.
    */
+  @Test
   public void testRemoteFetch() throws CacheException {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
@@ -198,6 +203,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
    * Tests that a bunch of threads in a bunch of VMs all atomically
    * incrementing the value of an entry get the right value.
    */
+  @Test
   public void testSynchronousIncrements()
     throws InterruptedException {
 
@@ -338,6 +344,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
    * Tests that {@link Region#put} and {@link Region#get} timeout when
    * another VM holds the distributed lock on the entry in question.
    */
+  @Test
   public void testPutGetTimeout() {
     assertEquals(Scope.GLOBAL, getRegionAttributes().getScope());
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
index 6f06758..d894565 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
@@ -16,28 +16,30 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Global Region with OffHeap memory.
  * 
  * @since Geode 1.0
  */
-@SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
+@SuppressWarnings({ "deprecation", "serial", "rawtypes", "unchecked" })
 public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
 
-  public GlobalRegionOffHeapDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownAssertions() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
@@ -52,14 +54,14 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
     Invoke.invokeInEveryVM(checkOrphans);
     checkOrphans.run();
   }
-  
+
+  @Ignore("TODO: DISABLED due to bug 47951")
   @Override
-  public void DISABLED_testNBRegionInvalidationDuringGetInitialImage() throws Throwable {
+  @Test
+  public void testNBRegionInvalidationDuringGetInitialImage() throws Exception {
     //DISABLED - bug 47951
   }
 
-
-
   @Override
   public Properties getDistributedSystemProperties() {
     Properties props = super.getDistributedSystemProperties();
@@ -67,7 +69,6 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
     return props;
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
   protected RegionAttributes getRegionAttributes() {
     RegionAttributes attrs = super.getRegionAttributes();
@@ -76,7 +77,6 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
     return factory.create();
   }
   
-  @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
   protected RegionAttributes getRegionAttributes(String type) {
     RegionAttributes ra = super.getRegionAttributes(type);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/LRUEvictionControllerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/LRUEvictionControllerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/LRUEvictionControllerDUnitTest.java
index e0358d7..fa2abb2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/LRUEvictionControllerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/LRUEvictionControllerDUnitTest.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.util.Properties;
 
@@ -56,15 +65,16 @@ import com.gemstone.gemfire.test.dunit.VM;
  *
  * @since GemFire 3.2
  */
-public class LRUEvictionControllerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class LRUEvictionControllerDUnitTest extends JUnit4CacheTestCase {
 
   private static boolean usingMain = false;
 
   /**
    * Creates a new <code>LRUEvictionControllerDUnitTest</code>
    */
-  public LRUEvictionControllerDUnitTest(String name) {
-    super(name);
+  public LRUEvictionControllerDUnitTest() {
+    super();
   }
 
   /**
@@ -81,6 +91,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
    * Carefully verifies that region operations effect the {@link
    * LRUStatistics} as expected.
    */
+  @Test
   public void testRegionOperations() throws CacheException {
 
     int threshold = 10;
@@ -128,6 +139,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
    * LRUStatistics} as expected in the presense of a {@link
    * CacheLoader}.
    */
+  @Test
   public void testCacheLoader() throws CacheException {
 
     int threshold = 10;
@@ -183,6 +195,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
   /**
    * Tests an <code>LRUCapacityController</code> of size 1.
    */
+  @Test
   public void testSizeOne() throws CacheException {
     int threshold = 1;
 
@@ -247,6 +260,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
    * Tests that a single set of eviction attributes can be used multiple times
    * (and does the right thing).
    */
+  @Test
   public void testMultipleUsesOfEvictionAttributes()
     throws CacheException, CloneNotSupportedException {
 
@@ -282,6 +296,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
    * Tests that a Region with an LRU capacity controller can be
    * accessed from inside a cache listener.
    */
+  @Test
   public void testBug31592() throws Exception {
     final String name = this.getUniqueName();
     final Object key = "KEY";
@@ -330,6 +345,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
    * Tests that a capacity controller with LOCAL_DESTROY eviction action
    * cannot be installed into a region
    */
+  @Test
   public void testCCMirrored() throws Exception {
     final String name = this.getUniqueName();
     AttributesFactory factory = new AttributesFactory();
@@ -351,6 +367,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
    * Asserts that the LRU rules are observed
    * @throws Exception
    */
+  @Test
   public void testReplicationAndTransactions() throws Exception {
     final String r1 = this.getUniqueName() + "-1";
     final String r2 = this.getUniqueName() + "-2";
@@ -481,7 +498,7 @@ public class LRUEvictionControllerDUnitTest extends CacheTestCase {
   
   public static void main(String[] args) throws Exception {
     usingMain = true;
-    (new LRUEvictionControllerDUnitTest("test")).testSizeOne();
+    (new LRUEvictionControllerDUnitTest()).testSizeOne();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
index 4f4a440..225cd7c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
@@ -16,6 +16,11 @@
  */
 package com.gemstone.gemfire.cache30;
 
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CacheLoaderException;
@@ -27,21 +32,19 @@ import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.TimeoutException;
 import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the functionality of a {@link Scope#LOCAL locally scoped}
  * cache {@link Region} including its callbacks.  Note that even
- * though this test is a {@link com.gemstone.gemfire.test.dunit.DistributedTestCase}, it does
+ * though this test is a dunit test, it does
  * not perform any distribution.
  *
  * @since GemFire 3.0
  */
+@Category(DistributedTest.class)
 public class LocalRegionDUnitTest extends CacheListenerTestCase {
 
-  public LocalRegionDUnitTest(String name) {
-    super(name);
-  }
-
   /**
    * Returns the attributes of a region to be tested.
    */
@@ -60,6 +63,7 @@ public class LocalRegionDUnitTest extends CacheListenerTestCase {
    *
    * @see Region#createSubregion
    */
+  @Test
   public void testIncompatibleSubregions() throws CacheException {
     Region region = createRegion(this.getUniqueName());
     assertEquals(Scope.LOCAL, region.getAttributes().getScope());
@@ -110,6 +114,7 @@ public class LocalRegionDUnitTest extends CacheListenerTestCase {
    * invokes {@link LoaderHelper#netSearch}, a {@link
    * CacheLoaderException} is thrown.
    */
+  @Test
   public void testLocalLoaderNetSearch() throws CacheException {
     assertEquals(Scope.LOCAL, getRegionAttributes().getScope());
 
@@ -155,6 +160,7 @@ public class LocalRegionDUnitTest extends CacheListenerTestCase {
    * Tests that a local writer receives a modified version of the
    * callback argument on a create.
    */
+  @Test
   public void testLocalCreateModifiedCallbackArgument()
     throws CacheException {
 
@@ -202,6 +208,7 @@ public class LocalRegionDUnitTest extends CacheListenerTestCase {
    * Tests that a local writer receives a modified version of the
    * callback argument on an update.
    */
+  @Test
   public void testLocalUpdateModifiedCallbackArgument()
     throws CacheException {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/MemLRUEvictionControllerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/MemLRUEvictionControllerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/MemLRUEvictionControllerDUnitTest.java
index 2e8716c..a74967b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/MemLRUEvictionControllerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/MemLRUEvictionControllerDUnitTest.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.util.Properties;
 import java.util.Random;
 
@@ -42,7 +51,8 @@ import com.gemstone.gemfire.internal.size.WellKnownClassSizer;
  * 
  * @since GemFire 3.2
  */
-public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
+@Category(DistributedTest.class)
+public class MemLRUEvictionControllerDUnitTest extends JUnit4CacheTestCase
 {
 
   private static boolean usingMain = false;
@@ -50,8 +60,8 @@ public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
   /**
    * Creates a new <code>MemLRUEvictionControllerDUnitTest</code>
    */
-  public MemLRUEvictionControllerDUnitTest(String name) {
-    super(name);
+  public MemLRUEvictionControllerDUnitTest() {
+    super();
   }
 
   /**
@@ -76,6 +86,7 @@ public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
    * Carefully verifies that region operations effect the {@link LRUStatistics}
    * as expected.
    */
+  @Test
   public void testRegionOperations() throws CacheException
   {
 
@@ -149,6 +160,7 @@ public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
    * see the class instance.
    * @throws CacheException
    */
+  @Test
   public void testSizeClassesOnce() throws CacheException
   {
     int threshold = 4;
@@ -191,6 +203,7 @@ public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
   /**
    * Prints out the number of bytes that a region entry occupies in the VM.
    */
+  @Test
   public void testEntryOverHead() throws Exception
   {
     final String name = this.getUniqueName();
@@ -235,6 +248,7 @@ public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
    * 
    * @throws Exception
    */
+  @Test
   public void testCustomObjectSizer() throws Exception
   {
     final String name = this.getUniqueName();
@@ -261,7 +275,7 @@ public class MemLRUEvictionControllerDUnitTest extends CacheTestCase
   public static void main(String[] args) throws Exception
   {
     usingMain = true;
-    (new MemLRUEvictionControllerDUnitTest("test")).testRegionOperations();
+    (new MemLRUEvictionControllerDUnitTest()).testRegionOperations();
   }
   
   private static class TestObject {


[27/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
index bd121fb..e47a1a8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
@@ -19,13 +19,31 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.ClientMetadataService;
 import com.gemstone.gemfire.cache.client.internal.ClientPartitionAdvisor;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
@@ -34,23 +52,22 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- *
- */
-public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTestCase{
-
-  private static final long serialVersionUID = 1L;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends JUnit4CacheTestCase {
 
   protected static final String PR_NAME = "single_hop_pr";
   protected static final String PR_NAME2 = "single_hop_pr_2";
@@ -62,41 +79,25 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
   private static final String CUSTOMER2 = "CUSTOMER2";
   private static final String ORDER2 = "ORDER2";
   private static final String SHIPMENT2 = "SHIPMENT2";
-  
-  protected VM member0 = null;
 
-  protected VM member1 = null;
+  protected static final int locatorPort = 12345;
 
+  protected VM member0 = null;
+  protected VM member1 = null;
   protected VM member2 = null;
-
   protected VM member3 = null;
 
   protected static Region region = null;
-
   protected static Region customerRegion = null;
-
   protected static Region orderRegion = null;
-
   protected static Region shipmentRegion = null;
-
   protected static Region region2 = null;
-
   protected static Region customerRegion2 = null;
-
   protected static Region orderRegion2 = null;
-
   protected static Region shipmentRegion2 = null;
-  
   protected static Cache cache = null;
-
-  protected static final int locatorPort = 12345;
-
   protected static Locator locator = null;
   
-  public PartitionedRegionSingleHopWithServerGroupDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -157,6 +158,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
 
+  @Test
   public void test_SingleHopWith2ServerGroup() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -187,6 +189,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
 
+  @Test
   public void test_SingleHopWith2ServerGroup2() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -217,6 +220,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWith2ServerGroup2WithoutSystemProperty() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -242,6 +246,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
 
+  @Test
   public void test_SingleHopWithServerGroupAccessor() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -271,6 +276,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWithServerGroupOneServerInTwoGroups() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -301,10 +307,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     } finally {
       member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.stopLocator());  
     }
-    
-    
   }
   
+  @Test
   public void test_SingleHopWithServerGroupWithOneDefaultServer() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -334,6 +339,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWithServerGroupClientServerGroupNull() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -362,6 +368,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWithServerGroupTwoClientServerGroup() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -399,6 +406,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWithServerGroupTwoClientServerGroup2() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -433,6 +441,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWithServerGroupTwoClientOneWithOneWithoutServerGroup() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -464,6 +473,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
   
+  @Test
   public void test_SingleHopWithServerGroup2ClientInOneVMServerGroup() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -498,6 +508,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
 
+  @Test
   public void test_SingleHopWithServerGroupColocatedRegionsInDifferentGroup() {
     int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String host0 = NetworkUtils.getServerHostName(member3.getHost());
@@ -526,7 +537,6 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     }
   }
 
-  
   public static void verifyMetadata(final int numRegions, final int numBucketLocations) {
     ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
     final Map<String, ClientPartitionAdvisor> regionMetaData = cms
@@ -713,8 +723,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
   }
   
   public static int createServer(int redundantCopies, int totalNoofBuckets, String group) {
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -789,8 +798,8 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     props.setProperty(LOCATORS, locator);
 
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.honourServerGroupsInPRSingleHop", "true");
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
+
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
 
@@ -875,8 +884,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     props.setProperty(LOCATORS, locator);
 
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.honourServerGroupsInPRSingleHop", "true");
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
 
@@ -950,9 +958,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     LogWriterUtils.getLogWriter().info(
         "Partitioned Region SHIPMENT created Successfully :"
             + shipmentRegion.toString());
-    
-    
-    
+
     paf = new PartitionAttributesFactory();
     paf.setRedundantCopies(redundantCopies).setLocalMaxMemory(localMaxMemory)
         .setTotalNumBuckets(totalNoofBuckets);
@@ -964,7 +970,6 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
         "Partitioned Region " + PR_NAME2 + " created Successfully :"
             + region2.toString());
 
-    
     paf = new PartitionAttributesFactory();
     paf.setRedundantCopies(redundantCopies).setLocalMaxMemory(localMaxMemory)
         .setTotalNumBuckets(totalNoofBuckets).setPartitionResolver(
@@ -1008,12 +1013,10 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
   
   public static void createClientWithLocator(String host, int port0, String group) {
     Properties props = new Properties();
-    props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(LOG_FILE, "");
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1034,11 +1037,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
   
   public static void create2ClientWithLocator(String host, int port0, String group1, String group2) {
     Properties props = new Properties();
-    props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1063,11 +1064,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
   
   public static void createClientWith3PoolLocator(String host, int port0, String group1, String group2,String group3) {
     Properties props = new Properties();
-    props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1086,8 +1085,6 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
           250).setSubscriptionEnabled(true).setSubscriptionRedundancy(-1)
           .setReadTimeout(2000).setSocketBufferSize(1000).setMinConnections(6)
           .setMaxConnections(10).setRetryAttempts(3).create(PR_NAME3);
-      
-      
     }
     finally {
       CacheServerTestUtil.enableShufflingOfEndpoints();
@@ -1248,13 +1245,10 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     LogWriterUtils.getLogWriter().info(
         "Distributed Region SHIPMENT created Successfully :"
             + shipmentRegion.toString());
-    
   }
 
-  
   public static int createAccessorServer(int redundantCopies, int numBuckets, String group) {
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -1322,11 +1316,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
   
   public static void createClientWithLocatorWithoutSystemProperty(String host, int port0, String group) {
     Properties props = new Properties();
-    props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest(
-        "PartitionedRegionSingleHopWithServerGroupDUnitTest");
+    PartitionedRegionSingleHopWithServerGroupDUnitTest test = new PartitionedRegionSingleHopWithServerGroupDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -1345,7 +1337,6 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     createRegionsInClientCache(p.getName());
   }
 
-  
   public static void putIntoPartitionedRegions() {
     for (int i = 0; i <= 800; i++) {
       CustId custid = new CustId(i);
@@ -1394,56 +1385,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     region.put(new Integer(7), "update33");
   }
   
-//  public static void putIntoPartitionedRegions2() {
-//    for (int i = 801; i <= 1600; i++) {
-//      CustId custid = new CustId(i);
-//      Customer customer = new Customer("name" + i, "Address" + i);
-//      customerRegion.put(custid, customer);
-//    }
-//    for (int j = 801; j <= 1600; j++) {
-//      CustId custid = new CustId(j);
-//      OrderId orderId = new OrderId(j, custid);
-//      Order order = new Order("OREDR" + j);
-//      orderRegion.put(orderId, order);
-//    }
-//    for (int k = 801; k <= 1600; k++) {
-//      CustId custid = new CustId(k);
-//      OrderId orderId = new OrderId(k, custid);
-//      ShipmentId shipmentId = new ShipmentId(k, orderId);
-//      Shipment shipment = new Shipment("Shipment" + k);
-//      shipmentRegion.put(shipmentId, shipment);
-//    }
-//
-//    region.put(new Integer(8), "create0");
-//    region.put(new Integer(9), "create1");
-//    region.put(new Integer(10), "create2");
-//    region.put(new Integer(11), "create3");
-//    region.put(new Integer(12), "create0");
-//    region.put(new Integer(13), "create1");
-//    region.put(new Integer(14), "create2");
-//    region.put(new Integer(15), "create3");
-//    
-//    region.put(new Integer(8), "update0");
-//    region.put(new Integer(9), "update1");
-//    region.put(new Integer(10), "update2");
-//    region.put(new Integer(11), "update3");
-//    region.put(new Integer(12), "update0");
-//    region.put(new Integer(13), "update1");
-//    region.put(new Integer(14), "update2");
-//    region.put(new Integer(15), "update3");
-//    
-//    region.put(new Integer(8), "update00");
-//    region.put(new Integer(9), "update11");
-//    region.put(new Integer(10), "update22");
-//    region.put(new Integer(11), "update33");
-//    region.put(new Integer(12), "update00");
-//    region.put(new Integer(13), "update11");
-//    region.put(new Integer(14), "update22");
-//    region.put(new Integer(15), "update33");
-//  }
-  
   public static void putIntoPartitionedRegions2Client() {
-    
     for (int i = 0; i <= 800; i++) {
       CustId custid = new CustId(i);
       Customer customer = new Customer("name" + i, "Address" + i);
@@ -1519,7 +1461,6 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     region2.put(new Integer(5), "update11");
     region2.put(new Integer(6), "update22");
     region2.put(new Integer(7), "update33");
-
   }
 
   public static void getFromPartitionedRegions() {
@@ -1549,34 +1490,6 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     region.get(new Integer(7));
   }
   
-  
-//  public static void getFromPartitionedRegions2() {
-//    for (int i = 801; i <= 1600; i++) {
-//      CustId custid = new CustId(i);
-//      customerRegion.get(custid);
-//    }
-//    for (int j = 801; j <= 1600; j++) {
-//      CustId custid = new CustId(j);
-//      OrderId orderId = new OrderId(j, custid);
-//      orderRegion.get(orderId);
-//    }
-//    for (int k = 801; k <= 1600; k++) {
-//      CustId custid = new CustId(k);
-//      OrderId orderId = new OrderId(k, custid);
-//      ShipmentId shipmentId = new ShipmentId(k, orderId);
-//      shipmentRegion.get(shipmentId);
-//     }
-//    region.get(new Integer(8));
-//    region.get(new Integer(9));
-//    region.get(new Integer(10));
-//    region.get(new Integer(11));
-//    region.get(new Integer(12));
-//    region.get(new Integer(13));
-//    region.get(new Integer(14));
-//    region.get(new Integer(15));
-//    
-//  }
-  
   public static void getFromPartitionedRegions2Client() {
     
     for (int i = 0; i <= 800; i++) {
@@ -1615,10 +1528,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
     region2.get(new Integer(5));
     region2.get(new Integer(6));
     region.get(new Integer(7));
-    
   }
-  public static void startLocatorInVM(final int locatorPort) {
 
+  public static void startLocatorInVM(final int locatorPort) {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
@@ -1628,8 +1540,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
       locator = Locator.startLocatorAndDS(locatorPort, null, null, props);
     }
     catch (IOException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
+      throw new AssertionError(e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
index c4e4780..cb56a21 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 com.gemstone.gemfire.cache.AttributesFactory;
@@ -48,12 +57,13 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionSizeDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
 
-  public PartitionedRegionSizeDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionSizeDUnitTest() {
+    super();
   }
 
   public static final String PR_PREFIX = "PR";
@@ -380,12 +390,14 @@ public class PartitionedRegionSizeDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testSize() throws Throwable
   {
     sizeOpsForDistAckSync();
     sizeOpsForDistAckASync();
   }
   
+  @Test
   public void testBug39868() throws Exception {
     Host host = Host.getHost(0);
 
@@ -438,6 +450,7 @@ public class PartitionedRegionSizeDUnitTest extends
     });
   }
   
+  @Test
   public void testByteSize() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -465,6 +478,7 @@ public class PartitionedRegionSizeDUnitTest extends
     };
   }
   
+  @Test
   public void testByteSizeWithEviction() throws Exception {
     Host host = Host.getHost(0);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
index 79a52a9..ceff1a8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.concurrent.CancellationException;
 
 import com.gemstone.gemfire.Statistics;
@@ -40,13 +49,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
 /**
  *  
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionStatsDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
 
   //////constructor //////////
-  public PartitionedRegionStatsDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionStatsDUnitTest() {
+    super();
   }//end of constructor
 
   public static final String PR_PREFIX = "PR";
@@ -72,6 +82,7 @@ public class PartitionedRegionStatsDUnitTest extends
   final int totalNumBuckets = 5;
   static final int REDUNDANT_COPIES = 1; 
   //////////test methods ////////////////
+  @Test
   public void testClose() throws Exception
   {
 
@@ -335,6 +346,7 @@ public class PartitionedRegionStatsDUnitTest extends
      */
   }
   
+  @Test
   public void testDataStoreEntryCountWithRebalance() throws InterruptedException {
     //Ok, first problem, GC'd tombstone is counted as an entry
     //To test
@@ -386,6 +398,7 @@ public class PartitionedRegionStatsDUnitTest extends
     validateEntryCount(vm1, 1);
   }
   
+  @Test
   public void testDataStoreEntryCount2WithRebalance() throws InterruptedException {
     final Host host = Host.getHost(0);
 
@@ -438,6 +451,7 @@ public class PartitionedRegionStatsDUnitTest extends
    * accurate.
    * @throws InterruptedException 
    */
+  @Test
   public void testDataStoreEntryCount() throws InterruptedException {
     //Ok, first problem, GC'd tombstone is counted as an entry
     //To test
@@ -554,6 +568,7 @@ public class PartitionedRegionStatsDUnitTest extends
   }
   
     
+  @Test
   public void testTotalNumBuckets() {
 	  final Host host = Host.getHost(0);
 	  

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
index d1083ad..1bd35f9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
@@ -17,6 +17,8 @@
 
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -26,6 +28,9 @@ import java.util.List;
 import java.util.Random;
 import java.util.Set;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -38,25 +43,23 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Confirm that the utils used for testing work as advertised
- * @since GemFire 5.0
  *
+ * @since GemFire 5.0
  */
-public class PartitionedRegionTestUtilsDUnitTest extends
-    PartitionedRegionDUnitTestCase
-{
+@Category(DistributedTest.class)
+public class PartitionedRegionTestUtilsDUnitTest extends PartitionedRegionDUnitTestCase {
+
   final int totalNumBuckets = 5;
-  public PartitionedRegionTestUtilsDUnitTest(String name) {
-    super(name);
-  }
 
   /**
    * Test the {@link PartitionedRegion#getSomeKeys(java.util.Random)} method, making sure it 
    * returns keys when there are keys and {@link java.util.Collections#EMPTY_SET} when there are none.
-   * @throws Exception
    */
+  @Test
   public void testGetKeys() throws Exception {
     final String r = getUniqueName();
     Host host = Host.getHost(0);
@@ -140,7 +143,6 @@ public class PartitionedRegionTestUtilsDUnitTest extends
    * Verify that it returns nodes after a value has been placed into the PartitionedRegion.
    * @see PartitionedRegion#getAllNodes()
    */
-  
   public static class TestGetNodesKey implements DataSerializable {
     int hc; 
     public TestGetNodesKey(int hc) { this.hc = hc; }
@@ -149,6 +151,8 @@ public class PartitionedRegionTestUtilsDUnitTest extends
     public void toData(DataOutput out) throws IOException  {out.writeInt(this.hc); }
     public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.hc = in.readInt(); } 
   }
+
+  @Test
   public void testGetNodes() throws Exception {
     final String r = getUniqueName();
     Host host = Host.getHost(0);
@@ -188,7 +192,6 @@ public class PartitionedRegionTestUtilsDUnitTest extends
       }
     };
 
-    
     validator.invoke(createAndTest);
     validator.invoke(new CacheSerializableRunnable("AssertGetNodesCreation1") {
       public void run2() throws CacheException
@@ -229,14 +232,13 @@ public class PartitionedRegionTestUtilsDUnitTest extends
   }
 
   /** 
-   * Test the test utiltities that allow investigation of a PartitionedRegion's local cache. 
-   * @throws Exception
+   * Test the test utilities that allow investigation of a PartitionedRegion's local cache.
    */
+  @Test
   public void testLocalCacheOps() throws Exception {
     final String r = getUniqueName();
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-//    VM vm1 = host.getVM(1);
     VM vm2 = host.getVM(2);
     
     vm0.invoke(new CacheSerializableRunnable("CreatePR") {
@@ -343,9 +345,8 @@ public class PartitionedRegionTestUtilsDUnitTest extends
    * Test the test method PartitionedRegion.getAllNodes
    * Verify that it returns nodes after a value has been placed into the PartitionedRegion.
    * @see PartitionedRegion#getAllNodes()
-   * 
-   * @throws Exception
    */
+  @Test
   public void testGetBucketKeys() throws Exception {
     final String r = getUniqueName();
     Host host = Host.getHost(0);
@@ -438,8 +439,8 @@ public class PartitionedRegionTestUtilsDUnitTest extends
   /**
    * Test the test method {@link PartitionedRegion#getBucketOwnersForValidation(int)}
    * Verify that the information it discovers is the same as the local advisor.
-   * @throws Exception
    */
+  @Test
   public void testGetBucketOwners() throws Exception {
     final String rName0 = getUniqueName() + "-r0";
     final String rName1 = getUniqueName() + "-r1";
@@ -568,6 +569,5 @@ public class PartitionedRegionTestUtilsDUnitTest extends
     datastore1.invoke(oneBucketOwner);
     datastore2.invoke(oneBucketOwner);
     datastore3.invoke(oneBucketOwner);
-
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
index 20048c5..bba30ef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
@@ -22,6 +22,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 java.util.Iterator;
 import java.util.List;
@@ -47,6 +56,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  * This test is to verify creation of partition region and
  * distributed region with same name.
  */
+@Category(DistributedTest.class)
 public class PartitionedRegionWithSameNameDUnitTest extends
     PartitionedRegionDUnitTestCase
 {
@@ -73,8 +83,8 @@ public class PartitionedRegionWithSameNameDUnitTest extends
 
   static protected final int PARTITIONED_REGION = 1;
 
-  public PartitionedRegionWithSameNameDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionWithSameNameDUnitTest() {
+    super();
   }
 
   /**
@@ -85,6 +95,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * on vm0 </br> In this test RegionExistException is expected while creating
    * region with the same as partition region.
    */
+  @Test
   public void testNameWithPartitionRegionFirstOnSameVM()
   {
     Host host = Host.getHost(0);
@@ -131,6 +142,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * In this test RegionExistException is expected while creating Partition
    * region with the same as region.
    */
+  @Test
   public void testNameWithDistributedRegionFirstOnSameVM()
   {
     Host host = Host.getHost(0);
@@ -174,6 +186,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * region.
    */
 
+  @Test
   public void testNameWithPartitionRegionFirstOnDifferentVM()
   {
     Host host = Host.getHost(0);
@@ -222,6 +235,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * InternalGemFireException is expected while creating region.
    */
 
+  @Test
   public void testNameWithDistributedRegionFirstOnDifferentVM()
   {
     Host host = Host.getHost(0);
@@ -263,6 +277,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * 2. creates partition region with the same name as distributed region on
    * vm1,vm2,vm3</br> NoException is expected.
    */
+  @Test
   public void testLocalRegionFirst()
   {
     Host host = Host.getHost(0);
@@ -305,6 +320,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * 2. creates distributed region scope = LOCAL with the same name as
    * partitioned region on vm1,vm2,vm3</br> NoException is expected.
    */
+  @Test
   public void testLocalRegionSecond()
   {
     Host host = Host.getHost(0);
@@ -346,6 +362,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * 2. Creates distributed subregion of parent region </br>
    * OperationNotSupportedException is expected.
    */
+  @Test
   public void testWithPartitionedRegionAsParentRegionAndDistributedSubRegion()
   {
     Host host = Host.getHost(0);
@@ -384,6 +401,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * OperationNotSupportedException is expected
    */
 
+  @Test
   public void testWithPartitionedRegionAsParentRegionAndPartitionedSubRegion()
   {
     Host host = Host.getHost(0);
@@ -422,6 +440,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * 3.Creates a distributed region as subregion of parent on vm1,vm2,vm3 </br>
    * In this case InternalGemFireException is expected.
    */
+  @Test
   public void testWithSubRegionPartitionedRegionFirst()
   {
     Host host = Host.getHost(0);
@@ -471,6 +490,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
    * 3.Creates a partitioned region as subregion of parent on vm1,vm2,vm3 </br>
    * In this case IllegalStateException is expected.
    */
+  @Test
   public void testWithSubRegionDistributedRegionFirst()
   {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
index b51c789..6f3ba94 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
@@ -21,10 +21,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+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.CacheException;
@@ -39,20 +44,15 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class PutAllDAckDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class PutAllDAckDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
-    /** Creates a new instance of PutAllDAckDunitTest */
-    public PutAllDAckDUnitTest(String name) {
-        super(name);
-    }
     static Cache cache;
     static Properties props = new Properties();
     static Properties propsWork = new Properties();
@@ -84,7 +84,7 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
     }
     
     public static void createCacheForVM0() throws Exception {
-            ds = (new PutAllDAckDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllDAckDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -94,7 +94,7 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
     
     public static void createCacheForVM1() throws Exception {
             CacheWriter aWriter = new BeforeCreateCallback();
-            ds = (new PutAllDAckDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllDAckDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -111,7 +111,8 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
     
     //test methods
  
-    public void testputAllRemoteVM(){
+  @Test
+  public void testputAllRemoteVM(){
         // Test PASS. 
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
index cd96294..2ca78bf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
@@ -21,6 +21,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
@@ -29,6 +31,9 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+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.CacheException;
@@ -46,18 +51,17 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.locks.DLockGrantor;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class PutAllGlobalDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class PutAllGlobalDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     /**
      * timeout period for the put() operation, when it is run
      * concurrent with a conflicting putAll() operation
@@ -66,10 +70,6 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
     
     private static ServerSocket serverSocket;
     
-    /** Creates a new instance of PutAllGlobalDUnitTest */
-    public PutAllGlobalDUnitTest(String name) {
-        super(name);
-    }
     static Cache cache;
     static Properties props = new Properties();
     static Properties propsWork = new Properties();
@@ -103,7 +103,7 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
     
     public static void createCacheForVM0(){
         try{
-            ds = (new PutAllGlobalDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllGlobalDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.GLOBAL);
@@ -117,7 +117,7 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
     public static void createCacheForVM1(){
         try{           
             CacheWriter aWriter = new BeforeCreateCallback();
-            ds = (new PutAllGlobalDUnitTest("temp")).getSystem(props);
+            ds = (new PutAllGlobalDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             cache.setLockTimeout(TIMEOUT_PERIOD/1000);
             AttributesFactory factory  = new AttributesFactory();
@@ -148,8 +148,9 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
     
     //test methods
     
-    public void testputAllGlobalRemoteVM() throws Throwable {
-        // Test Fails: AssertionFailedError: Should have thrown TimeoutException
+  @Test
+  public void testputAllGlobalRemoteVM() throws Throwable {
+        // Test Fails: AssertionError: Should have thrown TimeoutException
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RegionEntryFlagsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RegionEntryFlagsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RegionEntryFlagsJUnitTest.java
index c2795cf..72caae4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RegionEntryFlagsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RegionEntryFlagsJUnitTest.java
@@ -19,6 +19,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.Set;
 
 import org.junit.After;
@@ -26,10 +28,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
 import com.gemstone.gemfire.cache.Scope;
@@ -41,13 +39,10 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * This test verifies the flag's on-off switching for
  * boolean flags in AbstractRegionEntry.
  * Currently a byte array is used to maintain two flags.
- * 
- *
  */
 @Category(IntegrationTest.class)
 public class RegionEntryFlagsJUnitTest {
 
-
   @Before
   public void setUp() throws Exception {
     CacheUtils.startCache();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionCCEDUnitTest.java
index 3f5830e..d067ed1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionCCEDUnitTest.java
@@ -16,17 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-/**
- * 
- */
+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;
+
+@Category(DistributedTest.class)
 public class RemoteTransactionCCEDUnitTest extends RemoteTransactionDUnitTest {
 
   private static final long serialVersionUID = 5960292521068781262L;
 
-  public RemoteTransactionCCEDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   protected boolean getConcurrencyChecksEnabled() {
     return true;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
index 0b82c98..69b16a6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
@@ -17,22 +17,78 @@
 package com.gemstone.gemfire.internal.cache;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.UserTransaction;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.TXExpiryJUnitTest;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.CacheEvent;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CacheWriter;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EntryNotFoundException;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
+import com.gemstone.gemfire.cache.TransactionDataNotColocatedException;
+import com.gemstone.gemfire.cache.TransactionDataRebalancedException;
+import com.gemstone.gemfire.cache.TransactionEvent;
+import com.gemstone.gemfire.cache.TransactionException;
+import com.gemstone.gemfire.cache.TransactionId;
+import com.gemstone.gemfire.cache.TransactionListener;
+import com.gemstone.gemfire.cache.TransactionWriter;
+import com.gemstone.gemfire.cache.TransactionWriterException;
+import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+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.partition.PartitionRegionHelper;
 import com.gemstone.gemfire.cache.query.CqEvent;
 import com.gemstone.gemfire.cache.query.CqListener;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.AvailablePort;
@@ -43,23 +99,23 @@ import com.gemstone.gemfire.internal.cache.execute.data.Customer;
 import com.gemstone.gemfire.internal.cache.execute.data.Order;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-import com.gemstone.gemfire.test.dunit.*;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.UserTransaction;
-import java.util.*;
-import java.util.concurrent.CountDownLatch;
-
-/**
- *
- */
-public class RemoteTransactionDUnitTest extends CacheTestCase {
-  final protected String CUSTOMER = "custRegion";
-  final protected String ORDER = "orderRegion";
-  final protected String D_REFERENCE = "distrReference";
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class RemoteTransactionDUnitTest extends JUnit4CacheTestCase {
+
+  protected final String CUSTOMER = "custRegion";
+  protected final String ORDER = "orderRegion";
+  protected final String D_REFERENCE = "distrReference";
   
   private final SerializableCallable getNumberOfTXInProgress = new SerializableCallable() {
     public Object call() throws Exception {
@@ -86,12 +142,6 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
       return null;
     }
   };
-  /**
-   * @param name
-   */
-  public RemoteTransactionDUnitTest(String name) {
-    super(name);
-  }
 
   protected enum OP {
     PUT, GET, DESTROY, INVALIDATE, KEYS, VALUES, ENTRIES, PUTALL, GETALL, REMOVEALL
@@ -468,10 +518,12 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   
   
 
+  @Test
   public void testTXCreationAndCleanupAtCommit() throws Exception {
     doBasicChecks(true);
   }
 
+  @Test
   public void testTXCreationAndCleanupAtRollback() throws Exception {
     doBasicChecks(false);
   }
@@ -531,6 +583,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testPRTXGet() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -571,6 +624,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testPRTXGetOnRemoteWithLoader() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -617,6 +671,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   /**
    * Make sure that getEntry returns null properly and values when it should
    */
+  @Test
   public void testPRTXGetEntryOnRemoteSide() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -669,6 +724,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   
   
   
+  @Test
   public void testPRTXGetOnLocalWithLoader() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -710,6 +766,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   
   
 
+  @Test
   public void testTXPut() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -753,6 +810,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testTXInvalidate() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -794,6 +852,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   }
 
   
+  @Test
   public void testTXDestroy() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -834,6 +893,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testTxPutIfAbsent() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -930,6 +990,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     return accessor;
   }
   
+  @Test
   public void testTxRemove() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -1003,6 +1064,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTxRemoveAll() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -1096,6 +1158,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTxRemoveAllNotColocated() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -1141,6 +1204,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTxRemoveAllWithRedundancy() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -1188,6 +1252,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     datastore2.invoke(checkArtifacts);
   }
 
+  @Test
   public void testTxReplace() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -1267,6 +1332,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
    * When we have narrowed down on a target node for a transaction, test that
    * we throw an exception if that node does not host primary for subsequent entries
    */
+  @Test
   public void testNonColocatedTX() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -1318,18 +1384,22 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testListenersForPut() {
     doTestListeners(OP.PUT);
   }
 
+  @Test
   public void testListenersForDestroy() {
     doTestListeners(OP.DESTROY);
   }
 
+  @Test
   public void testListenersForInvalidate() {
     doTestListeners(OP.INVALIDATE);
   }
   
+  @Test
   public void testListenersForRemoveAll() {
     doTestListeners(OP.REMOVEALL);
   }
@@ -1641,6 +1711,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testRemoteExceptionThrown() {
     Host host = Host.getHost(0);
     VM acc = host.getVM(0);
@@ -1655,7 +1726,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
           }
           public void beforeCommit(TransactionEvent event)
               throws TransactionWriterException {
-            throw new TransactionWriterException("TestException");
+            throw new TransactionWriterException("AssertionError");
           }
         });
         return null;
@@ -1671,17 +1742,19 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
           getGemfireCache().getTxManager().commit();
           fail("Expected exception not thrown");
         } catch (Exception e) {
-          assertEquals("TestException", e.getCause().getMessage());
+          assertEquals("AssertionError", e.getCause().getMessage());
         }
         return null;
       }
     });
   }
 
+  @Test
   public void testSizeForTXHostedOnRemoteNode() {
     doSizeTest(false);
   }
 
+  @Test
   public void testSizeOnAccessor() {
     doSizeTest(true);
   }
@@ -1759,50 +1832,62 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     assertEquals(0, txOnDatastore2_2.intValue());
   }
 
+  @Test
   public void testKeysIterator() {
     doTestIterator(OP.KEYS, 0, OP.PUT);
   }
 
+  @Test
   public void testValuesIterator() {
     doTestIterator(OP.VALUES, 0, OP.PUT);
   }
 
+  @Test
   public void testEntriesIterator() {
     doTestIterator(OP.ENTRIES, 0, OP.PUT);
   }
   
+  @Test
   public void testKeysIterator1() {
     doTestIterator(OP.KEYS, 1, OP.PUT);
   }
 
+  @Test
   public void testValuesIterator1() {
     doTestIterator(OP.VALUES, 1, OP.PUT);
   }
 
+  @Test
   public void testEntriesIterator1() {
     doTestIterator(OP.ENTRIES, 1, OP.PUT);
   }
 
+  @Test
   public void testKeysIteratorOnDestroy() {
     doTestIterator(OP.KEYS, 0, OP.DESTROY);
   }
 
+  @Test
   public void testValuesIteratorOnDestroy() {
     doTestIterator(OP.VALUES, 0, OP.DESTROY);
   }
 
+  @Test
   public void testEntriesIteratorOnDestroy() {
     doTestIterator(OP.ENTRIES, 0, OP.DESTROY);
   }
   
+  @Test
   public void testKeysIterator1OnDestroy() {
     doTestIterator(OP.KEYS, 1, OP.DESTROY);
   }
 
+  @Test
   public void testValuesIterator1OnDestroy() {
     doTestIterator(OP.VALUES, 1, OP.DESTROY);
   }
 
+  @Test
   public void testEntriesIterator1OnDestroy() {
     doTestIterator(OP.ENTRIES, 1, OP.DESTROY);
   }
@@ -2046,6 +2131,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testKeyIterationOnRR() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2095,6 +2181,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testValuesIterationOnRR() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2144,6 +2231,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testEntriesIterationOnRR() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2193,6 +2281,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testIllegalIteration() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2327,10 +2416,12 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     OnMember
   }
   
+  @Test
   public void testTxFunctionOnRegion() {
     doTestTxFunction(Executions.OnRegion);
   }
 
+  @Test
   public void testTxFunctionOnMember() {
     doTestTxFunction(Executions.OnMember);
   }
@@ -2446,6 +2537,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testNestedTxFunction() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2518,6 +2610,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testDRFunctionExecution() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2607,6 +2700,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testTxFunctionWithOtherOps() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2820,10 +2914,12 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     return expectedSet;
   }
 
+  @Test
   public void testRemoteJTACommit() {
     doRemoteJTA(true);
   }
 
+  @Test
   public void testRemoteJTARollback() {
     doRemoteJTA(false);
   }
@@ -2889,6 +2985,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   }
   
   
+  @Test
   public void testOriginRemoteIsTrueForRemoteReplicatedRegions() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2993,6 +3090,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
   
   
   
+  @Test
   public void testRemoteCreateInReplicatedRegion() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3031,6 +3129,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testRemoteTxCleanupOnCrash() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3062,16 +3161,19 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testNonColocatedPutAll() {
     doNonColocatedbulkOp(OP.PUTALL);
   }
 
   /**
-   * disabled because rather than throwing an exception, 
+   * disabled because rather than throwing an exception,
    * getAll catches all exceptions and logs a warning
    * message
    */
-  public void _SWAP_testNonColocatedGetAll() {
+  @Ignore("TODO: disabled because rather than throwing an exception, getAll catches all exceptions and logs a warning message")
+  @Test
+  public void testNonColocatedGetAll() {
     doNonColocatedbulkOp(OP.GETALL);
   }
   
@@ -3114,10 +3216,12 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testBasicPutAll() {
     doTestBasicBulkOP(OP.PUTALL);
   }
 
+  @Test
   public void testBasicRemoveAll() {
     doTestBasicBulkOP(OP.REMOVEALL);
   }
@@ -3259,6 +3363,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testDestroyCreateConflation() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3551,6 +3656,7 @@ protected static class ClientListener extends CacheListenerAdapter {
   }
   
   
+  @Test
   public void testTXWithRI() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3599,6 +3705,7 @@ protected static class ClientListener extends CacheListenerAdapter {
   
   private static final String EMPTY_REGION = "emptyRegionName";
   
+  @Test
   public void testBug43176() {
     Host host = Host.getHost(0);
     VM datastore = host.getVM(0);
@@ -3672,6 +3779,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
   
+  @Test
   public void testTXWithRICommitInDatastore() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3719,6 +3827,7 @@ protected static class ClientListener extends CacheListenerAdapter {
   }
   
 
+  @Test
   public void testListenersNotInvokedOnSecondary() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3769,6 +3878,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     }
   }
 
+  @Test
   public void testBug33073() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3807,6 +3917,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
   
+  @Test
   public void testBug43081() throws Exception {
     createRegion(false, 0, null);
     Context ctx = getCache().getJNDIContext();
@@ -3891,6 +4002,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     }
   }
   
+  @Test
   public void testBug45556() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -3985,6 +4097,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
   
+  @Test
   public void testExpirySuspend_bug45984() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -4061,6 +4174,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     
   }
   
+  @Test
   public void testRemoteFetchVersionMessage() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -4097,6 +4211,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
 
+  @Test
   public void testTransactionWithRemoteVersionFetch() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -4148,6 +4263,7 @@ protected static class ClientListener extends CacheListenerAdapter {
     });
   }
 
+  @Test
   public void testBug49398() {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -4202,6 +4318,7 @@ protected static class ClientListener extends CacheListenerAdapter {
    * Install Listeners and verify that they are invoked after all tx events have been applied to the cache
    * see GEODE-278
    */
+  @Test
   public void testNonInlineRemoteEvents() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
index d672cf1..67beab4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
@@ -21,9 +21,14 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.Properties;
 
+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.CacheException;
@@ -37,20 +42,18 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Adapted from RemoveAllDAckDUnitTest
  */
-public class RemoveAllDAckDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class RemoveAllDAckDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
-    /** Creates a new instance of RemoveAllDAckDunitTest */
-    public RemoveAllDAckDUnitTest(String name) {
-        super(name);
-    }
     static Cache cache;
     static Properties props = new Properties();
     static Properties propsWork = new Properties();
@@ -81,7 +84,7 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
     }
     
     public static void createCacheForVM0() throws Exception {
-            ds = (new RemoveAllDAckDUnitTest("temp")).getSystem(props);
+            ds = (new RemoveAllDAckDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -91,7 +94,7 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
     
     public static void createCacheForVM1() throws Exception {
             CacheWriter aWriter = new BeforeDestroyCallback();
-            ds = (new RemoveAllDAckDUnitTest("temp")).getSystem(props);
+            ds = (new RemoveAllDAckDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -108,7 +111,8 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
     
     //test methods
  
-    public void testRemoveAllRemoteVM() {
+  @Test
+  public void testRemoveAllRemoteVM() {
         // Test PASS. 
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
index 405a2fe..59405f6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
@@ -21,8 +21,13 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+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.CacheException;
@@ -33,20 +38,14 @@ import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class RemoveDAckDUnitTest extends DistributedTestCase {
-    
-    /** Creates a new instance of RemoveDAckDUnitTest */
-    public RemoveDAckDUnitTest(String name) {
-        super(name);
-    }
+@Category(DistributedTest.class)
+public class RemoveDAckDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
     static Cache cache;
     static Properties props = new Properties();
@@ -78,7 +77,7 @@ public class RemoveDAckDUnitTest extends DistributedTestCase {
     
     public static void createCacheVM0(){
         try{            
-            ds = (new RemoveDAckDUnitTest("temp")).getSystem(props);
+            ds = (new RemoveDAckDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);            
             AttributesFactory factory  = new AttributesFactory();
             factory.setScope(Scope.DISTRIBUTED_ACK);            
@@ -91,7 +90,7 @@ public class RemoveDAckDUnitTest extends DistributedTestCase {
     } //end of create cache for VM0
     public static void createCacheVM1(){
         try{            
-            ds = (new RemoveDAckDUnitTest("temp")).getSystem(props);
+            ds = (new RemoveDAckDUnitTest()).getSystem(props);
             AttributesFactory factory  = new AttributesFactory();
             cache = CacheFactory.create(ds);
             factory.setScope(Scope.DISTRIBUTED_ACK);            
@@ -113,8 +112,9 @@ public class RemoveDAckDUnitTest extends DistributedTestCase {
     }
     
     
-    public void testRemoveMultiVM(){
-        //Commented the Test.As it is failing @ line no 133 : AssertionFailedError
+  @Test
+  public void testRemoveMultiVM(){
+        //Commented the Test.As it is failing @ line no 133 : AssertionError
         Host host = Host.getHost(0);
         VM vm0 = host.getVM(0);
         VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
index 9b28de1..ab51551 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
@@ -22,8 +22,13 @@
 
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+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.CacheException;
@@ -37,22 +42,17 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
-public class RemoveGlobalDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class RemoveGlobalDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
     
-    /** Creates a new instance of RemoveGlobalDUintTest */
-    public RemoveGlobalDUnitTest(String name) {
-        super(name);
-    }
     static Cache cache;
     static Properties props = new Properties();
     static Properties propsWork = new Properties();
@@ -86,7 +86,7 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
     
     public static void createCache(){
         try{
-            ds = (new RemoveGlobalDUnitTest("temp")).getSystem(props);
+            ds = (new RemoveGlobalDUnitTest()).getSystem(props);
             cache = CacheFactory.create(ds);
         } catch (Exception ex){
             ex.printStackTrace();
@@ -105,7 +105,8 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
     
     //test methods
     
-    public void testRemoveGlobalSingleVM() throws Throwable{
+  @Test
+  public void testRemoveGlobalSingleVM() throws Throwable{
         
         SerializableRunnable createRegionWithWriter = new CacheSerializableRunnable("create region with cache writer"){
             
@@ -157,8 +158,9 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
     }//end of testRemoveGlobalSingleVM
     
     
-    public void testRemoveGlobalMultiVM() throws Throwable{
-        //Commented the Test.As it is failing @ line no 145 : AssertionFailedError
+  @Test
+  public void testRemoveGlobalMultiVM() throws Throwable{
+        //Commented the Test.As it is failing @ line no 145 : AssertionError
        
         SerializableRunnable createSimpleRegion = new CacheSerializableRunnable("create region with cache writer"){
             public void run2() throws CacheException{

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
index 6bef30b..6466b41 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
@@ -22,17 +22,16 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.StatisticsFactory;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
@@ -41,19 +40,16 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * Testing methods for SimpleDiskRegion.java api's
  * 
  * @since GemFire 5.1
- *  
  */
 @Category(IntegrationTest.class)
-public class SimpleDiskRegionJUnitTest extends DiskRegionTestingBase
-{
+public class SimpleDiskRegionJUnitTest extends DiskRegionTestingBase {
 
-  protected Set keyIds = Collections.synchronizedSet(new HashSet());
+  private Set keyIds = Collections.synchronizedSet(new HashSet());
 
   private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
index ec6645f..eae57c6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
@@ -16,32 +16,48 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+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.CacheClosedException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.ClientMetadataService;
 import com.gemstone.gemfire.cache.client.internal.ClientPartitionAdvisor;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
-public class SingleHopStatsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class SingleHopStatsDUnitTest extends JUnit4CacheTestCase {
 
   private final String Region_Name = "42010";
   private final String ORDER_REGION_NAME = "ORDER";
@@ -61,11 +77,6 @@ public class SingleHopStatsDUnitTest extends CacheTestCase {
   private static long metaDataRefreshCount_Shipment;
   private static long nonSingleHopsCount_Shipment;
 
-
-  public SingleHopStatsDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -109,6 +120,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-364: random ports, time sensitive, waitForCriterions, magic numbers (113, 226)
+  @Test
   public void testClientStatsPR() {
     Integer port0 = (Integer) member0.invoke(() -> createServerForStats(0, 113, "No_Colocation"));
     Integer port1 = (Integer) member1.invoke(() -> createServerForStats(0, 113, "No_Colocation"));
@@ -126,6 +138,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase {
     member3.invoke(() -> updatePR("FirstClient", "No_Colocation"));
   }
 
+  @Test
   public void testClientStatsColocationPR() {
     Integer port0 = (Integer) member0.invoke(() -> createServerForStats(0, 4, "Colocation"));
     Integer port1 = (Integer) member1.invoke(() -> createServerForStats(0, 4, "Colocation"));
@@ -140,12 +153,9 @@ public class SingleHopStatsDUnitTest extends CacheTestCase {
 
   private void createClient(int port0, int port1, int port2, String colocation) {
     Properties props = new Properties();
-    props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new SingleHopStatsDUnitTest(
-        "SingleHopStatsDUnitTest");
-    DistributedSystem distributedSystem = test.getSystem(props);
+    DistributedSystem distributedSystem = getSystem(props);
     Cache cache = CacheFactory.create(distributedSystem);
     assertNotNull(cache);
     CacheServerTestUtil.disableShufflingOfEndpoints();
@@ -165,9 +175,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase {
   }
 
   private int createServerForStats(int redundantCopies, int totalNoofBuckets, String colocation) {
-    CacheTestCase test = new SingleHopStatsDUnitTest(
-        "SingleHopStatsDUnitTest");
-    Cache cache = test.getCache();
+    Cache cache = getCache();
     CacheServer server = cache.addCacheServer();
     server.setPort(0);
     server.setHostnameForClients("localhost");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
index 14b1a72..11bc209 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.DataInput;
 import java.io.DataOutput;
 import java.io.File;
@@ -63,27 +72,32 @@ import com.gemstone.gemfire.test.dunit.VM;
  * indexes on regions with overflow to disk.
  *
  */
-public class SizingFlagDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class SizingFlagDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * @param name
    */
-  public SizingFlagDUnitTest(String name) {
-    super(name);
+  public SizingFlagDUnitTest() {
+    super();
   }
   
+  @Test
   public void testRRMemLRU() {
     doRRMemLRUTest();
   }
   
+  @Test
   public void testRRMemLRUDeltaAndFlag() {
     doRRMemLRUDeltaTest(true);
   }
   
+  @Test
   public void testRRMemLRUDelta() {
     doRRMemLRUDeltaTest(false);
   }
   
+  @Test
   public void testRRListener() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -98,34 +112,42 @@ public class SizingFlagDUnitTest extends CacheTestCase {
     doListenerTestRR(vm0, vm1);
   }
   
+  @Test
   public void testPRMemLRU() {
     doPRMemLRUTest();
   }
   
+  @Test
   public void testPRMemLRUAndFlagDeltaPutOnPrimary() {
     doPRDeltaTestLRU(false, false, true, false);
   }
   
+  @Test
   public void testPRMemLRUDeltaPutOnPrimary() {
     doPRDeltaTestLRU(false, false, true, false);
   }
   
+  @Test
   public void testPRMemLRUAndFlagDeltaPutOnSecondary() {
     doPRDeltaTestLRU(false, false, false, true);
   }
   
+  @Test
   public void testPRMemLRUDeltaPutOnSecondary() {
     doPRDeltaTestLRU(false, false, false, true);
   }
   
+  @Test
   public void testPRNoLRUDelta() {
     doPRNoLRUDeltaTest(false);
   }
   
+  @Test
   public void testPRNoLRUAndFlagDelta() {
     doPRNoLRUDeltaTest(true);
   }
   
+  @Test
   public void testPRListener() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -140,6 +162,7 @@ public class SizingFlagDUnitTest extends CacheTestCase {
     doListenerTestPR(vm0, vm1);
   }
   
+  @Test
   public void testPRHeapLRU() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -172,6 +195,7 @@ public class SizingFlagDUnitTest extends CacheTestCase {
     //Test what happens when we reach the heap threshold??
   }
   
+  @Test
   public void testRRHeapLRU() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -198,23 +222,28 @@ public class SizingFlagDUnitTest extends CacheTestCase {
     //Test what happens when we reach the heap threshold??
   }
   
+  @Test
   public void testPRHeapLRUDeltaWithFlagPutOnPrimary() {
     doPRDeltaTestLRU(false, true, true, false);
   }  
   
+  @Test
   public void testPRHeapLRUDeltaPutOnPrimary() {
     doPRDeltaTestLRU(false, true, true, false);
   }  
 
+  @Test
   public void testPRHeapLRUDeltaWithFlagPutOnSecondary() {
     doPRDeltaTestLRU(false, true, false, true);
   }  
   
+  @Test
   public void testPRHeapLRUDeltaPutOnSecondary() {
     doPRDeltaTestLRU(false, true, false, true);
   }  
 
   // test to cover bug41916
+  @Test
   public void testLargeDelta() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);



[14/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
index b756100..b191a85 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
@@ -16,7 +16,35 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.ClientSession;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestRegistrationEvent;
+import com.gemstone.gemfire.cache.InterestRegistrationListener;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -26,16 +54,17 @@ import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.AssertionFailedError;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test Scenario :
@@ -72,56 +101,68 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * then both client connects to the server
  * c1 register(k1,k2,k3) and c2 register (k4,k5)
  * then verify that updates has occurred as a result of interest registration.
- *
- *
- *
  */
-public class InterestListDUnitTest extends DistributedTestCase
-{
-  static Cache cache = null;
-
-  VM vm0 = null;
-
-  VM vm1 = null;
+@Category(DistributedTest.class)
+public class InterestListDUnitTest extends JUnit4DistributedTestCase {
 
-  VM vm2 = null;
-
-  /** the server cache's port number */
-  int PORT1;
+  private static final String REGION_NAME = "InterestListDUnitTest_region";
 
-  // using a Integer instead of String to make sure ALL_KEYS works
-  // on non-String keys
-  final static Integer key1 = new Integer(1);
-  final static Integer key2 = new Integer(2);
-  final static String key1_originalValue = "key-1-orig-value";
-  final static String key2_originalValue = "key-2-orig-value";
+  // using a Integer instead of String to make sure ALL_KEYS works on non-String keys
+  private final static Integer key1 = new Integer(1);
+  private final static Integer key2 = new Integer(2);
+  private final static String key1_originalValue = "key-1-orig-value";
+  private final static String key2_originalValue = "key-2-orig-value";
 
-  static final String REGION_NAME = "InterestListDUnitTest_region";
+  private static Cache cache = null;
 
   /** some tests use this to hold the server for invoke() access */
-  static CacheServer server;
+  private static CacheServer server;
 
   /** interestListener listens in cache server vms */
-  static InterestListener interestListener;
+  private static InterestListener interestListener;
 
-  /** constructor */
-  public InterestListDUnitTest(String name) {
-    super(name);
-  }
+  private VM vm0 = null;
+  private VM vm1 = null;
+  private VM vm2 = null;
+
+  /** the server cache's port number */
+  private int PORT1;
 
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
-    Wait.pause(10000);
+
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
     vm2 = host.getVM(2);
+
     // start servers first
-    PORT1 =  ((Integer) vm0.invoke(() -> InterestListDUnitTest.createServerCache())).intValue();
+    PORT1 = vm0.invoke(() -> InterestListDUnitTest.createServerCache());
   }
 
-/**
+  @Override
+  public final void preTearDown() throws Exception {
+    // close the clients first
+    vm1.invoke(() -> InterestListDUnitTest.closeCache());
+    vm2.invoke(() -> InterestListDUnitTest.closeCache());
+    // then close the servers
+    vm0.invoke(() -> InterestListDUnitTest.closeCache());
+
+    cache = null;
+    server = null;
+    interestListener = null;
+
+    Invoke.invokeInEveryVM(new SerializableRunnable() {
+      public void run() {
+        cache = null;
+        server = null;
+        interestListener = null;
+      }
+    });
+  }
+
+  /**
    * one server two clients
    * create Entries in all the vms
    * c1 : register (k1)
@@ -136,67 +177,64 @@ public class InterestListDUnitTest extends DistributedTestCase
    * c2 : validate (k1 == vm2-k1) AND (k2 == vm2-k2) // as both are not registered
    * c2 : put (k1 -> vm2-k1-again) AND (k2 -> vm2-k2-again)
    * c1 : validate (k1 == vm1-k1-again) AND (k2 == vm1-k2-again)// as both are not registered
-   *
    */
-    public void testInterestListRegistration()
-    {
-
-      vm1.invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
-      vm2.invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
-
-      vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-      vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-
-      vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
-
-      vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
-      Wait.pause(10000);
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
-      Wait.pause(10000);
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
-
-      vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
-
-      vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
-      Wait.pause(10000);
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
-      Wait.pause(10000);
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
-    }
+  @Test
+  public void testInterestListRegistration() throws Exception {
+    vm1.invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
+    vm2.invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
 
-/**
- * one server two clients
- * create Entries in all the vms
- *
- * STEP 1:
- * c2:  put (k2 -> vm-k2)
- * c1:  validate k2 == k2 (not updated because no interest)
- *
- * STEP 2
- * c1:  register k2
- * c1 : validate k2 == vm-k2 (updated because of registerInterest)
- * c1:  validate k1 == k1 (other key not updated because still no interest)
- *
- * STEP 3:
- * c1:  put (k1 -> vm-k1)
- * c2:  validate k1 == k1 (not updated because no interest)
- * c2:  register k1
- * c2:  validate k1 == vm-k1 (updated because of registerInterest)
- *
- * STEP 4:
- * c2:  unregister k1
- * c1:  put k1->k1 (old value)
- * c2:  validate k1 == vm-k1 (no interest, so missing update)
- */
-  public void testValueRefresh()
-  {
+    vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
 
+    vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
+
+    vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
+    Wait.pause(10000);
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
+    Wait.pause(10000);
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
+
+    vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
+
+    vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
+    Wait.pause(10000);
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
+    Wait.pause(10000);
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
+  }
+
+  /**
+   * one server two clients
+   * create Entries in all the vms
+   *
+   * STEP 1:
+   * c2:  put (k2 -> vm-k2)
+   * c1:  validate k2 == k2 (not updated because no interest)
+   *
+   * STEP 2
+   * c1:  register k2
+   * c1 : validate k2 == vm-k2 (updated because of registerInterest)
+   * c1:  validate k1 == k1 (other key not updated because still no interest)
+   *
+   * STEP 3:
+   * c1:  put (k1 -> vm-k1)
+   * c2:  validate k1 == k1 (not updated because no interest)
+   * c2:  register k1
+   * c2:  validate k1 == vm-k1 (updated because of registerInterest)
+   *
+   * STEP 4:
+   * c2:  unregister k1
+   * c1:  put k1->k1 (old value)
+   * c2:  validate k1 == vm-k1 (no interest, so missing update)
+   */
+  @Test
+  public void testValueRefresh() throws Exception {
     // Initialization
     Host host = Host.getHost(0);
     vm1.invoke(() -> InterestListDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1)));
@@ -234,15 +272,13 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm2.invoke(() -> InterestListDUnitTest.validateSingleEntry(key1, "vm1")); // update lost
   }
 
-/**
- * one server two clients
- * create Entries in all the vms
- * register ALL_KEYS and verifies that updates are receiving to all the keys
- *
- */
-  public void testInterestListRegistration_ALL_KEYS()
-  {
-
+  /**
+   * one server two clients
+   * create Entries in all the vms
+   * register ALL_KEYS and verifies that updates are receiving to all the keys
+   */
+  @Test
+  public void testInterestListRegistration_ALL_KEYS() throws Exception {
     vm1.invoke(() -> InterestListDUnitTest.createClientCache(
       NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
     vm2.invoke(() -> InterestListDUnitTest.createClientCache(
@@ -256,19 +292,18 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm1.invoke(() -> InterestListDUnitTest.put_ALL_KEYS());
     Wait.pause(10000);
     vm2.invoke(() -> InterestListDUnitTest.validate_ALL_KEYS());
-
   }
- /**
-  * one server two clients
-  * create Entries in all the vms
-  * server directly puts some values
-  * then both clients connect to the server
-  * c1 register(k1,k2,k3) and c2 register (k4,k5)
-  * then verify that updates has occured as a result of interest registration.
-  *
-  */
-  public void testInitializationOfRegionFromInterestList()
-  {
+
+  /**
+   * one server two clients
+   * create Entries in all the vms
+   * server directly puts some values
+   * then both clients connect to the server
+   * c1 register(k1,k2,k3) and c2 register (k4,k5)
+   * then verify that updates has occured as a result of interest registration.
+   */
+  @Test
+  public void testInitializationOfRegionFromInterestList() throws Exception {
     // directly put on server
     vm0.invoke(() -> InterestListDUnitTest.multiple_put());
     Wait.pause(1000);
@@ -285,7 +320,6 @@ public class InterestListDUnitTest extends DistributedTestCase
     // verify the values for registered keys
     vm1.invoke(() -> InterestListDUnitTest.validateRegionEntriesFromInterestListInVm1());
     vm2.invoke(() -> InterestListDUnitTest.validateRegionEntriesFromInterestListInVm2());
-
   }
 
   /**
@@ -303,126 +337,124 @@ public class InterestListDUnitTest extends DistributedTestCase
    * c2 : validate (k1 == vm2-k1) AND (k2 == vm2-k2) // as both are not registered
    * c2 : put (k1 -> vm2-k1-again) AND (k2 -> vm2-k2-again)
    * c1 : validate (k1 == vm1-k1-again) AND (k2 == vm1-k2-again)// as both are not registered
-   *
    */
-    public void testInterestListRegistrationOnServer()
-    {
-
-      DistributedMember c1 = (DistributedMember)vm1
-        .invoke(() -> InterestListDUnitTest.createClientCache(
-          NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
-      DistributedMember c2 = (DistributedMember)vm2
-        .invoke(() -> InterestListDUnitTest.createClientCache(
-          NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
+  @Test
+  public void testInterestListRegistrationOnServer() throws Exception {
+    DistributedMember c1 = (DistributedMember)vm1
+      .invoke(() -> InterestListDUnitTest.createClientCache(
+        NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
+    DistributedMember c2 = (DistributedMember)vm2
+      .invoke(() -> InterestListDUnitTest.createClientCache(
+        NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
 
-      vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-      vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
 
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
+    vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
 
-      vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
+    vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
-    }
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
+  }
 
-    /**
-     * two servers one client
-     * create Entries in all the vms
-     * register interest in various ways and ensure that registration listeners
-     * are properly invoked
-     * @throws Exception 
-     */
-    public void testInterestRegistrationListeners() throws Exception {
-      int port2;
+  /**
+   * two servers one client
+   * create Entries in all the vms
+   * register interest in various ways and ensure that registration listeners
+   * are properly invoked
+   */
+  @Test
+  public void testInterestRegistrationListeners() throws Exception {
+    int port2;
 
-      createCache();
-      server = addCacheServer();
-      port2 = server.getPort();
+    createCache();
+    server = addCacheServer();
+    port2 = server.getPort();
 
-      addRegisterInterestListener();
-      vm0.invoke(() -> InterestListDUnitTest.addRegisterInterestListener());
+    addRegisterInterestListener();
+    vm0.invoke(() -> InterestListDUnitTest.addRegisterInterestListener());
 
-      // servers are set up, now do the clients
-      DistributedMember c1 = (DistributedMember)vm1
-      .invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
-      DistributedMember c2 = (DistributedMember)vm2
-      .invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
+    // servers are set up, now do the clients
+    DistributedMember c1 = (DistributedMember)vm1
+    .invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
+    DistributedMember c2 = (DistributedMember)vm2
+    .invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
 
-      vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-      vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
 
-      // interest registration from clients should cause listeners to be invoked
-      // in both servers
-      LogWriterUtils.getLogWriter().info("test phase 1");
-      vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
+    // interest registration from clients should cause listeners to be invoked
+    // in both servers
+    LogWriterUtils.getLogWriter().info("test phase 1");
+    vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
 
-      Integer zero = new Integer(0);
-      Integer two = new Integer(2);
+    Integer zero = new Integer(0);
+    Integer two = new Integer(2);
 
-      interestListener.verifyCountsAndClear(2, 0);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
+    interestListener.verifyCountsAndClear(2, 0);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
 
-      // unregistration from clients should invoke listeners on both servers
-      LogWriterUtils.getLogWriter().info("test phase 2");
-      vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
+    // unregistration from clients should invoke listeners on both servers
+    LogWriterUtils.getLogWriter().info("test phase 2");
+    vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
 
-      interestListener.verifyCountsAndClear(0, 2);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
+    interestListener.verifyCountsAndClear(0, 2);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
 
-      // now the primary server for eache client will register and unregister
-      LogWriterUtils.getLogWriter().info("test phase 3");
-      registerKeyForClient(c1, key1);
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
-      registerKeyForClient(c2, key2);
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
+    // now the primary server for eache client will register and unregister
+    LogWriterUtils.getLogWriter().info("test phase 3");
+    registerKeyForClient(c1, key1);
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
+    registerKeyForClient(c2, key2);
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
 
-      interestListener.verifyCountsAndClear(2, 0);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
+    interestListener.verifyCountsAndClear(2, 0);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
 
-      LogWriterUtils.getLogWriter().info("test phase 4");
-      unregisterKeyForClient(c1, key1);
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
-      unregisterKeyForClient(c2, key2);
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
+    LogWriterUtils.getLogWriter().info("test phase 4");
+    unregisterKeyForClient(c1, key1);
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
+    unregisterKeyForClient(c2, key2);
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
 
-      interestListener.verifyCountsAndClear(0, 2);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
-    }
+    interestListener.verifyCountsAndClear(0, 2);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
+  }
 
   /**
    * This tests whether an exception is thrown in register/unregister when no
    * server is available.
    */
-  public void testNoAvailableServer() {
-
+  @Test
+  public void testNoAvailableServer() throws Exception {
     // Register interest in key1.
     vm1.invoke(() -> InterestListDUnitTest.createClientCache( NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1) ));
     vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
@@ -437,11 +469,13 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm1.invoke(() -> InterestListDUnitTest.registerKeyEx( key2 ));
   }
 
+  @Test
   public void testRegisterInterestOnReplicatedRegionWithCacheLoader() {
     runRegisterInterestWithCacheLoaderTest(true);
   }
 
-  public void testRegisterInterestOnPartitionedRegionWithCacheLoader() {
+  @Test
+  public void testRegisterInterestOnPartitionedRegionWithCacheLoader() throws Exception {
     runRegisterInterestWithCacheLoaderTest(false);
   }
 
@@ -482,26 +516,23 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm1.invoke(() -> InterestListDUnitTest.confirmNoCacheListenerInvalidates());
   }
   
-  private  void createCache(Properties props) throws Exception
-  {
+  private  void createCache(Properties props) throws Exception {
     DistributedSystem ds = getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
   }
 
-  public static DistributedMember createClientCache(String host, int port) throws Exception {
+  private static DistributedMember createClientCache(String host, int port) throws Exception {
     return createClientCache(host, port, 0);
   }
 
-  public static DistributedMember createClientCache(String host,
-      int port, int port2) throws Exception
-  {
+  private static DistributedMember createClientCache(String host, int port, int port2) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(DELTA_PROPAGATION, "false");
 
-    new InterestListDUnitTest("temp").createCache(props);
+    new InterestListDUnitTest().createCache(props);
     PoolFactory pfactory = PoolManager.createFactory()
       .addServer(host, port)
       .setThreadLocalConnections(true)
@@ -533,7 +564,7 @@ public class InterestListDUnitTest extends DistributedTestCase
   private static void createCache(boolean addReplicatedRegion) throws Exception {
     Properties props = new Properties();
     props.setProperty(DELTA_PROPAGATION, "false");
-    new InterestListDUnitTest("temp").createCache(props);
+    new InterestListDUnitTest().createCache(props);
     if (addReplicatedRegion) {
       addReplicatedRegion();
     } else {
@@ -565,25 +596,27 @@ public class InterestListDUnitTest extends DistributedTestCase
   // this method is for use in vm0 where the CacheServer used by
   // most of these tests resides.  This server is held in the
   // static variable 'server1'
-  public static Integer createServerCache() throws Exception {
+  private static Integer createServerCache() throws Exception {
     return createServerCache(true);
   }
 
-  public static Integer createServerCache(boolean addReplicatedRegion) throws Exception {
+  private static Integer createServerCache(boolean addReplicatedRegion) throws Exception {
     createCache(addReplicatedRegion);
     server = addCacheServer();
     return new Integer(server.getPort());
   }
 
   /** wait for queues to drain in the server */
-  public static void flushQueues() throws Exception {
+  private static void flushQueues() throws Exception {
     CacheServerImpl impl = (CacheServerImpl)server;
     for (CacheClientProxy proxy: (Set<CacheClientProxy>)impl.getAllClientSessions()) {
       final CacheClientProxy fproxy = proxy;
       WaitCriterion ev = new WaitCriterion() {
+        @Override
         public boolean done() {
           return fproxy.getHARegionQueue().size() == 0;
         }
+        @Override
         public String description() {
           return "waiting for queues to drain for " + fproxy.getProxyID();
         }
@@ -592,7 +625,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void addRegisterInterestListener() {
+  private static void addRegisterInterestListener() {
     interestListener = new InterestListener();
     List<CacheServer> servers = cache.getCacheServers();
     for (CacheServer s: servers) {
@@ -627,9 +660,11 @@ public class InterestListDUnitTest extends DistributedTestCase
     final EventCountingCacheListener fCacheListener = (EventCountingCacheListener) region.getAttributes().getCacheListener();
   
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         return fCacheListener.hasReceivedAllCreateEvents();
       }
+      @Override
       public String description() {
         return "waiting for " + fCacheListener.getExpectedCreates() + " create events";
       }
@@ -653,12 +688,11 @@ public class InterestListDUnitTest extends DistributedTestCase
     assertEquals(0/*expected*/, cacheListener.getInvalidates()/*actual*/);
   }
 
-  public static void verifyCountsAndClear(int count1, int count2) {
+  private static void verifyCountsAndClear(int count1, int count2) {
     interestListener.verifyCountsAndClear(count1, count2);
   }
 
-  public static void createEntriesK1andK2()
-  {
+  private static void createEntriesK1andK2() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -678,14 +712,12 @@ public class InterestListDUnitTest extends DistributedTestCase
   }
 
   private static void registerKeyOnly(Object key) {
-
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     r.registerInterest(key);
   }
 
-  public static void registerKey(Object key)
-  {
+  private static void registerKey(Object key) {
     try {
       registerKeyOnly(key);
     }
@@ -700,7 +732,7 @@ public class InterestListDUnitTest extends DistributedTestCase
    * @param clientId the DM of the client
    * @param key the key that the client is interested in
    */
-  public static void registerKeyForClient(DistributedMember clientId, Object key) {
+  private static void registerKeyForClient(DistributedMember clientId, Object key) {
     try {
       ClientSession cs = server.getClientSession(clientId);
       if (cs.isPrimary()) {
@@ -712,8 +744,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerKeyEx(Object key) {
-
+  private static void registerKeyEx(Object key) {
     try {
       registerKeyOnly(key);
       fail("Expected an exception during register interest with no available servers.");
@@ -724,8 +755,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerALL_KEYS()
-  {
+  private static void registerALL_KEYS() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -736,8 +766,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void put_ALL_KEYS()
-  {
+  private static void put_ALL_KEYS() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -752,8 +781,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void validate_ALL_KEYS()
-  {
+  private static void validate_ALL_KEYS() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -765,8 +793,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerKeys()
-  {
+  private static void registerKeys() {
     List list = new ArrayList();
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -780,8 +807,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerKeysAgain()
-  {
+  private static void registerKeysAgain() {
     List list = new ArrayList();
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -796,14 +822,12 @@ public class InterestListDUnitTest extends DistributedTestCase
   }
 
   private static void unregisterKeyOnly(Object key) {
-
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     r.unregisterInterest(key);
   }
 
-  public static void unregisterKey(Object key)
-  {
+  private static void unregisterKey(Object key) {
     try {
       unregisterKeyOnly(key);
     }
@@ -817,8 +841,7 @@ public class InterestListDUnitTest extends DistributedTestCase
    * @param clientId the client's ID
    * @param key the key it's no longer interest in
    */
-  public static void unregisterKeyForClient(DistributedMember clientId, Object key)
-  {
+  private static void unregisterKeyForClient(DistributedMember clientId, Object key) {
     try {
       ClientSession cs = server.getClientSession(clientId);
       if (cs.isPrimary()) {
@@ -830,12 +853,11 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void unregisterKeyEx(Object key) {
+  private static void unregisterKeyEx(Object key) {
     unregisterKeyOnly(key);
   }
 
-  public static void validateRegionEntriesFromInterestListInVm1()
-  {
+  private static void validateRegionEntriesFromInterestListInVm1() {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     Region.Entry k1, k2;
@@ -847,8 +869,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     assertEquals(k2.getValue(), "server2");
   }
 
-  public static void validateRegionEntriesFromInterestListInVm2()
-  {
+  private static void validateRegionEntriesFromInterestListInVm2() {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     assertEquals(r.getEntry("k3").getValue(), "server3");
@@ -856,7 +877,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     assertEquals(r.getEntry("k5").getValue(), "server5");
   }
 
-  public static void putSingleEntry(Object key, String value) {
+  private static void putSingleEntry(Object key, String value) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -869,8 +890,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void put(String vm)
-  {
+  private static void put(String vm) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -895,8 +915,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void multiple_put()
-  {
+  private static void multiple_put() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -912,8 +931,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void putAgain(String vm)
-  {
+  private static void putAgain(String vm) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -938,9 +956,9 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void validateEntriesK1andK2(final String vm)
-  {
+  private static void validateEntriesK1andK2(final String vm) {
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         try {
           Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -959,10 +977,11 @@ public class InterestListDUnitTest extends DistributedTestCase
           }
           return true;
         }
-        catch (AssertionFailedError ex) {
+        catch (AssertionError ex) {
           return false;
         }
       }
+      @Override
       public String description() {
         return "waiting for client to apply events from server";
       }
@@ -970,7 +989,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 5 * 10 * 1000, 200, true);
   }
 
-  public static void validateSingleEntry(Object key, String value) {
+  private static void validateSingleEntry(Object key, String value) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertEquals(value, r.getEntry(key).getValue());
@@ -980,8 +999,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void validateEntriesAgain(String vm)
-  {
+  private static void validateEntriesAgain(String vm) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -1002,40 +1020,25 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  @Override
-  public final void preTearDown() throws Exception {
-    // close the clients first
-    vm1.invoke(() -> InterestListDUnitTest.closeCache());
-    vm2.invoke(() -> InterestListDUnitTest.closeCache());
-    // then close the servers
-    vm0.invoke(() -> InterestListDUnitTest.closeCache());
-    cache = null;
-    Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
-  }
-
-  public static void closeCache()
-  {
+  private static void closeCache() {
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();
     }
   }
 
-  static class InterestListener implements InterestRegistrationListener {
+  private static class InterestListener implements InterestRegistrationListener {
+
     private int registrationCount;
     private int unregistrationCount;
 
-    /* (non-Javadoc)
-     * @see com.gemstone.gemfire.cache.InterestRegistrationListener#afterRegisterInterest(com.gemstone.gemfire.cache.InterestRegistrationEvent)
-     */
+    @Override
     public void afterRegisterInterest(InterestRegistrationEvent event) {
       LogWriterUtils.getLogWriter().info("InterestListener.afterRegisterInterest invoked with this event: " + event);
       registrationCount++;
     }
 
-    /* (non-Javadoc)
-     * @see com.gemstone.gemfire.cache.InterestRegistrationListener#afterUnregisterInterest(com.gemstone.gemfire.cache.InterestRegistrationEvent)
-     */
+    @Override
     public void afterUnregisterInterest(InterestRegistrationEvent event) {
       LogWriterUtils.getLogWriter().info("InterestListener.afterUnregisterInterest invoked with this event: " + event);
       unregistrationCount++;
@@ -1054,9 +1057,7 @@ public class InterestListDUnitTest extends DistributedTestCase
       unregistrationCount = 0;
     }
 
-    /* (non-Javadoc)
-     * @see com.gemstone.gemfire.cache.CacheCallback#close()
-     */
+    @Override
     public void close() {
     }
 
@@ -1067,9 +1068,7 @@ public class InterestListDUnitTest extends DistributedTestCase
   private static class EventCountingCacheListener extends CacheListenerAdapter {
 
     private AtomicInteger creates = new AtomicInteger();
-
     private AtomicInteger updates = new AtomicInteger();
-
     private AtomicInteger invalidates = new AtomicInteger();
 
     private int expectedCreates;
@@ -1082,15 +1081,18 @@ public class InterestListDUnitTest extends DistributedTestCase
       return this.expectedCreates;
     }
 
+    @Override
     public void afterCreate(EntryEvent event) {
       incrementCreates();
     }
 
+    @Override
     public void afterUpdate(EntryEvent event) {
       incrementUpdates();
       event.getRegion().getCache().getLogger().warning("Received update event " + getUpdates() + " for " + event.getKey());
     }
 
+    @Override
     public void afterInvalidate(EntryEvent event) {
       incrementInvalidates();
       event.getRegion().getCache().getLogger().warning("Received invalidate event " + getInvalidates() + " for " + event.getKey());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
index 6213e85..f5c4bc0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
@@ -16,7 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Properties;
+
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -27,22 +46,18 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.Assert;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-/**
- *
- *
- */
-public class InterestListEndpointDUnitTest extends DistributedTestCase
-{
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class InterestListEndpointDUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -67,11 +82,6 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
 
   static InterestListEndpointDUnitTest impl;
 
-  /** constructor */
-  public InterestListEndpointDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -98,7 +108,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
 
   /** subclass support */
   public static void createImpl() {
-    impl = new InterestListEndpointDUnitTest("temp");
+    impl = new InterestListEndpointDUnitTest();
   }
 
   private void createCache(Properties props) throws Exception
@@ -112,6 +122,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
    * tests wheteher upadets are sent to clients if put on server directly
    *
    */
+  @Test
   public void testDirectPutOnServer()
   {
     client1.invoke(() -> impl.createEntriesK1andK2());
@@ -127,6 +138,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
   * put on non interest list ep and verify updates
   *
   */
+  @Test
   public void testInterestListEndpoint()
   {
     client1.invoke(() -> createEntriesK1andK2());
@@ -140,6 +152,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
     client1.invoke(() -> verifyPut());
   }
 
+  @Test
   public void testInterestListEndpointAfterFailover() throws Exception
   {
     final long maxWaitTime = 20000;
@@ -212,7 +225,8 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
   }
 
 
- public void testUpdaterThreadIsAliveForFailedEndPoint(){
+  @Test
+  public void testUpdaterThreadIsAliveForFailedEndPoint(){
       client1.invoke(() -> acquirePoolConnection());
       client1.invoke(() -> processException());
       client1.invoke(() -> verifyUpdaterThreadIsAlive());
@@ -246,8 +260,8 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
  public static void verifyUpdaterThreadIsAlive() throws InterruptedException
  {
    QueueConnectionImpl conn2 = (QueueConnectionImpl) pool.getPrimaryConnection();
-   Assert.assertNotSame(conn1, conn2);
-   Assert.assertFalse(conn1.getServer().equals(conn2.getServer()));
+   assertNotSame(conn1, conn2);
+   assertFalse(conn1.getServer().equals(conn2.getServer()));
    assertNull(((QueueConnectionImpl)conn1).getUpdater());
    assertTrue((conn2).getUpdater().isAlive());
  }
@@ -307,7 +321,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new InterestListEndpointDUnitTest("temp").createCache(props);
+    new InterestListEndpointDUnitTest().createCache(props);
     Pool p;
     try {
       p = PoolManager.createFactory()
@@ -346,7 +360,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache(Integer maxThreads) throws Exception
   {
-    new InterestListEndpointDUnitTest("temp").createCache(new Properties());
+    new InterestListEndpointDUnitTest().createCache(new Properties());
     RegionAttributes attrs = impl.createServerCacheAttributes();
     cache.createRegion(REGION_NAME, attrs);
     CacheServer server1 = cache.addCacheServer();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
index e08202d..30f91a1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
@@ -16,19 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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.*;
 
 /**
  * subclass of InterestListEndpointDUnitTest to exercise partitioned regions
  *
  */
+@Category(DistributedTest.class)
 public class InterestListEndpointPRDUnitTest extends InterestListEndpointDUnitTest {
 
-  public InterestListEndpointPRDUnitTest(String name) {
-    super(name);
+  public InterestListEndpointPRDUnitTest() {
+    super();
   }
   public static void createImpl() {
-    impl = new InterestListEndpointPRDUnitTest("temp");
+    impl = new InterestListEndpointPRDUnitTest();
   }
   
   protected RegionAttributes createServerCacheAttributes()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
index 2a5d32e..5bfa0c7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
@@ -16,16 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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;
+
 /**
  * Just like InterestListEndpointDUnitTest but uses thread pool (i.e. selector)
  * in bridge servers
  *
  */
+@Category(DistributedTest.class)
 public class InterestListEndpointSelectorDUnitTest
   extends InterestListEndpointDUnitTest
 {
-  public InterestListEndpointSelectorDUnitTest(String name) {
-    super(name);
+  public InterestListEndpointSelectorDUnitTest() {
+    super();
   }
 
   protected int getMaxThreads() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
index 66527d0..2a27474 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
@@ -16,23 +16,28 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-
+import static org.junit.Assert.*;
 
 import java.util.Iterator;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.Pool;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache.client.*;
-import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
-import com.gemstone.gemfire.cache.client.internal.PoolImpl;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test Scenario :
@@ -47,11 +52,12 @@ import com.gemstone.gemfire.cache.client.internal.PoolImpl;
  * c2 : put (k1 -> vm2-key-1) and (k6 -> vm2-key-6)
  * c1 :  validate (r.getEntry("key-1").getValue() == "vm2-key-1")
  *                (r.getEntry("key-6").getValue() == "key-6") // as it is not registered *
- *
- *
  */
-public class InterestListFailoverDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class InterestListFailoverDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final String REGION_NAME = InterestListFailoverDUnitTest.class.getSimpleName() + "_region";
+
   VM vm0 = null;
 
   VM vm1 = null;
@@ -63,13 +69,6 @@ public class InterestListFailoverDUnitTest extends DistributedTestCase
   private int PORT1;
   private int PORT2;
 
-  private static final String REGION_NAME = "InterestListFailoverDUnitTest_region";
-
-  /** constructor */
-  public InterestListFailoverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -113,11 +112,13 @@ public class InterestListFailoverDUnitTest extends DistributedTestCase
  *
  */
 
+  @Test
   public void testInterestListRecoveryHA()
   {
     doTestInterestListRecovery(-1);
   }
 
+  @Test
   public void testInterestListRecoveryNonHA()
   {
     doTestInterestListRecovery(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
index 0a44d60..280ab66 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
@@ -16,9 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.EOFException;
+import java.net.SocketException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker;
@@ -27,20 +48,16 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.EOFException;
-import java.net.SocketException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
  * Test Scenario :
  *
  * one client(c1) two servers(s1,s2)
@@ -52,10 +69,12 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * see interest list on s1 contains only s4, s5
  * s2 ----> unavaliable // fail over should to s1 with intrest list s4,s5
  * see only k4 and k5 are registerd on s1
- *
  */
-public class InterestListRecoveryDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class InterestListRecoveryDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final String REGION_NAME = InterestListRecoveryDUnitTest.class.getSimpleName() + "_region";
+
   private static Cache cache = null;
 
   VM server1 = null;
@@ -67,14 +86,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
   private static int PORT1;
   private static int PORT2;
 
-
-  private static final String REGION_NAME = "InterestListRecoveryDUnitTest_region";
-
-  /** constructor */
-  public InterestListRecoveryDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -92,9 +103,9 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2));
   }
 
-  // this test fails because of bug# 35352 , hence commented the bug is Deferred to: Danube
-  public void XtestKeyInterestRecoveryWhileServerFailover() throws Exception
-  {
+  @Ignore("TODO: test is disabled because of #35352: proxy.markServerUnavailable() is not causing interestListEndpoint to change")
+  @Test
+  public void testKeyInterestRecoveryWhileServerFailover() throws Exception {
     createEntries();
     server1.invoke(() -> InterestListRecoveryDUnitTest.createEntries());
     registerK1toK5();
@@ -111,6 +122,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
 
   }
 
+  @Test
   public void testKeyInterestRecoveryWhileProcessException() throws Exception {
     VM serverFirstRegistered = null;
     VM serverSecondRegistered = null;
@@ -188,8 +200,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
 
   public static void createClientCache(String host, Integer port1, Integer port2 ) throws Exception
   {
-    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest(
-        "temp");
+    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -218,8 +229,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest(
-        "temp");
+    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -234,9 +244,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     return new Integer(server1.getPort());
   }
 
-
-
-
   public static void createEntries()
   {
     try {
@@ -290,6 +297,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
       Assert.fail("while setting server unavailable  "+ server, ex);
     }
   }
+
   public static void setServerAvailable(String server)
   {
     try {
@@ -316,8 +324,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     }
   }
 
-
-
   public static void put(String key)
   {
     try {
@@ -329,7 +335,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     }
   }
 
-
   public static void verifyRegionToProxyMapForFullRegistrationRetry() {
     WaitCriterion ev = new WaitCriterion() {
       public boolean done() {
@@ -355,21 +360,19 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 20 * 1000, 200, true);
   }
   
-   public static void verifyRegionToProxyMapForFullRegistration()
-   {
-     Iterator iter = getCacheClientProxies().iterator();
-     if(iter.hasNext()){
-       Set keys = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
-       assertNotNull(keys);
-
-       assertTrue(keys.contains("key-1"));
-       assertTrue(keys.contains("key-2"));
-       assertTrue(keys.contains("key-3"));
-       assertTrue(keys.contains("key-4"));
-       assertTrue(keys.contains("key-5"));
-     }
-   }
-
+  public static void verifyRegionToProxyMapForFullRegistration() {
+    Iterator iter = getCacheClientProxies().iterator();
+    if(iter.hasNext()){
+      Set keys = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
+      assertNotNull(keys);
+
+      assertTrue(keys.contains("key-1"));
+      assertTrue(keys.contains("key-2"));
+      assertTrue(keys.contains("key-3"));
+      assertTrue(keys.contains("key-4"));
+      assertTrue(keys.contains("key-5"));
+    }
+  }
 
   public static void verifyRegisterK4toK5Retry() {
     WaitCriterion ev = new WaitCriterion() {
@@ -397,19 +400,19 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 20 * 1000, 200, true);
   }
 
-   public static void verifyRegisterK4toK5() {
-     Iterator iter = getCacheClientProxies().iterator();
-     if (iter.hasNext()) {
-       Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
-       assertNotNull(keysMap);
-
-       assertFalse(keysMap.contains("key-1"));
-       assertFalse(keysMap.contains("key-2"));
-       assertFalse(keysMap.contains("key-3"));
-       assertTrue(keysMap.contains("key-4"));
-       assertTrue(keysMap.contains("key-5"));
-     }
-   }
+  public static void verifyRegisterK4toK5() {
+    Iterator iter = getCacheClientProxies().iterator();
+    if (iter.hasNext()) {
+      Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
+      assertNotNull(keysMap);
+
+      assertFalse(keysMap.contains("key-1"));
+      assertFalse(keysMap.contains("key-2"));
+      assertFalse(keysMap.contains("key-3"));
+      assertTrue(keysMap.contains("key-4"));
+      assertTrue(keysMap.contains("key-5"));
+    }
+  }
 
   public static void verifyRegionToProxyMapForNoRegistrationRetry() {
     WaitCriterion ev = new WaitCriterion() {
@@ -436,41 +439,40 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 20 * 1000, 200, true);
   }
 
- public static void verifyRegionToProxyMapForNoRegistration()
- {
-   Iterator iter = getCacheClientProxies().iterator();
-   if (iter.hasNext()) {
-     Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
-     if (keysMap != null) { // its ok not to have an empty map, just means there is no registration
-       assertFalse(keysMap.contains("key-1"));
-       assertFalse(keysMap.contains("key-2"));
-       assertFalse(keysMap.contains("key-3"));
-       assertFalse(keysMap.contains("key-4"));
-       assertFalse(keysMap.contains("key-5"));
-     }
-   }
- }
-
- public static Set getCacheClientProxies() {
-   Cache c = CacheFactory.getAnyInstance();
-   assertEquals("More than one CacheServer", 1, c.getCacheServers().size());
-   CacheServerImpl bs = (CacheServerImpl)c.getCacheServers().iterator()
-   .next();
-   assertNotNull(bs);
-   assertNotNull(bs.getAcceptor());
-   assertNotNull(bs.getAcceptor().getCacheClientNotifier());
-   return new HashSet(bs.getAcceptor().getCacheClientNotifier().getClientProxies());
- }
-
- public static Set getKeysOfInterestMap(CacheClientProxy proxy, String regionName) {
-   //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]);
-   //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]._keysOfInterest);
-   return proxy.cils[RegisterInterestTracker.interestListIndex]
-     .getProfile(regionName).getKeysOfInterestFor(proxy.getProxyID());
- }
-
- @Override
- public final void preTearDown() throws Exception {
+  public static void verifyRegionToProxyMapForNoRegistration() {
+    Iterator iter = getCacheClientProxies().iterator();
+    if (iter.hasNext()) {
+      Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
+      if (keysMap != null) { // its ok not to have an empty map, just means there is no registration
+        assertFalse(keysMap.contains("key-1"));
+        assertFalse(keysMap.contains("key-2"));
+        assertFalse(keysMap.contains("key-3"));
+        assertFalse(keysMap.contains("key-4"));
+        assertFalse(keysMap.contains("key-5"));
+      }
+    }
+  }
+
+  public static Set getCacheClientProxies() {
+    Cache c = CacheFactory.getAnyInstance();
+    assertEquals("More than one CacheServer", 1, c.getCacheServers().size());
+    CacheServerImpl bs = (CacheServerImpl)c.getCacheServers().iterator()
+    .next();
+    assertNotNull(bs);
+    assertNotNull(bs.getAcceptor());
+    assertNotNull(bs.getAcceptor().getCacheClientNotifier());
+    return new HashSet(bs.getAcceptor().getCacheClientNotifier().getClientProxies());
+  }
+
+  public static Set getKeysOfInterestMap(CacheClientProxy proxy, String regionName) {
+    //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]);
+    //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]._keysOfInterest);
+    return proxy.cils[RegisterInterestTracker.interestListIndex]
+      .getProfile(regionName).getKeysOfInterestFor(proxy.getProxyID());
+  }
+
+  @Override
+  public final void preTearDown() throws Exception {
     // close the clients first
     server2.invoke(() -> InterestListRecoveryDUnitTest.closeCache());
     closeCache();
@@ -485,8 +487,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
       cache.getDistributedSystem().disconnect();
     }
   }
-  
-  
+
   public static void verifyDeadAndLiveServers(final int expectedDeadServers, 
       final int expectedLiveServers)
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
index a2536c1..e16eb9c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
@@ -16,15 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.ClientCache;
-import com.gemstone.gemfire.cache.client.ClientCacheFactory;
-import com.gemstone.gemfire.cache.client.ClientRegionFactory;
-import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
-import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.net.InetAddress;
@@ -32,13 +25,38 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.ClientSession;
+import com.gemstone.gemfire.cache.InterestRegistrationEvent;
+import com.gemstone.gemfire.cache.InterestRegistrationListener;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Written to test fix for Bug #47132
- *
  */
-public class InterestRegrListenerDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class InterestRegrListenerDUnitTest extends JUnit4DistributedTestCase {
   
   private Cache cache;
   private DistributedSystem ds;
@@ -52,14 +70,7 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
   private static final String REGISTER_INTEREST = "RegisterInterest";
   private static final int DURABLE_CLIENT_TIMEOUT_TEST=20;
   
-  private static InterestRegrListenerDUnitTest instance = new InterestRegrListenerDUnitTest("InterestRegrListenerDUnitTest");
-
-
-  public InterestRegrListenerDUnitTest(String name) {
-    super(name);    
-  }
-  
-  private static final long serialVersionUID = 1L;
+  private static InterestRegrListenerDUnitTest instance = new InterestRegrListenerDUnitTest();
 
   @Override
   public final void preSetUp() throws Exception {
@@ -84,8 +95,7 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     hostName = InetAddress.getLocalHost().getHostAddress();
     listnerMap.clear();
   }
-  
-  
+
   public int getCacheServerPort(){
     return cacheServerPort;
   }
@@ -239,6 +249,7 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     instance.doClientRegionRegisterInterest(isDurable);
   }
   
+  @Test
   public void testDurableClientExit_ClientExpressedInterest() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(0);
@@ -302,8 +313,8 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     assertEquals(3, unregisterCount);
     serverVM.invoke(() -> InterestRegrListenerDUnitTest.closeCacheTask());    
   }
-  
-  
+
+  @Test
   public void testDurableClientExit_ServerExpressedInterest() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(0);
@@ -363,11 +374,9 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     assertEquals(3, registerCount);
     assertEquals(3, unregisterCount);
     serverVM.invoke(() -> InterestRegrListenerDUnitTest.closeCacheTask());
-    
   }
-  
-  
-  
+
+  @Test
   public void testDurableClientExit_ServerExpressedInterest_NonDurableInterest() throws Exception {
     final Host host = Host.getHost(0);
     final VM serverVM = host.getVM(0);
@@ -444,7 +453,6 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     Thread.sleep((DURABLE_CLIENT_TIMEOUT_TEST+5)*1000);
     serverVM.invoke(() -> InterestRegrListenerDUnitTest.closeCacheTask());
   }
-  
 
   private int getMapValueForKey(Map<String, Integer> map, String key) {
     if (map.containsKey(key))

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
index eaa8433..6f23ff8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
@@ -16,30 +16,46 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * DUnit Test for use-cases of various {@link InterestResultPolicy} types.
- *
- *
  */
-public class InterestResultPolicyDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class InterestResultPolicyDUnitTest extends JUnit4DistributedTestCase {
+
   /** test VM */
   VM vm0, vm1 = null;
 
@@ -49,23 +65,13 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
   /** the cache instance for the test */
   private static Cache cache = null;
   
-  private int PORT   ; 
+  private int PORT;
 
-  private static final String REGION_NAME = "InterestResultPolicyDUnitTest_region" ;
+  private static final String REGION_NAME = InterestResultPolicyDUnitTest.class.getSimpleName() + "_region" ;
 
   private IgnoredException expectedEx;
 
   /**
-   * Creates a test instance with the given name
-   *
-   * @param name -
-   *          name of test instance
-   */
-  public InterestResultPolicyDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Creates the server cache and populates it with some entries
    */
   @Override
@@ -108,6 +114,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * 3)At the end of registerInterest call, verify that no entries are created
    * in the client cache<br>
    */
+  @Test
   public void testPolicyNone()
   {
     LogWriter logger = getSystem().getLogWriter();
@@ -131,6 +138,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * 3)At the end of registerInterest call, verify that entries are created in
    * the client cache with value null<br>
    */
+  @Test
   public void testPolicyKeys()
   {
     LogWriter logger = getSystem().getLogWriter();
@@ -154,6 +162,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * 3)At the end of registerInterest call, verify that all entries are created
    * in the client cache with values<br>
    */
+  @Test
   public void testPolicyKeysValues()
   {
     LogWriter logger = getSystem().getLogWriter();
@@ -179,6 +188,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * in the keylist which are not on the server should not be created on the
    * client as a result of registerInterest call)<br>
    */
+  @Test
   public void testBug35358()
   {
     Host host = Host.getHost(0);
@@ -239,8 +249,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    */
   public static Integer createServerCache() throws Exception
   {
-    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest(
-        "temp");
+    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -279,8 +288,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
   public static void createClientCache(String host, Integer port) throws Exception
   {
     int PORT = port.intValue() ;
-    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest(
-        "temp");
+    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
index 0f78c66..7f16642 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
@@ -16,10 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+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.CacheFactory;
@@ -29,18 +34,18 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This tests that basic entry operations work properly when regions are
  * configured with newly added RegionAttributes in a P2P environment.
- * 
  */
-public class NewRegionAttributesDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class NewRegionAttributesDUnitTest extends JUnit4DistributedTestCase {
 
   /** test VM */
   VM vm0, vm1 = null;
@@ -54,16 +59,6 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
   private static final String REGION_NAME = "NewRegionAttributesDUnitTest_region" ;
 
   /**
-   * Creates a test instance with the given name
-   * 
-   * @param name -
-   *          name of test instance
-   */
-  public NewRegionAttributesDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Creates the server cache on test-VMs
    * 
    * @throws Exception
@@ -124,7 +119,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
   public static void createServerCache(Boolean enableWan, Boolean setPublisher,
       Boolean enableConflation, Boolean enableAsyncConflation) throws Exception
   {
-    NewRegionAttributesDUnitTest test = new NewRegionAttributesDUnitTest("temp");
+    NewRegionAttributesDUnitTest test = new NewRegionAttributesDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -182,6 +177,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
    * @see AttributesFactory#setEnableConflation(boolean)
    * @see AttributesFactory#setEnableAsyncConflation(boolean)
    */
+  @Test
   public void testEntryOperationsWithNewAttributesEnabled()
   {
     vm0.invoke(() -> NewRegionAttributesDUnitTest.checkAttributes());
@@ -202,6 +198,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
    * test-region (which does not have any bridge-client or bridge-server) and
    * verifies that <code>UnsupportedOperationException</code> occurs as expected
    */
+  @Test
   public void testRegisterInterestUseCases()
   {
     vm1.invoke(() -> NewRegionAttributesDUnitTest.registerInterest());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
index 0805e2a..10f707d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
@@ -39,7 +39,7 @@ public class ObjectPartListJUnitTest {
     list.addObjectPart("key", "value2", true, null);
     byte[] serializedObjectBytes = BlobHelper.serializeToBlob("value3");
     list.addObjectPart("key", serializedObjectBytes, true, null);
-    list.addExceptionPart("key", new TestException("hello"));
+    list.addExceptionPart("key", new AssertionError("hello"));
     list.addObjectPartForAbsentKey("key", null);
     
     //Create a clone of the this.
@@ -65,7 +65,7 @@ public class ObjectPartListJUnitTest {
     assertEquals("value1", new String((byte[]) values.get(0)));
     assertEquals("value2", values.get(1));
     assertEquals("value3", values.get(2));
-    assertEquals(new TestException("hello"), values.get(3));
+    assertEquals(new AssertionError("hello"), values.get(3));
     assertNull(values.get(4));
   }
 
@@ -77,7 +77,7 @@ public class ObjectPartListJUnitTest {
     list.addObjectPart("key", "value2", true, null);
     byte[] serializedObjectBytes = BlobHelper.serializeToBlob("value3");
     list.addObjectPart("key", serializedObjectBytes, true, null);
-    list.addExceptionPart("key", new TestException("hello"));
+    list.addExceptionPart("key", new AssertionError("hello"));
     list.addObjectPartForAbsentKey("key", null);
     
     //Create a clone of the this list.
@@ -100,22 +100,22 @@ public class ObjectPartListJUnitTest {
     assertEquals("value1", new String((byte[]) values.get(0)));
     assertEquals("value2", BlobHelper.deserializeBlob((byte[])values.get(1)));
     assertEquals("value3", BlobHelper.deserializeBlob((byte[])values.get(2)));
-    assertEquals(new TestException("hello"), values.get(3));
+    assertEquals(new AssertionError("hello"), values.get(3));
     assertNull(values.get(4));
   }
   
-  private static class TestException extends Exception {
+  private static class AssertionError extends Exception {
 
-    public TestException(String message) {
+    public AssertionError(String message) {
       super(message);
     }
 
     @Override
     public boolean equals(Object o) {
-      if(!(o instanceof TestException)) {
+      if(!(o instanceof AssertionError)) {
         return false;
       }
-      if(!((TestException) o ).getMessage().equals(getMessage())) {
+      if(!((AssertionError) o ).getMessage().equals(getMessage())) {
         return false;
       }
       return true;


[21/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
index ea1ed4a..61c9b45 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
@@ -16,16 +16,17 @@
  */
 package com.gemstone.gemfire.internal.cache.ha;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
+import org.junit.Ignore;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import util.TestException;
-
-import junit.framework.Assert;
 
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -44,39 +45,27 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.HARegion;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
-public class HARegionQueueDUnitTest extends DistributedTestCase {
-  VM vm0 = null;
-
-  VM vm1 = null;
-
-  VM vm3 = null;
-
-  VM vm2 = null;
-
-  protected static Cache cache = null;
-
-  protected static HARegionQueue hrq = null;
+public class HARegionQueueDUnitTest extends JUnit4DistributedTestCase {
 
-//  private static int counter = 0;
+  private static volatile boolean toCnt = true;
+  private static volatile Thread createQueuesThread;
 
-  protected static volatile boolean toCnt = true;
+  private static Cache cache = null;
+  private static HARegionQueue hrq = null;
+  private static Thread[] opThreads;
 
-  protected static Thread opThreads[];
-  
-  protected static volatile Thread createQueuesThread;
-
-  /** constructor */
-  public HARegionQueueDUnitTest(String name) {
-    super(name);
-  }
+  private VM vm0 = null;
+  private VM vm1 = null;
+  private VM vm3 = null;
+  private VM vm2 = null;
 
   /**
    * get the VM's
@@ -99,13 +88,16 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm1.invoke(() -> HARegionQueueDUnitTest.closeCache());
     vm2.invoke(() -> HARegionQueueDUnitTest.closeCache());
     vm3.invoke(() -> HARegionQueueDUnitTest.closeCache());
+    
+    cache = null;
+    hrq = null;
+    opThreads = null;
   }
 
   /**
    * create cache
    */
-  protected Cache createCache() throws CacheException
-  {
+  private Cache createCache() throws CacheException {
     Properties props = new Properties();
     DistributedSystem ds = getSystem(props);
     ds.disconnect();
@@ -124,10 +116,9 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * assert that the put has not propagated from VM1 to VM2 4) do a put in VM2
    * 5) assert that the value in VM1 has not changed to due to put in VM2 6)
    * assert put in VM2 was successful by doing a get
-   *
    */
-  public void testLocalPut()
-  {
+  @Test
+  public void testLocalPut() throws Exception {
     vm0.invoke(() -> HARegionQueueDUnitTest.createRegion());
     vm1.invoke(() -> HARegionQueueDUnitTest.createRegion());
     vm0.invoke(() -> HARegionQueueDUnitTest.putValue1());
@@ -145,10 +136,9 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * assert respective puts the VMs were successful by doing a get 7)
    * localDestroy key in VM1 8) assert key has been destroyed in VM1 9) assert
    * key has not been destroyed in VM2
-   *
    */
-  public void testLocalDestroy()
-  {
+  @Test
+  public void testLocalDestroy() throws Exception {
     vm0.invoke(() -> HARegionQueueDUnitTest.createRegion());
     vm1.invoke(() -> HARegionQueueDUnitTest.createRegion());
     vm0.invoke(() -> HARegionQueueDUnitTest.putValue1());
@@ -166,10 +156,9 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * value in VM1 to assert put has happened successfully 4) Create mirrored
    * HARegion region1 in VM2 5) do a get in VM2 to verify that value was got
    * through GII 6) do a put in VM2 7) assert put in VM2 was successful
-   *
    */
-  public void testGII()
-  {
+  @Test
+  public void testGII() throws Exception {
     vm0.invoke(() -> HARegionQueueDUnitTest.createRegion());
     vm0.invoke(() -> HARegionQueueDUnitTest.putValue1());
     vm0.invoke(() -> HARegionQueueDUnitTest.getValue1());
@@ -177,37 +166,16 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm1.invoke(() -> HARegionQueueDUnitTest.getValue1());
     vm1.invoke(() -> HARegionQueueDUnitTest.putValue2());
     vm1.invoke(() -> HARegionQueueDUnitTest.getValue2());
-
   }
 
   /**
-   * Tests the relevant data structures are updated after GII happens.
-   *
-   * In this test, a HARegion is created in vm0. 10 conflatable objects are put
-   * in vm0's region HARegion is then created in vm1. After region creation, the
-   * verification whether the relevant data structuers have been updated is
-   * done.
-   *
-   */
- /* public void testGIIAndMapUpdates()
-  {
-    vm0.invoke(() -> HARegionQueueDUnitTest.createRegionQueue2());
-    vm0.invoke(() -> HARegionQueueDUnitTest.putConflatables());
-    vm1.invoke(() -> HARegionQueueDUnitTest.createRegionQueue2());
-    vm0.invoke(() -> HARegionQueueDUnitTest.clearRegion());
-    vm1.invoke(() -> HARegionQueueDUnitTest.verifyMapsAndData());
-
-  } */
-
-  /**
    * 1) Create mirrored HARegion region1 in VM1 2) do a put in VM1 3) get teh
    * value in VM1 to assert put has happened successfully 4) Create mirrored
    * HARegion region1 in VM2 5) do a get in VM2 to verify that value was got
    * through GII 6) do a put in VM2 7) assert put in VM2 was successful
-   *
    */
-  public void testQRM()
-  {
+  @Test
+  public void testQRM() throws Exception {
     vm0.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());
     vm1.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());
     vm0.invoke(() -> HARegionQueueDUnitTest.verifyAddingDispatchMesgs());
@@ -216,27 +184,18 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
   }
 
   /**
-   * 1)Create regionqueue on VM0 and VM1 2) put same conflated object from VM1
-   * aand VM2 3)perform take() operation from VM0 4) Wait for the QRM to
-   * execute. 4)check the size of the regionqueue in VM1. It should be zero
-   * because QRM should remove entry from the regionqueue of VM1
-   * 
-   * 
-   */
-  
-  /**
-   * Behaviour of take() has been changed for relaible messaging feature. Region queue take()
+   * Behaviour of take() has been changed for reliable messaging feature. Region queue take()
    * operation will no longer add to the Dispatch Message Map. Hence disabling the test - SUYOG
-  */
-    
-  public void _testBugNo35988() throws Exception
-  {
-    
-    CacheSerializableRunnable createQueue = new CacheSerializableRunnable(
-        "CreateCache, HARegionQueue and start thread") {
-      public void run2() throws CacheException
-      {
-        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest("region1");
+   *
+   * Test for #35988 HARegionQueue.take() is not functioning as expected
+   */
+  @Ignore("TODO: this test was disabled")
+  @Test
+  public void testBugNo35988() throws Exception {
+    CacheSerializableRunnable createQueue = new CacheSerializableRunnable("CreateCache, HARegionQueue and start thread") {
+      @Override
+      public void run2() throws CacheException {
+        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
         //TODO:ASIF: Bcoz of the QRM thread cannot take frequency below
         // 1 second , thus we need to carfully evaluate what to do. Though
         //in this case 1 second instead of 500 ms will work
@@ -253,8 +212,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
               new byte[] { 0 }, 1, 1), false, "dummy"));
         }
         catch (Exception e) {
-          throw new CacheException(e) {
-          };
+          throw new AssertionError(e);
         }
       }
     };
@@ -262,28 +220,28 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm1.invoke(createQueue);
 
     vm0.invoke(new CacheSerializableRunnable("takeFromVm0") {
+      @Override
       public void run2() throws CacheException {
         try {
           Conflatable obj = (Conflatable)hrq.take();
           assertNotNull(obj);
         }
         catch (Exception e) {
-          throw new CacheException(e) {
-          };
+          throw new AssertionError(e);
         }
       }
     });
 
-
-
     vm1.invoke(new CacheSerializableRunnable("checkInVm1") {
-      public void run2() throws CacheException
-      {
+      @Override
+      public void run2() throws CacheException {
         WaitCriterion ev = new WaitCriterion() {
+          @Override
           public boolean done() {
             Thread.yield(); // TODO is this necessary?
             return hrq.size() == 0;
           }
+          @Override
           public String description() {
             return null;
           }
@@ -296,32 +254,18 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
   /**
    * create a client with 2 regions sharing a common writer
-   *
-   * @throws Exception
    */
-
-  public static void createRegion() throws Exception
-  {
-    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest(
-        "HARegionQueueDUnitTest_region");
+  private static void createRegion() throws Exception {
+    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
     cache = test.createCache();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
-    HARegion.getInstance("HARegionQueueDUnitTest_region", (GemFireCacheImpl)cache,
-        null, factory.create());
+    HARegion.getInstance("HARegionQueueDUnitTest_region", (GemFireCacheImpl)cache, null, factory.create());
   }
 
-  /**
-   *
-   *
-   * @throws Exception
-   */
-
-  public static void createRegionQueue() throws Exception
-  {
-    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest(
-        "HARegionQueueDUnitTest_region");
+  private static void createRegionQueue() throws Exception   {
+    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
     cache = test.createCache();
     /*
      * AttributesFactory factory = new AttributesFactory();
@@ -339,13 +283,10 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
         "HARegionQueueDUnitTest_region");
     hrq.put(c1);
     hrq.put(c2);
-
   }
 
-  public static void createRegionQueue2() throws Exception
-  {
-    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest(
-        "HARegionQueueDUnitTest_region");
+  private static void createRegionQueue2() throws Exception {
+    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
     cache = test.createCache();
     /*
      * AttributesFactory factory = new AttributesFactory();
@@ -359,8 +300,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
         HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
   }
 
-  public static void clearRegion()
-  {
+  private static void clearRegion() {
     try {
       Iterator iterator = hrq.getRegion().keys().iterator();
       while (iterator.hasNext()) {
@@ -368,31 +308,31 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("Exception occured while trying to destroy region");
+      fail("Exception occured while trying to destroy region", e);
     }
 
   }
 
-  public static void verifyAddingDispatchMesgs()
-  {
-    Assert.assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting()
+  private static void verifyAddingDispatchMesgs() {
+    assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting()
         .isEmpty());
     hrq.addDispatchedMessage(new ThreadIdentifier(new byte[1], 1), 1);
-    Assert.assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting()
+    assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting()
         .isEmpty());
   }
 
-  public static void verifyDispatchedMessagesRemoved()
+  private static void verifyDispatchedMessagesRemoved()
   {
     try {
       final Region region = hrq.getRegion();
-      // wait until we have a dead
-      // server
+      // wait until we have a dead server
       WaitCriterion ev = new WaitCriterion() {
+        @Override
         public boolean done() {
           Thread.yield(); // TODO is this necessary?
           return region.get(new Long(0)) == null;
         }
+        @Override
         public String description() {
           return null;
         }
@@ -410,16 +350,14 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
     }
     catch (Exception e) {
-      fail("test failed due to an exception :  " + e);
+      fail("test failed due to an exception", e);
     }
   }
 
   /**
    * close the cache
-   * 
    */
-  public static void closeCache()
-  {
+  private static void closeCache() {
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();
@@ -428,22 +366,18 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
   /**
    * do puts on key-1
-   *
    */
-  public static void putValue1()
-  {
+  private static void putValue1() {
     try {
       Region r1 = cache.getRegion("/HARegionQueueDUnitTest_region");
       r1.put("key-1", "value-1");
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
+      fail("failed while region.put()", ex);
     }
   }
 
-  public static void putConflatables()
-  {
+  private static void putConflatables() {
     try {
       Region r1 = hrq.getRegion();
       for (int i = 1; i < 11; i++) {
@@ -453,54 +387,51 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
+      fail("failed while region.put()", ex);
     }
   }
 
   /**
    * verifies the data has been populated correctly after GII
-   *
    */
-  public static void verifyMapsAndData()
-  {
+  private static void verifyMapsAndData() {
     try {
       HARegion r1 = (HARegion)hrq.getRegion();
       // region should not be null
-      Assert.assertNotNull(" Did not expect the HARegion to be null but it is",
+      assertNotNull(" Did not expect the HARegion to be null but it is",
           r1);
       // it should have ten non null entries
       for (int i = 1; i < 11; i++) {
-        Assert.assertNotNull(" Did not expect the entry to be null but it is",
+        assertNotNull(" Did not expect the entry to be null but it is",
             r1.get(new Long(i)));
       }
       // HARegionQueue should not be null
-      Assert.assertNotNull(
+      assertNotNull(
           " Did not expect the HARegionQueue to be null but it is", hrq);
 
       Map conflationMap = hrq.getConflationMapForTesting();
       // conflationMap size should be greater than 0
-      Assert.assertTrue(
+      assertTrue(
           " Did not expect the conflationMap size to be 0 but it is",
           conflationMap.size() > 0);
       Map internalMap = (Map)conflationMap.get("HARegionQueueDUnitTest_region");
       // internal map should not be null. it should be present
-      Assert.assertNotNull(
+      assertNotNull(
           " Did not expect the internalMap to be null but it is", internalMap);
       // get and verify the entries in the conflation map.
       for (int i = 1; i < 11; i++) {
-        Assert.assertTrue(
+        assertTrue(
             " Did not expect the entry not to be equal but it is", internalMap
                 .get("key" + i).equals(new Long(i)));
       }
       Map eventMap = hrq.getEventsMapForTesting();
       // DACE should not be null
-      Assert.assertNotNull(
+      assertNotNull(
           " Did not expect the result (DACE object) to be null but it is",
           eventMap.get(new ThreadIdentifier(new byte[] { 1 }, 1)));
       Set counterSet = hrq.getCurrentCounterSet(new EventID(new byte[] { 1 },
           1, 1));
-      Assert.assertTrue(
+      assertTrue(
           " excpected the counter set size to be 10 but it is not so",
           counterSet.size() == 10);
       long i = 1;
@@ -508,12 +439,12 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
       // verify the order of the iteration. it should be 1 - 10. The underlying
       // set is a LinkedHashSet
       while (iterator.hasNext()) {
-        Assert.assertTrue(((Long)iterator.next()).longValue() == i);
+        assertTrue(((Long)iterator.next()).longValue() == i);
         i++;
       }
       // The last dispactchde sequence Id should be -1 since no dispatch has
       // been made
-      Assert.assertTrue(hrq.getLastDispatchedSequenceId(new EventID(
+      assertTrue(hrq.getLastDispatchedSequenceId(new EventID(
           new byte[] { 1 }, 1, 1)) == -1);
 
       // sleep for 8.0 seconds. Everythign should expire and everything should
@@ -521,8 +452,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
       Thread.sleep(7500);
 
       for (int j = 1; j < 11; j++) {
-        Assert
-            .assertNull(
+        assertNull(
                 "expected the entry to be null since expiry time exceeded but it is not so",
                 r1.get(new Long(j)));
       }
@@ -530,50 +460,41 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
       internalMap = (Map)hrq.getConflationMapForTesting().get(
           "HARegionQueueDUnitTest_region");
 
-      Assert.assertNotNull(
+      assertNotNull(
           " Did not expect the internalMap to be null but it is", internalMap);
-      Assert
-          .assertTrue(
+      assertTrue(
               "internalMap (conflation) should have been emptry since expiry of all entries has been exceeded but it is not so",
               internalMap.isEmpty());
-      Assert
-          .assertTrue(
+      assertTrue(
               "eventMap should have been emptry since expiry of all entries has been exceeded but it is not so",
               eventMap.isEmpty());
-      Assert
-          .assertTrue(
+      assertTrue(
               "counter set should have been emptry since expiry of all entries has been exceeded but it is not so",
               counterSet.isEmpty());
 
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
+      fail("failed while region.put()", ex);
     }
   }
 
   /**
    * do puts on key-1,value-2
-   *
    */
-  public static void putValue2()
-  {
+  private static void putValue2() {
     try {
       Region r1 = cache.getRegion("/HARegionQueueDUnitTest_region");
       r1.put("key-1", "value-2");
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
+      fail("failed while region.put()", ex);
     }
   }
 
   /**
    * do a get on region1
-   *
    */
-  public static void getValue1()
-  {
+  private static void getValue1() {
     try {
       Region r = cache.getRegion("/HARegionQueueDUnitTest_region");
       if (!(r.get("key-1").equals("value-1"))) {
@@ -582,17 +503,14 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
+      fail("failed while region.get()", ex);
     }
   }
 
   /**
    * do a get on region1
-   *
    */
-  public static void getNull()
-  {
+  private static void getNull() {
     try {
       Region r = cache.getRegion("/HARegionQueueDUnitTest_region");
       if (!(r.get("key-1") == (null))) {
@@ -601,17 +519,14 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
+      fail("failed while region.get()", ex);
     }
   }
 
   /**
    * do a get on region1
-   *
    */
-  public static void getValue2()
-  {
+  public static void getValue2() {
     try {
       Region r = cache.getRegion("/HARegionQueueDUnitTest_region");
       if (!(r.get("key-1").equals("value-2"))) {
@@ -620,24 +535,20 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
     }
     catch (Exception ex) {
-      ex.printStackTrace();
-      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
+      fail("failed while region.get()", ex);
     }
   }
 
   /**
    * destroy key-1
-   *
    */
-  public static void destroy()
-  {
+  public static void destroy() {
     try {
       Region region1 = cache.getRegion("/HARegionQueueDUnitTest_region");
       region1.localDestroy("key-1");
     }
     catch (Exception e) {
-      e.printStackTrace();
-      fail("test failed due to exception in destroy ");
+      fail("test failed due to exception in destroy", e);
     }
   }
 
@@ -646,11 +557,9 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * peek , batch peek operations in multiple regions. The test will have
    * take/remove occuring in all the VMs. This test is targetted to test for
    * hang or exceptions in non blocking queue.
-   *
-   *
    */
-  public void testConcurrentOperationsDunitTestOnNonBlockingQueue()
-  {
+  @Test
+  public void testConcurrentOperationsDunitTestOnNonBlockingQueue() throws Exception {
     concurrentOperationsDunitTest(false, Scope.DISTRIBUTED_ACK);
   }
 
@@ -659,11 +568,9 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * peek , batch peek operations in multiple regions. The test will have
    * take/remove occuring in all the VMs. This test is targetted to test for
    * hang or exceptions in non blocking queue.
-   *
-   *
    */
-  public void testConcurrentOperationsDunitTestOnNonBlockingQueueWithDNoAckRegion()
-  {
+  @Test
+  public void testConcurrentOperationsDunitTestOnNonBlockingQueueWithDNoAckRegion() throws Exception {
     concurrentOperationsDunitTest(false, Scope.DISTRIBUTED_NO_ACK);
   }
 
@@ -672,25 +579,19 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * peek , batch peek operations in multiple regions. The test will have
    * take/remove occuring in all the VMs. This test is targetted to test for
    * hang or exceptions in blocking queue.
-   *
-   *
    */
-  public void testConcurrentOperationsDunitTestOnBlockingQueue()
-  {
+  @Test
+  public void testConcurrentOperationsDunitTestOnBlockingQueue() throws Exception {
     concurrentOperationsDunitTest(true, Scope.DISTRIBUTED_ACK);
   }
 
-  private void concurrentOperationsDunitTest(
-      final boolean createBlockingQueue, final Scope rscope)
-  {
+  private void concurrentOperationsDunitTest(final boolean createBlockingQueue, final Scope rscope) {
     // Create Cache and HARegionQueue in all the 4 VMs.
 
-    CacheSerializableRunnable createRgnsAndQueues = new CacheSerializableRunnable(
-        "CreateCache, mirrored Region & HARegionQueue with a CacheListener") {
-      public void run2() throws CacheException
-      {
-        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest(
-            "HARegionQueueDUnitTest_region");
+    CacheSerializableRunnable createRgnsAndQueues = new CacheSerializableRunnable("CreateCache, mirrored Region & HARegionQueue with a CacheListener") {
+      @Override
+      public void run2() throws CacheException {
+        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
         System.getProperties()
             .put("QueueRemovalThreadWaitTime", "2000");
         cache = test.createCache();
@@ -710,12 +611,11 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
           }
         }
         catch (Exception e) {
-          throw new CacheException(e) {
-          };
+          throw new AssertionError(e);
         }
         factory.addCacheListener(new CacheListenerAdapter() {
-          public void afterCreate(final EntryEvent event)
-          {
+          @Override
+          public void afterCreate(final EntryEvent event) {
             Conflatable conflatable = new ConflatableObject(event.getKey(),
                 event.getNewValue(), ((EntryEventImpl)event).getEventId(),
                 false, event.getRegion().getFullPath());
@@ -724,14 +624,12 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
               hrq.put(conflatable);
             }
             catch (Exception e) {
-              e.printStackTrace();
-              fail("The put operation in queue did not succeed due to exception ="
-                  + e);
+              fail("The put operation in queue did not succeed due to exception =", e);
             }
           }
 
-          public void afterUpdate(final EntryEvent event)
-          {
+          @Override
+          public void afterUpdate(final EntryEvent event) {
             Conflatable conflatable = new ConflatableObject(event.getKey(),
                 event.getNewValue(), ((EntryEventImpl)event).getEventId(),
                 true, event.getRegion().getFullPath());
@@ -740,9 +638,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
               hrq.put(conflatable);
             }
             catch (Exception e) {
-              e.printStackTrace();
-              fail("The put operation in queue did not succeed due to exception ="
-                  + e);
+              fail("The put operation in queue did not succeed due to exception =", e);
             }
           }
 
@@ -757,11 +653,10 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm1.invoke(createRgnsAndQueues);
     vm2.invoke(createRgnsAndQueues);
     vm3.invoke(createRgnsAndQueues);
-    CacheSerializableRunnable spawnThreadsAndperformOps = new CacheSerializableRunnable(
-        "Spawn multipe threads which do various operations") {
+    CacheSerializableRunnable spawnThreadsAndperformOps = new CacheSerializableRunnable("Spawn multiple threads which do various operations") {
 
-      public void run2() throws CacheException
-      {
+      @Override
+      public void run2() throws CacheException {
         opThreads = new Thread[4 + 2 + 2 + 2];
         for (int i = 0; i < 4; ++i) {
           opThreads[i] = new Thread(new RunOp(RunOp.PUT, i), "ID="
@@ -798,13 +693,14 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
       Thread.sleep(2000);
     }
     catch (InterruptedException e1) {
-      fail("Test failed as the test thread encoutered exception in sleep");
+      fail("Test failed as the test thread encoutered exception in sleep", e1);
     }
+
     // Asif : In case of blocking HARegionQueue do some extra puts so that the
     // blocking threads
     // are exited
-    CacheSerializableRunnable toggleFlag = new CacheSerializableRunnable(
-        "Toggle the flag to signal end of threads") {
+    CacheSerializableRunnable toggleFlag = new CacheSerializableRunnable("Toggle the flag to signal end of threads") {
+      @Override
       public void run2() throws CacheException {
         toCnt = false;
         if (createBlockingQueue) {
@@ -815,8 +711,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
             }
           }
           catch (Exception e) {
-            throw new CacheException(e) {
-            };
+            throw new AssertionError(e);
           }
         }
 
@@ -827,16 +722,10 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm1.invokeAsync(toggleFlag);
     vm2.invokeAsync(toggleFlag);
     vm3.invokeAsync(toggleFlag);
-//     try {
-//       Thread.sleep(5000);
-//     }
-//     catch (InterruptedException e2) {
-//       fail("Test failed as the test thread encoutered exception in sleep");
-//     }
-    CacheSerializableRunnable joinWithThreads = new CacheSerializableRunnable(
-        "Join with the threads") {
-      public void run2() throws CacheException
-      {
+
+    CacheSerializableRunnable joinWithThreads = new CacheSerializableRunnable("Join with the threads") {
+      @Override
+      public void run2() throws CacheException {
         for (int i = 0; i < opThreads.length; ++i) {
 
           if (opThreads[i].isInterrupted()) {
@@ -858,20 +747,21 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
    * This is to test the bug which is caused when HARegionQueue object hasnot
    * been fully constructed but as the HARegion has got constructed , it gets
    * visible to QRM Message Thread.
+   *
+   * TODO: this test runs too long! Shorten run time. 1m 40s on new Mac.
    */
   @Category(FlakyTest.class) // GEODE-690: async queuing, time sensitive, expiration, waitForCriterion, joins
-  public void testNPEDueToHARegionQueueEscapeInConstructor()
-  {
+  @Test
+  public void testNPEDueToHARegionQueueEscapeInConstructor() {
     // changing EXPIRY_TIME to 5 doesn't change how long the test runs!
     final int EXPIRY_TIME = 30; // test will run for this many seconds
     // Create two HARegionQueue 's in the two VMs. The frequency of QRM thread
     // should be high
     // Check for NullPointeException in the other VM.
-    CacheSerializableRunnable createQueuesAndThread = new CacheSerializableRunnable(
-        "CreateCache, HARegionQueue and start thread") {
-      public void run2() throws CacheException
-      {
-        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest("region1");
+    CacheSerializableRunnable createQueuesAndThread = new CacheSerializableRunnable("CreateCache, HARegionQueue and start thread") {
+      @Override
+      public void run2() throws CacheException {
+        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
         //TODO:ASIF: Bcoz of the QRM thread cannot take frequency below
         // 1 second , thus we need to carfully evaluate what to do. 
         //For this bug to appear ,without bugfix , qrm needs to run
@@ -894,8 +784,8 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
           }
           opThreads = new Thread[1];
           opThreads[0] = new Thread(new Runnable() {
-            public void run()
-            {
+            @Override
+            public void run() {
               for (int i = 0; i < OP_COUNT; ++i) {
                 try {
                   Object o = hrq.take();
@@ -904,7 +794,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
                   }
                 }
                 catch (InterruptedException e) {
-                  fail("interrupted");
+                  throw new AssertionError(e);
                 }
               }
             }
@@ -913,18 +803,16 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
 
         }
         catch (Exception e) {
-          throw new CacheException(e) {
-          };
+          throw new AssertionError(e);
         }
       }
     };
 
-    CacheSerializableRunnable createQueues = new CacheSerializableRunnable(
-        "CreateCache, HARegionQueue ") {
-      public void run2() throws CacheException
-      {
+    CacheSerializableRunnable createQueues = new CacheSerializableRunnable("CreateCache, HARegionQueue ") {
+      @Override
+      public void run2() throws CacheException {
         createQueuesThread = Thread.currentThread();
-        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest("region1");
+        HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
         //System.getProperties().put("QueueRemovalThreadWaitTime",
          //   new Long(120000));
         cache = test.createCache();
@@ -937,19 +825,20 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
               HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
         }
         catch (Exception e) {
-          throw new CacheException(e) {
-          };
+          throw new AssertionError(e);
         }
       }
     };
     
-    CacheSerializableRunnable waitForCreateQueuesThread = new CacheSerializableRunnable(
-        "joinCreateCache") {
-      public void run2() throws TestException {
+    CacheSerializableRunnable waitForCreateQueuesThread = new CacheSerializableRunnable("joinCreateCache") {
+      @Override
+      public void run2() {
         WaitCriterion ev = new WaitCriterion() {
+          @Override
           public boolean done() {
             return createQueuesThread != null;
           }
+          @Override
           public String description() {
             return null;
           }
@@ -962,10 +851,9 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm0.invoke(createQueuesAndThread);
     vm1.invokeAsync(createQueues);
 
-    CacheSerializableRunnable joinWithThread = new CacheSerializableRunnable(
-        "CreateCache, HARegionQueue join with thread") {
-      public void run2() throws CacheException
-      {
+    CacheSerializableRunnable joinWithThread = new CacheSerializableRunnable("CreateCache, HARegionQueue join with thread") {
+      @Override
+      public void run2() throws CacheException {
         if (opThreads[0].isInterrupted()) {
           fail("The test has failed as it encountered interrupts in puts & takes");
         }
@@ -976,28 +864,23 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     vm1.invoke(waitForCreateQueuesThread);
   }
 
-  class RunOp implements Runnable
-  {
-
-    int opType;
-
-    int threadID;
-
-    public static final int PUT = 1;
-
-    public static final int TAKE = 2;
+  private static class RunOp implements Runnable {
 
-    public static final int PEEK = 3;
+    private static final int PUT = 1;
+    private static final int TAKE = 2;
+    private static final int PEEK = 3;
+    private static final int BATCH_PEEK = 4;
 
-    public static final int BATCH_PEEK = 4;
+    private int opType;
+    private int threadID;
 
     public RunOp(int opType, int id) {
       this.opType = opType;
       this.threadID = id;
     }
 
-    public void run()
-    {
+    @Override
+    public void run() {
       Region rgn = cache.getRegion("test_region");
       int counter = 0;
       LogWriter logger = cache.getLogger();
@@ -1049,35 +932,17 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
         }
       }
       catch (Exception e) {
-        Thread.currentThread().interrupt();
+        throw new AssertionError(e);
       }
     }
   }
 
   /**
-   * This is to test the bug which is caused when HARegionQueue object hasnot
-   * been fully constructed but as the HARegion has got constructed , it gets
-   * visible to expiry thread task causing NullPointerException in some
-   * situations.
-   *
-   */
- /* public void testBugNo35989()
-  {
-    vm0.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());
-    vm1.invoke(() -> HARegionQueueDUnitTest.createHARegionQueueandCheckExpiration());
-
-  } */
-
-  /**
    * Checks the data received by GII, only gets expired after proper
    * construction of HARegionQueue object.
-   *
-   * @throws Exception
    */
-  public static void createHARegionQueueandCheckExpiration() throws Exception
-  {
-    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest(
-        "HARegionQueueDUnitTest_region");
+  private static void createHARegionQueueandCheckExpiration() throws Exception {
+    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
     cache = test.createCache();
     HARegionQueueAttributes attrs = new HARegionQueueAttributes();
     attrs.setExpiryTime(1);
@@ -1087,9 +952,11 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     // wait until we have a dead
     // server
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         return hrq.getAvalaibleIds().size() == 0;
       }
+      @Override
       public String description() {
         return null;
       }
@@ -1098,21 +965,17 @@ public class HARegionQueueDUnitTest extends DistributedTestCase {
     // assertIndexDetailsEquals(0, hrq.getAvalaibleIds().size());
   }
 
-  public void testForDuplicateEvents()
-  {
+  @Test
+  public void testForDuplicateEvents() throws Exception {
     vm0.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());
     vm1.invoke(() -> HARegionQueueDUnitTest.createRegionQueueandCheckDuplicates());
   }
 
   /**
    *  HARegionQueue should not allow data with duplicate EventIds.
-   *
-   * @throws Exception
    */
-  public static void createRegionQueueandCheckDuplicates() throws Exception
-  {
-    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest(
-        "HARegionQueueDUnitTest_region");
+  private static void createRegionQueueandCheckDuplicates() throws Exception {
+    HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();
     cache = test.createCache();
 
     hrq = HARegionQueue.getHARegionQueueInstance("HARegionQueueDUnitTest_region", cache,



[30/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java
index edcc089..4c1434f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java
@@ -21,18 +21,7 @@
 package com.gemstone.gemfire.internal.cache;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.internal.cache.LocalRegion.NonTXEntry;
-import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.IOException;
@@ -40,42 +29,53 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.FileUtil;
+import com.gemstone.gemfire.internal.cache.LocalRegion.NonTXEntry;
+import com.gemstone.gemfire.internal.cache.versions.VersionTag;
 
 /**
  * All disk region unit tests extend this base class , common method to be used in
  * all tests are present here.
  * 
  * @since GemFire 5.1
- *
  */
-public class DiskRegionTestingBase
-{
-  @Rule public TestName name = new TestName();
-  
-   boolean testFailed = false;
-   String failureCause = "";
-  protected static Cache cache = null;
+public abstract class DiskRegionTestingBase {
+
+  protected static final boolean debug = false;
 
+  protected static Cache cache = null;
   protected static DistributedSystem ds = null;
   protected static Properties props = new Properties();
-
   protected static File[] dirs = null;
-
   protected static int[] diskDirSize = null;
 
-  protected Region region = null;
-  
-  protected static final boolean debug = false;
-
+  protected Region region;
   protected LogWriter logWriter;
 
+  boolean testFailed;
+  String failureCause = "";
+
+  @Rule
+  public TestName name = new TestName();
 
   @Before
-  public void setUp() throws Exception
-  {
+  public final void setUp() throws Exception {
+    preSetUp();
+
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(LOG_LEVEL, "config"); // to keep diskPerf logs smaller
@@ -116,14 +116,20 @@ public class DiskRegionTestingBase
     deleteFiles();
 
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = true;
+
+    postSetUp();
+  }
+
+  protected void preSetUp() throws Exception {
+  }
+
+  protected void postSetUp() throws Exception {
   }
 
   @After
-  public void tearDown() throws Exception
-  {
-    /*if (cache != null && !cache.isClosed()) {
-      cache.close();
-    }*/
+  public final void tearDown() throws Exception {
+    preTearDown();
+
     try {
       if (cache != null && !cache.isClosed()) {
         for (Iterator itr = cache.rootRegions().iterator(); itr.hasNext();) {
@@ -139,13 +145,6 @@ public class DiskRegionTestingBase
           catch (RegionDestroyedException e) {
             // ignore
           }
-          catch (VirtualMachineError e) {
-            SystemFailure.initiateFailure(e);
-            throw e;
-          }
-          catch (Throwable t) {
-            logWriter.error(t);
-          }
         }
       }
       
@@ -154,22 +153,20 @@ public class DiskRegionTestingBase
       }
     }
     finally {
-      try {
-        closeCache();
-      }
-      catch (VirtualMachineError e) {
-        SystemFailure.initiateFailure(e);
-        throw e;
-      }
-      catch (Throwable t) {
-        logWriter.error("Error in closing the cache ", t);
-        
-      }
+      closeCache();
     }
     ds.disconnect();
     //Asif : below is not needed but leave it
     deleteFiles();
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = false;
+
+    postTearDown();
+  }
+
+  protected void preTearDown() throws Exception {
+  }
+
+  protected void postTearDown() throws Exception {
   }
 
   protected Cache createCache() {
@@ -202,8 +199,7 @@ public class DiskRegionTestingBase
   /**
    * cleans all the directory of all the files present in them
    */
-  protected static void deleteFiles()
-  {
+  protected static void deleteFiles() {
     closeDiskStores();
     for (int i = 0; i < dirs.length; i++) {
       System.out.println("trying to delete files in " + dirs[i].getAbsolutePath());
@@ -230,7 +226,6 @@ public class DiskRegionTestingBase
         }
       }
     }
-
   }
 
   protected static void closeDiskStores() {
@@ -243,34 +238,30 @@ public class DiskRegionTestingBase
    * clears and closes the region
    *  
    */
-
-  protected void closeDown()
-  {
-    try{
-      if(!region.isDestroyed()) {
+  protected void closeDown() {
+    try {
+      if (!region.isDestroyed()) {
         region.destroyRegion();
       }
-    }catch(Exception e) {
+    } catch(Exception e) {
       this.logWriter.error("DiskRegionTestingBase::closeDown:Exception in destroyiong the region",e);
     }
   }
 
   /**
    * puts a 100 integers into the region
-   *  
    */
-  protected void put100Int()
-  {
+  protected void put100Int() {
     for (int i = 0; i < 100; i++) {
       region.put(new Integer(i), new Integer(i));
     }
   }
+
   protected void verify100Int() {
     verify100Int(true);
   }
   
-  protected void verify100Int(boolean verifySize)
-  {
+  protected void verify100Int(boolean verifySize) {
     if (verifySize) {
       assertEquals(100,region.size());
     }
@@ -283,31 +274,26 @@ public class DiskRegionTestingBase
 
   /**
    * will keep on putting till region overflows
-   *  
    */
-  protected void putTillOverFlow(Region region)
-  {
+  protected void putTillOverFlow(Region region) {
     int i = 0;
     for (i = 0; i < 1010; i++) {
       region.put(new Integer(i + 200), new Integer(i + 200));
     }
   }
 
-  /*
+  /**
    * put an entry
-   *  
    */
-  protected void putForValidation(Region region)
-  {
+  protected void putForValidation(Region region) {
     final byte[] value = new byte[1024];
     region.put("testKey", value);
   }
 
-  /*
+  /**
    * get val from disk
    */
-  protected void validatePut(Region region)
-  {
+  protected void validatePut(Region region) {
     // flush data to disk
     ((LocalRegion)region).getDiskRegion().flushForTesting();
     try {
@@ -316,9 +302,7 @@ public class DiskRegionTestingBase
     catch (Exception ex) {
       ex.printStackTrace();
       fail("Failed to get the value on disk");
-
     }
-
   }
   
   protected HashMap<String, VersionTag> saveVersionTags(LocalRegion region) {
@@ -345,17 +329,15 @@ public class DiskRegionTestingBase
     }
   }
 
-  /** Since these are not visible to cache.diskPerf we add wrapper methods to
+  /**
+   * Since these are not visible to cache.diskPerf we add wrapper methods to
    * make the following parameters/visible
-   *
    */
-  public static void setCacheObserverCallBack()
-  {
+  public static void setCacheObserverCallBack() {
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
   }
 
-  public static void unSetCacheObserverCallBack()
-  {
+  public static void unSetCacheObserverCallBack() {
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java
index 7a8a3d5..8993d3d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java
@@ -16,35 +16,40 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.FilenameFilter;
 import java.util.Arrays;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.*;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Tests DiskStoreFactory
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskStoreFactoryJUnitTest
-{
+public class DiskStoreFactoryJUnitTest {
 
-  protected static Cache cache = null;
+  private static Cache cache = null;
 
-  protected static DistributedSystem ds = null;
-  protected static Properties props = new Properties();
+  private static DistributedSystem ds = null;
+  private static Properties props = new Properties();
 
   static {
     props.setProperty(MCAST_PORT, "0");
@@ -60,7 +65,7 @@ public class DiskStoreFactoryJUnitTest
     createCache();
   }
 
-  protected Cache createCache() {
+  private Cache createCache() {
     cache = new CacheFactory(props).create();
     ds = cache.getDistributedSystem();
     return cache;
@@ -71,7 +76,7 @@ public class DiskStoreFactoryJUnitTest
     cache.close();
   }
 
-  /*
+  /**
    * Test method for
    * 'com.gemstone.gemfire.cache.DiskWriteAttributes.getDefaultInstance()'
    */
@@ -188,6 +193,7 @@ public class DiskStoreFactoryJUnitTest
     } catch (IllegalArgumentException expected) {
     }
   }
+
   @Test
   public void testTimeInterval() {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -208,6 +214,7 @@ public class DiskStoreFactoryJUnitTest
     } catch (IllegalArgumentException expected) {
     }
   }
+
   @Test
   public void testMaxOplogSize() {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -234,6 +241,7 @@ public class DiskStoreFactoryJUnitTest
     } catch (IllegalArgumentException expected) {
     }
   }
+
   @Test
   public void testFlush() {
     DiskStoreFactory dsf = cache.createDiskStoreFactory();
@@ -348,7 +356,7 @@ public class DiskStoreFactoryJUnitTest
     removeFiles(diskStore);
   }
 
-  protected void removeFiles(DiskStore diskStore) {
+  private void removeFiles(DiskStore diskStore) {
     final String diskStoreName = diskStore.getName();
     File[] dirs = diskStore.getDiskDirs();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
index 7d78d69..a54218a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
@@ -16,24 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+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.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
-  private static final long serialVersionUID = 1L;
-
-  public DistrbutedRegionProfileOffHeapDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class DistrbutedRegionProfileOffHeapDUnitTest extends JUnit4CacheTestCase {
 
   @Override
   public final void preTearDownAssertions() throws Exception {
@@ -55,6 +61,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
    * region as on-heap and the other as having the region as off-heap, will
    * cause an exception and the region will not be created.
    */
+  @Test
   public void testPartitionedRegionProfileWithConflict() throws Exception {
     final String regionName = getTestMethodName() + "Region";
 
@@ -110,6 +117,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
    * same off-heap status, will not cause an exception and the region will be
    * created.
    */
+  @Test
   public void testPartitionedRegionProfileWithoutConflict() throws Exception {
     final String offHeapRegionName = getTestMethodName() + "OffHeapRegion";
     final String onHeapRegionName = getTestMethodName() + "OnHeapRegion";
@@ -148,6 +156,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
    * storage and the other being on-heap without local storage, will not cause an
    * exception.
    */
+  @Test
   public void testPartitionedRegionProfileWithAccessor() throws Exception {
     final String regionName = getTestMethodName() + "Region";
 
@@ -201,6 +210,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
    * Asserts that creating a region on two members, with one being off-heap with local
    * storage and the other being a proxy will not cause an exception.
    */
+  @Test
   public void testPartitionedRegionProfileWithProxy() throws Exception {
     final String regionName = getTestMethodName() + "Region";
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
index 4f5a3e7..acce19a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import com.gemstone.gemfire.InternalGemFireException;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -31,32 +33,26 @@ import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.DistributionManagerDUnitTest;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 
 /**
  * This is the abstract superclass of tests that validate the
  * functionality of GemFire's distributed caches.  It provides a
  * number of convenient helper classes.
  */
-public abstract class DistributedCacheTestCase
-  extends DistributedTestCase {
+public abstract class DistributedCacheTestCase extends JUnit4DistributedTestCase {
 
   /** The current cache in this VM */
   protected static Cache cache = null;
 
-  ///////////////////////  Constructors  ///////////////////////
-
-  public DistributedCacheTestCase(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     setUpDistributedCacheTestCase(true);
   }
+
   /**
    * Creates the {@link Cache} and root region in each remote VM
    * and, if createLocalCache, in this VM.
@@ -93,7 +89,7 @@ public abstract class DistributedCacheTestCase
 
     Assert.assertTrue(cache == null, "cache should be null");
 
-    DistributedCacheTestCase x = new DistributedCacheTestCase("Lame") { };
+    DistributedCacheTestCase x = new DistributedCacheTestCase() { };
     cache = CacheFactory.create(x.getSystem());
     
     AttributesFactory factory = new AttributesFactory();
@@ -164,8 +160,6 @@ public abstract class DistributedCacheTestCase
     return exceptionInThreads;
   }
 
-  //////////////////////  Helper Methods  //////////////////////
-
   /**
    * Returns the root region of the cache.  We assume that the {@link
    * Cache} and the root region have already been created.
@@ -250,9 +244,6 @@ public abstract class DistributedCacheTestCase
     remoteDefineEntry(regionName, entryName, scope, true);
   }
 
-
-  
-  
   /**
    * Defines an entry in the Region with the given name and scope.  In
    * 3.0 this method create a subregion named <code>entryName</code>
@@ -304,7 +295,6 @@ public abstract class DistributedCacheTestCase
       "Defined Entry named '" + entryName + "' in region '" +
       sub.getFullPath() +"'");
   }
-  
 
   /**
    * Puts (or creates) a value in a subregion of <code>region</code>
@@ -348,8 +338,7 @@ public abstract class DistributedCacheTestCase
    throws CacheException {
      remotePut(regionName, entryName, value, Scope.DISTRIBUTED_NO_ACK);
    }
-                                  
-  
+
   /**
    * Replaces the value of an entry in a region in a remote VM
    *
@@ -462,11 +451,19 @@ public abstract class DistributedCacheTestCase
    * every VM that host knows about.
    */
   public void forEachVMInvoke(String methodName, Object[] args) {
+    forEachVMInvoke(getClass(), methodName, args);
+  }
+
+  /**
+   * Assumes there is only one host, and invokes the given method in
+   * every VM that host knows about.
+   */
+  public void forEachVMInvoke(Class<?> targetClass, String methodName, Object[] args) {
     Host host = Host.getHost(0);
     int vmCount = host.getVMCount();
     for (int i=0; i<vmCount; i++) {
       LogWriterUtils.getLogWriter().info("Invoking " + methodName + "on VM#" + i);
-      host.getVM(i).invoke(this.getClass(), methodName, args);
+      host.getVM(i).invoke(targetClass, methodName, args);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
index 263b130..ee68866 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
@@ -16,28 +16,46 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+
+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.CacheException;
+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.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.EventTracker.BulkOpHolder;
 import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests <code>EventTracker</code> management.
  *
- *
  * @since GemFire 6.5
  */
-public class EventTrackerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class EventTrackerDUnitTest extends JUnit4CacheTestCase {
 
   /** The port on which the <code>CacheServer</code> was started in this VM */
   private static int cacheServerPort;
@@ -45,22 +63,6 @@ public class EventTrackerDUnitTest extends CacheTestCase {
   /** The <code>Cache</code>'s <code>ExpiryTask</code>'s ping interval */
   private static final String MESSAGE_TRACKING_TIMEOUT = "5000";
   
-  /**
-   * Creates a new <code>EventTrackerDUnitTest</code>
-   */
-  public EventTrackerDUnitTest(String name) {
-    super(name);
-  }
-
-  ////////  Test Methods
-  public static void caseSetUp() throws Exception {
-    disconnectAllFromDS();
-  }
-
-  public static void caseTearDown() throws Exception {
-    disconnectAllFromDS();
-  }
-
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectAllFromDS();
@@ -70,6 +72,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
    * Tests <code>EventTracker</code> is created and destroyed when a <code>Region</code> is created 
    * and destroyed.
    */
+  @Test
   public void testEventTrackerCreateDestroy() throws CacheException {
     // Verify the Cache's ExpiryTask contains no EventTrackers
     GemFireCacheImpl cache = (GemFireCacheImpl) getCache();
@@ -108,6 +111,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
   /**
    * Tests adding threads to an <code>EventTracker</code>.
    */
+  @Test
   public void testEventTrackerAddThreadIdentifier() throws CacheException {
     Host host = Host.getHost(0);
     VM serverVM = host.getVM(0);
@@ -178,6 +182,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
   /**
    * Tests adding events to and removing events from an <code>EventTracker</code>.
    */
+  @Test
   public void testEventTrackerAddRemoveThreadIdentifier() throws CacheException {
     Host host = Host.getHost(0);
     VM serverVM = host.getVM(0);
@@ -261,6 +266,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
    * Test to make sure we don't leak put all events in the event tracker
    * after multiple putAlls
    */
+  @Test
   public void testPutAllHoldersInEventTracker() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
index 2d19ba5..3b0a95b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
@@ -16,11 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
 
 import org.junit.Ignore;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.EvictionAlgorithm;
@@ -30,14 +33,10 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 @Category(DistributedTest.class)
-@Ignore("Test was disabled by renaming to DisabledTest")
+@Ignore("TODO: Test was disabled by renaming to DisabledTest")
 public class EvictionDUnitTest extends EvictionTestBase {
-  private static final long serialVersionUID = 270073077723092256L;
 
-  public EvictionDUnitTest(String name) {
-    super(name);
-  }
- 
+  @Test
   public void testDummyInlineNCentralizedEviction() {
     prepareScenario1(EvictionAlgorithm.LRU_HEAP,0);
     putData("PR1", 50, 1);
@@ -53,6 +52,7 @@ public class EvictionDUnitTest extends EvictionTestBase {
     validateNoOfEvictions("PR1", 4 + expectedEviction1 + expectedEviction2);
   }
   
+  @Test
   public void testThreadPoolSize() {
     prepareScenario1(EvictionAlgorithm.LRU_HEAP,0);
     putData("PR1", 50, 1);
@@ -60,6 +60,7 @@ public class EvictionDUnitTest extends EvictionTestBase {
     verifyThreadPoolTaskCount(HeapEvictor.MAX_EVICTOR_THREADS);
   }
   
+  @Test
   public void testCentralizedEvictionnForDistributedRegionWithDummyEvent() {
     prepareScenario1(EvictionAlgorithm.LRU_HEAP,0);
     createDistributedRegion();
@@ -77,6 +78,7 @@ public class EvictionDUnitTest extends EvictionTestBase {
    * goes down and then comes up again causing GII to take place, the system
    * doesnot throw an OOME.
    */
+  @Test
   public void testEvictionWithNodeDown() {
     prepareScenario2(EvictionAlgorithm.LRU_HEAP, "PR3", "PR4");
     putDataInDataStore3("PR3", 100, 1);
@@ -88,6 +90,7 @@ public class EvictionDUnitTest extends EvictionTestBase {
     assertEquals(0, getPRSize("PR4"));
   }
   
+  @Test
   public void testEntryLruEvictions() {
     int extraEntries=1;
     createCache();
@@ -104,8 +107,8 @@ public class EvictionDUnitTest extends EvictionTestBase {
      
     assertEquals(extraEntries,((AbstractLRURegionMap)pr.entries)._getLruList().stats().getEvictions());
   }
-  
-  
+
+  @Test
   public void testEntryLru() {
     createCache();
     maxEnteries=12;
@@ -132,6 +135,7 @@ public class EvictionDUnitTest extends EvictionTestBase {
    assertEquals(0,((AbstractLRURegionMap)pr.entries)._getLruList().stats().getEvictions());
   }
 
+  @Test
   public void testCheckEntryLruEvictionsIn1DataStore() {
     int extraEntries=10;
     createCache();
@@ -162,14 +166,15 @@ public class EvictionDUnitTest extends EvictionTestBase {
     }
   }
   
+  @Test
   public void testCheckEntryLruEvictionsIn2DataStore() {
     maxEnteries=20;
     prepareScenario1(EvictionAlgorithm.LRU_ENTRY,maxEnteries);
     putData("PR1", 60, 1);
     validateNoOfEvictions("PR1", 20);
   }
-  
-  
+
+  @Test
   public void testMemLruForPRAndDR() {
     createCache();
     createPartitionedRegion(true, EvictionAlgorithm.LRU_MEMORY, "PR1", 4, 1, 1000,40);
@@ -195,6 +200,7 @@ public class EvictionDUnitTest extends EvictionTestBase {
    assertTrue(((AbstractLRURegionMap)dr.entries)._getLruList().stats().getEvictions()<=2);
   }
   
+  @Test
   public void testEachTaskSize() {
     createCache();
     createPartitionedRegion(true, EvictionAlgorithm.LRU_HEAP, "PR1", 6, 1,
@@ -211,37 +217,5 @@ public class EvictionDUnitTest extends EvictionTestBase {
         assertEquals(8, size.intValue());
       }
     }
-
-    /*
-    final PartitionedRegion pr1 = (PartitionedRegion)cache.getRegion("PR1");
-    final PartitionedRegion pr2 = (PartitionedRegion)cache.getRegion("PR2");
-    final PartitionedRegion pr3 = (PartitionedRegion)cache.getRegion("PR3");
-    final DistributedRegion dr1 = (DistributedRegion)cache.getRegion("DR1");
-    
-    for (int counter = 1; counter <= 18; counter++) {
-      pr1.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-    }
-    getLogWriter().info("Size of PR1 before eviction = "+ pr1.size());
-    
-    for (int counter = 1; counter <= 30; counter++) {
-      pr2.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-    }
-    getLogWriter().info("Size of PR2 before eviction = "+ pr2.size());
-    
-    for (int counter = 1; counter <= 45; counter++) {
-      pr3.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-    }
-    getLogWriter().info("Size of PR3 before eviction = "+ pr3.size());
-    
-    for (int counter = 1; counter <= 150; counter++) {
-      dr1.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-    }
-    getLogWriter().info("Size of DR1 before eviction = "+ dr1.size());
-    
-    
-    getLogWriter().info("Size of PR1 after eviction = "+ pr1.size());
-    getLogWriter().info("Size of PR2 after eviction = "+ pr2.size());
-    getLogWriter().info("Size of PR3 after eviction = "+ pr3.size());
-    getLogWriter().info("Size of PR4 after eviction = "+ dr1.size());*/
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
index 2eee95f..c016e1e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.util.Iterator;
 import java.util.Map;
@@ -40,7 +49,8 @@ import com.gemstone.gemfire.internal.size.ReflectionSingleObjectSizer;
 import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 
-public class EvictionObjectSizerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class EvictionObjectSizerDUnitTest extends JUnit4CacheTestCase {
 
   protected static Cache cache = null;
 
@@ -54,13 +64,14 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
   
   // Removed CONCURRENT_OVERHEAD since it is included in the regionEntrySize.
 
-  public EvictionObjectSizerDUnitTest(String name) {
-    super(name);
+  public EvictionObjectSizerDUnitTest() {
+    super();
   }
 
   /**
    * Without object sizer
    */
+  @Test
   public void testWithoutObjectSizerForHeapLRU() {
     prepareScenario(EvictionAlgorithm.LRU_HEAP, null);
 
@@ -83,6 +94,7 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
    * With object sizer for standard objects.Key -Integer Value ByteArray
    * 
    */
+  @Test
   public void testObjectSizerForHeapLRU_StandardObjects() {
     prepareScenario(EvictionAlgorithm.LRU_HEAP, new TestObjectSizerImpl());
 
@@ -118,6 +130,7 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
    * With object sizer for customized value object implementing ObjectSizer .Key
    * -Integer Value TestNonSizerObject
    */
+  @Test
   public void testObjectSizerForHeapLRU_CustomizedNonSizerObject() {
     prepareScenario(EvictionAlgorithm.LRU_HEAP, new TestObjectSizerImpl());
 
@@ -154,6 +167,7 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
    * With object sizer for customized value object implementing ObjectSizer .Key
    * -Integer Value TestObjectSizerImpl
    */
+  @Test
   public void testObjectSizerForHeapLRU_CustomizedSizerObject() {
     prepareScenario(EvictionAlgorithm.LRU_HEAP, new TestObjectSizerImpl());
 
@@ -172,6 +186,7 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
   /**
    * With object sizer for customized key and value objects.
    */
+  @Test
   public void testObjectSizerForHeapLRU_CustomizedSizerObjects() {
     prepareScenario(EvictionAlgorithm.LRU_HEAP, new TestObjectSizerImpl());
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
index e820e1f..4e6ed58 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.util.Iterator;
 import java.util.Map;
@@ -46,7 +55,8 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class EvictionStatsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   protected static Cache cache = null;
 
@@ -62,8 +72,8 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
 
   static int totalNoOfBuckets = 2;
 
-  public EvictionStatsDUnitTest(String name) {
-    super(name);
+  public EvictionStatsDUnitTest() {
+    super();
     // TODO Auto-generated constructor stub
   }
 
@@ -74,6 +84,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     dataStore2 = host.getVM(1);
   }
 
+  @Test
   public void testEntryLruLimitNDestroyLimit() {
     prepareScenario(EvictionAlgorithm.LRU_ENTRY);
     putData("PR1", 100);
@@ -112,6 +123,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testMemLruLimitNDestroyLimit() {
     prepareScenario(EvictionAlgorithm.LRU_MEMORY);
     putData("PR1", 100);
@@ -156,6 +168,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
 
   }
 
+  @Test
   public void testEntryLruCounter() {
     prepareScenario(EvictionAlgorithm.LRU_ENTRY);
     putData("PR1", 10);
@@ -170,6 +183,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     assertEquals(sizeOfPr2, totalBucketSizeForPR2);
   }
 
+  @Test
   public void testMemLruCounter() {
     prepareScenario(EvictionAlgorithm.LRU_MEMORY);
     putData("PR1", 10);
@@ -184,6 +198,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     assertEquals(sizeOfPr2, totalBucketSizeForPR2);
   }
 
+  @Test
   public void testHeapLruCounter() {
     prepareScenario(EvictionAlgorithm.LRU_HEAP);
     System.setProperty(
@@ -198,6 +213,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     long totalBucketSizeForPR2 = getCounterForBucketsOfPR("PR2");
   }
 
+  @Test
   public void testEntryLruAllCounterMethods() {
     final long ONE_MEG = 1024L * 1024L;
     createCache();
@@ -269,6 +285,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
 
   
 
+  @Test
   public void testEntryLRUEvictionNDestroyNNumOverflowOnDiskCount() {
     final int extraEnteries = 24;
     prepareScenario(EvictionAlgorithm.LRU_ENTRY);
@@ -317,6 +334,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testMemLRUEvictionNDestroyNNumOverflowOnDiskCount() {
     int localMaxMem=50;
     final int extraEntries = 6;
@@ -400,7 +418,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
   }
 
   public static void createCacheInVm() {
-    new EvictionStatsDUnitTest("temp").createCache();
+    new EvictionStatsDUnitTest().createCache();
   }
 
   public void createCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
index 6bf8ec0..f262609 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
@@ -16,10 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAlgorithm;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.util.ObjectSizerImpl;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.OSProcess;
@@ -29,12 +48,19 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.Resou
 import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
 import com.gemstone.gemfire.internal.cache.control.MemoryThresholds.MemoryState;
 import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.util.*;
-
-public class EvictionTestBase extends CacheTestCase {
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class EvictionTestBase extends JUnit4CacheTestCase {
 
   protected static Cache cache = null;
 
@@ -54,10 +80,6 @@ public class EvictionTestBase extends CacheTestCase {
 
   static int totalNoOfBuckets = 4;
 
-  public EvictionTestBase(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -245,7 +267,7 @@ public class EvictionTestBase extends CacheTestCase {
   }
 
   public static void createCacheInVm() {
-    new EvictionTestBase("temp").createCache();
+    new EvictionTestBase().createCache();
   }
 
   public void createCache() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FaultingInJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FaultingInJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FaultingInJUnitTest.java
index 76d8bc9..6a0e660 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FaultingInJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FaultingInJUnitTest.java
@@ -16,32 +16,27 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Tests faulting in from current oplog, old oplog
  * and htree for different modes (overflow only, persist+overflow : Sync/Async)
- * 
- *
  */
 @Category(IntegrationTest.class)
-public class FaultingInJUnitTest extends DiskRegionTestingBase
-{
-  protected volatile boolean hasBeenNotified;
-  
-  
+public class FaultingInJUnitTest extends DiskRegionTestingBase {
+
+  private volatile boolean hasBeenNotified;
+
   private DiskRegionProperties diskProps = new DiskRegionProperties();
   
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     deleteFiles();
     diskProps.setDiskDirs(dirs);
     diskProps.setCompactionThreshold(100);
@@ -49,19 +44,16 @@ public class FaultingInJUnitTest extends DiskRegionTestingBase
     LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
   }
   
-  @After
-  public void tearDown() throws Exception {
+  @Override
+  protected final void preTearDown() throws Exception {
     closeDown();
     deleteFiles();
-    super.tearDown();
   }
 
   /**
    * fault in a value from teh current oplog
-   *
    */
-  void faultInFromCurrentOplog()
-  { 
+  private void faultInFromCurrentOplog() {
     put100Int();
     putTillOverFlow(region);
     region.put(new Integer(200), new Integer(200));
@@ -73,10 +65,8 @@ public class FaultingInJUnitTest extends DiskRegionTestingBase
 
   /**
    * fault in a value from an old oplog
-   *
    */
-  void faultInFromOldOplog()
-  {
+  private void faultInFromOldOplog() {
     put100Int();
     putTillOverFlow(region);
     region.put(new Integer(200), new Integer(200));
@@ -89,10 +79,8 @@ public class FaultingInJUnitTest extends DiskRegionTestingBase
 
   /**
    * fault in a value that has been copied forward by compaction
-   *
    */
-  void faultInFromCompactedOplog()
-  {
+  private void faultInFromCompactedOplog() {
     put100Int();
     putTillOverFlow(region);
     region.put(new Integer(101), new Integer(101));
@@ -147,89 +135,74 @@ public class FaultingInJUnitTest extends DiskRegionTestingBase
    * test OverflowOnly Sync Faultin  From CurrentOplog
    */
   @Test
-  public void testOverflowOnlyFaultinSyncFromCurrentOplog()
-  {
+  public void testOverflowOnlyFaultinSyncFromCurrentOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache,diskProps);
     faultInFromCurrentOplog();
   }
 
   @Test
-  public void testOverflowOnlyFaultinSyncFromOldOplog()
-  {
+  public void testOverflowOnlyFaultinSyncFromOldOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache,diskProps);
     faultInFromOldOplog();
   }
 
   @Test
-  public void testOverflowOnlyFaultinSyncFromCompactedOplog()
-  {
+  public void testOverflowOnlyFaultinSyncFromCompactedOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache,diskProps);
     faultInFromCompactedOplog();
   }
 
   @Test
-  public void testOverflowOnlyFaultinAsyncFromCurrentOplog()
-  {
+  public void testOverflowOnlyFaultinAsyncFromCurrentOplog() {
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,diskProps);
     faultInFromCurrentOplog();
   }
 
   @Test
-  public void testOverflowOnlyFaultinAsyncFromOldOplog()
-  {
+  public void testOverflowOnlyFaultinAsyncFromOldOplog() {
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,diskProps);
     faultInFromOldOplog();
   }
 
   @Test
-  public void testOverflowOnlyFaultinAsyncFromCompactedOplog()
-  {
+  public void testOverflowOnlyFaultinAsyncFromCompactedOplog() {
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,diskProps);
     faultInFromCompactedOplog();
   }
   
   @Test
-  public void testOverflowAndPersistFaultinSyncFromCurrentOplog()
-  {
+  public void testOverflowAndPersistFaultinSyncFromCurrentOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,diskProps);
     faultInFromCurrentOplog();
   }
 
   @Test
-  public void testOverflowAndPersistFaultinSyncFromOldOplog()
-  {
+  public void testOverflowAndPersistFaultinSyncFromOldOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,diskProps);
     faultInFromOldOplog();
   }
 
   @Test
-  public void testOverflowAndPersistFaultinSyncFromCompactedOplog()
-  {
+  public void testOverflowAndPersistFaultinSyncFromCompactedOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,diskProps);
     faultInFromCompactedOplog();
   }
 
   @Test
-  public void testOverflowAndPersistFaultinAsyncFromCurrentOplog()
-  {
+  public void testOverflowAndPersistFaultinAsyncFromCurrentOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,diskProps);
     faultInFromCurrentOplog();
   }
 
   @Test
-  public void testOverflowAndPersistFaultinAsyncFromOldOplog()
-  {
+  public void testOverflowAndPersistFaultinAsyncFromOldOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,diskProps);
     faultInFromOldOplog();
   }
 
   @Test
-  public void testOverflowAndPersistFaultinAsyncFromCompactedOplog()
-  {
+  public void testOverflowAndPersistFaultinAsyncFromCompactedOplog() {
     region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache,diskProps);
     faultInFromCompactedOplog();
   }
-
-
-  
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
index cf279cc..4da2b61 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
@@ -16,32 +16,54 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.FixedPartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.ClientMetadataService;
 import com.gemstone.gemfire.cache.client.internal.ClientPartitionAdvisor;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.partitioned.fixed.QuarterPartitionResolver;
 import com.gemstone.gemfire.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallableIF;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class FixedPRSinglehopDUnitTest extends CacheTestCase {
-
-  private static final long serialVersionUID = 1L;
+@Category(DistributedTest.class)
+public class FixedPRSinglehopDUnitTest extends JUnit4CacheTestCase {
 
   private static final String PR_NAME = "fixed_single_hop_pr";
 
@@ -75,10 +97,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   
   private static final Date q4dateDec1 = new Date(2010, 11, 1);
   
-  public FixedPRSinglehopDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testNoClientConnected() {
     final Host host = Host.getHost(0);
     VM accessorServer = host.getVM(0);
@@ -135,6 +154,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   // 2 AccessorServers, 2 Peers
   // 1 Client connected to 2 AccessorServers. Hence metadata should not be
   // fetched.
+  @Test
   public void testClientConnectedToAccessors() {
     final Host host = Host.getHost(0);
     VM accessorServer1 = host.getVM(0);
@@ -178,6 +198,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   // Now verify that metadata has all 8 buckets info.
   // Now update and ensure the fetch service is never called.
   @Category(FlakyTest.class) // GEODE-1176: random ports, time sensitive, waitForCriterion
+  @Test
   public void test_MetadataContents() {
     
     final Host host = Host.getHost(0);
@@ -243,6 +264,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
    * the metadata are fetched and then later up one more partition and do some operations on them. It should
    * fetch new fpa. 
    */
+  @Test
   public void test_FPAmetadataFetch() {
     
     final Host host = Host.getHost(0);
@@ -323,8 +345,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   public static int createServer(boolean isAccessor,
       List<FixedPartitionAttributes> fpaList) {
 
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-        "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     cache = test.getCache();
     CacheServer server = cache.addCacheServer();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -363,8 +384,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   public static int createServerWithLocator(String locator, boolean isAccessor,
       List<FixedPartitionAttributes> fpaList, boolean simpleFPR) {
 
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-    "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     Properties props = new Properties();
     props = new Properties();
     props.setProperty(LOCATORS, locator);
@@ -425,8 +445,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   }
   
   public static int totalNumBucketsCreated () {
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-    "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     PartitionedRegion pr = (PartitionedRegion)cache.getRegion(PR_NAME);
     assertNotNull(pr);
     return pr.getLocalPrimaryBucketsListTestOnly().size();
@@ -434,8 +453,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
   
   public static void createPeer(boolean isAccessor,
       List<FixedPartitionAttributes> fpaList) {
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-        "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     cache = test.getCache();
 
     PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -463,8 +481,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-        "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -489,8 +506,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-        "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -515,8 +531,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-        "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
@@ -540,8 +555,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
     props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    CacheTestCase test = new FixedPRSinglehopDUnitTest(
-        "FixedPRSinglehopDUnitTest");
+    FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
     DistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
index ce309a1..c92a436 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
@@ -19,6 +19,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.DataSerializer;
 import com.gemstone.gemfire.GemFireIOException;
 import com.gemstone.gemfire.cache.*;
@@ -49,7 +58,8 @@ import java.io.DataInputStream;
 import java.io.IOException;
 import java.util.concurrent.CountDownLatch;
 
-public class GIIDeltaDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class GIIDeltaDUnitTest extends JUnit4CacheTestCase {
 
   VM P; // GII provider
   VM R; // GII requester
@@ -65,8 +75,8 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public GIIDeltaDUnitTest(String name) {
-    super(name);
+  public GIIDeltaDUnitTest() {
+    super();
   }
 
   @Override
@@ -228,6 +238,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts. 
    * The deltaGII should only exchange RVV. No need to send data from vm0 to vm1.  
    */
+  @Test
   public void testDeltaGIIWithSameRVV() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -282,6 +293,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts. https://wiki.gemstone.com/display/gfepersistence/DeltaGII+Spec+for+8.0
    * The deltaGII should send delta to R, revoke unfinished opeation R4,R5  
    */
+  @Test
   public void testDeltaGIIWithExceptionList() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -342,6 +354,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts.
    * The deltaGII should send delta which only contains unfinished opeation R4,R5  
    */
+  @Test
   public void testDeltaGIIWithOnlyUnfinishedOp() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -416,6 +429,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts.
    * The deltaGII should send delta which only contains unfinished opeation R4,R5  
    */
+  @Test
   public void testDeltaGIIWithOnlyUnfinishedOp_GCAtR() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -475,6 +489,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts. https://wiki.gemstone.com/display/gfepersistence/DeltaGII+Spec+for+8.0
    * The deltaGII should send delta to R, revoke unfinished opeation R4,R5  
    */
+  @Test
   public void testDeltaGIIWithDifferentRVVGC() throws Throwable {
     final String testcase = "testDeltaGIIWithExceptionList";
     prepareForEachTest();
@@ -534,6 +549,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * i.e. before GII, P's RVVGC=P0,R0, upon received RequestImageMessage, it becomes P4,R0
    * it should cause the fullGII. 
    */
+  @Test
   public void testFullGIITriggeredByHigherRVVGC() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -601,6 +617,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * If R did not save the rvvgc, restarted R will have a way smaller rvvgc (maybe the same as T's) 
    * Let T requests GII from R, it wll become deltaGII, which is wrong. 
    */
+  @Test
   public void testSavingRVVGC() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -669,6 +686,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts. https://wiki.gemstone.com/display/gfepersistence/DeltaGII+Spec+for+8.0
    * The deltaGII should send delta to R, revoke unfinished opeation R4,R5  
    */
+  @Test
   public void testDeltaGIIWithoutRVVGC() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -719,6 +737,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * P's RVV=P9,R6(3-6), RVVGC=P8,R0, R's RVV=P9(7-9),R6, RVV
    * It should trigger fullGII
    */
+  @Test
   public void testFullGIINotDorminatedByProviderRVVGC() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -776,6 +795,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * still P:x,R3, without exception list. But actually R4, R5 are unfinished ops by 
    * all means.  
    */
+  @Test
   public void testUnfinishedOpsWithoutExceptionList() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -844,6 +864,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    *
    * When image (which contains P4, P5) arrives, it should fill the special exception
    */
+  @Test
   public void testFillSpecialException() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -898,6 +919,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    *  This test will let the 2 operations happen before RIM, so the rvv will match between R and P and
    *  no gii will happen. In this way, the chunk will not contain the missing entries.
    */
+  @Test
   public void testFillSpecialException2() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -946,6 +968,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * 3. gii packing should wait for tombstone GC
    * 4. gii packing should wait for other on-fly operations
    */
+  @Test
   public void testHooks() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1169,6 +1192,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * wait for all GIIs to finish
    */
   @Category(FlakyTest.class) // GEODE-633: SLOW_DISTRIBUTION_MS, non-thread safe test hook, async actions, time sensitive, waitForCriterion, thread joins, forceGC
+  @Test
   public void testTombstoneGCInMiddleOfGII() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1300,6 +1324,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * The deltaGII should send nothing to R since the RVVs are the same. So after GII, P and R will 
    * have different tombstone number. But P's tombstones should be expired.  
    */
+  @Test
   public void testExpiredTombstoneSkippedAtProviderOnly() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1395,6 +1420,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * vm1 becomes offline then restarts. 
    * The deltaGII should only exchange RVV. No need to send data from vm0 to vm1.  
    */
+  @Test
   public void testRequesterHasHigherRVVGC() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1447,6 +1473,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * P8 is clear() operation. After that, R offline. Run P9 is a put. Restart R.   
    * R will do deltaGII to get P9 as delta  
    */
+  @Test
   public void testDeltaGIIAfterClear() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1513,6 +1540,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * After that, do clear(). Make sure R should not contain key1 after GII.     
    */
   @Category(FlakyTest.class) // GEODE-1068: time sensitive, SLOW_DISTRIBUTION_MS, waitForCriterion, possible thread unsafe test hooks, async actions, depends on stats
+  @Test
   public void testClearAfterChunkEntries() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1583,6 +1611,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * R off line, then run P7. Restart R. When P's RVV arrives, do clear(). It should trigger
    * fullGII. Make sure R should not contain key1 after GII.     
    */
+  @Test
   public void testClearAfterSavedRVV() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1647,6 +1676,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * R offline, then P8 is clear() operation. Run P9 is a put. Restart R.   
    * R will do fullGII since R missed a clear  
    */
+  @Test
   public void testFullGIIAfterClear() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1699,6 +1729,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * By changing MAX_UNFINISHED_OPERATIONS to be 1, 2. It should be fullGII then deltaGII.    
    */
   @Category(FlakyTest.class) // GEODE-686: time sensitive, SLOW_DISTRIBUTION_MS, forceGC
+  @Test
   public void testFullGIITriggeredByTooManyUnfinishedOps() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1734,6 +1765,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * R off line, then run P7. Restart R. When P's RVV arrives, restart R. It should trigger
    * fullGII.      
    */
+  @Test
   public void testRestartWithOnlyGIIBegion() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1798,6 +1830,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * still initializes from the local data. See bug 48066
    * @throws Throwable
    */
+  @Test
   public void testRecoverFromUntrustedRVV() throws Throwable {
     prepareForEachTest();
     final DiskStoreID memberP = getMemberID(P);
@@ -1870,6 +1903,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
    * @throws Throwable
    */
   @Category(FlakyTest.class) // GEODE-1137: orphaned AsyncInvocations, time sensitive, GC, waitForCriterion, thread unsafe test hooks/observers, expiration
+  @Test
   public void testTombstoneGCDuringFullGII() throws Throwable {
     prepareForEachTest();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
index 3ded889..405ff45 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -43,7 +52,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
 /**
  *
  */
-public class GIIFlowControlDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class GIIFlowControlDUnitTest extends JUnit4CacheTestCase {
   
   protected static final String REGION_NAME = "region";
   private static final long MAX_WAIT = 10 * 1000;
@@ -53,8 +63,8 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public GIIFlowControlDUnitTest(String name) {
-    super(name);
+  public GIIFlowControlDUnitTest() {
+    super();
   }
 
   @Override
@@ -67,6 +77,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testLotsOfChunks() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -88,6 +99,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
     
   }
   
+  @Test
   public void testFlowControlHappening() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -157,6 +169,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
     closeCache(vm0);
   }
   
+  @Test
   public void testKillSenderNoHang() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
index 4120fca..2c7d1d4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
@@ -16,6 +16,18 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -26,32 +38,27 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.InternalLocator;
 import com.gemstone.gemfire.internal.AvailablePort.Keeper;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the GridAdvisor
  *
  * @since GemFire 5.7
  */
-public class GridAdvisorDUnitTest extends DistributedTestCase {
-
-  public GridAdvisorDUnitTest(String name) {
-    super(name);
-  }
-
-  ////////  Test Methods
+@Category(DistributedTest.class)
+public class GridAdvisorDUnitTest extends JUnit4DistributedTestCase {
 
   /**
    * Tests 2 controllers and 2 bridge servers
    */
+  @Test
   public void test2by2() throws Exception {
     disconnectAllFromDS();
 
@@ -562,6 +569,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
     vm3.invoke(stopLocator);
   }
 
+  @Test
   public void test2by2usingGroups() throws Exception {
     disconnectAllFromDS();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
index b441ef1..05340a1 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
@@ -19,7 +19,23 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
@@ -28,24 +44,19 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.lru.EnableLRU;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessageImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
-
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests the size of clientUpdateMessageImpl with the size calculated by
  * {@link com.gemstone.gemfire.internal.cache.lru.MemLRUCapacityController} for HA overFlow
  * @since GemFire 5.7
  */
-public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class HAOverflowMemObjectSizerDUnitTest extends JUnit4DistributedTestCase {
 
   /* entry over head used by memCapacityController */
   private static final int OVERHEAD_PER_ENTRY = 250;
@@ -57,7 +68,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
   /** The distributedSystem instance */
   static DistributedSystem ds = null;
 
-  static String regionName = "HAOverflowMemObjectSizerDUnitTest-region";
+  static String regionName = HAOverflowMemObjectSizerDUnitTest.class.getSimpleName() + "-region";
 
   /* handler for LRU capacity controller */
   private static EnableLRU cc = null;
@@ -77,11 +88,6 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
   /* store the reference of Client Messages Region */
   static Region region = null;
 
-  /* Create new instance of HAOverflowMemObjectSizerTest */
-  public HAOverflowMemObjectSizerDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -125,7 +131,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
    *  @param notification property of BridgeServer
    */
   public static Integer createCacheServer(Boolean notification) throws Exception {
-    new HAOverflowMemObjectSizerDUnitTest("temp").createCache(new Properties());
+    new HAOverflowMemObjectSizerDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.NORMAL);
@@ -158,7 +164,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAOverflowMemObjectSizerDUnitTest("temp").createCache(props);
+    new HAOverflowMemObjectSizerDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.NORMAL);
@@ -175,6 +181,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
    * 1)Verify size calculated by getSizeInByte() of ClientUpdateMessagesImpl is
    * equal to the size calculated by memCapacity controller <br>
    */
+  @Test
   public void testSizerImplementationofMemCapacityControllerWhenNotificationBySubscriptionIsTrue() {
 
     Integer port1 = (Integer)serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.createCacheServer( new Boolean(true) ));
@@ -194,6 +201,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
    * 1)Verify size calculated by getSizeInByte() of ClientUpdateMessagesImpl is
    * equal to the size calculated by memCapacity controller <br>
    */
+  @Test
   public void testSizerImplementationofMemCapacityControllerWhenNotificationBySubscriptionIsFalse() {
     Integer port2 = (Integer)serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.createCacheServer( new Boolean(false) ));
     serverPort2 = port2;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
index b4f1c98..9b527e4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
@@ -16,11 +16,36 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.admin.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.admin.AdminDistributedSystem;
+import com.gemstone.gemfire.admin.AdminDistributedSystemFactory;
+import com.gemstone.gemfire.admin.AdminException;
+import com.gemstone.gemfire.admin.BackupStatus;
+import com.gemstone.gemfire.admin.DistributedSystemConfig;
 import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.persistence.PersistentID;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.ClassBuilder;
@@ -30,18 +55,22 @@ import com.gemstone.gemfire.internal.JarDeployer;
 import com.gemstone.gemfire.internal.cache.persistence.BackupManager;
 import com.gemstone.gemfire.internal.util.IOUtils;
 import com.gemstone.gemfire.internal.util.TransformUtils;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.*;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests for the incremental backup feature.
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class IncrementalBackupDUnitTest extends CacheTestCase {
+public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
   /**
    * Data load increment.
    */
@@ -93,14 +122,6 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
   };
   
   /**
-   * Creates a new IncrementalBackupDUnitTest.
-   * @param name test case name.
-   */
-  public IncrementalBackupDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Abstracts the logging mechanism.
    * @param message a message to log.
    */
@@ -658,6 +679,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
    * Additionally, the restore script should reference and copy operation logs from the baseline backup.
    * @throws Exception
    */
+  @Test
   public void testIncrementalBackup() 
   throws Exception {
     String memberId = getMemberId(Host.getHost(0).getVM(1));
@@ -785,6 +807,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
    * incremental backup.  This means that the member peformed a full backup because its oplogs were missing
    * in the baseline.
    */
+  @Test
   public void testMissingMemberInBaseline()
   throws Exception {        
     // Simulate the missing member by forcing a persistent member
@@ -868,6 +891,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
    * Successful if a member performs a full backup if their backup is marked as 
    * incomplete in the baseline.
    */
+  @Test
   public void testIncompleteInBaseline()
   throws Exception {
     /*
@@ -916,6 +940,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
    * Successful if all members perform a full backup when they share the baseline directory
    * and it is missing.
    */
+  @Test
   public void testMissingBaseline()
   throws Exception {
     /*
@@ -987,6 +1012,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
    * Successful if a user deployed jar file is included as part of the backup.
    * @throws Exception
    */
+  @Test
   public void testBackupUserDeployedJarFiles() throws Exception {
     final String jarName = "BackupJarDeploymentDUnit";
     final String jarNameRegex = ".*" + jarName + ".*";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
index 0a8c63f..79b58d6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
@@ -16,6 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import org.junit.Ignore;
+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.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -43,14 +53,15 @@ import com.gemstone.gemfire.test.dunit.VM;
  * Tests interrupting gemfire threads and seeing what happens
  *
  */
-public class InterruptClientServerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class InterruptClientServerDUnitTest extends JUnit4CacheTestCase {
 
   private static volatile Thread puttingThread;
   private static final long MAX_WAIT = 60 * 1000;
   private static AtomicBoolean doInterrupt = new AtomicBoolean(false);
 
-  public InterruptClientServerDUnitTest(String name) {
-    super(name);
+  public InterruptClientServerDUnitTest() {
+    super();
   }
   
   
@@ -66,23 +77,13 @@ public class InterruptClientServerDUnitTest extends CacheTestCase {
       }
     });
   }
-  
-  public void _testLoop() throws Throwable {
-    for(int i=0; i < 100; i++) {
-      System.err.println("i=" +i);
-      System.out.println("i=" +i);
-      testClientPutWithInterrupt();
-      tearDown();
-      setUp();
-    }
-  }
-
 
   /**
    * A simple test case that we are actually
    * persisting with a PR.
    * @throws Throwable 
    */
+  @Test
   public void testClientPutWithInterrupt() throws Throwable {
     IgnoredException.addIgnoredException("InterruptedException");
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java
index d8d68f3..ef7d240 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java
@@ -20,11 +20,15 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
 
 import java.util.Properties;
 
-public class InterruptsConserveSocketsFalseDUnitTest extends
-    InterruptsDUnitTest {
+import org.junit.experimental.categories.Category;
 
-  public InterruptsConserveSocketsFalseDUnitTest(String name) {
-    super(name);
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class InterruptsConserveSocketsFalseDUnitTest extends InterruptsDUnitTest {
+
+  public InterruptsConserveSocketsFalseDUnitTest() {
+    super();
   }
 
   @Override
@@ -33,7 +37,4 @@ public class InterruptsConserveSocketsFalseDUnitTest extends
     props.setProperty(CONSERVE_SOCKETS, "false");
     return props;
   }
-  
-  
-
 }



[48/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HelperTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HelperTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HelperTestCase.java
index dfde1a6..fdd5b50 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HelperTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HelperTestCase.java
@@ -16,31 +16,48 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheException;
+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.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.CqAttributes;
+import com.gemstone.gemfire.cache.query.CqAttributesFactory;
+import com.gemstone.gemfire.cache.query.CqEvent;
+import com.gemstone.gemfire.cache.query.CqException;
+import com.gemstone.gemfire.cache.query.CqExistsException;
+import com.gemstone.gemfire.cache.query.CqListener;
+import com.gemstone.gemfire.cache.query.IndexExistsException;
+import com.gemstone.gemfire.cache.query.IndexNameConflictException;
+import com.gemstone.gemfire.cache.query.QueryTestUtils;
+import com.gemstone.gemfire.cache.query.RegionNotFoundException;
 import com.gemstone.gemfire.cache.query.internal.index.CompactRangeIndex;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public class HelperTestCase extends CacheTestCase {
+@Category(DistributedTest.class)
+public class HelperTestCase extends JUnit4CacheTestCase {
 
-  public HelperTestCase(String name) {
-    super(name);
-  }
-  
   protected void createPartitionRegion(VM vm, final String regionName, final Class valueConstraint) {
     vm.invoke(new SerializableCallable() {
       public Object call() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByDUnitImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByDUnitImpl.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByDUnitImpl.java
index 05f3ba1..0dbe297 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByDUnitImpl.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/NonDistinctOrderByDUnitImpl.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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.Cache;
 import com.gemstone.gemfire.cache.query.Index;
 import com.gemstone.gemfire.cache.query.IndexExistsException;
@@ -28,14 +37,15 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
+public abstract class NonDistinctOrderByDUnitImpl extends JUnit4CacheTestCase {
 
-  public NonDistinctOrderByDUnitImpl(String name) {
-    super(name);
+  public NonDistinctOrderByDUnitImpl() {
+    super();
   }
 
   protected abstract NonDistinctOrderByTestImplementation createTestInstance();
 
+  @Test
   public void testOrderByWithIndexResultDefaultProjection() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -48,6 +58,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testOrderByWithIndexResultWithProjection() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -60,6 +71,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testMultiColOrderByWithIndexResultDefaultProjection()
       throws Exception {
     Host host = Host.getHost(0);
@@ -73,6 +85,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testMultiColOrderByWithIndexResultWithProjection()
       throws Exception {
     Host host = Host.getHost(0);
@@ -86,6 +99,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testMultiColOrderByWithMultiIndexResultDefaultProjection()
       throws Exception {
     Host host = Host.getHost(0);
@@ -99,6 +113,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testMultiColOrderByWithMultiIndexResultProjection()
       throws Exception {
     Host host = Host.getHost(0);
@@ -112,6 +127,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testLimitNotAppliedIfOrderByNotUsingIndex() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -124,6 +140,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testOrderByWithNullValues() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -136,6 +153,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testOrderByWithNullValuesUseIndex() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -148,6 +166,7 @@ public abstract class NonDistinctOrderByDUnitImpl extends CacheTestCase {
     this.closeCache(vm0, vm1, vm2, vm3);
   }
 
+  @Test
   public void testOrderByForUndefined() throws Exception {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 619a29b..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
@@ -17,6 +17,15 @@
 package com.gemstone.gemfire.cache.query.dunit;
 
 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 org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
@@ -43,8 +52,8 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 public class NonDistinctOrderByPartitionedDUnitTest extends
     NonDistinctOrderByDUnitImpl {
 
-  public NonDistinctOrderByPartitionedDUnitTest(String name) {
-    super(name);
+  public NonDistinctOrderByPartitionedDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 6421439..e1d698a 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
@@ -16,16 +16,8 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
-import com.gemstone.gemfire.cache.query.Query;
-import com.gemstone.gemfire.cache.query.QueryService;
-import com.gemstone.gemfire.cache.query.QueryTestUtils;
-import com.gemstone.gemfire.cache.query.SelectResults;
-import com.gemstone.gemfire.cache.query.data.Portfolio;
-import com.gemstone.gemfire.test.dunit.*;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import com.gemstone.gemfire.util.test.TestUtil;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.util.HashMap;
@@ -33,14 +25,25 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.stream.IntStream;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-@Category(DistributedTest.class)
-public class PartitionedRegionCompactRangeIndexDUnitTest extends DistributedTestCase {
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.QueryTestUtils;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.data.Portfolio;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-  public PartitionedRegionCompactRangeIndexDUnitTest(String name) {
-    super(name);
-  }
+@Category(DistributedTest.class)
+public class PartitionedRegionCompactRangeIndexDUnitTest extends JUnit4DistributedTestCase {
 
   private Properties getSystemProperties(String cacheXML) {
     Properties props = new Properties();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java
index 0498a79..5124d85 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java
@@ -16,13 +16,17 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static org.junit.Assert.*;
+
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Properties;
 import java.util.Set;
 
+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.CacheException;
@@ -54,30 +58,27 @@ import com.gemstone.gemfire.cache.query.internal.index.RangeIndex;
 import com.gemstone.gemfire.cache.query.types.CollectionType;
 import com.gemstone.gemfire.cache.query.types.ObjectType;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator;
 import com.gemstone.gemfire.pdx.internal.PdxString;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-public class PdxStringQueryDUnitTest extends CacheTestCase{
-  private static int bridgeServerPort;
+@Category(DistributedTest.class)
+public class PdxStringQueryDUnitTest extends JUnit4CacheTestCase {
 
-  public PdxStringQueryDUnitTest(String name) {
-    super(name);
-   }
+  private static int bridgeServerPort;
 
   private final String rootRegionName = "root";
   private final String regionName = "PdxTest";
@@ -117,6 +118,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
       "SELECT distinct pos.secIdIndexed FROM " + regName + " p, p.positions.values pos WHERE p.ID > 1 order by pos.secIdIndexed limit 5",//12
  };
 
+  @Test
   public void testReplicatedRegionNoIndex() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -375,6 +377,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
     this.closeClient(server0);
   }
 
+  @Test
   public void testRepliacatedRegionCompactRangeIndex() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -589,6 +592,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
     this.closeClient(server0);
   }
   
+  @Test
   public void testReplicatedRegionRangeIndex() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -793,6 +797,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
     this.closeClient(server0);
   }
   
+  @Test
   public void testPartitionRegionNoIndex() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1058,6 +1063,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
     this.closeClient(server0);
   }
   
+  @Test
   public void testPartitionRegionCompactRangeIndex() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1285,6 +1291,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
     this.closeClient(server0);
   }
   
+  @Test
   public void testPartitionRegionRangeIndex() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1512,6 +1519,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
     this.closeClient(server0);
   }
 
+  @Test
   public void testNullPdxString() throws CacheException {
     final Host host = Host.getHost(0);
     VM server0 = host.getVM(0);
@@ -1794,6 +1802,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
    * 
    * @throws CacheException
    */
+  @Test
   public void testPRQueryForDuplicates() throws CacheException {
     final String regionName = "exampleRegion";
     final Host host = Host.getHost(0);
@@ -1878,7 +1887,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{
       }
     });
     
-    Invoke.invokeInEveryVM(DistributedTestCase.class, "disconnectFromDS");
+    disconnectAllFromDS();
   }
    
   protected void configAndStartBridgeServer(boolean isPr, boolean isAccessor, boolean asyncIndex) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryAuthorization.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryAuthorization.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryAuthorization.java
index c4b3240..fca163e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryAuthorization.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryAuthorization.java
@@ -16,9 +16,9 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
-import java.security.Principal;
+import static org.junit.Assert.*;
 
-import junit.framework.TestCase;
+import java.security.Principal;
 
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Cache;
@@ -32,9 +32,12 @@ import com.gemstone.gemfire.security.NotAuthorizedException;
  * Test authorization class for testing the accessibility of query bind
  * parameters from QueryOperationContext
  * 
- * 
+ * Used by test:
+ *
+ * <li/>QueryParamsAuthorizationDUnitTest (via reflection)
  */
-public class QueryAuthorization extends TestCase implements AccessControl {
+public class QueryAuthorization implements AccessControl {
+
   private DistributedMember remoteDistributedMember;
 
   private LogWriter logger;
@@ -48,8 +51,7 @@ public class QueryAuthorization extends TestCase implements AccessControl {
   }
 
   @Override
-  public void init(Principal principal, DistributedMember remoteMember,
-      Cache cache) throws NotAuthorizedException {
+  public void init(Principal principal, DistributedMember remoteMember, Cache cache) throws NotAuthorizedException {
     this.remoteDistributedMember = remoteMember;
     this.logger = cache.getSecurityLogger();
   }
@@ -60,10 +62,8 @@ public class QueryAuthorization extends TestCase implements AccessControl {
     if (context instanceof QueryOperationContext) {
       Object[] params = ((QueryOperationContext) context).getQueryParams();
       assertTrue(" Bind parameters should not be null", params != null);
-      assertEquals(" 2 bind parameters should have been received.", 2,
-          params.length);
+      assertEquals(" 2 bind parameters should have been received.", 2, params.length);
     }
     return true;
   }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
index 475ad49..5513585 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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.Properties;
 
 import org.junit.experimental.categories.Category;
@@ -57,7 +66,8 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * This tests the data inconsistency during update on an index and querying the
  * same UNLOCKED index.
  */
-public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class QueryDataInconsistencyDUnitTest extends JUnit4CacheTestCase {
 
   private static final int cnt = 0;
 
@@ -88,8 +98,8 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public QueryDataInconsistencyDUnitTest(String name) {
-    super(name);
+  public QueryDataInconsistencyDUnitTest() {
+    super();
   }
 
   @Override
@@ -104,6 +114,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
     server = host.getVM(0);
   }
 
+  @Test
   public void testCompactRangeIndex() {
     // Create caches
     Properties props = new Properties();
@@ -199,6 +210,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
     ThreadUtils.join(putThread, 200);
   }
 
+  @Test
   public void testRangeIndex() {
     // Create caches
     Properties props = new Properties();
@@ -294,6 +306,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-925: time sensitive, async actions, short timeouts
+  @Test
   public void testRangeIndexWithIndexAndQueryFromCluaseMisMatch() { // TODO: fix misspelling
     // Create caches
     Properties props = new Properties();
@@ -384,6 +397,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
     ThreadUtils.join(putThread, 200); // GEODE-925 occurs here and this is very short join 200 millis
   }
 
+  @Test
   public void testRangeIndexWithIndexAndQueryFromCluaseMisMatch2() {
     // Create caches
     Properties props = new Properties();
@@ -475,7 +489,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
   }
   
   public static void createProxyRegions() {
-    new QueryDataInconsistencyDUnitTest("temp").createProxyRegs();
+    new QueryDataInconsistencyDUnitTest().createProxyRegs();
   }
 
   private void createProxyRegs() {
@@ -488,7 +502,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
   }
 
   public static void createNewPR() {
-    new QueryDataInconsistencyDUnitTest("temp").createPR();
+    new QueryDataInconsistencyDUnitTest().createPR();
   }
   public void createPR() {
     PartitionResolver testKeyBasedResolver = new QueryAPITestPartitionResolver();
@@ -504,7 +518,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
   }
 
   public static void createCacheClientWithoutRegion(String host, Integer port1) {
-    new QueryDataInconsistencyDUnitTest("temp").createCacheClientWithoutReg(
+    new QueryDataInconsistencyDUnitTest().createCacheClientWithoutReg(
         host, port1);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
index 16ff4cf..f6ced21 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
@@ -16,6 +16,18 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheExistsException;
@@ -32,23 +44,29 @@ import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.cache.query.internal.index.IndexManager;
 import com.gemstone.gemfire.cache.query.internal.index.PartitionedIndex;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.FileUtil;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.util.test.TestUtil;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Properties;
-
-public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class QueryIndexUsingXMLDUnitTest extends JUnit4CacheTestCase {
 
   static private final String WAIT_PROPERTY = "QueryIndexBuckets.maxWaitTime";
 
@@ -101,11 +119,6 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
 
   private String persistentOverFlowRegName = "PersistentOverflowPortfolios";
 
-  /** Creates a new instance of QueryIndexUsingXMLDUnitTest */
-  public QueryIndexUsingXMLDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     //Workaround for #52008
@@ -123,6 +136,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
   /**
    * Creates partitioned index from an xml description.
    */
+  @Test
   public void testCreateIndexThroughXML() throws Exception
   {
 
@@ -190,6 +204,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
   /**
    * Creates partitioned index from an xml description.
    */
+  @Test
   public void testCreateIndexWhileDoingGII() throws Exception
   {
 
@@ -241,10 +256,10 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm1.invoke(close());
   }
 
- 
   /**
    * Creates partitioned index from an xml description.
    */
+  @Test
   public void testReplicatedRegionCreateIndexWhileDoingGII() throws Exception
   {
 
@@ -290,9 +305,11 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm0.invoke(close());
     vm1.invoke(close());
   }
+
   /**
    * Creates persistent partitioned index from an xml description.
    */
+  @Test
   public void testPersistentPRRegionCreateIndexWhileDoingGII() throws Exception
   {
 
@@ -322,7 +339,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm0.invoke(prIndexCreationCheck(persistentRegName, "secIndex", 50));
     vm1.invoke(prIndexCreationCheck(persistentRegName, "secIndex", 50));
     
-  //check hash index creation
+    //check hash index creation
     vm0.invoke(prIndexCreationCheck(persistentRegNameWithHash, statusIndex, 50));
     vm1.invoke(prIndexCreationCheck(persistentRegNameWithHash, statusIndex, 50));
     vm0.invoke(prIndexCreationCheck(persistentRegNameWithHash, idIndex, 50));
@@ -354,10 +371,10 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm1.invoke(close());
   }
 
-
   /**
    * Creates partitioned index from an xml description.
    */
+  @Test
   public void testCreateIndexWhileDoingGIIWithEmptyPRRegion() throws Exception
   {
 
@@ -393,8 +410,9 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
   }
 
   /**
-   * Creats partitioned index from an xml discription.
+   * Creates partitioned index from an xml description.
    */
+  @Test
   public void testCreateAsyncIndexWhileDoingGII() throws Exception
   {
 
@@ -441,6 +459,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
   /**
    * Creates indexes and compares the results between index and non-index results.
    */
+  @Test
   public void testCreateIndexWhileDoingGIIAndCompareQueryResults() throws Exception
   {
 
@@ -489,9 +508,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm1.invoke(indexCreationCheck(repRegName, "secIndex"));
     vm1.invoke(prIndexCreationCheck(persistentRegNameWithHash, "secIndex", 50));
     vm1.invoke(indexCreationCheck(repRegNameWithHash, "secIndex"));
-   
-   
- 
+
     // Execute query and verify index usage    
     vm0.invoke(executeQueryAndCompareResult(name, true));
     vm1.invoke(executeQueryAndCompareResult(name, true));
@@ -504,6 +521,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
   /**
    * Creates async partitioned index from an xml description.
    */
+  @Test
   public void testCreateAsyncIndexWhileDoingGIIAndQuery() throws Exception
   {
 
@@ -554,7 +572,9 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
    * <p>
    * DISABLED.  This test is disabled due to a high rate of failure.  See ticket #52167
    */
-  public void disabled_testCreateAsyncIndexWhileDoingGIIAndCompareQueryResults() throws Exception
+  @Ignore("TODO: test is disabled because of #52167")
+  @Test
+  public void testCreateAsyncIndexWhileDoingGIIAndCompareQueryResults() throws Exception
   {
 
     Host host = Host.getHost(0);
@@ -598,6 +618,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm1.invoke(close());
   }
   
+  @Test
   public void testIndexCreationForReplicatedPersistentOverFlowRegionOnRestart() throws Exception
   {
     Host host = Host.getHost(0);
@@ -623,8 +644,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     vm0.invoke(close());
     
   }
-  
-  
+
   public CacheSerializableRunnable setTestHook()
   {
     SerializableRunnable sr = new CacheSerializableRunnable("TestHook") {
@@ -641,13 +661,6 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
             }
           }
         };
-        /*
-        try {
-          ClassLoader.getSystemClassLoader().loadClass(IndexManager.class.getName());
-        } catch (Exception ex) {
-          fail("Failed to load IndexManager.class");
-        }
-        */
         IndexManager.testHook = new IndexTestHook();
       }
     };
@@ -665,6 +678,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     };
     return (CacheSerializableRunnable)sr;
   }
+
   public CacheSerializableRunnable createIndexThrougXML(final String vmid,
       final String regionName, final String xmlFileName)
   {
@@ -917,8 +931,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
     } 
     return basicGetSystem();
   }
-  
-  
+
   private Cache getCache(InternalDistributedSystem system) {
     Cache cache = basicGetCache();
     if (cache == null) {
@@ -941,13 +954,16 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
   }
   
   public static class QueryObserverImpl extends QueryObserverAdapter {
+
     boolean isIndexesUsed = false;
     ArrayList indexesUsed = new ArrayList();
 
+    @Override
     public void beforeIndexLookup(Index index, int oper, Object key) {
       indexesUsed.add(index.getName());
     }
 
+    @Override
     public void afterIndexLookup(Collection results) {
       if (results != null) {
         isIndexesUsed = true;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java
index 26cfc05..674eca4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -44,14 +53,16 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * 
  * 
  */
-public class QueryParamsAuthorizationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class QueryParamsAuthorizationDUnitTest extends JUnit4CacheTestCase {
 
   private final String regName = "exampleRegion";
 
-  public QueryParamsAuthorizationDUnitTest(String name) {
-    super(name);
+  public QueryParamsAuthorizationDUnitTest() {
+    super();
   }
 
+  @Test
   public void testNothing() {
     // remove when Bug #51079 is fixed
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
index 1d60010..2505bbc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+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 static com.gemstone.gemfire.cache.query.Utils.createPortfoliosAndPositions;
 
 import java.util.ArrayList;
@@ -74,7 +83,8 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * (routing keys) to run the query on subset of buckets "locally". If query
  * includes buckets
  */
-public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class QueryUsingFunctionContextDUnitTest extends JUnit4CacheTestCase {
 
   private static final int cnt = 0;
 
@@ -130,8 +140,8 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public QueryUsingFunctionContextDUnitTest(String name) {
-    super(name);
+  public QueryUsingFunctionContextDUnitTest() {
+    super();
   }
 
   @Override
@@ -161,6 +171,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   /**
    * Test on Replicated Region.
    */
+  @Test
   public void testQueriesWithFilterKeysOnReplicatedRegion() {
     IgnoredException.addIgnoredException("IllegalArgumentException");
 
@@ -197,6 +208,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   /**
    * Test on PR on one server only using filter.
    */
+  @Test
   public void testQueriesWithFilterKeysOnPRLocal() {
     
     client.invoke(new CacheSerializableRunnable("Test query on client and server") {
@@ -211,7 +223,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
 
           TestServerQueryFunction func = new TestServerQueryFunction("LDS Server function-1");
           function = new TestQueryFunction("queryFunction-1");
-          QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest("test");
+          QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
           ArrayList queryResults2 = test.runQueryOnClientUsingFunc(function, PartitionedRegionName1, filter, queries[i]);  
           if (queryResults2 == null)
             fail(queries[i] +"result is null from client function");
@@ -230,6 +242,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
     
   }
 
+  @Test
   public void testInvalidQueries() {
     
     IgnoredException.addIgnoredException("Syntax error");
@@ -242,7 +255,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
         String query = "select * from / " + repRegionName + " where ID>=0";
         TestServerQueryFunction func = new TestServerQueryFunction("LDS Server function-1");
         function = new TestQueryFunction("queryFunction-1");
-        QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest("test");
+        QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
         try {
           test.runQueryOnClientUsingFunc(function, repRegionName, filter, query);  
           fail("Query execution should have failed.");
@@ -253,7 +266,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
         query = "select * from / " + PartitionedRegionName1 + " where ID>=0";
         func = new TestServerQueryFunction("LDS Server function-1");
         function = new TestQueryFunction("queryFunction-1");
-        test = new QueryUsingFunctionContextDUnitTest("test");
+        test = new QueryUsingFunctionContextDUnitTest();
         try {
           test.runQueryOnClientUsingFunc(function, PartitionedRegionName1, filter, query);  
           fail("Query execution should have failed.");
@@ -268,6 +281,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   /**
    *
    */
+  @Test
   public void testQueriesWithFilterKeysOnPRLocalAndRemote() {
     
     client.invoke(new CacheSerializableRunnable("Test query on client and server") {
@@ -282,7 +296,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
         for (int i=0; i< queries.length; i++) {
           Object[][] r = new Object[1][2];
 
-          QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest("test");
+          QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
           ArrayList queryResults2 = test.runQueryOnClientUsingFunc(function, PartitionedRegionName1, filter, queries[i]);
           if (queryResults2 == null)
             fail(queries[i] +"result is null from client function");
@@ -303,7 +317,8 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   /**
   *
   */
- public void testQueriesWithFilterKeysOnPRLocalAndRemoteWithBucketDestroy() {
+  @Test
+  public void testQueriesWithFilterKeysOnPRLocalAndRemoteWithBucketDestroy() {
    
    // Set Query Observer in cache on server1
    server1.invoke(new CacheSerializableRunnable("Set QueryObserver in cache on server1") {
@@ -342,7 +357,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
 
        for (int i=0; i< queries.length; i++) {
          
-         QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest("test");
+         QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
          ArrayList queryResults2 = test.runQueryOnClientUsingFunc(function, PartitionedRegionName1, filter, queries[i]);  
          
          // The Partition Region has 20 buckets with 100 values and key i goes in bucket j=(i%20)
@@ -366,6 +381,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   /**
    *
    */
+  @Test
   public void testQueriesWithFilterKeysOnPRWithBucketDestroy() {
     IgnoredException.addIgnoredException("QueryInvocationTargetException");
     Object[][] r = new Object[queries.length][2];
@@ -436,6 +452,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   }
 
   @Category(FlakyTest.class) // GEODE-575: ignores lots of exceptions, non-thread-safe test hooks
+  @Test
   public void testQueriesWithFilterKeysOnPRWithRebalancing() {
    IgnoredException.addIgnoredException("QueryInvocationTargetException");
    IgnoredException.addIgnoredException("java.net.SocketException");
@@ -515,7 +532,8 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
  }
 
  
- public void testNonColocatedRegionQueries() {
+  @Test
+  public void testNonColocatedRegionQueries() {
    IgnoredException.addIgnoredException("UnsupportedOperationException");
    client.invoke(new CacheSerializableRunnable("Test query on non-colocated regions on server") {
      @Override
@@ -525,7 +543,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
 
        for (int i=0; i< nonColocatedQueries.length; i++) {
          function = new TestQueryFunction("queryFunction-1");
-         QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest("test");
+         QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
          try {
           ArrayList queryResults2 = test.runQueryOnClientUsingFunc(function, PartitionedRegionName1, filter, nonColocatedQueries[i]);
           fail("Function call did not fail for query with function context");
@@ -540,7 +558,8 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
    
  }
  
- public void testJoinQueryPRWithMultipleIndexes(){
+  @Test
+  public void testJoinQueryPRWithMultipleIndexes(){
    
    server1.invoke(new CacheSerializableRunnable("Test query with indexes") {
      
@@ -549,7 +568,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
        Set filter = getFilter(0, 1);
        function = new TestQueryFunction("queryFunction-2");
        Object[][] r = new Object[2][2];
-       QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest("test");
+       QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
        int j = 0;
        for (int i=3; i< 5; i++) {
          ArrayList queryResults2 = test.runQueryOnClientUsingFunc(function, PartitionedRegionName1, filter, queries[i]);
@@ -744,7 +763,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   }
 
   public static void createProxyRegions() {
-    new QueryUsingFunctionContextDUnitTest("temp").createProxyRegs();
+    new QueryUsingFunctionContextDUnitTest().createProxyRegs();
   }
 
   private void createProxyRegs() {
@@ -766,7 +785,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   }
 
   public static void createLocalRegion() {
-    new QueryUsingFunctionContextDUnitTest("temp").createLocalReg();
+    new QueryUsingFunctionContextDUnitTest().createLocalReg();
   }
   public void createLocalReg() {
     cache = CacheFactory.getAnyInstance();
@@ -774,7 +793,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   }
 
   public static void createReplicatedRegion() {
-    new QueryUsingFunctionContextDUnitTest("temp").createRR();
+    new QueryUsingFunctionContextDUnitTest().createRR();
   }
   public void createRR() {
     cache = CacheFactory.getAnyInstance();
@@ -782,7 +801,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   }
 
   public static void createColocatedPR() {
-    new QueryUsingFunctionContextDUnitTest("temp").createColoPR();
+    new QueryUsingFunctionContextDUnitTest().createColoPR();
   }
   public void createColoPR() {
     PartitionResolver testKeyBasedResolver = new QueryAPITestPartitionResolver();
@@ -837,7 +856,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
   }
 
   public static void createCacheClientWithoutRegion(String host, Integer port1, Integer port2, Integer port3) {
-    new QueryUsingFunctionContextDUnitTest("temp").createCacheClientWithoutReg(host, port1, port2, port3);
+    new QueryUsingFunctionContextDUnitTest().createCacheClientWithoutReg(host, port1, port2, port3);
   }
   private void createCacheClientWithoutReg(String host, Integer port1, Integer port2, Integer port3) {
     this.disconnectFromDS();
@@ -853,7 +872,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
    * received from client function execution.
    */
   public static ArrayList runQueryOnServerLocalDataSet(String query, Set filter) {
-    return new QueryUsingFunctionContextDUnitTest("temp").runQueryOnServerLDS(query, filter);
+    return new QueryUsingFunctionContextDUnitTest().runQueryOnServerLDS(query, filter);
   }
 
   protected ArrayList runQueryOnServerLDS(String queryStr, Set filter) {
@@ -880,7 +899,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
    * Run query on server to compare the results received from client function execution.
    */
   public static ArrayList runQueryOnServerRegion(String query) {
-    return new QueryUsingFunctionContextDUnitTest("temp").runQueryOnServerReg(query);
+    return new QueryUsingFunctionContextDUnitTest().runQueryOnServerReg(query);
   }
   protected ArrayList runQueryOnServerReg(String queryStr) {
 
@@ -904,7 +923,7 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
    * @return ArrayList of results
    */
   public static ArrayList runQueryOnClientUsingFunction(Function function, String regionName, Set filter, String query) {
-    return new QueryUsingFunctionContextDUnitTest("temp").runQueryOnClientUsingFunc(function, regionName, filter, query);
+    return new QueryUsingFunctionContextDUnitTest().runQueryOnClientUsingFunc(function, regionName, filter, query);
   }
 
   private ArrayList runQueryOnClientUsingFunc(Function func, String regionName, Set filter, String query) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
index 7774920..cf73b81 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
@@ -16,36 +16,57 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static org.junit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+import org.apache.logging.log4j.Logger;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.IndexType;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.Struct;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.cache.query.types.ObjectType;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.experimental.categories.Category;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
 
@@ -54,40 +75,37 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  *
  * @since GemFire 5.0.1
  */
-public class QueryUsingPoolDUnitTest extends CacheTestCase {
-
+@Category(DistributedTest.class)
+public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
+  private static final Logger logger = LogService.getLogger();
+  
   /**
    * The port on which the bridge server was started in this VM
    */
   private static int bridgeServerPort;
 
-  final String rootRegionName = "root";
-
-  private final String regionName = this.getName();
-
-  private final String regName = "/" + rootRegionName + "/" + regionName;
+  private String rootRegionName;
+  private String regionName;
+  private String regName;
 
   // Used with compiled queries.
-  private final String[] queryString = new String[] {
-      "SELECT itr.value FROM " + regName + ".entries itr where itr.key = $1", // 0
-      "SELECT DISTINCT * FROM " + regName + " WHERE id < $1 ORDER BY   id", // 1
-      "SELECT DISTINCT * FROM " + regName + " WHERE id < $1 ORDER BY id", // 2
-      "(SELECT DISTINCT * FROM " + regName + " WHERE id < $1).size", // 3
-      "SELECT * FROM " + regName + " WHERE id = $1 and Ticker = $2", // 4
-      "SELECT * FROM " + regName + " WHERE id < $1 and Ticker = $2", // 5
-  };
-
-  /**
-   * Creates a new <code>GemFireMemberStatusDUnitTest</code>
-   */
-  public QueryUsingPoolDUnitTest(String name) {
-    super(name);
-  }
-
-  ////////  Test Methods
+  private String[] queryString;
 
   @Override
   public final void postSetUp() throws Exception {
+    this.rootRegionName = "root";
+    this.regionName = this.getName();
+    this.regName = "/" + this.rootRegionName + "/" + this.regionName;
+
+    this.queryString = new String[] {
+      "SELECT itr.value FROM " + this.regName + ".entries itr where itr.key = $1", // 0
+      "SELECT DISTINCT * FROM " + this.regName + " WHERE id < $1 ORDER BY   id", // 1
+      "SELECT DISTINCT * FROM " + this.regName + " WHERE id < $1 ORDER BY id", // 2
+      "(SELECT DISTINCT * FROM " + this.regName + " WHERE id < $1).size", // 3
+      "SELECT * FROM " + this.regName + " WHERE id = $1 and Ticker = $2", // 4
+      "SELECT * FROM " + this.regName + " WHERE id < $1 and Ticker = $2", // 5
+    };
+
     disconnectAllFromDS();
     IgnoredException.addIgnoredException("Connection reset");
     IgnoredException.addIgnoredException("Socket input is shutdown");
@@ -114,7 +132,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     PoolFactory poolFactory = PoolManager.createFactory();
     poolFactory.setSubscriptionEnabled(subscriptionEnabled);
     for (int i = 0; i < servers.length; i++) {
-      LogService.getLogger().info("### Adding to Pool. ### Server : " + servers[i] + " Port : " + ports[i]);
+      logger.info("### Adding to Pool. ### Server : " + servers[i] + " Port : " + ports[i]);
       poolFactory.addServer(servers[i], ports[i]);
     }
     poolFactory.setMinConnections(1);
@@ -132,6 +150,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests remote import query execution.
    */
+  @Test
   public void testRemoteImportQueries() throws CacheException {
 
     final String name = this.getName();
@@ -250,6 +269,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests remote struct query execution.
    */
+  @Test
   public void testRemoteStructQueries() throws CacheException {
 
     final String name = this.getName();
@@ -372,6 +392,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests remote full region query execution.
    */
+  @Test
   public void testRemoteFullRegionQueries() throws CacheException {
 
     final String name = this.getName();
@@ -541,6 +562,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests client-server query using parameters (compiled queries).
    */
+  @Test
   public void testClientServerQueriesWithParams() throws CacheException {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -565,6 +587,8 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         50, // 5
     };
 
+    assertNotNull(this.regionName);//KIRK
+
     // Start server
     final int port = vm0.invoke("Create Bridge Server", () -> {
       setupBridgeServerAndCreateData(regionName, numberOfEntries);
@@ -632,7 +656,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   private void executeQueriesForClientServerQueriesWithParams(SelectResults results, QueryService qService, Object[][] params, int[] expectedResults) {
     for (int i = 0; i < queryString.length; i++) {
       try {
-        LogService.getLogger().info("### Executing Query :" + queryString[i]);
+        logger.info("### Executing Query :" + queryString[i]);
         Query query = qService.newQuery(queryString[i]);
         results = (SelectResults) query.execute(params[i]);
       } catch (Exception e) {
@@ -649,6 +673,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests client-server query using parameters (compiled queries).
    */
+  @Test
   public void testMulitipleClientServerQueriesWithParams() throws CacheException {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -764,6 +789,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests client-server compiled query register and cleanup.
    */
+  @Test
   public void testClientServerCompiledQueryRegisterAndCleanup() throws CacheException {
 
     final String name = this.getName();
@@ -822,6 +848,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests client-server compiled query register and cleanup.
    */
+  @Test
   public void testClientServerCompiledQueryTimeBasedCleanup() throws CacheException {
 
     final String name = this.getName();
@@ -905,6 +932,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
    * It creates the client connections without the subscription
    * enabled. This doesn't create any client proxy on the server.
    */
+  @Test
   public void testClientServerCompiledQueryCleanup() throws CacheException {
 
     final String name = this.getName();
@@ -998,6 +1026,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
    * Tests client-server query using parameters (compiled queries).
    */
   @Category(FlakyTest.class) // GEODE-1146: time senstiive, thread sleeps, uses zero port for servers (good!), async actions, AsyncInvocation orphans
+  @Test
   public void testBindParamsWithMulitipleClients() throws CacheException {
 
     final Host host = Host.getHost(0);
@@ -1055,7 +1084,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         for (int j = 0; j < 5; j++) {
           for (int i = 0; i < 2; i++) {
             try {
-              LogService.getLogger().info("### Executing Query :" + queryString[i]);
+              logger.info("### Executing Query :" + queryString[i]);
               Query query = qService.newQuery(queryString[i]);
               rs[0][0] = (SelectResults) query.execute(params[i]);
               Query query2 = qService.newQuery(querys[i]);
@@ -1064,9 +1093,9 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
             } catch (Exception e) {
               Assert.fail("Failed executing " + queryString[i], e);
             }
-            LogService.getLogger().info("### Comparing results for Query :" + ((i + 1) * (j + 1)) + " : " + queryString[i]);
+            logger.info("### Comparing results for Query :" + ((i + 1) * (j + 1)) + " : " + queryString[i]);
             compareQueryResultsWithoutAndWithIndexes(rs, 1);
-            LogService.getLogger().info("### Done Comparing results for Query :" + ((i + 1) * (j + 1)) + " : " + queryString[i]);
+            logger.info("### Done Comparing results for Query :" + ((i + 1) * (j + 1)) + " : " + queryString[i]);
           }
         }
       }
@@ -1090,7 +1119,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         for (int j = 0; j < queryString.length; j++) {
           for (int i = 0; i < queryString.length; i++) {
             try {
-              LogService.getLogger().info("### Executing Query :" + queryString[i]);
+              logger.info("### Executing Query :" + queryString[i]);
               Query query = qService.newQuery(queryString[i]);
               rs[0][0] = (SelectResults) query.execute(params[i]);
               Query query2 = qService.newQuery(querys[i]);
@@ -1120,6 +1149,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests remote join query execution.
    */
+  @Test
   public void testRemoteJoinRegionQueries() throws CacheException {
 
     final String name = this.getName();
@@ -1204,6 +1234,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
    * Tests remote query execution using a BridgeClient as the CacheWriter
    * and CacheLoader.
    */
+  @Test
   public void testRemoteBridgeClientQueries() throws CacheException {
 
     final String name = this.getName();
@@ -1297,6 +1328,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
    * @throws Exception
    */
 
+  @Test
   public void testBug36969() throws Exception {
     final String name = this.getName();
     final String rootRegionName = "root";
@@ -1368,6 +1400,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   /**
    * Tests remote full region query execution.
    */
+  @Test
   public void testRemoteSortQueriesUsingIndex() throws CacheException {
     final String name = this.getName();
     final String rootRegionName = "root";
@@ -1500,6 +1533,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     vm0.invoke("Stop CacheServer", () -> stopBridgeServer(getCache()));
   }
 
+  @Test
   public void testUnSupportedOps() throws Exception {
     final String name = this.getName();
     final String rootRegionName = "root";
@@ -1635,15 +1669,15 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       type1 = ((SelectResults) r[j][0]).getCollectionType().getElementType();
       type2 = ((SelectResults) r[j][1]).getCollectionType().getElementType();
       if ((type1.getClass().getName()).equals(type2.getClass().getName())) {
-        LogService.getLogger().info("Both SelectResults are of the same Type i.e.--> "
+        logger.info("Both SelectResults are of the same Type i.e.--> "
             + ((SelectResults) r[j][0]).getCollectionType().getElementType());
       } else {
-        LogService.getLogger().info("Classes are : " + type1.getClass().getName() + " "
+        logger.info("Classes are : " + type1.getClass().getName() + " "
             + type2.getClass().getName());
         fail("FAILED:Select result Type is different in both the cases");
       }
       if (((SelectResults) r[j][0]).size() == ((SelectResults) r[j][1]).size()) {
-        LogService.getLogger().info("Both SelectResults are of Same Size i.e.  Size= "
+        logger.info("Both SelectResults are of Same Size i.e.  Size= "
             + ((SelectResults) r[j][1]).size());
       } else {
         fail("FAILED:SelectResults size is different in both the cases. Size1="
@@ -1653,7 +1687,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       set2 = (((SelectResults) r[j][1]).asSet());
       set1 = (((SelectResults) r[j][0]).asSet());
 
-      LogService.getLogger().info(" SIZE1 = " + set1.size() + " SIZE2 = " + set2.size());
+      logger.info(" SIZE1 = " + set1.size() + " SIZE2 = " + set2.size());
 
       //      boolean pass = true;
       itert1 = set1.iterator();
@@ -1663,10 +1697,10 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
         boolean exactMatch = false;
         while (itert2.hasNext()) {
-          LogService.getLogger().info("### Comparing results..");
+          logger.info("### Comparing results..");
           Object p2 = itert2.next();
           if (p1 instanceof Struct) {
-            LogService.getLogger().info("ITS a Set");
+            logger.info("ITS a Set");
             Object[] values1 = ((Struct) p1).getFieldValues();
             Object[] values2 = ((Struct) p2).getFieldValues();
             assertEquals(values1.length, values2.length);
@@ -1678,26 +1712,26 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
             }
             exactMatch = elementEqual;
           } else {
-            LogService.getLogger().info("Not a Set p2:" + p2 + " p1: " + p1);
+            logger.info("Not a Set p2:" + p2 + " p1: " + p1);
             if (p2 instanceof TestObject) {
-              LogService.getLogger().info("An instance of TestObject");
+              logger.info("An instance of TestObject");
               exactMatch = p2.equals(p1);
             } else {
-              LogService.getLogger().info("Not an instance of TestObject" + p2.getClass().getCanonicalName());
+              logger.info("Not an instance of TestObject" + p2.getClass().getCanonicalName());
               exactMatch = p2.equals(p1);
             }
           }
           if (exactMatch) {
-            LogService.getLogger().info("Exact MATCH");
+            logger.info("Exact MATCH");
             break;
           }
         }
         if (!exactMatch) {
-          LogService.getLogger().info("NOT A MATCH");
+          logger.info("NOT A MATCH");
           fail("Atleast one element in the pair of SelectResults supposedly identical, is not equal ");
         }
       }
-      LogService.getLogger().info("### Done Comparing results..");
+      logger.info("### Done Comparing results..");
     }
   }
 
@@ -1712,7 +1746,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
     for (int i = 0; i < queryString.length; i++) {
       try {
-        LogService.getLogger().info("### Executing Query :" + queryString[i]);
+        logger.info("### Executing Query :" + queryString[i]);
         Query query = qService.newQuery(queryString[i]);
         query.execute(params[i]);
       } catch (Exception e) {
@@ -1749,11 +1783,11 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
   /* Close Client */
   public void closeClient() {
-    LogService.getLogger().info("### Close Client. ###");
+    logger.info("### Close Client. ###");
     try {
       closeCache();
     } catch (Exception ex) {
-      LogService.getLogger().info("### Failed to get close client. ###");
+      logger.info("### Failed to get close client. ###");
     }
     //    Wait.pause(2 * 1000);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
index 829f9ec..3866f40 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
@@ -16,11 +16,29 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Comparator;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import cacheRunner.Portfolio;
 import cacheRunner.Position;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
 import com.gemstone.gemfire.cache.query.SelectResults;
@@ -30,38 +48,31 @@ import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.cache.query.internal.ResultsBag;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Comparator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
 /**
  * Tests remote (client/server) query execution.
  *
  * @since GemFire 5.0.1
  */
-public class RemoteQueryDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RemoteQueryDUnitTest extends JUnit4CacheTestCase {
 
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
 
-  public RemoteQueryDUnitTest(String name) {
-    super(name);
-  }
-
-  ////////  Test Methods
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -75,6 +86,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
   /**
    * Tests remote predicate query execution.
    */
+  @Test
   public void testRemotePredicateQueries() throws CacheException {
 
     final String name = this.getName();
@@ -218,6 +230,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
   /**
    * Tests remote import query execution.
    */
+  @Test
   public void testRemoteImportQueries() throws CacheException {
 
     final String name = this.getName();
@@ -346,6 +359,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
   /**
    * Tests remote struct query execution.
    */
+  @Test
   public void testRemoteStructQueries() throws CacheException {
 
     final String name = this.getName();
@@ -472,7 +486,9 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
   /**
    * Tests remote complex query execution.
    */
-  public void __testRemoteComplexQueries() throws CacheException {
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testRemoteComplexQueries() throws CacheException {
 
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -666,6 +682,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
   /**
    * Tests remote full region query execution.
    */
+  @Test
   public void testRemoteFullRegionQueries() throws CacheException {
 
     final String name = this.getName();
@@ -831,6 +848,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
   /**
    * Tests remote join query execution.
    */
+  @Test
   public void testRemoteJoinRegionQueries() throws CacheException {
 
     final String name = this.getName();
@@ -932,6 +950,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
    * and CacheLoader.
    */
   @Category(FlakyTest.class) // GEODE-490: random port
+  @Test
   public void testRemoteBridgeClientQueries() throws CacheException {
 
     final String name = this.getName();
@@ -1085,13 +1104,11 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
     });
   }
 
-
   /**
    * This the dunit test for the bug no : 36434
-   * @throws Exception
    */
-
-   public void testBug36434() throws Exception
+  @Test
+  public void testBug36434() throws Exception
    {
      final String name = this.getName();
      final Host host = Host.getHost(0);
@@ -1185,17 +1202,13 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
          stopBridgeServer(getCache());
        }
      });
-
-
-
    }
 
   /**
-    * This the dunit test for the bug no : 36969
-    * @throws Exception
-    */
-
-    public void testBug36969() throws Exception
+   * This the dunit test for the bug no : 36969
+   */
+  @Test
+  public void testBug36969() throws Exception
     {
       final String name = this.getName();
       final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
index 1ea2c3f..4a09351 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
@@ -16,9 +16,41 @@
  */
 package com.gemstone.gemfire.cache.query.dunit;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.*;
-import com.gemstone.gemfire.cache.query.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache.client.ServerOperationException;
+import com.gemstone.gemfire.cache.query.FunctionDomainException;
+import com.gemstone.gemfire.cache.query.Index;
+import com.gemstone.gemfire.cache.query.IndexInvalidException;
+import com.gemstone.gemfire.cache.query.NameResolutionException;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryException;
+import com.gemstone.gemfire.cache.query.QueryExecutionLowMemoryException;
+import com.gemstone.gemfire.cache.query.QueryExecutionTimeoutException;
+import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.TypeMismatchException;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.cache.query.internal.QueryMonitor;
@@ -30,31 +62,32 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.DistributedRegion;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.control.*;
+import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor;
+import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
+import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
+import com.gemstone.gemfire.internal.cache.control.ResourceListener;
+import com.gemstone.gemfire.internal.cache.control.TestMemoryThresholdListener;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-import util.TestException;
-
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCase {
   
   private static int MAX_TEST_QUERY_TIMEOUT = 4000;
   private static int TEST_QUERY_TIMEOUT = 1000;
   private final static int CRITICAL_HEAP_USED = 950;
   private final static int NORMAL_HEAP_USED = 500;
-  public ResourceManagerWithQueryMonitorDUnitTest(String name) {
-    super(name);
-  }
-  
+
   @Override
   public final void postSetUpClientServerTestCase() throws Exception {
     Invoke.invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
@@ -103,98 +136,118 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
       return null;
     }
   };
- 
+
+  @Test
   public void testRMAndNoTimeoutSet() throws Exception {
     doCriticalMemoryHitTest("portfolios", false, 85/*crit threshold*/, false, -1, true);
   }
-  
+
+  @Test
   public void testRMAndNoTimeoutSetParReg() throws Exception {
     doCriticalMemoryHitTest("portfolios", true, 85/*crit threshold*/, false, -1, true);
   }
-  
+
+  @Test
   public void testRMButDisabledQueryMonitorForLowMemAndNoTimeoutSet() throws Exception {
     //verify that timeout is not set and that a query can execute properly
     doCriticalMemoryHitTest("portfolios", false, 85/*crit threshold*/, true, -1, true);
   }
-  
+
+  @Test
   public void testRMAndTimeoutSet() throws Exception {
     //verify that we still receive critical heap cancelation
     doCriticalMemoryHitTest("portfolios", false, 85/*crit threshold*/, true, TEST_QUERY_TIMEOUT, true);
   }
-  
+
+  @Test
   public void testRMAndTimeoutSetAndQueryTimesoutInstead() throws Exception {
     //verify that timeout is set correctly and cancel query 
     doCriticalMemoryHitTest("portfolios", false, 85/*crit threshold*/, true, TEST_QUERY_TIMEOUT, false);
   }
-  
+
+  @Test
   public void testRMButDisabledQueryMonitorForLowMemAndTimeoutSet()  throws Exception {
     //verify that timeout is still working properly
     doCriticalMemoryHitTest("portfolios", false, 85/*crit threshold*/, true, TEST_QUERY_TIMEOUT, true);
   }
   
-  
   //Query directly on member with RM and QM set
+  @Test
   public void testRMAndNoTimeoutSetOnServer() throws Exception {
     doCriticalMemoryHitTestOnServer("portfolios", false, 85/*crit threshold*/, false, -1, true);
   }
-  
+
+  @Test
   public void testRMAndNoTimeoutSetParRegOnServer() throws Exception {
     doCriticalMemoryHitTestOnServer("portfolios", true, 85/*crit threshold*/, false, -1, true);
   }
-  
+
+  @Test
   public void testRMButDisabledQueryMonitorForLowMemAndNoTimeoutSetOnServer() throws Exception {
     //verify that timeout is not set and that a query can execute properly
     doCriticalMemoryHitTestOnServer("portfolios", false, 85/*crit threshold*/, true, -1, true);
   }
-  
+
+  @Test
   public void testRMAndTimeoutSetOnServer() throws Exception {
     //verify that we still receive critical heap cancelation
     doCriticalMemoryHitTestOnServer("portfolios", false, 85/*crit threshold*/, true, TEST_QUERY_TIMEOUT, true);
   }
-  
+
+  @Test
   public void testRMAndTimeoutSetAndQueryTimesoutInsteadOnServer() throws Exception {
     //verify that timeout is set correctly and cancel query 
     doCriticalMemoryHitTestOnServer("portfolios", false, 85/*crit threshold*/, true, TEST_QUERY_TIMEOUT, false);
   }
-  
+
+  @Test
   public void testRMButDisabledQueryMonitorForLowMemAndTimeoutSetOnServer()  throws Exception {
     //verify that timeout is still working properly
     doCriticalMemoryHitTestOnServer("portfolios", false, 85/*crit threshold*/, true, TEST_QUERY_TIMEOUT, true);
   }
-  
+
+  @Test
   public void testPRGatherCancellation() throws Exception {
     doCriticalMemoryHitTestWithMultipleServers("portfolios", true, 85/*crit threshold*/, false, -1, true);
   }
 
+  @Test
   public void testPRGatherCancellationWhileGatheringResults() throws Exception {
     doCriticalMemoryHitDuringGatherTestWithMultipleServers("portfolios", true, 85/*crit threshold*/, false, -1, true);
   }
-  
+
+  @Test
   public void testPRGatherCancellationWhileAddingResults() throws Exception {
     doCriticalMemoryHitAddResultsTestWithMultipleServers("portfolios", true, 85/*crit threshold*/, false, -1, true);
   }
-  
+
+  @Test
   public void testIndexCreationCancellationPR() throws Exception {
     doCriticalMemoryHitWithIndexTest("portfolios", true, 85/*crit threshold*/, false, -1, true, "compact");
   }
-  
+
+  @Test
   public void testIndexCreationCancellation() throws Exception {
     doCriticalMemoryHitWithIndexTest("portfolios", false, 85/*crit threshold*/, false, -1, true, "compact");
   }
-  
+
+  @Test
   public void testIndexCreationNoCancellationPR() throws Exception {
     doCriticalMemoryHitWithIndexTest("portfolios", true, 85/*crit threshold*/, true, -1, true, "compact");
   }
-  
+
+  @Test
   public void testHashIndexCreationCancellationPR() throws Exception {
     doCriticalMemoryHitWithIndexTest("portfolios", true, 85/*crit threshold*/, false, -1, true, "hash");
   }
-  
+
+  @Test
   public void testHashIndexCreationCancellation() throws Exception {
     //need to add hook to canceled result set and very it is triggered for multiple servers
     doCriticalMemoryHitWithIndexTest("portfolios", false, 85/*crit threshold*/, false, -1, true, "hash");
   }
-  
+
+  @Test
   public void testHashIndexCreationNoCancellationPR() throws Exception {
     //need to add hook to canceled result set and very it is triggered for multiple servers
     doCriticalMemoryHitWithIndexTest("portfolios", true, 85/*crit threshold*/, true, -1, true, "hash");
@@ -1064,7 +1117,7 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
       if (spot == 1) {
         try {
           if (!latch.await(8, TimeUnit.SECONDS)) {
-            throw new TestException("query was never unlatched");
+            fail("query was never unlatched");
           }
         } catch (InterruptedException e) {
           e.printStackTrace();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/ConstantsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/ConstantsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/ConstantsJUnitTest.java
index d1ecff6..b437734 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/ConstantsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/ConstantsJUnitTest.java
@@ -22,12 +22,7 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.query.CacheUtils;
-import com.gemstone.gemfire.cache.query.Query;
-import com.gemstone.gemfire.cache.query.QueryService;
-import com.gemstone.gemfire.cache.query.data.Portfolio;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import static org.junit.Assert.*;
 
 import java.util.Collection;
 
@@ -36,19 +31,15 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import junit.framework.*;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.query.CacheUtils;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.data.Portfolio;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class ConstantsJUnitTest {
   
-  public ConstantsJUnitTest() {
-  }
-  
   @Before
   public void setUp() throws java.lang.Exception {
     CacheUtils.startCache();


[50/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
index f10d96b..b63b6ec 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsQueryAndFEJUnitTest.java
@@ -16,33 +16,62 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.distributed.ServerLauncher;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.GemFireVersion;
-import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.management.internal.AgentUtil;
-import com.gemstone.gemfire.management.internal.ManagementConstants;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.TestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.springframework.http.*;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.util.StringUtils;
 import org.springframework.web.client.HttpClientErrorException;
 import org.springframework.web.client.HttpServerErrorException;
 
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheWriter;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.distributed.ServerLauncher;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.internal.GemFireVersion;
+import com.gemstone.gemfire.internal.SocketCreator;
+import com.gemstone.gemfire.management.internal.AgentUtil;
+import com.gemstone.gemfire.management.internal.ManagementConstants;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
-public class RestAPIsQueryAndFEJUnitTest extends TestCase {
+public class RestAPIsQueryAndFEJUnitTest {
 
   private Cache c;
 
@@ -54,9 +83,6 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
   
   private final String CUSTOMER_REGION = "customers";
   
-  //DEBUG code
-  //private final String PEOPLE_REGION = "People";
-  
   private final String ITEM_REGION = "items";
   private final String ORDER_REGION = "orders";
   private final String PRIMITIVE_KV_STORE_REGION = "primitiveKVStore";
@@ -1252,9 +1278,9 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
       return baseURL + RestTestUtils.GEMFIRE_REST_API_CONTEXT + RestTestUtils.GEMFIRE_REST_API_VERSION + requestPart;
     }
   }
+
   public void initializeQueryTestData() {
-    
-    //LIST_ALL_NAMED_QUERY 
+    //LIST_ALL_NAMED_QUERY
     int size = PARAMETERIZED_QUERIES.length;
     List<String> queryIds = new ArrayList<>();
     for (int i=0; i < size; i++ ){
@@ -1293,10 +1319,8 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
     queryResultByIndex.put(48, qIndex48_resultData);
   }
   
-  @Override
-  @SuppressWarnings("deprecation")
+  @Before
   public void setUp() throws Exception {
-    
     AgentUtil agentUtil = new AgentUtil(GemFireVersion.getGemFireVersion());
     if (agentUtil.findWarLocation("geode-web-api") == null) {
       fail("unable to locate geode-web-api WAR file");
@@ -1329,33 +1353,6 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
     this.baseURL = "http://" + this.hostName + ":" + this.restServicePort;
     this.c = CacheFactory.getAnyInstance();
     
-    /*
-    //Debug code
-    this.baseURL = "http://" + "localhost" + ":" + "8080";
-   
-    this.c = (GemFireCacheImpl) new CacheFactory().set("mcast-port", "0")
-        .set("rest-service-http-port", String.valueOf(this.restServicePort))
-        .set("rest-service-bind-address", this.hostName)
-        //.set("log-file", "./restJunitLogs/my.log")
-        .setPdxReadSerialized(true).create();
-    */
-    
-    /*
-    this.c = (GemFireCacheImpl) new CacheFactory().set("mcast-port", "0")
-        .set("rest-service-http-port", "8080")
-        .set("rest-service-bind-address", "localhost")
-        //.set("log-file", "./restJunitLogs/my.log")
-        .setPdxReadSerialized(true).create();
-    */
-    
-    //start cache-server, Gemfire cache clients will connect it
-    /*
-    BridgeServer server = c.addCacheServer();
-    final int serverPort = 40405;
-    server.setPort(serverPort);
-    server.start();
-    */
-    
     final AttributesFactory<String, String> attributesFactory = new AttributesFactory<>();
     attributesFactory.setDataPolicy(DataPolicy.REPLICATE);
 
@@ -1364,9 +1361,6 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
         .create();
     c.createRegion(CUSTOMER_REGION, regionAttributes);
     
-    //Debug code
-    //c.createRegion(PEOPLE_REGION, regionAttributes);
-    
     // Create region, items
     attributesFactory.setDataPolicy(DataPolicy.PARTITION);
     c.createRegion(ITEM_REGION, regionAttributes);
@@ -1399,10 +1393,9 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
     FunctionService.registerFunction(new AddFreeItemToOrders());
   }
 
-  @Override
+  @After
   public void tearDown() {
     // shutdown and clean up the manager node.
-    //this.c.close();
     ServerLauncher.getInstance().stop();
   }
   
@@ -1416,24 +1409,27 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
     return headers;
   }
 
- 
+  @Test
   public void testCreateAsJson() { 
     executeQueryTestCases();
   }
-    
+
+  private void caught(String message, Throwable cause) {
+    throw new AssertionError(message, cause);
+  }
+
   private void validateGetAllResult(int index, ResponseEntity<String> result){
-    if(index == 27  || index == 29  || index == 30) {
+    if (index == 27  || index == 29  || index == 30) {
       try {
         new JSONObject(result.getBody()).getJSONArray("customers");
       } catch (JSONException e) {
-        fail("Caught JSONException in validateGetAllResult :: " + e.getMessage());
+        caught("Caught JSONException in validateGetAllResult :: " + e.getMessage(), e);
       }
     }
   }
   
   private void verifyRegionSize(int index, ResponseEntity<String> result) {
-    
-    if(index == 59 ) {
+    if (index == 59 ) {
       HttpHeaders headers = result.getHeaders();
       String value = headers.getFirst("Resource-Count");
       assertEquals(Integer.parseInt(value), 55);
@@ -1441,8 +1437,7 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
   }
   
   private void validateQueryResult(int index, ResponseEntity<String> result){
-    
-    if(Query_URL_INDEXS.contains(index)) {
+    if (Query_URL_INDEXS.contains(index)) {
       queryResultByIndex = new HashMap<>();
       initializeQueryTestData();  
       QueryResultData queryResult =  queryResultByIndex.get(index);   
@@ -1458,7 +1453,7 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
             assertTrue("PREPARE_PARAMETERIZED_QUERY: function IDs are not matched", queryResult.getResult().contains(jsonArray.getJSONObject(i).getString("id")));
           }
         } catch (JSONException e) {
-          fail("Caught JSONException in validateQueryResult :: " + e.getMessage());
+          caught("Caught JSONException in validateQueryResult :: " + e.getMessage(), e);
         }
       }
       else if (index == 46 || index == 47 || index == 48) {
@@ -1469,16 +1464,13 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
           //verify query result size
           assertEquals(queryResult.getResultSize(), jsonArray.length());
         } catch (JSONException e) {
-          fail("Caught JSONException in validateQueryResult :: " + e.getMessage());
+          caught("Caught JSONException in validateQueryResult :: " + e.getMessage(), e);
         }
-        
       }
-        
     }
   }
   
   private String addExpectedException (int index) {
-  
     String expectedEx =  "appears to have started a thread named";
     if (index == 4 || index == 5 || index == 24) {
       expectedEx = "java.lang.UnsupportedOperationException";
@@ -1492,118 +1484,110 @@ public class RestAPIsQueryAndFEJUnitTest extends TestCase {
       expectedEx = "com.gemstone.gemfire.cache.CacheWriterException";
       c.getLogger().info("<ExpectedException action=add>" + expectedEx + "</ExpectedException>");
       return expectedEx;
-    }else if (index == 19) {
+    } else if (index == 19) {
       expectedEx = "java.lang.IllegalArgumentException";
       c.getLogger().info("<ExpectedException action=add>" + expectedEx + "</ExpectedException>");
       return expectedEx;
-    }else if (index == 38 || index == 41 ) {
+    } else if (index == 38 || index == 41 ) {
       expectedEx = "com.gemstone.gemfire.cache.RegionDestroyedException";
       c.getLogger().info("<ExpectedException action=add>" + expectedEx + "</ExpectedException>");
       return expectedEx;
     }
     
     return expectedEx;
-    
   }
-  private void executeQueryTestCases() {
 
+  private void executeQueryTestCases() {
     HttpHeaders headers = setAcceptAndContentTypeHeaders();
     HttpEntity<Object> entity;
     
     int totalRequests = TEST_DATA.length;
     String expectedEx = null;
       
-      for (int index=0; index < totalRequests; index++) { 
-      //Debug code
-      /*
-      c.getLogger().info("-------------------------------");
-      c.getLogger().info("Index:" + index+ " " +  TEST_DATA[index][METHOD_INDEX] + " " + TEST_DATA[index][URL_INDEX]);
-                 
-       if(index == 50){
-         System.out.println("Debug Here...!!");
-       }
-       */
-       try {    
-          expectedEx = addExpectedException(index);
-          final String restRequestUrl = createRestURL(this.baseURL, TEST_DATA[index][URL_INDEX]);  
-          
-          entity = new HttpEntity<>(TEST_DATA[index][REQUEST_BODY_INDEX], headers);
-          ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange(
-              restRequestUrl,
-              (HttpMethod)TEST_DATA[index][METHOD_INDEX], entity, String.class);
-        
-          validateGetAllResult(index, result);
-          validateQueryResult(index, result);
-          
-          assertEquals(result.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
-          assertEquals(result.hasBody(), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
-          
-          verifyRegionSize(index, result);
-          //TODO:
-          //verify location header
-          
-        } catch (HttpClientErrorException e) {
-          
-          if( VALID_409_URL_INDEXS.contains(index)) { 
-            //create-409, conflict testcase. [create on already existing key]
-            
-            assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
-            assertEquals(StringUtils.hasText(e.getResponseBodyAsString()),((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
-            
-          }else if (VALID_400_URL_INDEXS.contains(index)) { 
-            // 400, Bad Request testcases. [create with malformed Json]
-            
-            assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
-            assertEquals(StringUtils.hasText(e.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
-            
-          }
-          else if(VALID_404_URL_INDEXS.contains(index) ) { 
-            // create-404, Not Found testcase. [create on not-existing region]
-            
-            assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
-            assertEquals(StringUtils.hasText(e.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
-           
-          }
-          else if(VALID_405_URL_INDEXS.contains(index) ) { 
-            // create-404, Not Found testcase. [create on not-existing region]
-            
-            assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
-            assertEquals(StringUtils.hasText(e.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
-          }
-          else {
-          fail( "Index:" + index+ " " +  TEST_DATA[index][METHOD_INDEX] + " " + TEST_DATA[index][URL_INDEX] + " should not have thrown exception ");
-          }
-          
-        }catch (HttpServerErrorException se) { 
-          //index=4, create- 500, INTERNAL_SERVER_ERROR testcase. [create on Region with DataPolicy=Empty set]
-          //index=7, create- 500, INTERNAL_SERVER_ERROR testcase. [Get, attached cache loader throws Timeout exception]
-          //index=11, put- 500, [While doing R.put, CacheWriter.beforeCreate() has thrown CacheWriterException]
-          //.... and more test cases
-          assertEquals(se.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
-          assertEquals(StringUtils.hasText(se.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
-          
+    for (int index=0; index < totalRequests; index++) {
+      try {
+        expectedEx = addExpectedException(index);
+        final String restRequestUrl = createRestURL(this.baseURL, TEST_DATA[index][URL_INDEX]);
+
+        entity = new HttpEntity<>(TEST_DATA[index][REQUEST_BODY_INDEX], headers);
+        ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange(
+            restRequestUrl,
+            (HttpMethod)TEST_DATA[index][METHOD_INDEX], entity, String.class);
+
+        validateGetAllResult(index, result);
+        validateQueryResult(index, result);
+
+        assertEquals(result.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
+        assertEquals(result.hasBody(), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
+
+        verifyRegionSize(index, result);
+        //TODO:
+        //verify location header
+
+      } catch (HttpClientErrorException e) {
+
+        if( VALID_409_URL_INDEXS.contains(index)) {
+          //create-409, conflict testcase. [create on already existing key]
+
+          assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
+          assertEquals(StringUtils.hasText(e.getResponseBodyAsString()),((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
+
+        }else if (VALID_400_URL_INDEXS.contains(index)) {
+          // 400, Bad Request testcases. [create with malformed Json]
+
+          assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
+          assertEquals(StringUtils.hasText(e.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
+
         }
-        catch (Exception e) {
-          throw new RuntimeException("caught Exception in executeQueryTestCases " + "Index:" + index+ " " +  TEST_DATA[index][METHOD_INDEX] + " " + TEST_DATA[index][URL_INDEX] + " :: Unexpected ERROR...!!", e);
-        }finally {
-          c.getLogger().info("<ExpectedException action=remove>" + expectedEx + "</ExpectedException>");
+        else if (VALID_404_URL_INDEXS.contains(index) ) {
+          // create-404, Not Found testcase. [create on not-existing region]
+
+          assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
+          assertEquals(StringUtils.hasText(e.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
+
         }
-        
-      } 
-    
+        else if (VALID_405_URL_INDEXS.contains(index) ) {
+          // create-404, Not Found testcase. [create on not-existing region]
+
+          assertEquals(e.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
+          assertEquals(StringUtils.hasText(e.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
+        }
+        else {
+        fail( "Index:" + index+ " " +  TEST_DATA[index][METHOD_INDEX] + " " + TEST_DATA[index][URL_INDEX] + " should not have thrown exception ");
+        }
+
+      } catch (HttpServerErrorException se) {
+        //index=4, create- 500, INTERNAL_SERVER_ERROR testcase. [create on Region with DataPolicy=Empty set]
+        //index=7, create- 500, INTERNAL_SERVER_ERROR testcase. [Get, attached cache loader throws Timeout exception]
+        //index=11, put- 500, [While doing R.put, CacheWriter.beforeCreate() has thrown CacheWriterException]
+        //.... and more test cases
+        assertEquals(se.getStatusCode(), TEST_DATA[index][STATUS_CODE_INDEX]);
+        assertEquals(StringUtils.hasText(se.getResponseBodyAsString()), ((Boolean)TEST_DATA[index][RESPONSE_HAS_BODY_INDEX]).booleanValue());
+
+      }
+      catch (Exception e) {
+        caught("caught Exception in executeQueryTestCases " + "Index:" + index+ " " +  TEST_DATA[index][METHOD_INDEX] + " " + TEST_DATA[index][URL_INDEX] + " :: Unexpected ERROR...!!", e);
+      } finally {
+        c.getLogger().info("<ExpectedException action=remove>" + expectedEx + "</ExpectedException>");
+      }
+    }
   }
-  
 }
 
+// TODO: move following classes to be inner classes
+
 class SimpleCacheLoader implements CacheLoader<String, Object>, Declarable {
 	  
+  @Override
   public Object load(LoaderHelper helper) {
     //throws TimeoutException  
     throw new TimeoutException("Could not load, Request Timedout...!!");
   }
-  public void close() {  
-  
+
+  @Override
+  public void close() {
   }
+
   @Override
   public void init(Properties props) {
     
@@ -1613,10 +1597,12 @@ class SimpleCacheLoader implements CacheLoader<String, Object>, Declarable {
 class SampleCacheWriter  implements CacheWriter<String, Object> {
 
   @Override
-  public void close() { }
+  public void close() {
+  }
 
   @Override
-  public void beforeUpdate(EntryEvent event) throws CacheWriterException { }
+  public void beforeUpdate(EntryEvent event) throws CacheWriterException {
+  }
 
   @Override
   public void beforeCreate(EntryEvent event) throws CacheWriterException {
@@ -1629,16 +1615,18 @@ class SampleCacheWriter  implements CacheWriter<String, Object> {
   }
 
   @Override
-  public void beforeRegionDestroy(RegionEvent event) throws CacheWriterException { }
+  public void beforeRegionDestroy(RegionEvent event) throws CacheWriterException {
+  }
 
   @Override
-  public void beforeRegionClear(RegionEvent event) throws CacheWriterException { } 
+  public void beforeRegionClear(RegionEvent event) throws CacheWriterException {
+  }
 }
 
 enum QueryType {LIST_ALL_NAMED_QUERY, EXECUTE_NAMED_QUERY, EXECUTE_ADHOC_QUERY }
 
-class QueryResultData
-{
+class QueryResultData {
+
   private int queryIndex;
   private QueryType type; 
   private int resultSize;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index e82d198..e6b16d0 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
+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.*;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
@@ -58,6 +67,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * 
  * @since GemFire 8.0
  */
+@Category(DistributedTest.class)
 public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
 
   private static final long serialVersionUID = -254776154266339226L;
@@ -66,8 +76,8 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
 
   private File jks;
 
-  public RestAPIsWithSSLDUnitTest(String name) {
-    super(name);
+  public RestAPIsWithSSLDUnitTest() {
+    super();
     this.jks = findTrustedJKS();
   }
 
@@ -401,6 +411,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
 
   // Actual Tests starts here.
 
+  @Test
   public void testSimpleSSL() throws Exception {
 
     Properties props = new Properties();
@@ -412,6 +423,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "SSL");
   }
 
+  @Test
   public void testSSLWithoutKeyStoreType() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -422,6 +434,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "SSL");
   }
 
+  @Test
   public void testSSLWithSSLProtocol() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -433,6 +446,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "SSL");
   }
 
+  @Test
   public void testSSLWithTLSProtocol() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -444,6 +458,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "TLS");
   }
 
+  @Test
   public void testSSLWithTLSv11Protocol() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -455,6 +470,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "TLSv1.1");
   }
 
+  @Test
   public void testSSLWithTLSv12Protocol() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -466,6 +482,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "TLSv1.2");
   }
 
+  @Test
   public void testWithMultipleProtocol() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -477,6 +494,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "TLSv1.2");
   }
 
+  @Test
   public void testSSLWithCipherSuite() throws Exception {
     System.setProperty("javax.net.debug", "ssl");
     Properties props = new Properties();
@@ -496,6 +514,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "TLSv1.2");
   }
 
+  @Test
   public void testSSLWithMultipleCipherSuite() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");
@@ -514,6 +533,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     validateConnection(restEndpoint, "TLSv1.2");
   }
 
+  @Test
   public void testMutualAuthentication() throws Exception {
     Properties props = new Properties();
     props.setProperty(HTTP_SERVICE_SSL_ENABLED, "true");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/JUnitTestSetup.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/JUnitTestSetup.java b/geode-core/src/test/java/com/gemstone/gemfire/JUnitTestSetup.java
deleted file mode 100644
index deba960..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/JUnitTestSetup.java
+++ /dev/null
@@ -1,143 +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;
-
-import junit.extensions.TestDecorator;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.framework.TestResult;
-import java.util.ArrayList;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-
-/*
- * This class is a decorator for junit.framework.Test to enable class wide setUp() and tearDown() 
- * In order to use this decorator, the Testcase must contain this code:
- * <code>
- * public static Test suite() {
- *   return JUnitTestSetup.createJUnitTestSetup(ExampleTestCase.class);
- * }
- * </code>
- * If a class being added to this suite has any static methods like this
- * <code>static void caseSetUp()</code>
- * then it will be called once for that test case before any of its test methods are invoked.
- * If a class being added to this suite has any static methods like this
- * <code>static void caseTearDown()</code>
- * then it will be called once for that test case after all of its test methods are invoked.
- * For both of these <em>case</em> methods the subclass one is called first
- * followed by any found in the parent classes.
- *
- * @see Test
- * @deprecated use @BeforeClass and @AfterClass instead
- */
-public class JUnitTestSetup extends TestDecorator {
-
-   /**   * List of Method instances to call once on a testCase before any of its test methods
-   */
-  private ArrayList fCaseSetUp = null;
-  /**
-   * List of Method instances to call once on a testCase after all of its test methods
-   */
-  private ArrayList fCaseTearDown = null;
-
-   /**
-   * Find a static method on the specified class with the specified name
-   * and puts it in the specified list
-   * given class
-   */
-  private void findCaseMethod(Class c, String methName, ArrayList l) {
-    Method m = null;
-    try {
-      m = c.getDeclaredMethod(methName, new Class[]{});
-      if (!Modifier.isStatic(m.getModifiers())) {
-        m = null;
-      }
-    } catch (NoSuchMethodException ex) {
-    }
-    if (m != null) {
-      l.add(m);
-    }
-  }
-
-  /*
-   * Factory method to use this Junit TestDecorator
-   * @params theClass this is the test you want to decorate
-   */
-  public static Test createJUnitTestSetup(final Class theClass) {
-    TestSuite ts = new TestSuite();
-    ts.addTestSuite(theClass);
-    return new JUnitTestSetup(ts, theClass);
-  }
-
-  public JUnitTestSetup(Test ts, Class theClass) {
-    super(ts);
-    Class superClass = theClass;
-    ArrayList caseSetUp = new ArrayList();
-    ArrayList caseTearDown = new ArrayList();
-    while (Test.class.isAssignableFrom(superClass)) { 
-//      Method[] methods= superClass.getDeclaredMethods();
-      //for (int i= 0; i < methods.length; i++) {
-      //  addTestMethod(methods[i], names, theClass);
-      //} 
-      findCaseMethod(superClass, "caseSetUp", caseSetUp);       
-      findCaseMethod(superClass, "caseTearDown", caseTearDown);  
-      superClass= superClass.getSuperclass();
-      if (this.countTestCases() != 0) {
-        if (caseSetUp.size() > 0) {
-          fCaseSetUp = caseSetUp;
-        }
-        if (caseTearDown.size() > 0) {
-          fCaseTearDown = caseTearDown;
-        }
-      }
-    }
-  }
-
-  public void run(TestResult result) {
-    try {
-      callCaseMethods(fCaseSetUp, result);    
-      basicRun(result);
-      //getTest().run(result);
-      //for (Enumeration e= tests(); e.hasMoreElements(); ) {
-      //  if (result.shouldStop() )
-      //    break;
-      //    Test test= (Test)e.nextElement();
-      //    test.run(result);
-      //  }
-    } finally {
-      callCaseMethods(fCaseTearDown, result);
-    }
-  }
-  
-  /**
-   * Used to invoke a caseSetUp method once, if one exists,
-   * before all the test methods have been invoked
-   */
-  private void callCaseMethods(ArrayList l, TestResult result) {
-    if (l != null) {
-      for (int i=0; i < l.size(); i++) {
-        try {
-          Method m = (Method)l.get(i);
-          m.invoke(null, new Object[]{});
-        } catch (Exception ex) {
-          result.addError(this, ex);
-        }
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/TestDataSerializer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/TestDataSerializer.java b/geode-core/src/test/java/com/gemstone/gemfire/TestDataSerializer.java
index 1eba6ca..5f1ee1f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/TestDataSerializer.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/TestDataSerializer.java
@@ -23,8 +23,6 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import util.TestException;
-
 import com.gemstone.gemfire.internal.cache.tier.sockets.DataSerializerPropogationDUnitTest;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/TimingTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/TimingTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/TimingTestCase.java
deleted file mode 100644
index 00d268c..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/TimingTestCase.java
+++ /dev/null
@@ -1,77 +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;
-
-import junit.framework.TestCase;
-
-/**
- * TimingTestCase provides a nanosecond timing framework.  Extend
- * this class instead of TestCase to implement GemFire timing tests.
- */
-public abstract class TimingTestCase extends TestCase {
-
-    static private long nanosPerMilli = 1000000;
-
-    public TimingTestCase(String name) {
-        super(name);
-    }
-
-    /**
-     * backward compatibility
-     */
-    protected void time(String opDescription, int numPasses, int opsPerPass, final Runnable runnable) {
-      try {
-        time(opDescription, numPasses, opsPerPass, new RunBlock() {
-          public void run() {
-            runnable.run();
-          }});
-      } catch (Exception ex) {
-        ex.printStackTrace();
-        fail(ex.toString());
-      }
-    }
-
-    /**
-     * Invoke the Runnable numPasses times, then compute and display
-     * the duration of each operation in nanoseconds.
-     * @param opDescription a short description of the operation being timed
-     * @param numPasses the number of times to run runnable
-     * @param opsPerPass the number of operations occurring in each execution
-     *      of runnable.  This is used to compute the time of each operation -
-     *      invoking this method will execute the operation numPasses * opsPerPass
-     *      times.
-     * @param runnable contains the code to execute in the run() method
-     */
-    protected void time(String opDescription, int numPasses, int opsPerPass, RunBlock runnable) 
-    throws Exception {
-
-        // Measure elapsed time to invoke runnable numPasses times
-        long start = System.currentTimeMillis();
-        for (int pass=numPasses; pass > 0; pass--) {
-            runnable.run();
-        }
-        long elapsed = System.currentTimeMillis() - start;
-
-        // Compute time per operationS
-        long nanosPerOp = (long)((float)(elapsed * nanosPerMilli) / (float)(opsPerPass * numPasses));
-        System.out.println("Timing " + opDescription + ": " + nanosPerOp + " nanoseconds per operation");
-    }
-    
-    public static interface RunBlock {
-      public void run() throws Exception;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
index 34f6bbb..ce43f70 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
@@ -16,23 +16,33 @@
  */
 package com.gemstone.gemfire.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 /**
  * verifies the count of clear operation
- *  
  */
-public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class CacheRegionClearStatsDUnitTest extends JUnit4DistributedTestCase {
+
   /** the cache */
   private static GemFireCacheImpl cache = null;
 
@@ -53,11 +63,6 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
   
   private static final int clearOp = 2;
   
-  /** constructor */
-  public CacheRegionClearStatsDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -76,11 +81,11 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
 
   public static void createClientCache(String host, Integer port1)
       throws Exception {
-    new CacheRegionClearStatsDUnitTest("temp");
+    new CacheRegionClearStatsDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new CacheRegionClearStatsDUnitTest("temp").createCache(props);
+    new CacheRegionClearStatsDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host,
         port1.intValue()).setSubscriptionEnabled(false)
         .setThreadLocalConnections(true).setMinConnections(1).setReadTimeout(
@@ -101,7 +106,7 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
   }
 
   private static Integer createCache(DataPolicy dataPolicy) throws Exception {
-    new CacheRegionClearStatsDUnitTest("temp").createCache(new Properties());
+    new CacheRegionClearStatsDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(dataPolicy);
@@ -121,11 +126,11 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
 
   public static void createClientCacheDisk(String host, Integer port1)
       throws Exception {
-    new CacheRegionClearStatsDUnitTest("temp");
+    new CacheRegionClearStatsDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new CacheRegionClearStatsDUnitTest("temp").createCache(props);
+    new CacheRegionClearStatsDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host,
         port1.intValue()).setSubscriptionEnabled(false)
         .setThreadLocalConnections(true).setMinConnections(1).setReadTimeout(
@@ -140,10 +145,12 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
     Region region = cache.createRegion(REGION_NAME, attrs);
     //region.registerInterest("ALL_KEYS");
   }
+
   /**
    * This test does the following (<b> clear stats counter </b>):<br>
    * 1)Verifies that clear operation count matches with stats count<br>
    */
+  @Test
   public void testClearStatsWithNormalRegion(){
     Integer port1 = ((Integer)server1.invoke(() -> CacheRegionClearStatsDUnitTest.createServerCache()));
 
@@ -161,10 +168,12 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
     
     server1.invoke(() -> CacheRegionClearStatsDUnitTest.validationClearStat());
   }
+
   /**
    * This test does the following (<b> clear stats counter when disk involved </b>):<br>
    * 1)Verifies that clear operation count matches with stats count <br>
    */
+  @Test
   public void testClearStatsWithDiskRegion(){
     Integer port1 = ((Integer)server1.invoke(() -> CacheRegionClearStatsDUnitTest.createServerCacheDisk()));
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
index 0932ff1..bbde730 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
@@ -15,6 +15,15 @@
  * limitations under the License.
  */
 package com.gemstone.gemfire.cache;
+
+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.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
@@ -32,10 +41,11 @@ import java.util.Properties;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
 
-public class ClientServerTimeSyncDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClientServerTimeSyncDUnitTest extends JUnit4CacheTestCase {
 
-  public ClientServerTimeSyncDUnitTest(String name) {
-    super(name);
+  public ClientServerTimeSyncDUnitTest() {
+    super();
   }
 
   @Ignore("Bug 52327")
@@ -111,6 +121,7 @@ public class ClientServerTimeSyncDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testNothing() {
     // place-holder to keep dunit runner from barfing
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
index 412d3ed..f414621 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
@@ -16,42 +16,40 @@
  */
 package com.gemstone.gemfire.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.Assert;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This tests cases where we have both 
  * a connection pool and a bridge loader.
- *
  */
-public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConnectionPoolAndLoaderDUnitTest extends JUnit4CacheTestCase {
   
   private static int bridgeServerPort;
-  protected boolean useLocator;
+  private boolean useLocator;
 
-  public ConnectionPoolAndLoaderDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void preTearDownCacheTestCase() {
-    //TODO grid. This is a hack. The next dunit test to run after
-    //this one is the ConnectionPoolAutoDUnit test. That ends up calling
-    //getSystem() with no arguments and expects to get a system without
-    //a locator. But getSystem() is broken in that it only compares the 
-    //passed in properties (an empty list) with the  current properties.
     disconnectAllFromDS();
   }
   
@@ -62,9 +60,9 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
    * load from loader.
    * 
    * Anything that is loaded on the client is put on the server..
-   * 
    */
-  public void testPoolAndLoader() {
+  @Test
+  public void testPoolAndLoader() throws Exception {
     final String regionName = this.getName();
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -107,18 +105,18 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
         Region region = getRootRegion(regionName);
         region.put("a", "put-a");
         region.put("b", "put-b");
-        Assert.assertEquals("loaded-c", region.get("c"));
-        Assert.assertEquals("loaded-d", region.get("d"));
+        assertEquals("loaded-c", region.get("c"));
+        assertEquals("loaded-d", region.get("d"));
       }
     });
     
     server.invoke(new SerializableRunnable() {
       public void run() {
         Region region = getRootRegion(regionName);
-        Assert.assertEquals("put-a", region.get("a"));
-        Assert.assertEquals("put-b", region.get("b"));
-        Assert.assertEquals("loaded-c", region.get("c"));
-        Assert.assertEquals("loaded-d", region.get("d"));
+        assertEquals("put-a", region.get("a"));
+        assertEquals("put-b", region.get("b"));
+        assertEquals("loaded-c", region.get("c"));
+        assertEquals("loaded-d", region.get("d"));
         region.put("e", "server-e");
       }
     });
@@ -126,11 +124,11 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
     client.invoke(new SerializableRunnable() {
       public void run() {
         Region region = getRootRegion(regionName);
-        Assert.assertEquals("put-a", region.get("a"));
-        Assert.assertEquals("put-b", region.get("b"));
-        Assert.assertEquals("loaded-c", region.get("c"));
-        Assert.assertEquals("loaded-d", region.get("d"));
-        Assert.assertEquals("server-e", region.get("e"));
+        assertEquals("put-a", region.get("a"));
+        assertEquals("put-b", region.get("b"));
+        assertEquals("loaded-c", region.get("c"));
+        assertEquals("loaded-d", region.get("d"));
+        assertEquals("server-e", region.get("e"));
       }
     });
   }
@@ -143,7 +141,8 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
    * local writer
    * put on server
    */
-  public void testPoolAndWriter() {
+  @Test
+  public void testPoolAndWriter() throws Exception {
     final String regionName = this.getName();
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -194,31 +193,31 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
           region.put("a", "new-a");
           fail("Should have gotten a cache writer exception");
         } catch(CacheWriterException e) {
-          Assert.assertEquals("beforeUpdate", e.getMessage());
+          assertEquals("beforeUpdate", e.getMessage());
         }
         try {
           region.destroy("b");
           fail("Should have gotten a cache writer exception");
         } catch(CacheWriterException e) {
-          Assert.assertEquals("beforeDestroy", e.getMessage());
+          assertEquals("beforeDestroy", e.getMessage());
         }
         try {
           region.put("d", "d");
           fail("Should have gotten a cache writer exception");
         } catch(CacheWriterException e) {
-          Assert.assertEquals("beforeCreate", e.getMessage());
+          assertEquals("beforeCreate", e.getMessage());
         }
         try {
           region.clear();
           fail("Should have gotten a cache writer exception");
         } catch(CacheWriterException e) {
-          Assert.assertEquals("beforeRegionClear", e.getMessage());
+          assertEquals("beforeRegionClear", e.getMessage());
         }
         try {
           region.destroyRegion();
           fail("Should have gotten a cache writer exception");
         } catch(CacheWriterException e) {
-          Assert.assertEquals("beforeRegionDestroy", e.getMessage());
+          assertEquals("beforeRegionDestroy", e.getMessage());
         }
       }
     });
@@ -226,10 +225,10 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
     server.invoke(new SerializableRunnable() {
       public void run() {
         Region region = getRootRegion(regionName);
-        Assert.assertEquals("a", region.get("a"));
-        Assert.assertEquals("b", region.get("b"));
-        Assert.assertEquals(null, region.get("c"));
-        Assert.assertEquals(null, region.get("d"));
+        assertEquals("a", region.get("a"));
+        assertEquals("b", region.get("b"));
+        assertEquals(null, region.get("c"));
+        assertEquals(null, region.get("d"));
       }
     });
   }
@@ -244,7 +243,8 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
    * 3 server
    * 4 loader
    */
-  public void testPoolLoadAndPeer() {
+  @Test
+  public void testPoolLoadAndPeer() throws Exception {
     final String regionName = this.getName();
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -264,11 +264,7 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
         return null;
       }
     });
-    
-    
-    
-    
-    
+
     SerializableCallable createClient1 = new SerializableCallable() {
       public Object call() {
         //Make sure we get a distributed system that has the locator
@@ -289,8 +285,7 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
       }
     };
     client1.invoke(createClient1);
-    
-    
+
     SerializableCallable createClient2 = new SerializableCallable() {
       public Object call() {
         //Make sure we get a distributed system that has the locator
@@ -311,8 +306,6 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
       }
     };
     client2.invoke(createClient2);
-    
-    
 
     //We need to test what happens when
     //we do a load in client1 in each of these cases:
@@ -325,7 +318,6 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
     // f                                         X                X               client1
     // g                                                          X               client2 (loader does a netSearch)
     // h                                                                           client1 loader
-    
 
     //Setup scenarios
     client1.invoke(new SerializableRunnable() {
@@ -341,9 +333,9 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
     client2.invoke(new SerializableRunnable() {
       public void run() {
         Region region = getRootRegion(regionName);
-        Assert.assertEquals("client1-c", region.get("c"));
+        assertEquals("client1-c", region.get("c"));
         region.put("d", "client2-d");
-        Assert.assertEquals("client1-f", region.get("f"));
+        assertEquals("client1-f", region.get("f"));
         region.put("g", "client2-g");
       }
     });
@@ -362,48 +354,47 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
     client1.invoke(new SerializableRunnable() {
       public void run() {
         Region region = getRootRegion(regionName);
-        Assert.assertEquals("server-a", region.get("a"));
-        Assert.assertEquals("client1-b", region.get("b"));
-        Assert.assertEquals("client1-c", region.get("c"));
-        Assert.assertEquals("client2-d", region.get("d"));
-        Assert.assertEquals("client1-e", region.get("e"));
-        Assert.assertEquals("client1-f", region.get("f"));
-        Assert.assertEquals("client2-g", region.get("g"));
-        Assert.assertEquals("loaded1-h", region.get("h"));
+        assertEquals("server-a", region.get("a"));
+        assertEquals("client1-b", region.get("b"));
+        assertEquals("client1-c", region.get("c"));
+        assertEquals("client2-d", region.get("d"));
+        assertEquals("client1-e", region.get("e"));
+        assertEquals("client1-f", region.get("f"));
+        assertEquals("client2-g", region.get("g"));
+        assertEquals("loaded1-h", region.get("h"));
       }
     });
     
     server.invoke(new SerializableRunnable() {
       public void run() {
         Region region = getRootRegion(regionName);
-        Assert.assertEquals("server-a", region.get("a"));
-        Assert.assertEquals("client1-b", region.get("b"));
-        Assert.assertEquals("client1-c", region.get("c"));
-        Assert.assertEquals("client2-d", region.get("d"));
-        Assert.assertEquals(null, region.get("e"));
-        Assert.assertEquals(null, region.get("f"));
+        assertEquals("server-a", region.get("a"));
+        assertEquals("client1-b", region.get("b"));
+        assertEquals("client1-c", region.get("c"));
+        assertEquals("client2-d", region.get("d"));
+        assertEquals(null, region.get("e"));
+        assertEquals(null, region.get("f"));
         
         //dsmith - This result seems somewhat suspect. client1 did a net load
         //which found a value in client2, but it never propagated that result
         //to the server. After talking with Darrel we decided to keep it this
         //way for now.
-        Assert.assertEquals(null, region.get("g"));
-        Assert.assertEquals("loaded1-h", region.get("h"));
+        assertEquals(null, region.get("g"));
+        assertEquals("loaded1-h", region.get("h"));
       }
     });
   }
   
-  protected void startBridgeServer(int port, boolean notifyBySubscription)
-  throws IOException {
-
-  Cache cache = getCache();
-  CacheServer bridge = cache.addCacheServer();
-  bridge.setPort(port);
-  bridge.setNotifyBySubscription(notifyBySubscription);
-  bridge.start();
-  bridgeServerPort = bridge.getPort();
-}
+  private void startBridgeServer(int port, boolean notifyBySubscription) throws IOException {
+    Cache cache = getCache();
+    CacheServer bridge = cache.addCacheServer();
+    bridge.setPort(port);
+    bridge.setNotifyBySubscription(notifyBySubscription);
+    bridge.start();
+    bridgeServerPort = bridge.getPort();
+  }
 
+  @Override
   public Properties getDistributedSystemProperties() {
     Properties p = new Properties();
     if(!useLocator) {
@@ -413,45 +404,49 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
     return p;
   }
   
-  public static class MyCacheWriter extends CacheWriterAdapter {
+  private static class MyCacheWriter extends CacheWriterAdapter {
+
     protected boolean throwException = false;
 
+    @Override
     public void beforeCreate(EntryEvent event) throws CacheWriterException {
-      if(throwException) {
+      if (throwException) {
         throw new CacheWriterException("beforeCreate");
       }
     }
 
+    @Override
     public void beforeDestroy(EntryEvent event) throws CacheWriterException {
-      if(throwException) {
+      if (throwException) {
         throw new CacheWriterException("beforeDestroy");
       }
     }
 
+    @Override
     public void beforeRegionClear(RegionEvent event)
         throws CacheWriterException {
-      if(throwException) {
+      if (throwException) {
         throw new CacheWriterException("beforeRegionClear");
       }
     }
 
+    @Override
     public void beforeRegionDestroy(RegionEvent event)
         throws CacheWriterException {
-      if(throwException) {
+      if (throwException) {
         throw new CacheWriterException("beforeRegionDestroy");
       }
     }
 
+    @Override
     public void beforeUpdate(EntryEvent event) throws CacheWriterException {
-      if(throwException) {
+      if (throwException) {
         throw new CacheWriterException("beforeUpdate");
       }
     }
-
-    
   }
   
-  public static class MyCacheLoader implements CacheLoader {
+  private static class MyCacheLoader implements CacheLoader {
     
     private String message;
 
@@ -459,6 +454,7 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
       this.message = message;
     }
 
+    @Override
     public Object load(LoaderHelper helper) throws CacheLoaderException {
       if(helper.getRegion().getAttributes().getScope().equals(Scope.DISTRIBUTED_ACK)) {
         System.err.println("Doing a net search for " + helper.getKey());
@@ -473,10 +469,8 @@ public class ConnectionPoolAndLoaderDUnitTest  extends CacheTestCase {
       return message + "-" + key;
     }
 
+    @Override
     public void close() {
     }
   }
-  
-  
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
index 3b43ab8..74c3037 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
@@ -19,17 +19,16 @@ package com.gemstone.gemfire.cache;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 import static org.junit.runners.MethodSorters.*;
 import org.junit.FixMethodOrder;
+import org.junit.experimental.categories.Category;
 
 @FixMethodOrder(NAME_ASCENDING)
+@Category(DistributedTest.class)
 public class ConnectionPoolAutoDUnitTest extends ConnectionPoolDUnitTest {
 
-  public ConnectionPoolAutoDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   protected final void postSetUpConnectionPoolDUnitTest() throws Exception {
     ClientServerTestCase.AUTO_LOAD_BALANCE = true;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
index b72734b..3ae6cf6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
@@ -16,7 +16,8 @@
  */
 package com.gemstone.gemfire.cache;
 
-import static org.junit.runners.MethodSorters.NAME_ASCENDING;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static org.junit.runners.MethodSorters.*;
 
 import java.io.IOException;
 import java.io.Serializable;
@@ -28,9 +29,9 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
-import junit.framework.AssertionFailedError;
-
 import org.junit.FixMethodOrder;
+import org.junit.Ignore;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.CancelException;
@@ -42,10 +43,9 @@ import com.gemstone.gemfire.cache.client.internal.Endpoint;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.cache30.TestCacheLoader;
 import com.gemstone.gemfire.cache30.TestCacheWriter;
 import com.gemstone.gemfire.distributed.DistributedMember;
@@ -62,7 +62,6 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.logging.InternalLogWriter;
 import com.gemstone.gemfire.internal.logging.LocalLogWriter;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
@@ -71,6 +70,8 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 /**
@@ -80,14 +81,13 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
  * (this happens in the controller VM). the client then spins up
  * 10 different threads and issues gets on keys. The server data loader returns the
  * data to the client.
+ *
  * Test uses Groboutils TestRunnable objects to achieve multi threading behavior
  * in the test.
- *
  */
+@Category(DistributedTest.class)
 @FixMethodOrder(NAME_ASCENDING)
-public class ConnectionPoolDUnitTest extends CacheTestCase {
-
-  private static final long serialVersionUID = 1L;
+public class ConnectionPoolDUnitTest extends JUnit4CacheTestCase {
 
   /** The port on which the bridge server was started in this VM */
   private static int bridgeServerPort;
@@ -104,10 +104,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
   protected final static int TYPE_INVALIDATE = 2;
   protected final static int TYPE_DESTROY = 3;
 
-  public ConnectionPoolDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     // avoid IllegalStateException from HandShake by connecting all vms to
@@ -149,9 +145,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     }
     return result;
   }
+
   protected static TestCacheWriter getTestWriter(Region r) {
     return (TestCacheWriter)r.getAttributes().getCacheWriter();
   }
+
   /**
    * Create a bridge server on the given port without starting it.
    *
@@ -242,8 +240,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     return ds;
   }
 
-  
-  
   /**
    * Returns region attributes for a <code>LOCAL</code> region
    */
@@ -337,9 +333,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     }
   }
 
-  
-
-
   /**
    * Create a fake EntryEvent that returns the provided region for {@link CacheEvent#getRegion()}
    * and returns {@link com.gemstone.gemfire.cache.Operation#LOCAL_LOAD_CREATE} for {@link CacheEvent#getOperation()}
@@ -402,6 +395,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
                  + " but endpoints=" + outOfBalanceReport(pool),
                  true, balanced(pool, expectedConsPerServer));
   }
+
   protected boolean balanced(PoolImpl pool, int expectedConsPerServer) {
     Iterator it = pool.getEndpointMap().values().iterator();
     while (it.hasNext()) {
@@ -465,6 +459,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
   /**
    * Tests that the callback argument is sent to the server
    */
+  @Test
   public void test001CallbackArg() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -564,6 +559,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    * Tests that consecutive puts have the callback assigned
    * appropriately.
    */
+  @Test
   public void test002CallbackArg2() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -657,13 +653,13 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-  
   /**
    * Tests for bug 36684 by having two bridge servers with cacheloaders that should always return
    * a value and one client connected to each server reading values. If the bug exists, the
    * clients will get null sometimes. 
    * @throws InterruptedException 
    */
+  @Test
   public void test003Bug36684() throws CacheException, InterruptedException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -756,11 +752,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
       com.gemstone.gemfire.test.dunit.Assert.fail("Error occured in vm3", inv3.getException());
     }
   }
-  
 
   /**
    * Test for client connection loss with CacheLoader Exception on the server.
    */
+  @Test
   public void test004ForCacheLoaderException() throws CacheException, InterruptedException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -854,7 +850,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     
   }
 
-
   protected void validateDS() {
     List l = InternalDistributedSystem.getExistingSystems();
     if (l.size() > 1) {
@@ -868,12 +863,12 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     assertEquals(1, l.size());
   }
   
-
   /**
    * Tests the basic operations of the {@link Pool}
    *
    * @since GemFire 3.5
    */
+  @Test
   public void test006Pool() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -981,13 +976,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
     });
   }
-  
-  
-    
-  
+
   /**
    * Tests the BridgeServer failover (bug 31832).
    */
+  @Test
   public void test007BridgeServerFailoverCnx1() throws CacheException {
     disconnectAllFromDS();
     basicTestBridgeServerFailover(1);
@@ -995,6 +988,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
   /**
    * Test BridgeServer failover with connectionsPerServer set to 0
    */
+  @Test
   public void test008BridgeServerFailoverCnx0() throws CacheException {
     basicTestBridgeServerFailover(0);
   }
@@ -1079,7 +1073,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
       });
 
-
     SerializableRunnable verify1Server =
       new CacheSerializableRunnable("verify1Server") {
         public void run2() throws CacheException {
@@ -1165,7 +1158,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("FIXME: this thread does not terminate"); // FIXME
 //    // Verify that no exception has occurred in the putter thread
-//    DistributedTestCase.join(putAI, 5 * 60 * 1000, getLogWriter());
+//    join(putAI, 5 * 60 * 1000, getLogWriter());
 //    //assertTrue("Exception occurred while invoking " + putAI, !putAI.exceptionOccurred());
 //    if (putAI.exceptionOccurred()) {
 //      fail("While putting entries: ", putAI.getException());
@@ -1182,13 +1175,13 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     // Stop the last cache server
     vm1.invoke(stopCacheServer);
   }
-  
 
   /**
    * Make sure cnx lifetime expiration working on thread local cnxs.
    * @author darrel
    */
   @Category(FlakyTest.class) // GEODE-1197: random ports, BindException, FixMethodOrder, expiration, time sensitive, waitForCriterion, async actions
+  @Test
   public void test009LifetimeExpireOnTL() throws CacheException {
     basicTestLifetimeExpire(true);
   }
@@ -1197,6 +1190,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    * Make sure cnx lifetime expiration working on thread local cnxs.
    * @author darrel
    */
+  @Test
   public void test010LifetimeExpireOnPoolCnx() throws CacheException {
     basicTestLifetimeExpire(false);
   }
@@ -1402,7 +1396,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
             };
             try {
               Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-            } catch (AssertionFailedError e) {
+            } catch (AssertionError e) {
 //              dumpStack();
               throw e;
             }
@@ -1473,6 +1467,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @since GemFire 3.5
    */
+  @Test
   public void test011PoolCreate() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -1555,6 +1550,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @since GemFire 3.5
    */
+  @Test
   public void test012PoolPut() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -1669,11 +1665,13 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
     });
   }
-    /**
+
+  /**
    * Tests the put operation of the {@link Pool}
    *
    * @since GemFire 3.5
    */
+  @Test
   public void test013PoolPutNoDeserialize() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -1794,6 +1792,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @since GemFire 3.5
    */
+  @Test
   public void test014InvalidateAndDestroyPropagation() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -1892,7 +1891,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
       });
 
-
     vm2.invoke(new CacheSerializableRunnable("Validate original and destroy") {
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(name);
@@ -1986,12 +1984,14 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
     });
   }
+
   /**
    * Tests that invalidates and destroys are propagated to {@link Pool}s
    * correctly to DataPolicy.EMPTY + InterestPolicy.ALL
    *
    * @since GemFire 5.0
    */
+  @Test
   public void test015InvalidateAndDestroyToEmptyAllPropagation() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -2106,7 +2106,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
       });
 
-
     vm2.invoke(new CacheSerializableRunnable("Validate original and destroy") {
           public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(name);
@@ -2222,6 +2221,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @since GemFire 5.0
    */
+  @Test
   public void test016InvalidateAndDestroyToEmptyCCPropagation() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -2391,10 +2391,10 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-
   /**
    * Tests interest key registration.
    */
+  @Test
   public void test017ExpireDestroyHasEntryInCallback() throws CacheException {
     disconnectAllFromDS();
     final String name = this.getName();
@@ -2561,10 +2561,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     return ret;
   }
 
-   /**
+  /**
    * Tests that updates are not sent to VMs that did not ask for
    * them.
    */
+  @Test
   public void test018OnlyRequestedUpdates() throws Exception {
     final String name1 = this.getName() + "-1";
     final String name2 = this.getName() + "-2";
@@ -2706,6 +2707,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
   /**
    * Tests interest key registration.
    */
+  @Test
   public void test019InterestKeyRegistration() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -2949,6 +2951,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
   /**
    * Tests interest list registration.
    */
+  @Test
   public void test020InterestListRegistration() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -3072,9 +3075,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-
-  
-
   protected class ConnectionPoolDUnitTestSerializable2 implements java.io.Serializable
   {
     protected ConnectionPoolDUnitTestSerializable2(String key)
@@ -3160,10 +3160,10 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 //          fail("interrupted");
 //        }
 //        catch(ServerConnectivityException sce) {
-//            DistributedTestCase.fail("While getting value for ACK region", sce);
+//            fail("While getting value for ACK region", sce);
 //        }
 //        catch(TimeoutException te) {
-//          DistributedTestCase.fail("While getting value for ACK region", te);
+//          fail("While getting value for ACK region", te);
 //        }
 //      }
 //      assertTrue(pi.getConnectedServerCount() >= 1);
@@ -3193,10 +3193,10 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 //          fail("interrupted");
 //        }
 //        catch(ServerConnectivityException sce) {
-//            DistributedTestCase.fail("While getting value for ACK region", sce);
+//            fail("While getting value for ACK region", sce);
 //        }
 //        catch(TimeoutException te) {
-//          DistributedTestCase.fail("While getting value for ACK region", te);
+//          fail("While getting value for ACK region", te);
 //        }
 //      }
 //      assertTrue(pi.getConnectedServerCount() >= 1);
@@ -3219,6 +3219,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     Cache z = getCache();
     return z;
   }
+
   /**
    * A handy method to poll for arrival of non-null/non-invalid entries
    * @param r the Region to poll
@@ -3268,6 +3269,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 
     public void init(Properties props)  {}
   }
+
   /**
    * Create a server that has a value for every key queried and a unique
    * key/value in the specified Region that uniquely identifies each instance.
@@ -3305,7 +3307,8 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-//test for bug 35884
+  //test for bug 35884
+  @Test
   public void test021ClientGetOfInvalidServerEntry() throws CacheException {
     final String regionName1 = this.getName() + "-1";
 
@@ -3384,7 +3387,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 
   }
 
-  
+  @Test
   public void test022ClientRegisterUnregisterRequests() throws CacheException {
     final String regionName1 = this.getName() + "-1";
 
@@ -3509,6 +3512,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @since GemFire 5.0.2
    */
+  @Test
   public void test023ContainsKeyOnServer() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -3598,7 +3602,6 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-  
   /**
    * Tests that invoking {@link Region#create} with a
    * <code>null</code> value does the right thing with the {@link
@@ -3606,6 +3609,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @since GemFire 3.5
    */
+  @Test
   public void test024CreateNullValue() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -3711,13 +3715,12 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-  
-  
   /**
    * Tests that a {@link Region#localDestroy} is not propagated to the
    * server and that a {@link Region#destroy} is.  Also makes sure
    * that callback arguments are passed correctly.
    */
+  @Test
   public void test025Destroy() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -3879,7 +3882,9 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    * to the server and that a {@link Region#destroyRegion} is.  Also
    * makes sure that callback arguments are passed correctly.
    */
-  public void todo_testDestroyRegion() throws CacheException {
+  @Ignore("TODO")
+  @Test
+  public void testDestroyRegion() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -3993,11 +3998,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 
   }
 
-  
   /**
    * Tests interest list registration with callback arg with DataPolicy.EMPTY
    * and InterestPolicy.ALL
    */
+  @Test
   public void test026DPEmptyInterestListRegistrationWithCallbackArg() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -4167,10 +4172,12 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
     });
   }
+
   /**
    * Tests interest list registration with callback arg with DataPolicy.EMPTY
    * and InterestPolicy.CACHE_CONTENT
    */
+  @Test
   public void test027DPEmptyCCInterestListRegistrationWithCallbackArg() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -4317,6 +4324,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    *
    * @throws Exception
    */
+  @Test
   public void test028DynamicRegionCreation() throws Exception {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -4332,9 +4340,9 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     final String k3 = name + "-key3";
     final String v3 = name + "-val3";
 
-    client1.invoke(() -> DistributedTestCase.disconnectFromDS());
-    srv1.invoke(() -> DistributedTestCase.disconnectFromDS());
-    srv2.invoke(() -> DistributedTestCase.disconnectFromDS());
+    client1.invoke(() -> disconnectFromDS());
+    srv1.invoke(() -> disconnectFromDS());
+    srv2.invoke(() -> disconnectFromDS());
     try {
       // setup servers
       CacheSerializableRunnable ccs = new CacheSerializableRunnable("Create Cache Server") {
@@ -4499,7 +4507,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
               assertNotNull(getCache().getRegion(name + Region.SEPARATOR + dynFromClientName));
               break;
             }
-            catch (AssertionFailedError e) {
+            catch (AssertionError e) {
               if (System.currentTimeMillis() > end) {
                 throw e;
               }
@@ -4579,7 +4587,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
               assertNotNull(getCache().getRegion(name + Region.SEPARATOR + dynFromServerName));
               break;
             }
-            catch (junit.framework.AssertionFailedError e) {
+            catch (AssertionError e) {
               if (System.currentTimeMillis() > end) {
                 throw e;
               } else {
@@ -4642,9 +4650,9 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
         }
       });
     } finally {
-      client1.invoke(() -> DistributedTestCase.disconnectFromDS()); // clean-up loner
-      srv1.invoke(() -> DistributedTestCase.disconnectFromDS());
-      srv2.invoke(() -> DistributedTestCase.disconnectFromDS());
+      client1.invoke(() -> disconnectFromDS()); // clean-up loner
+      srv1.invoke(() -> disconnectFromDS());
+      srv2.invoke(() -> disconnectFromDS());
     }
   }
   
@@ -4652,6 +4660,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
   /**
    * Test for bug 36279
    */
+  @Test
   public void test029EmptyByteArray() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -4744,10 +4753,10 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
       });
   }
 
-  
   /**
    * Tests interest list registration with callback arg
    */
+  @Test
   public void test030InterestListRegistrationWithCallbackArg() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -4899,12 +4908,12 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     });
   }
 
-  
   /**
    * Tests the keySetOnServer operation of the {@link Pool}
    *
    * @since GemFire 5.0.2
    */
+  @Test
   public void test031KeySetOnServer() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -5067,6 +5076,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    * Tests that creating, putting and getting a non-serializable key or value
    * throws the correct (NotSerializableException) exception.
    */
+  @Test
   public void test033NotSerializableException() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -5178,6 +5188,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
    * - non-originators of updates are sent invalidates
    * - multiple invalidates are not sent for the same update
    */
+  @Test
   public void test034NotifyAllUpdates() throws CacheException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -5498,10 +5509,10 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 //      HashSet destroyedRoots = new HashSet();
       try {
         client1.invoke(() -> CacheTestCase.remoteTearDown());
-        client1.invoke(() -> DistributedTestCase.disconnectFromDS());
+        client1.invoke(() -> disconnectFromDS());
       } finally {
         client2.invoke(() -> CacheTestCase.remoteTearDown());
-        client2.invoke(() -> DistributedTestCase.disconnectFromDS());
+        client2.invoke(() -> disconnectFromDS());
       }
     }
   }
@@ -5581,10 +5592,10 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
 //    } finally {
 //      try {
 //        client1.invoke(() -> CacheTestCase.remoteTearDown());
-//        client1.invoke(() -> DistributedTestCase.disconnectFromDS());
+//        client1.invoke(() -> disconnectFromDS());
 //      } finally {
 //        client2.invoke(() -> CacheTestCase.remoteTearDown());
-//        client2.invoke(() -> DistributedTestCase.disconnectFromDS());
+//        client2.invoke(() -> disconnectFromDS());
 //      }
 //    }
 //  }
@@ -5633,10 +5644,12 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
       delay();
     }
   }
+
   /**
    * Make sure a tx done in a server on an empty region gets sent
    * to clients who have registered interest.
    */
+  @Test
   public void test037Bug39526part1() throws CacheException, InterruptedException {
     final String name = this.getName();
     final Host host = Host.getHost(0);
@@ -5731,10 +5744,12 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     getSystem().getLogWriter().info("before confirmCommitOnClient");
     vm1.invoke(validateClient);
   }
+
   /**
    * Now confirm that a tx done in a peer of a server (the server having
    * an empty region and wanting all events) sends the tx to its clients
    */
+  @Test
   public void test038Bug39526part2() throws CacheException, InterruptedException {
     disconnectAllFromDS();
     final String name = this.getName();
@@ -5862,5 +5877,3 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
     }
   }
 }
-
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 8f82edd..fdefbfe 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
@@ -16,12 +16,8 @@
  */
 package com.gemstone.gemfire.cache.client;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache.server.ClientSubscriptionConfig;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.net.UnknownHostException;
@@ -29,16 +25,36 @@ import java.util.Stack;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.cache.server.ClientSubscriptionConfig;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * The ClientServerRegisterInterestsDUnitTest class is a test suite of test cases testing the interaction between a
  * client and a server in a Register Interests scenario.
  *
- * @see com.gemstone.gemfire.test.dunit.DistributedTestCase
  * @since GemFire 8.0
  */
-public class ClientServerRegisterInterestsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class ClientServerRegisterInterestsDUnitTest extends JUnit4DistributedTestCase {
 
   protected static final long WAIT_TIME_MILLISECONDS = TimeUnit.SECONDS.toMillis(5);
 
@@ -50,10 +66,6 @@ public class ClientServerRegisterInterestsDUnitTest extends DistributedTestCase
 
   private VM gemfireServerVm;
 
-  public ClientServerRegisterInterestsDUnitTest(final String testName) {
-    super(testName);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -197,6 +209,7 @@ public class ClientServerRegisterInterestsDUnitTest extends DistributedTestCase
     }
   }
 
+  @Test
   public void testClientRegisterInterests() {
     ClientCache clientCache = setupGemFireClientCache();
 



[15/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
index 5710ad2..6bfbff3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
@@ -16,6 +16,17 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.InterestResultPolicy;
@@ -26,19 +37,22 @@ import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.*;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.internal.cache.FilterProfile;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
- * 
  * We have 2 servers and One client which registers some keys with durable
  * interest and some without it. We maintain queues on only One server as
  * redundancy level is one. Following 2 tests have the two TestCase scenarios
@@ -59,9 +73,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * Unregister Some Keys (Here K1, K3) // Step 12: Modify values on the server
  * for all the Keys // Step 13: Check the values for the ones not unregistered
  * and the Unregistered Keys' Values should be null
- * 
  */
-public class DurableRegistrationDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DurableRegistrationDUnitTest extends JUnit4DistributedTestCase {
 
   private VM server1VM;
 
@@ -83,8 +97,8 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
 
   private static final String K4 = "KEY_STONE4";
 
-  public DurableRegistrationDUnitTest(String name) {
-    super(name);
+  public DurableRegistrationDUnitTest() {
+    super();
   }
 
   @Override
@@ -97,6 +111,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     CacheServerTestUtil.disableShufflingOfEndpoints();
   }
 
+  @Test
   public void testSimpleDurableClient() {
 
     // Step 1: Starting the servers
@@ -215,6 +230,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
 
   }
 
+  @Test
   public void testSimpleDurableClientWithRegistration() {
     // Step 1: Starting the servers
     PORT1 = ((Integer)this.server1VM.invoke(() -> CacheServerTestUtil.createCacheServer( regionName, new Boolean(true)
@@ -366,6 +382,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
 
   }
 
+  @Test
   public void testDurableClientWithRegistrationHA() {
     
     // Step 1: Start server1
@@ -459,6 +476,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
 
   }
 
+  @Test
   public void testDurableClientDisConnectWithRegistrationHA() {
     
     // Step 1: Start server1

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
index 12ad99d..46fd108 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
@@ -16,7 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -25,22 +41,24 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * Tests that the Matris defined in <code>ServerResponseMatrix</code> is
  * applied or not
  * 
  * @since GemFire 5.1
- * 
  */
-public class DurableResponseMatrixDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class DurableResponseMatrixDUnitTest extends JUnit4DistributedTestCase {
 
   protected static Cache cache = null;
 
@@ -52,11 +70,6 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
   
   public static final String KEY = "KeyMatrix1" ;
 
-  /** constructor */
-  public DurableResponseMatrixDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -68,6 +81,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     IgnoredException.addIgnoredException("Connection reset||Unexpected IOException");
   }
 
+  @Test
   public void testRegisterInterestResponse_NonExistent_Invalid()
       throws Exception
   {
@@ -78,6 +92,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals(null, r.getEntry(KEY).getValue()); // invalidate
   }
 
+  @Test
   public void testRegisterInterestResponse_NonExistent_Valid() throws Exception
   {
     server1.invoke(() -> DurableResponseMatrixDUnitTest.updateEntry( KEY, "ValueMatrix1" ));
@@ -86,7 +101,9 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals("ValueMatrix1", r.getEntry(KEY).getValue());
   }
 
-  public void BROKEN_testRegisterInterestResponse_Valid_Invalid() throws Exception
+  @Ignore("TODO: test is broken and disabled")
+  @Test
+  public void testRegisterInterestResponse_Valid_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     r.put(KEY, "ValueMatrix1");
@@ -95,6 +112,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals("ValueMatrix1", r.getEntry(KEY).getValue());
   }
 
+  @Test
   public void testRegisterInterestResponse_Valid_Valid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -103,6 +121,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals("ValueMatrix1", r.getEntry(KEY).getValue());
   }
 
+  @Test
   public void testRegisterInterestResponse_Invalid_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -112,7 +131,9 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals(null, r.getEntry(KEY).getValue());
   }
 
-  public void BROKEN_testRegisterInterestResponse_Invalid_Valid()
+  @Ignore("TODO: test is broken and disabled")
+  @Test
+  public void testRegisterInterestResponse_Invalid_Valid()
       throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -122,6 +143,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals("ValueMatrix1", r.getEntry(KEY).getValue());
   }
 
+  @Test
   public void testRegisterInterestResponse_Destroyed_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -133,6 +155,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     assertEquals(null, r.getEntry(KEY).getValue()); // invalidate
   }
 
+  @Test
   public void testRegisterInterestResponse_Destroyed_Valid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -142,6 +165,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     r.registerInterest(KEY, InterestResultPolicy.KEYS_VALUES);
     assertEquals("ValueMatrix1", r.getEntry(KEY).getValue());
   }
+  @Test
   public void testRegisterInterest_Destroy_Concurrent() throws Exception
   {  
 	PoolImpl.BEFORE_REGISTER_CALLBACK_FLAG = true;
@@ -188,6 +212,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 120 * 1000, 200, true);
   }
   
+  @Test
   public void testNotification_NonExistent_Create() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -196,6 +221,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix1");
   }
 
+  @Test
   public void testNotification_NonExistent_Update() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -205,6 +231,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix2");
   }
 
+  @Test
   public void testNotification_NonExistent_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -214,6 +241,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // invalidate
   }
 
+  @Test
   public void testNotification_NonExistent_Destroy() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -223,6 +251,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // destroyed
   }
 
+  @Test
   public void testNotification_Valid_Create() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -232,6 +261,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix1");
   }
 
+  @Test
   public void testNotification_Valid_Update() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -241,7 +271,9 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix2");
   }
 
-  public void BROKEN_testNotification_Valid_Invalid() throws Exception
+  @Ignore("TODO: test is broken and disabled")
+  @Test
+  public void testNotification_Valid_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     r.put(KEY, "DummyValue");
@@ -250,6 +282,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // invalidate
   }
 
+  @Test
   public void testNotification_Valid_Destroy() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -259,6 +292,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // destroyed
   }
 
+  @Test
   public void testNotification_Invalid_Create() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -268,6 +302,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix1");
   }
 
+  @Test
   public void testNotification_Invalid_Update() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -277,7 +312,9 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix1");
   }
 
-  public void BROKEN_testNotification_Invalid_Invalid() throws Exception
+  @Ignore("TODO: test is broken and disabled")
+  @Test
+  public void testNotification_Invalid_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     invalidateEntry(KEY);
@@ -286,6 +323,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // invalidate
   }
 
+  @Test
   public void testNotification_Invalid_Destroy() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -295,6 +333,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // destroyed
   }
 
+  @Test
   public void testNotification_LocalInvalid_Create() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -304,6 +343,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix1");
   }
 
+  @Test
   public void testNotification_LocalInvalid_Update() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -313,7 +353,9 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, "ValueMatrix1");
   }
 
-  public void BROKEN_testNotification_LocalInvalid_Invalid() throws Exception
+  @Ignore("TODO: test is broken and disabled")
+  @Test
+  public void testNotification_LocalInvalid_Invalid() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     localInvalidateEntry(KEY);
@@ -322,6 +364,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     waitForValue(r, KEY, null); // invalidate
   }
 
+  @Test
   public void testNotification_LocalInvalid_Destroy() throws Exception
   {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -415,7 +458,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       final int durableClientTimeout = 60; // keep the client alive for 60 s
       Properties props = getClientDistributedSystemProperties(durableClientId,
           durableClientTimeout);
-      new DurableResponseMatrixDUnitTest("temp").createCache(props);
+      new DurableResponseMatrixDUnitTest().createCache(props);
       Pool p = PoolManager.createFactory()
         .addServer(host, PORT1.intValue())
         .setSubscriptionEnabled(true)
@@ -445,7 +488,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
   public static Integer createServerCache() throws Exception
   {
     Properties props = new Properties();
-    new DurableResponseMatrixDUnitTest("temp").createCache(props);
+    new DurableResponseMatrixDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
index 1b81297..a18adf7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
@@ -16,31 +16,52 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriter;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.*;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
+import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
+import com.gemstone.gemfire.internal.cache.EntryEventImpl;
+import com.gemstone.gemfire.internal.cache.EventID;
+import com.gemstone.gemfire.internal.cache.RegionEventImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test to verify EventID generated from Cache Client is correctly passed on to
  * the cache server for create, update, remove and destroy operations.It also checks
  * that peer nodes also get the same EventID.
- *
- *
  */
+@Category(DistributedTest.class)
+public class EventIDVerificationDUnitTest extends JUnit4DistributedTestCase {
 
-public class EventIDVerificationDUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
 
   static VM vm0 = null;
@@ -51,7 +72,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
 
   private static int PORT2;
 
-  private static final String REGION_NAME = "EventIDVerificationDUnitTest_region";
+  private static final String REGION_NAME = EventIDVerificationDUnitTest.class.getSimpleName() + "_region";
 
   protected static EventID eventId;
 
@@ -61,8 +82,8 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
 
   /* Constructor */
 
-  public EventIDVerificationDUnitTest(String name) {
-    super(name);
+  public EventIDVerificationDUnitTest() {
+    super();
   }
 
   @Override
@@ -81,6 +102,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
     CacheObserverHolder.setInstance(new CacheObserverAdapter());
   }
 
+  @Test
   public void testEventIDOnServer()
   {
     createEntry();
@@ -106,6 +128,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
    * also checks that peer nodes also get the same EventID.
    *
    */
+  @Test
   public void testEventIDPrapogationOnServerDuringRegionDestroy()
   {
     destroyRegion();
@@ -120,6 +143,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
    * also checks that peer nodes also get the same EventID.
 
    */
+  @Test
   public void testEventIDPrapogationOnServerDuringRegionClear()
   {
     clearRegion();
@@ -148,7 +172,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new EventIDVerificationDUnitTest("temp").createCache(props);
+    new EventIDVerificationDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setMirrorType(MirrorType.NONE);
@@ -263,7 +287,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    new EventIDVerificationDUnitTest("temp").createCache(new Properties());
+    new EventIDVerificationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
index 08467b0..6f5b4c7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
@@ -16,8 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
+import org.junit.Ignore;
+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.CacheFactory;
@@ -32,9 +38,10 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.InternalCacheEvent;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test to verify EventID generated from a peer is correctly passed on to the
@@ -42,17 +49,15 @@ import com.gemstone.gemfire.test.dunit.VM;
  * GLOBAL scope the EventIDs should be same in P2P for a propagation of given
  * operation. In case of NO-ACK EventIDs should be different.Currently this test
  * is commented because of a bug.
- * 
- * 
  */
+@Category(DistributedTest.class)
+public class EventIDVerificationInP2PDUnitTest extends JUnit4DistributedTestCase {
 
-public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
-{
   private static Cache cache = null;
 
   static VM vm0 = null;
 
-  private static final String REGION_NAME = "EventIDVerificationInP2PDUnitTest_region";
+  private static final String REGION_NAME = EventIDVerificationInP2PDUnitTest.class.getSimpleName() + "_region";
 
   protected static EventID eventId;
 
@@ -64,12 +69,6 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
 
   static int GLOBAL = 2;
 
-  /* Constructor */
-
-  public EventIDVerificationInP2PDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -77,6 +76,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
     receiver = false;
   }
 
+  @Test
   public void testEventIDsDACK() throws Exception
   {
     createServerCache(new Integer(DISTRIBUTED_ACK));
@@ -84,6 +84,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
     verifyOperations();
   }
 
+  @Test
   public void testEventIDsGLOBAL() throws Exception
   {
     createServerCache(new Integer(GLOBAL));
@@ -91,8 +92,9 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
     verifyOperations();
   }
 
-  public void _testEventIDsNOACK() throws Exception
-  {
+  @Ignore("TODO")
+  @Test
+  public void testEventIDsNOACK() throws Exception {
     createServerCache(new Integer(0));
     vm0.invoke(() -> EventIDVerificationInP2PDUnitTest.createServerCache( new Integer(0) ));
 
@@ -122,7 +124,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
 
   public static void createServerCache(Integer type) throws Exception
   {
-    new EventIDVerificationInP2PDUnitTest("temp").createCache(new Properties());
+    new EventIDVerificationInP2PDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     if (type.intValue() == DISTRIBUTED_ACK)
       factory.setScope(Scope.DISTRIBUTED_ACK);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
index 901d837..9cf6095 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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.IOException;
 import java.io.Serializable;
 import java.util.Map;
@@ -54,12 +63,13 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
 /**
  *
  */
-public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ForceInvalidateEvictionDUnitTest extends JUnit4CacheTestCase {
   
   private static final long serialVersionUID = -11364213547039967L;
 
-  public ForceInvalidateEvictionDUnitTest(String name) {
-    super(name);
+  public ForceInvalidateEvictionDUnitTest() {
+    super();
   }
 
   private void doPropagationTest(VM sourceVM, VM destinationVm, boolean validateCallbacks, boolean validateContent) {
@@ -95,6 +105,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
     removeListener(destinationVm);
   }
   
+  @Test
   public void testPRToAccessor() {
     
     Host host = Host.getHost(0);
@@ -113,6 +124,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
     doPropagationTest(vm1, vm2, true, false);
   }
   
+  @Test
   public void testBridgeClientWithPR() {
     
     Host host = Host.getHost(0);
@@ -132,6 +144,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
     doPropagationTest(vm1, vm3, true, true);
   }
 
+  @Test
   public void testBridgeClientWithAccessorServer() {
     
     Host host = Host.getHost(0);
@@ -149,6 +162,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
     doPropagationTest(vm0, vm3, true, true);
   }
   
+  @Test
   public void testBridgeClientWithAccessorSource() {
     
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
index f0daf23..b75ca4c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
@@ -16,23 +16,27 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
-import com.gemstone.gemfire.test.dunit.Invoke;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Runs force invalidate eviction tests with off-heap regions.
  * @since Geode 1.0
  */
+@Category(DistributedTest.class)
 public class ForceInvalidateOffHeapEvictionDUnitTest extends
     ForceInvalidateEvictionDUnitTest {
 
-  public ForceInvalidateOffHeapEvictionDUnitTest(String name) {
-    super(name);
+  public ForceInvalidateOffHeapEvictionDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
index a82061e..55af1bf 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
@@ -19,6 +19,10 @@ package com.gemstone.gemfire.internal.cache.tier.sockets;
 import static com.gemstone.gemfire.test.dunit.Invoke.*;
 import static com.jayway.awaitility.Awaitility.*;
 import static com.jayway.awaitility.Duration.*;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
@@ -33,9 +37,10 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.HARegion;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.ha.HAHelper;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is the bugtest for bug no. 36738. When Object of class
@@ -47,7 +52,8 @@ import com.gemstone.gemfire.test.dunit.VM;
  * 3. Create server2 and HARegion in it so that GII will happen. 
  * 4. Perform get operations from server2.
  */
-public class HABug36738DUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class HABug36738DUnitTest extends JUnit4DistributedTestCase {
 
   private static final String REGION_NAME = "HABug36738DUnitTest_Region";
   private static final String HAREGION_NAME = "haRegion";
@@ -57,8 +63,8 @@ public class HABug36738DUnitTest extends DistributedTestCase {
 
   private Region haRegion;
 
-  public HABug36738DUnitTest(String name) {
-    super(name);
+  public HABug36738DUnitTest() {
+    super();
   }
 
   @Override
@@ -67,6 +73,7 @@ public class HABug36738DUnitTest extends DistributedTestCase {
     invokeInEveryVM( () -> cache = null );
   }
 
+  @Test
   public void testBug36768() throws Exception {
     final VM server1 = Host.getHost(0).getVM(0);
     final VM server2 = Host.getHost(0).getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
index d236bc5..9ca8e40 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
@@ -16,20 +16,31 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
 @SuppressWarnings("serial")
+@Category(DistributedTest.class)
 public class HAInterestPart1DUnitTest extends HAInterestTestCase {
 
-  public HAInterestPart1DUnitTest(String name) {
-    super(name);
+  public HAInterestPart1DUnitTest() {
+    super();
   }
 
   /**
    * Tests whether interest is registered or not on both primary and secondaries
    */
+  @Test
   public void testInterestRegistrationOnBothPrimaryAndSecondary() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -47,6 +58,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * Tests whether interest is registered on both primary and secondaries and
    * verify their responses
    */
+  @Test
   public void testInterestRegistrationResponseOnBothPrimaryAndSecondary() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -61,6 +73,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * Tests whether re-registration of interest causes duplicates on server side
    * interest map
    */
+  @Test
   public void testRERegistrationWillNotCreateDuplicateKeysOnServerInterstMaps() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -80,6 +93,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * failover and should pick new primary and get server keys in response of
    * registerInterest
    */
+  @Test
   public void testPrimaryFailureInRegisterInterest() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -101,6 +115,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * Tests if Secondary fails during interest registration should add to dead Ep
    * list
    */
+  @Test
   public void testSecondaryFailureInRegisterInterest() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -123,6 +138,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * server to dead ep list and expect serverKeys as a response from
    * registration on newly selected primary
    */
+  @Test
   public void testBothPrimaryAndSecondaryFailureInRegisterInterest() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -147,6 +163,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * expect serverKeys as a response from registration on newly selected primary
    *
    */
+  @Test
   public void testProbablePrimaryFailureInRegisterInterest() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -167,6 +184,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * Tests if DeadServerMonitor on detecting an EP as alive should register
    * client ( create CCP) as welll as register IL
    */
+  @Test
   public void testInterstRegistrationOnRecoveredEPbyDSM() throws Exception {
     IgnoredException.addIgnoredException("SocketException");
     IgnoredException.addIgnoredException("Unexpected IOException");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
index 8a30f08..67f3c41 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+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.EntryDestroyedException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
@@ -26,16 +35,18 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 @SuppressWarnings({"rawtypes", "serial"})
+@Category(DistributedTest.class)
 public class HAInterestPart2DUnitTest extends HAInterestTestCase {
 
-  public HAInterestPart2DUnitTest(String name) {
-    super(name);
+  public HAInterestPart2DUnitTest() {
+    super();
   }
 
   /**
    * Tests if Primary fails during interest un registration should initiate
    * failover should pick new primary
    */
+  @Test
   public void testPrimaryFailureInUNregisterInterest() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -62,6 +73,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * Tests if Secondary fails during interest un registration should add to dead
    * Ep list
    */
+  @Test
   public void testSecondaryFailureInUNRegisterInterest() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -84,6 +96,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * before interest registration then interest should be registered on the newly
    * detected live server as well
    */
+  @Test
   public void testDSMDetectsServerLiveJustBeforeInterestRegistration() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
@@ -110,6 +123,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * After interest registration then interest should be registered on the newly
    * detected live server as well
    */
+  @Test
   public void testDSMDetectsServerLiveJustAfterInterestRegistration() throws Exception {
     createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
 
@@ -142,6 +156,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * part of recovery it refreshes registered entries from the server, because it
    * is primary
    */
+  @Test
   public void testRefreshEntriesFromPrimaryWhenDSMDetectsServerLive() throws Exception {
     IgnoredException.addIgnoredException(ServerConnectivityException.class.getName());
     
@@ -214,6 +229,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * this live server and verify that as a part of recovery it does not
    * refreshes registered entries from the server, because it is secondary
    */
+  @Test
   public void testGIIFromSecondaryWhenDSMDetectsServerLive() throws Exception {
     server1.invoke(() -> HAInterestTestCase.closeCache());
     server2.invoke(() -> HAInterestTestCase.closeCache());
@@ -249,6 +265,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    *
    * @throws Exception
    */
+  @Test
   public void testBug35945() throws Exception {
     PORT1 = ((Integer) server1.invoke(() -> HAInterestTestCase.createServerCache())).intValue();
     server1.invoke(() -> HAInterestTestCase.createEntriesK1andK2());
@@ -315,6 +332,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * Tests if failure occurred in Interest recovery thread, then it should select
    * new endpoint to register interest
    */
+  @Test
   public void testInterestRecoveryFailure() throws Exception {
     IgnoredException.addIgnoredException("Server unreachable");
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
index 7120f28..2c12118 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
@@ -16,7 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -31,19 +50,21 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.tier.InterestType;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Tests Interest Registration Functionality
  */
+@Category(DistributedTest.class)
 @SuppressWarnings({"deprecation", "rawtypes", "serial", "unchecked"})
-public class HAInterestTestCase extends DistributedTestCase {
+public class HAInterestTestCase extends JUnit4DistributedTestCase {
   
   protected static final int TIMEOUT_MILLIS = 60 * 1000;
   protected static final int INTERVAL_MILLIS = 10;
@@ -77,10 +98,6 @@ public class HAInterestTestCase extends DistributedTestCase {
   
   protected volatile static boolean exceptionOccured = false;
 
-  public HAInterestTestCase(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     host = Host.getHost(0);
@@ -874,7 +891,7 @@ public class HAInterestTestCase extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAInterestTestCase("temp").createCache(props);
+    new HAInterestTestCase().createCache(props);
     CacheServerTestUtil.disableShufflingOfEndpoints();
     PoolImpl p;
     try {
@@ -908,7 +925,7 @@ public class HAInterestTestCase extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAInterestTestCase("temp").createCache(props);
+    new HAInterestTestCase().createCache(props);
     CacheServerTestUtil.disableShufflingOfEndpoints();
     PoolImpl p;
     try {
@@ -943,7 +960,7 @@ public class HAInterestTestCase extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAInterestTestCase("temp").createCache(props);
+    new HAInterestTestCase().createCache(props);
     PoolImpl p = (PoolImpl) PoolManager.createFactory()
         .addServer(hostName, PORT1)
         .setSubscriptionEnabled(true)
@@ -964,7 +981,7 @@ public class HAInterestTestCase extends DistributedTestCase {
   }
 
   public static Integer createServerCache() throws Exception {
-    new HAInterestTestCase("temp").createCache(new Properties());
+    new HAInterestTestCase().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableBridgeConflation(true);
@@ -983,7 +1000,7 @@ public class HAInterestTestCase extends DistributedTestCase {
   }
 
   public static Integer createServerCacheWithLocalRegion() throws Exception {
-    new HAInterestTestCase("temp").createCache(new Properties());
+    new HAInterestTestCase().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
     factory.setConcurrencyChecksEnabled(true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
index dae8d2a..4f62f67 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
@@ -16,7 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -27,24 +46,27 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.experimental.categories.Category;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
 
 /**
  * Test to verify Startup. and failover during startup.
  */
-public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class HAStartupAndFailoverDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final String REGION_NAME = HAStartupAndFailoverDUnitTest.class.getSimpleName() + "_region";
+
   protected static Cache cache = null;
+
   VM server1 = null;
   VM server2 = null;
   VM server3 = null;
@@ -60,13 +82,6 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
   //To verify the primary identification on client side toggeled after notification on client side
   protected static boolean identifiedPrimary = false;
 
-  private static final String REGION_NAME = "HAStartupAndFailoverDUnitTest_region";
-
-  /** constructor */
-  public HAStartupAndFailoverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -86,9 +101,9 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
 
     /**
      * Stops primary server one by one to ensure new primary is selected
-     *
      */
-    public void testPrimaryFailover() throws Exception
+  @Test
+  public void testPrimaryFailover() throws Exception
     {
 
       createClientCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
@@ -136,7 +151,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
      * new primary will be selected
      *
      */
-    public void testExceptionWhileMakingPrimary()throws Exception
+  @Test
+  public void testExceptionWhileMakingPrimary()throws Exception
     {
 
       createClientCacheWithIncorrectPrimary(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
@@ -165,7 +181,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
      * new primary will be selected
      *
      */
-    public void testTwoPrimaryFailedOneAfterTheAnother() throws Exception
+  @Test
+  public void testTwoPrimaryFailedOneAfterTheAnother() throws Exception
     {
 
       createClientCacheWithLargeRetryInterval(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
@@ -194,7 +211,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
      * verify that Primary Should Be Null And EPList Should Be Empty When All Servers Are Dead
      */
     @Category(FlakyTest.class) // GEODE-1045: random ports, time senstive, waitForCriterion
-    public void testPrimaryShouldBeNullAndEPListShouldBeEmptyWhenAllServersAreDead() throws Exception {
+  @Test
+  public void testPrimaryShouldBeNullAndEPListShouldBeEmptyWhenAllServersAreDead() throws Exception {
       createClientCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
       verifyPrimaryShouldNotBeNullAndEPListShouldNotBeEmpty();
       server1.invoke(() -> HAStartupAndFailoverDUnitTest.stopServer());
@@ -208,7 +226,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
      * Tests failover initialization by cacheClientUpdater Thread
      * on failure in Primary Server
      */
-    public void testCacheClientUpdatersInitiatesFailoverOnPrimaryFailure() throws Exception
+  @Test
+  public void testCacheClientUpdatersInitiatesFailoverOnPrimaryFailure() throws Exception
     {
       createClientCacheWithLargeRetryInterval(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
       server1.invoke(() -> HAStartupAndFailoverDUnitTest.verifyDispatcherIsAlive());
@@ -226,7 +245,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
      * Tests failover initialization by cacheClientUpdater
      * Thread on failure on Secondary server
      */
-    public void testCacheClientUpdaterInitiatesFailoverOnSecondaryFailure() throws Exception
+  @Test
+  public void testCacheClientUpdaterInitiatesFailoverOnSecondaryFailure() throws Exception
     {
       createClientCacheWithLargeRetryInterval(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
       server1.invoke(() -> HAStartupAndFailoverDUnitTest.verifyDispatcherIsAlive());
@@ -244,7 +264,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
      * Tests failover initialization by cacheClientUpdater Thread failure on both
      * Primary and Secondary server
      */
-    public void testCacheClientUpdaterInitiatesFailoverOnBothPrimaryAndSecondaryFailure() throws Exception
+  @Test
+  public void testCacheClientUpdaterInitiatesFailoverOnBothPrimaryAndSecondaryFailure() throws Exception
     {
 
       createClientCacheWithLargeRetryInterval(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
@@ -262,7 +283,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
     /**
      * Tests failover initialization by cacheClientUpdater Thread
      */
-    public void testCacheClientUpdaterInitiatesFailoverOnBothPrimaryAndSecondaryFailureWithServerMonitors() throws Exception
+  @Test
+  public void testCacheClientUpdaterInitiatesFailoverOnBothPrimaryAndSecondaryFailureWithServerMonitors() throws Exception
     {
 
       createClientCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
@@ -278,7 +300,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
     /**
      * Tests failover initialization by cache operation Threads on secondary
      */
-    public void testInitiateFailoverByCacheOperationThreads_Secondary() throws Exception {
+  @Test
+  public void testInitiateFailoverByCacheOperationThreads_Secondary() throws Exception {
       //Stop the 3rd server to guarantee the client put will go to the first server
       server3.invoke(() -> HAStartupAndFailoverDUnitTest.stopServer());
       // create a client with no client updater thread
@@ -537,7 +560,7 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAStartupAndFailoverDUnitTest("temp").createCache(props);
+    new HAStartupAndFailoverDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, PORT1.intValue())
       .addServer(host, PORT2.intValue())
@@ -566,7 +589,7 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAStartupAndFailoverDUnitTest("temp").createCache(props);
+    new HAStartupAndFailoverDUnitTest().createCache(props);
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, PORT1.intValue())
       .addServer(host, PORT2.intValue())
@@ -597,7 +620,7 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAStartupAndFailoverDUnitTest("temp").createCache(props);
+    new HAStartupAndFailoverDUnitTest().createCache(props);
 
     CacheServerTestUtil.disableShufflingOfEndpoints();
     PoolImpl p;
@@ -635,7 +658,7 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new HAStartupAndFailoverDUnitTest("temp").createCache(props);
+    new HAStartupAndFailoverDUnitTest().createCache(props);
     final int INCORRECT_PORT = 1;
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, INCORRECT_PORT)
@@ -662,7 +685,7 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase {
 
   public static Integer createServerCache() throws Exception
   {
-    new HAStartupAndFailoverDUnitTest("temp").createCache(new Properties());
+    new HAStartupAndFailoverDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setEnableBridgeConflation(true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
index 28f70b3..5879bd4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
@@ -16,9 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.*;
+import static org.junit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.Random;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.Instantiator;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -31,19 +52,19 @@ import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Properties;
-import java.util.Random;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.unregisterInstantiatorsInThisVM;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class InstantiatorPropagationDUnitTest extends JUnit4DistributedTestCase {
 
-public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
   private static Cache cache = null;
 
   private static VM client1 = null;
@@ -62,7 +83,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
 
   private static int instanceCountWithOnePut = 1;
 
-  private static final String REGION_NAME = "ClientServerInstantiatorRegistrationDUnitTest";
+  private static final String REGION_NAME = InstantiatorPropagationDUnitTest.class.getSimpleName() + "_region";
   
   protected static EventID eventId;
 
@@ -70,14 +91,6 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
 
   public static boolean testObject20Loaded = false;
 
-
-
-
-  public InstantiatorPropagationDUnitTest(String name) {
-    super(name);
-    // TODO Auto-generated constructor stub
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -96,12 +109,11 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
     assertNotNull(cache);
   }
 
-  public static void createClientCache(String host, Integer port1)
-      throws Exception {
+  public static void createClientCache(String host, Integer port1) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new InstantiatorPropagationDUnitTest("temp").createCache(props);
+    new InstantiatorPropagationDUnitTest().createCache(props);
     Pool p = PoolManager.createFactory().addServer(host, port1.intValue())
         .setMinConnections(1).setSubscriptionEnabled(true).setPingInterval(200)
         .create("ClientServerInstantiatorRegistrationDUnitTestPool");
@@ -123,7 +135,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
   }
 
   public static Integer createServerCache(Integer maxThreads) throws Exception {
-    new InstantiatorPropagationDUnitTest("temp").createCache(new Properties());
+    new InstantiatorPropagationDUnitTest().createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setMirrorType(MirrorType.KEYS_VALUES);
@@ -451,6 +463,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
    * Verified if the 2 instantiators get propagated to client when client gets
    * connected.
    */
+  @Test
   public void testServerUpFirstClientLater() throws Exception {
     PORT1 = initServerCache(server1);
 
@@ -520,6 +533,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
    * the client is connected to(server1), to the other server(server2) in the DS
    * and the client(client2) that is connected to server2.
    */
+  @Test
   public void testInstantiatorsWith2ClientsN2Servers() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -559,6 +573,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
    * instantiators. Client1 should have only 1 instantiator since the server1
    * was stopped when 2 instantiators were added on it.
    */
+  @Test
   public void testInstantiatorsWithServerKill() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -605,6 +620,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
    * stopped.So registering an instantiator on server should propagate that to
    * client as well.
    */
+  @Test
   public void testInstantiators() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -642,7 +658,9 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
    * Test's Number of Instantiators at all clients & servers with one Server
    * being stopped and then restarted
    */
-  public void _testInstantiatorsWithServerKillAndReInvoked() throws Exception {
+  @Ignore("TODO")
+  @Test
+  public void testInstantiatorsWithServerKillAndReInvoked() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
     client1
@@ -696,8 +714,8 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
    * client(client1). Verified, if that instantiator gets propagated to the
    * server the client is connected to(server1), to client2, to the other
    * server(server2) in the DS and the client that is connected to server2.
-   * 
    */
+  @Test
   public void testInstantiatorCount() throws Exception {
     PORT1 = initServerCache(server1);
     PORT2 = initServerCache(server2);
@@ -730,12 +748,11 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
     unregisterInstantiatorsInAllVMs();
   }
 
-  public static void createClientCache_EventId(String host, Integer port1) throws Exception
-  {
+  public static void createClientCache_EventId(String host, Integer port1) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new InstantiatorPropagationDUnitTest("temp").createCache(props);
+    new InstantiatorPropagationDUnitTest().createCache(props);
     Pool p = PoolManager.createFactory()
       .addServer(host, port1.intValue())
       .setSubscriptionEnabled(true)
@@ -745,14 +762,14 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
     factory.setPoolName(p.getName());
     cache.createRegion(REGION_NAME, factory.create());
   }
+
   /**
    * Test's same eventId being same for the Instantiators at all clients &
    * servers
-   * 
    */
-  // disabled - the eventID received does not match the sender's eventID.  Why is this a requirement anyway?
-  public void _testInstantiatorsEventIdVerificationClientsAndServers()
-      throws Exception {
+  @Ignore("TODO: disabled - the eventID received does not match the sender's eventID.  Why is this a requirement anyway?")
+  @Test
+  public void _testInstantiatorsEventIdVerificationClientsAndServers() throws Exception {
     PORT1 = initServerCache(server1, 1);
     PORT2 = initServerCache(server2, 2);
 
@@ -773,11 +790,10 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
     assertTrue("EventId found Different", pass.booleanValue());
 
     PoolImpl.IS_INSTANTIATOR_CALLBACK = false;
-
   }
   
-  public void testLazyRegistrationOfInstantiators()
-      throws Exception {
+  @Test
+  public void testLazyRegistrationOfInstantiators() throws Exception {
     try {
       PORT1 = initServerCache(server1);
       PORT2 = initServerCache(server2);
@@ -829,12 +845,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
   
   /**
    * this method initializes the appropriate server cache
-   * 
-   * @param server
-   * @param serverNo
-   * @return portNo.
    */
-
   private int initServerCache(VM server, int serverNo)
   {
     Object[] args = new Object[] { new Integer(getMaxThreads()) };
@@ -852,15 +863,9 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
 
   /**
    * This method creates the server cache
-   * 
-   * @param maxThreads
-   * @return
-   * @throws Exception
    */
-  public static Integer createServerCacheTwo(Integer maxThreads)
-      throws Exception
-  {
-    new InstantiatorPropagationDUnitTest("temp")
+  public static Integer createServerCacheTwo(Integer maxThreads) throws Exception {
+    new InstantiatorPropagationDUnitTest()
         .createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -879,15 +884,9 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
 
   /**
    * This method creates the server cache
-   * 
-   * @param maxThreads
-   * @return
-   * @throws Exception
    */
-  public static Integer createServerCacheOne(Integer maxThreads)
-      throws Exception
-  {
-    new InstantiatorPropagationDUnitTest("temp")
+  public static Integer createServerCacheOne(Integer maxThreads) throws Exception {
+    new InstantiatorPropagationDUnitTest()
         .createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -903,8 +902,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
     return new Integer(port);
   }
 
-  public static void setClientServerObserver1()
-  {
+  public static void setClientServerObserver1() {
     PoolImpl.IS_INSTANTIATOR_CALLBACK = true;
     ClientServerObserverHolder
         .setInstance(new ClientServerObserverAdapter() {
@@ -921,8 +919,6 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
 
   /**
    * sets the EventId value in the VM
-   * 
-   * @param eventID
    */
   public static void setEventId(EventID eventID)
   {
@@ -944,6 +940,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
   }
 }
 
+// TODO: move the following classes to be inner classes
 
 abstract class ConfigurableObject {
   public abstract void init(int index);
@@ -951,9 +948,6 @@ abstract class ConfigurableObject {
   public abstract void validate(int index);
 }
 
-
-
-
 class TestObject1 extends ConfigurableObject implements DataSerializable {
 
   private int field1;
@@ -966,32 +960,37 @@ class TestObject1 extends ConfigurableObject implements DataSerializable {
    */
   static {
     Instantiator.register(new Instantiator(TestObject1.class, -100123) {
+      @Override
       public DataSerializable newInstance() {
         return new TestObject1();
       }
     });
   }
 
+  @Override
   public void init(int index) {
     Random random = new Random();
     this.field1 = random.nextInt();
   }
 
+  @Override
   public int getIndex() {
     return 1;
   }
 
+  @Override
   public void validate(int index) {
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.field1 = in.readInt();
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     out.writeInt(this.field1);
   }
-
 }
 
 class TestObject2 extends ConfigurableObject implements DataSerializable {
@@ -1003,6 +1002,7 @@ class TestObject2 extends ConfigurableObject implements DataSerializable {
 
   static {
     Instantiator.register(new Instantiator(TestObject2.class, -100122) {
+      @Override
       public DataSerializable newInstance() {
         return new TestObject2();
       }
@@ -1012,27 +1012,30 @@ class TestObject2 extends ConfigurableObject implements DataSerializable {
   /**
    * Initializes a Instantiator1DUnitTestObject1.
    */
-
+  @Override
   public void init(int index) {
     Random random = new Random();
     this.field1 = random.nextInt();
   }
 
+  @Override
   public int getIndex() {
     return 1;
   }
 
+  @Override
   public void validate(int index) {
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.field1 = in.readInt();
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     out.writeInt(this.field1);
   }
-
 }
 
 class TestObject3 extends ConfigurableObject implements DataSerializable {
@@ -1044,6 +1047,7 @@ class TestObject3 extends ConfigurableObject implements DataSerializable {
 
   static {
     Instantiator.register(new Instantiator(TestObject3.class, -121) {
+      @Override
       public DataSerializable newInstance() {
         return new TestObject3();
       }
@@ -1053,22 +1057,27 @@ class TestObject3 extends ConfigurableObject implements DataSerializable {
   /**
    * Initializes a Instantiator1DUnitTestObject1.
    */
+  @Override
   public void init(int index) {
     Random random = new Random();
     this.field1 = random.nextInt();
   }
 
+  @Override
   public int getIndex() {
     return 1;
   }
 
+  @Override
   public void validate(int index) {
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.field1 = in.readInt();
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     out.writeInt(this.field1);
   }
@@ -1083,6 +1092,7 @@ class TestObject4 extends ConfigurableObject implements DataSerializable {
 
   static {
     Instantiator.register(new Instantiator(TestObject4.class, -122) {
+      @Override
       public DataSerializable newInstance() {
         return new TestObject4();
       }
@@ -1092,22 +1102,27 @@ class TestObject4 extends ConfigurableObject implements DataSerializable {
   /**
    * Initializes a Instantiator1DUnitTestObject1.
    */
+  @Override
   public void init(int index) {
     Random random = new Random();
     this.field1 = random.nextInt();
   }
 
+  @Override
   public int getIndex() {
     return 1;
   }
 
+  @Override
   public void validate(int index) {
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.field1 = in.readInt();
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     out.writeInt(this.field1);
   }
@@ -1122,6 +1137,7 @@ class TestObject5 extends ConfigurableObject implements DataSerializable {
 
   static {
     Instantiator.register(new Instantiator(TestObject5.class, -123) {
+      @Override
       public DataSerializable newInstance() {
         return new TestObject5();
       }
@@ -1131,22 +1147,27 @@ class TestObject5 extends ConfigurableObject implements DataSerializable {
   /**
    * Initializes a Instantiator1DUnitTestObject1.
    */
+  @Override
   public void init(int index) {
     Random random = new Random();
     this.field1 = random.nextInt();
   }
 
+  @Override
   public int getIndex() {
     return 1;
   }
 
+  @Override
   public void validate(int index) {
   }
 
+  @Override
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.field1 = in.readInt();
   }
 
+  @Override
   public void toData(DataOutput out) throws IOException {
     out.writeInt(this.field1);
   }
@@ -1161,6 +1182,7 @@ class TestObject6 extends ConfigurableObject implements DataSerializable {
 
   static {
     Instantiator.register(new Instantiator(TestObject6.class, -124) {
+      @Override
       public DataSerializable newInstance() {
         return new TestObject6();
       }


[10/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2PerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2PerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2PerformanceTest.java
index f303d35..12f2744 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2PerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/Log4J2PerformanceTest.java
@@ -16,21 +16,29 @@
  */
 package com.gemstone.gemfire.internal.logging.log4j;
 
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.internal.logging.LoggingPerformanceTestCase;
-import com.gemstone.gemfire.internal.util.IOUtils;
-import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
+import org.junit.After;
 import org.junit.Ignore;
 import org.junit.experimental.categories.Category;
 
-import java.io.*;
-import java.net.URL;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.FileUtil;
+import com.gemstone.gemfire.internal.logging.LoggingPerformanceTestCase;
+import com.gemstone.gemfire.internal.util.IOUtils;
+import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
@@ -45,13 +53,8 @@ public class Log4J2PerformanceTest extends LoggingPerformanceTestCase {
   
   private File config = null;
   
-  public Log4J2PerformanceTest(String name) {
-    super(name);
-  }
-
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
+  @After
+  public void tearDownLog4J2PerformanceTest() throws Exception {
     this.config = null; // leave this file in place for now
   }
   
@@ -107,7 +110,8 @@ public class Log4J2PerformanceTest extends LoggingPerformanceTestCase {
     final Logger logger = LogManager.getLogger();
     return logger;
   }
-  
+
+  @Override
   protected PerformanceLogger createPerformanceLogger() throws IOException {
     final Logger logger = createLogger();
     
@@ -124,24 +128,4 @@ public class Log4J2PerformanceTest extends LoggingPerformanceTestCase {
     
     return perfLogger;
   }
-
-  @Override
-  public void testCountBasedLogging() throws Exception {
-    super.testCountBasedLogging();
-  }
-
-  @Override
-  public void testTimeBasedLogging() throws Exception {
-    super.testTimeBasedLogging();
-  }
-
-  @Override
-  public void testCountBasedIsEnabled() throws Exception {
-    super.testCountBasedIsEnabled();
-  }
-
-  @Override
-  public void testTimeBasedIsEnabled() throws Exception {
-    super.testTimeBasedIsEnabled();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerDisabledPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerDisabledPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerDisabledPerformanceTest.java
index 4be34c7..42472f8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerDisabledPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerDisabledPerformanceTest.java
@@ -29,10 +29,7 @@ import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 @Ignore("Tests have no assertions")
 public class LogWriterLoggerDisabledPerformanceTest extends LogWriterLoggerPerformanceTest {
 
-  public LogWriterLoggerDisabledPerformanceTest(String name) {
-    super(name);
-  }
-
+  @Override
   protected PerformanceLogger createPerformanceLogger() throws IOException {
     final Logger logger = createLogger();
     
@@ -49,24 +46,4 @@ public class LogWriterLoggerDisabledPerformanceTest extends LogWriterLoggerPerfo
     
     return perfLogger;
   }
-
-  @Override
-  public void testCountBasedLogging() throws Exception {
-    super.testCountBasedLogging();
-  }
-
-  @Override
-  public void testTimeBasedLogging() throws Exception {
-    super.testTimeBasedLogging();
-  }
-
-  @Override
-  public void testCountBasedIsEnabled() throws Exception {
-    super.testCountBasedIsEnabled();
-  }
-
-  @Override
-  public void testTimeBasedIsEnabled() throws Exception {
-    super.testTimeBasedIsEnabled();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
index f186672..3eb6602 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
@@ -16,20 +16,28 @@
  */
 package com.gemstone.gemfire.internal.logging.log4j;
 
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.internal.logging.LoggingPerformanceTestCase;
-import com.gemstone.gemfire.internal.util.IOUtils;
-import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
+import org.junit.After;
 import org.junit.Ignore;
 import org.junit.experimental.categories.Category;
 
-import java.io.*;
-import java.net.URL;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.FileUtil;
+import com.gemstone.gemfire.internal.logging.LoggingPerformanceTestCase;
+import com.gemstone.gemfire.internal.util.IOUtils;
+import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
@@ -44,13 +52,8 @@ public class LogWriterLoggerPerformanceTest extends LoggingPerformanceTestCase {
   
   private File config = null;
   
-  public LogWriterLoggerPerformanceTest(String name) {
-    super(name);
-  }
-
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
+  @After
+  public void tearDownLogWriterLoggerPerformanceTest() throws Exception {
     this.config = null; // leave this file in place for now
   }
 
@@ -60,7 +63,7 @@ public class LogWriterLoggerPerformanceTest extends LoggingPerformanceTestCase {
     pw.close();
   }
 
-  protected void setPropertySubstitutionValues(final String logFile, 
+  protected void setPropertySubstitutionValues(final String logFile,
                                                final int logFileSizeLimitMB,
                                                final int logFileCountLimit) {
       if (logFileSizeLimitMB < 0) {
@@ -80,7 +83,7 @@ public class LogWriterLoggerPerformanceTest extends LoggingPerformanceTestCase {
       System.setProperty(SYS_LOG_FILE_SIZE_LIMIT, logFileSizeLimitMBValue);
       System.setProperty(SYS_LOG_FILE_COUNT_LIMIT, logFileCountLimitValue);
   }
-  
+
   protected Logger createLogger() throws IOException {
     // create configuration with log-file and log-level
     this.configDirectory = new File(getUniqueName());
@@ -106,7 +109,8 @@ public class LogWriterLoggerPerformanceTest extends LoggingPerformanceTestCase {
     final Logger logger = LogWriterLogger.create(this.getClass().getName(), false);
     return logger;
   }
-  
+
+  @Override
   protected PerformanceLogger createPerformanceLogger() throws IOException {
     final Logger logger = createLogger();
     
@@ -123,24 +127,4 @@ public class LogWriterLoggerPerformanceTest extends LoggingPerformanceTestCase {
     
     return perfLogger;
   }
-
-  @Override
-  public void testCountBasedLogging() throws Exception {
-    super.testCountBasedLogging();
-  }
-
-  @Override
-  public void testTimeBasedLogging() throws Exception {
-    super.testTimeBasedLogging();
-  }
-
-  @Override
-  public void testCountBasedIsEnabled() throws Exception {
-    super.testCountBasedIsEnabled();
-  }
-
-  @Override
-  public void testTimeBasedIsEnabled() throws Exception {
-    super.testTimeBasedIsEnabled();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
index 43406d3..02a8050 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
@@ -16,11 +16,24 @@
  */
 package com.gemstone.gemfire.internal.offheap;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+import java.util.concurrent.Callable;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.OutOfOffHeapMemoryException;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
@@ -28,40 +41,25 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.cache.DistributedRegion;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
-import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.util.StopWatch;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-import org.apache.logging.log4j.Logger;
-
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static com.jayway.awaitility.Awaitility.with;
-import static org.hamcrest.CoreMatchers.equalTo;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test behavior of region when running out of off-heap memory.
- * 
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
-  private static final Logger logger = LogService.getLogger();
-  
+public class OutOfOffHeapMemoryDUnitTest extends JUnit4CacheTestCase {
+
   protected static final AtomicReference<Cache> cache = new AtomicReference<Cache>();
   protected static final AtomicReference<DistributedSystem> system = new AtomicReference<DistributedSystem>();
   protected static final AtomicBoolean isSmallerVM = new AtomicBoolean();
   
-  public OutOfOffHeapMemoryDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void preSetUp() throws Exception {
     disconnectAllFromDS();
@@ -124,6 +122,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
     return props;
   }
   
+  @Test
   public void testSimpleOutOfOffHeapMemoryMemberDisconnects() {
     final DistributedSystem system = getSystem();
     final Cache cache = getCache();
@@ -194,6 +193,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testOtherMembersSeeOutOfOffHeapMemoryMemberDisconnects() {
     final int vmCount = Host.getHost(0).getVMCount();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
index 8d037b2..692b2a5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
@@ -16,26 +16,33 @@
  */
 package com.gemstone.gemfire.internal.process;
 
+import static org.junit.Assert.*;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Multi-process tests for ProcessLauncher.
  * 
  * @since GemFire 7.0
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class LocalProcessLauncherDUnitTest extends DistributedTestCase {
+public class LocalProcessLauncherDUnitTest extends JUnit4DistributedTestCase {
 
-  public LocalProcessLauncherDUnitTest(String name) {
-    super(name);
+  public LocalProcessLauncherDUnitTest() {
+    super();
   }
 
   @Override
@@ -43,6 +50,7 @@ public class LocalProcessLauncherDUnitTest extends DistributedTestCase {
     new File(getClass().getSimpleName()).mkdir();
   }
   
+  @Test
   public void testExistingPidFileThrows() throws Exception {
     final File pidFile = new File(getClass().getSimpleName() 
         + File.separator + "testExistingPidFileThrows.pid");
@@ -71,6 +79,7 @@ public class LocalProcessLauncherDUnitTest extends DistributedTestCase {
     });
   }
   
+  @Test
   public void testForceReplacesExistingPidFile() throws Exception {
     final File pidFile = new File(getClass().getSimpleName() 
         + File.separator + "testForceReplacesExistingPidFile.pid");
@@ -111,6 +120,7 @@ public class LocalProcessLauncherDUnitTest extends DistributedTestCase {
     });
   }
   
+  @Test
   public void testPidFileReadByOtherProcess() throws Exception {
     final File pidFile = new File(getClass().getSimpleName() 
         + File.separator + "testPidFileReadByOtherProcess.pid");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
index 09cf61a..5f46199 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
@@ -17,31 +17,63 @@
 package com.gemstone.gemfire.internal.statistics;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.atomic.AtomicReferenceArray;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.StatisticDescriptor;
+import com.gemstone.gemfire.Statistics;
+import com.gemstone.gemfire.StatisticsFactory;
+import com.gemstone.gemfire.StatisticsType;
+import com.gemstone.gemfire.StatisticsTypeFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.RegionMembershipListenerAdapter;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.internal.*;
+import com.gemstone.gemfire.internal.GemFireStatSampler;
+import com.gemstone.gemfire.internal.NanoTimer;
+import com.gemstone.gemfire.internal.StatArchiveReader;
 import com.gemstone.gemfire.internal.StatArchiveReader.StatSpec;
 import com.gemstone.gemfire.internal.StatArchiveReader.StatValue;
+import com.gemstone.gemfire.internal.StatSamplerStats;
+import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.atomic.AtomicReferenceArray;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Integration tests for Statistics. VM0 performs puts and VM1 receives
@@ -56,7 +88,8 @@ import java.util.regex.Pattern;
  * @since GemFire 7.0
  */
 @SuppressWarnings("serial")
-public class StatisticsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class StatisticsDUnitTest extends JUnit4CacheTestCase {
 
   private static final String dir = "StatisticsDUnitTest";
 
@@ -94,8 +127,8 @@ public class StatisticsDUnitTest extends CacheTestCase {
     return puts.get();
   }
   
-  public StatisticsDUnitTest(String name) {
-    super(name);
+  public StatisticsDUnitTest() {
+    super();
   }
   
   @Override
@@ -104,6 +137,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
     disconnectAllFromDS(); // because this test enabled stat sampling!
   }
   
+  @Test
   public void testPubAndSubCustomStats() throws Exception {
     final String testName = "testPubAndSubCustomStats";
 
@@ -404,7 +438,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
                 double mean = sv.getSnapshotsAverage();
                 double stdDev = sv.getSnapshotsStandardDeviation();
                 
-                assertEquals(mostRecent, max);
+                assertEquals(mostRecent, max, 0f);
   
                 double summation = 0;
                 double[] rawSnapshots = sv.getRawSnapshots();
@@ -412,7 +446,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
                   //log.convertToLogWriter().info("DEBUG " + ri.getName() + " " + statName + " rawSnapshots[" + j + "] = " + rawSnapshots[j]);
                   summation += rawSnapshots[j];
                 }
-                assertEquals(mean, summation / sv.getSnapshotsSize());
+                assertEquals(mean, summation / sv.getSnapshotsSize(), 0);
                 
                 combinedPuts += mostRecent;
               }
@@ -420,7 +454,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
           }
           
           // assert that sum of mostRecent values for all puts equals totalPuts
-          assertEquals((double)totalPuts, combinedPuts);
+          assertEquals((double)totalPuts, combinedPuts, 0);
           puts.getAndAdd(totalPuts);
         }
       });
@@ -487,7 +521,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
               double mean = sv.getSnapshotsAverage();
               double stdDev = sv.getSnapshotsStandardDeviation();
               
-              assertEquals(mostRecent, max);
+              assertEquals(mostRecent, max,0);
 
               double summation = 0;
               double[] rawSnapshots = sv.getRawSnapshots();
@@ -495,13 +529,13 @@ public class StatisticsDUnitTest extends CacheTestCase {
                 //log.convertToLogWriter().info("DEBUG " + ri.getName() + " " + statName + " rawSnapshots[" + j + "] = " + rawSnapshots[j]);
                 summation += rawSnapshots[j];
               }
-              assertEquals(mean, summation / sv.getSnapshotsSize());
+              assertEquals(mean, summation / sv.getSnapshotsSize(),0);
               
               combinedUpdateEvents += mostRecent;
             }
           }
         }
-        assertEquals((double)totalUpdateEvents, combinedUpdateEvents);
+        assertEquals((double)totalUpdateEvents, combinedUpdateEvents,0);
       }
     });
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
index b13f72f..b671250 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.statistics;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -31,8 +33,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.StatisticDescriptor;
 import com.gemstone.gemfire.Statistics;
 import com.gemstone.gemfire.StatisticsType;
@@ -43,8 +43,6 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-import junit.framework.TestCase;
-
 /**
  * Integration test for the SampleCollector class.
  *   
@@ -55,7 +53,6 @@ public class ValueMonitorJUnitTest {
 
   private Mockery mockContext;
   
-  
   @Before
   public void setUp() throws Exception {
     this.mockContext = new Mockery() {{
@@ -300,8 +297,7 @@ public class ValueMonitorJUnitTest {
     assertEquals(1, statCount);
   }
   
-  protected StatisticId createStatisticId(
-      final StatisticDescriptor descriptor, final Statistics stats) {
+  private StatisticId createStatisticId(final StatisticDescriptor descriptor, final Statistics stats) {
     return new StatisticId() {
 
       @Override
@@ -317,8 +313,7 @@ public class ValueMonitorJUnitTest {
     };
   }
   
-  protected StatisticsNotification createStatisticsNotification(
-      final long timeStamp, final Type type, final Number value) {
+  protected StatisticsNotification createStatisticsNotification(final long timeStamp, final Type type, final Number value) {
     return new StatisticsNotification() {
 
       @Override
@@ -333,22 +328,22 @@ public class ValueMonitorJUnitTest {
 
       @Override
       public Iterator<StatisticId> iterator() {
-        return null; // TODO
+        return null;
       }
 
       @Override
       public Iterator<StatisticId> iterator(StatisticDescriptor statDesc) {
-        return null; // TODO
+        return null;
       }
 
       @Override
       public Iterator<StatisticId> iterator(Statistics statistics) {
-        return null; // TODO
+        return null;
       }
 
       @Override
       public Iterator<StatisticId> iterator(StatisticsType statisticsType) {
-        return null; // TODO
+        return null;
       }
 
       @Override
@@ -361,9 +356,11 @@ public class ValueMonitorJUnitTest {
   
   private static void waitForNotification(final List<StatisticsNotification> notifications, long ms, long interval, boolean throwOnTimeout) {
     WaitCriterion wc = new WaitCriterion() {
+      @Override
       public boolean done() {
         return notifications.size() > 0;
       }
+      @Override
       public String description() {
         return "waiting for notification";
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
index e5aa0fe..ca1fb64 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
@@ -16,22 +16,28 @@
  */
 package com.gemstone.gemfire.internal.util.concurrent;
 
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.TestCase;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
 import java.util.concurrent.ConcurrentMap;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-@SuppressWarnings({ "rawtypes", "unchecked" })
 @Category(IntegrationTest.class)
-public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ConcurrentHashMapIteratorJUnitTest {
 
+  @Test
   public void test() throws InterruptedException {
-    
     //Apparently, we need a distributed system to create
     //this CHM, because it's locks use DS properties.
     Properties props = new Properties();
@@ -46,14 +52,9 @@ public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
     assertEquals(baselineMap, testMap);
     initialSet = new HashMap(baselineMap);
     
-//    putter = new Putter(baselineMap, testMap, 1000, 2000);
-//    putter.run();
-    
-    
     RandomMutations randomer = new RandomMutations(baselineMap, testMap, 1001, 50000);
     randomer.start();
     
-    
     for(int i = 0; i < 1000; i++) {
       checkForInitialSet(i, testMap, initialSet);
     }
@@ -71,23 +72,22 @@ public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
       fail("On run " + i + " did not find these elements of the initial set using the iterator " + missed);
     }
   }
-  
-  public void createBaseline(ConcurrentMap baselineMap, ConcurrentMap testMap, 
+
+  private void createBaseline(ConcurrentMap baselineMap, ConcurrentMap testMap,
       int start, int end) {
     for(int i = start; i < end; i++) {
       baselineMap.put(i, i);
       testMap.put(i, i);
     }
   }
-  
-  public static class RandomMutations extends Thread {
+
+  private static class RandomMutations extends Thread {
     private final ConcurrentMap baselineMap;
     private final ConcurrentMap testMap;
     private int start;
     private int end;
     private volatile boolean done;
-    
-    
+
     public RandomMutations(ConcurrentMap baselineMap, ConcurrentMap testMap, int start, int end) {
       this.baselineMap = baselineMap;
       this.testMap = testMap;
@@ -95,6 +95,7 @@ public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
       this.end = end;
     }
 
+    @Override
     public void run() {
       Random random = new Random();
       while(!done) {
@@ -115,6 +116,4 @@ public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
       this.join();
     }
   }
-     
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/CopyOnWriteHashMapJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/CopyOnWriteHashMapJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/CopyOnWriteHashMapJUnitTest.java
index 6a3142e..c223aff 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/CopyOnWriteHashMapJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/CopyOnWriteHashMapJUnitTest.java
@@ -23,6 +23,8 @@
  */
 package com.gemstone.gemfire.internal.util.concurrent;
 
+import static org.junit.Assert.*;
+
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
@@ -36,6 +38,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.internal.util.concurrent.cm.ConcurrentHashMapJUnitTest;
@@ -46,11 +49,7 @@ import com.gemstone.gemfire.util.JSR166TestCase;
  * Adopted from the JSR166 test cases. {@link ConcurrentHashMapJUnitTest}
  */
 @Category(IntegrationTest.class)
-public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
-
-    public CopyOnWriteHashMapJUnitTest(String name) {
-      super(name);
-    }
+public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase { // TODO: reformat
 
     /**
      * Create a map from Integers 1-5 to Strings "A"-"E".
@@ -75,6 +74,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  clear removes all pairs
      */
+    @Test
     public void testClear() {
         CopyOnWriteHashMap map = map5();
         map.clear();
@@ -84,6 +84,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  Maps with same contents are equal
      */
+    @Test
     public void testEquals() {
         CopyOnWriteHashMap map1 = map5();
         CopyOnWriteHashMap map2 = map5();
@@ -97,6 +98,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  containsKey returns true for contained key
      */
+    @Test
     public void testContainsKey() {
         CopyOnWriteHashMap map = map5();
         assertTrue(map.containsKey(one));
@@ -106,6 +108,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  containsValue returns true for held values
      */
+    @Test
     public void testContainsValue() {
         CopyOnWriteHashMap map = map5();
         assertTrue(map.containsValue("A"));
@@ -116,6 +119,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
      *  get returns the correct element at the given key,
      *  or null if not present
      */
+    @Test
     public void testGet() {
         CopyOnWriteHashMap map = map5();
         assertEquals("A", (String)map.get(one));
@@ -126,6 +130,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  isEmpty is true of empty map and false for non-empty
      */
+    @Test
     public void testIsEmpty() {
         CopyOnWriteHashMap empty = newMap();
         CopyOnWriteHashMap map = map5();
@@ -136,6 +141,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   keySet returns a Set containing all the keys
      */
+    @Test
     public void testKeySet() {
         CopyOnWriteHashMap map = map5();
         Set s = map.keySet();
@@ -150,6 +156,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  keySet.toArray returns contains all keys
      */
+    @Test
     public void testKeySetToArray() {
         CopyOnWriteHashMap map = map5();
         Set s = map.keySet();
@@ -163,6 +170,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  Values.toArray contains all values
      */
+    @Test
     public void testValuesToArray() {
         CopyOnWriteHashMap map = map5();
         Collection v = map.values();
@@ -179,6 +187,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *  entrySet.toArray contains all entries
      */
+    @Test
     public void testEntrySetToArray() {
         CopyOnWriteHashMap map = map5();
         Set s = map.entrySet();
@@ -193,6 +202,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * values collection contains all values
      */
+    @Test
     public void testValues() {
         CopyOnWriteHashMap map = map5();
         Collection s = map.values();
@@ -207,6 +217,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * entrySet contains all pairs
      */
+    @Test
     public void testEntrySet() {
         CopyOnWriteHashMap map = map5();
         Set s = map.entrySet();
@@ -226,6 +237,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   putAll  adds all key-value pairs from the given map
      */
+    @Test
     public void testPutAll() {
         CopyOnWriteHashMap empty = newMap();
         CopyOnWriteHashMap map = map5();
@@ -241,6 +253,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   putIfAbsent works when the given key is not present
      */
+    @Test
     public void testPutIfAbsent() {
         CopyOnWriteHashMap map = map5();
         map.putIfAbsent(six, "Z");
@@ -250,6 +263,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   putIfAbsent does not add the pair if the key is already present
      */
+    @Test
     public void testPutIfAbsent2() {
         CopyOnWriteHashMap map = map5();
         assertEquals("A", map.putIfAbsent(one, "Z"));
@@ -258,6 +272,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   replace fails when the given key is not present
      */
+    @Test
     public void testReplace() {
         CopyOnWriteHashMap map = map5();
         assertNull(map.replace(six, "Z"));
@@ -267,6 +282,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   replace succeeds if the key is already present
      */
+    @Test
     public void testReplace2() {
         CopyOnWriteHashMap map = map5();
         assertNotNull(map.replace(one, "Z"));
@@ -277,6 +293,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace value fails when the given key not mapped to expected value
      */
+    @Test
     public void testReplaceValue() {
         CopyOnWriteHashMap map = map5();
         assertEquals("A", map.get(one));
@@ -287,6 +304,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace value succeeds when the given key mapped to expected value
      */
+    @Test
     public void testReplaceValue2() {
         CopyOnWriteHashMap map = map5();
         assertEquals("A", map.get(one));
@@ -298,6 +316,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   remove removes the correct key-value pair from the map
      */
+    @Test
     public void testRemove() {
         CopyOnWriteHashMap map = map5();
         map.remove(five);
@@ -308,6 +327,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(key,value) removes only if pair present
      */
+    @Test
     public void testRemove2() {
         CopyOnWriteHashMap map = map5();
         map.remove(five, "E");
@@ -322,6 +342,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      *   size returns the correct values
      */
+    @Test
     public void testSize() {
         CopyOnWriteHashMap map = map5();
         CopyOnWriteHashMap empty = newMap();
@@ -332,6 +353,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * toString contains toString of elements
      */
+    @Test
     public void testToString() {
         CopyOnWriteHashMap map = map5();
         String s = map.toString();
@@ -345,6 +367,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * get(null) throws NPE
      */
+    @Test
     public void testGetNull() {
       CopyOnWriteHashMap c = newMap();
       assertNull(c.get(null));
@@ -353,6 +376,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * containsKey(null) throws NPE
      */
+    @Test
     public void testContainsKeyNull() {
       CopyOnWriteHashMap c = newMap();
       assertFalse(c.containsKey(null));
@@ -361,6 +385,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * containsValue(null) throws NPE
      */
+    @Test
     public void testContainsValue_NullPointerException() {
       CopyOnWriteHashMap c = newMap();
       assertFalse(c.containsValue(null));
@@ -369,6 +394,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * put(null,x) throws NPE
      */
+    @Test
     public void testPut1NullKey() {
       CopyOnWriteHashMap c = newMap();
       c.put(null, "whatever");
@@ -379,6 +405,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * put(x, null) throws NPE
      */
+    @Test
     public void testPut2NullValue() {
       CopyOnWriteHashMap c = newMap();
       c.put("whatever", null);
@@ -389,6 +416,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * putIfAbsent(null, x) throws NPE
      */
+    @Test
     public void testPutIfAbsent1NullKey() {
       CopyOnWriteHashMap c = newMap();
       c.putIfAbsent(null, "whatever");
@@ -399,6 +427,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(null, x) throws NPE
      */
+    @Test
     public void testReplace_NullPointerException() {
       CopyOnWriteHashMap c = newMap();
       assertNull(c.replace(null, "whatever"));
@@ -407,6 +436,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(null, x, y) throws NPE
      */
+    @Test
     public void testReplaceValueNullKey() {
       CopyOnWriteHashMap c = newMap();
       c.replace(null, one, "whatever");
@@ -416,6 +446,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * putIfAbsent(x, null) throws NPE
      */
+    @Test
     public void testPutIfAbsent2_NullPointerException() {
       CopyOnWriteHashMap c = newMap();
       c.putIfAbsent("whatever", null);
@@ -427,6 +458,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(x, null) throws NPE
      */
+    @Test
     public void testReplace2Null() {
       CopyOnWriteHashMap c = newMap();
       c.replace("whatever", null);
@@ -437,6 +469,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(x, null, y) throws NPE
      */
+    @Test
     public void testReplaceValue2Null() {
       CopyOnWriteHashMap c = newMap();
       c.replace("whatever", null, "A");
@@ -446,6 +479,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(x, y, null) throws NPE
      */
+    @Test
     public void testReplaceValue3Null() {
       CopyOnWriteHashMap c = newMap();
       c.replace("whatever", one, null);
@@ -456,6 +490,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(null) throws NPE
      */
+    @Test
     public void testRemoveNull() {
       CopyOnWriteHashMap c = newMap();
       c.put("sadsdf", "asdads");
@@ -465,6 +500,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(null, x) throws NPE
      */
+    @Test
     public void testRemove2_NullPointerException() {
       CopyOnWriteHashMap c = newMap();
       c.put("sadsdf", "asdads");
@@ -474,6 +510,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(x, null) returns false
      */
+    @Test
     public void testRemove3() {
         try {
             CopyOnWriteHashMap c = newMap();
@@ -487,6 +524,7 @@ public class CopyOnWriteHashMapJUnitTest extends JSR166TestCase{
     /**
      * A deserialized map equals original
      */
+    @Test
     public void testSerialization() throws Exception {
         CopyOnWriteHashMap q = map5();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/ConcurrentHashMapJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/ConcurrentHashMapJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/ConcurrentHashMapJUnitTest.java
index bd29b6b..b8a52fb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/ConcurrentHashMapJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/ConcurrentHashMapJUnitTest.java
@@ -23,27 +23,31 @@
  */
 package com.gemstone.gemfire.internal.util.concurrent.cm;
 
-import java.io.*;
+import static org.junit.Assert.*;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Set;
 import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Map;
+import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap;
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
-
-    public ConcurrentHashMapJUnitTest(String name) {
-      super(name);
-    }
+public class ConcurrentHashMapJUnitTest extends JSR166TestCase { // TODO: reformat
 
     /**
      * Create a map from Integers 1-5 to Strings "A"-"E".
@@ -64,6 +68,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  clear removes all pairs
      */
+    @Test
     public void testClear() {
         CustomEntryConcurrentHashMap map = map5();
         map.clear();
@@ -73,6 +78,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  Maps with same contents are equal
      */
+    @Test
     public void testEquals() {
         CustomEntryConcurrentHashMap map1 = map5();
         CustomEntryConcurrentHashMap map2 = map5();
@@ -86,6 +92,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  contains returns true for contained value
      */
+    @Test
     public void testContains() {
         CustomEntryConcurrentHashMap map = map5();
         assertTrue(map.contains("A"));
@@ -95,6 +102,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  containsKey returns true for contained key
      */
+    @Test
     public void testContainsKey() {
         CustomEntryConcurrentHashMap map = map5();
         assertTrue(map.containsKey(one));
@@ -104,6 +112,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  containsValue returns true for held values
      */
+    @Test
     public void testContainsValue() {
         CustomEntryConcurrentHashMap map = map5();
         assertTrue(map.containsValue("A"));
@@ -114,6 +123,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
      *   enumeration returns an enumeration containing the correct
      *   elements
      */
+    @Test
     public void testEnumeration() {
         CustomEntryConcurrentHashMap map = map5();
         Enumeration e = map.elements();
@@ -129,6 +139,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
      *  get returns the correct element at the given key,
      *  or null if not present
      */
+    @Test
     public void testGet() {
         CustomEntryConcurrentHashMap map = map5();
         assertEquals("A", (String)map.get(one));
@@ -139,6 +150,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  isEmpty is true of empty map and false for non-empty
      */
+    @Test
     public void testIsEmpty() {
         CustomEntryConcurrentHashMap empty = new CustomEntryConcurrentHashMap();
         CustomEntryConcurrentHashMap map = map5();
@@ -149,6 +161,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   keys returns an enumeration containing all the keys from the map
      */
+    @Test
     public void testKeys() {
         CustomEntryConcurrentHashMap map = map5();
         Enumeration e = map.keys();
@@ -163,6 +176,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   keySet returns a Set containing all the keys
      */
+    @Test
     public void testKeySet() {
         CustomEntryConcurrentHashMap map = map5();
         Set s = map.keySet();
@@ -177,6 +191,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  keySet.toArray returns contains all keys
      */
+    @Test
     public void testKeySetToArray() {
         CustomEntryConcurrentHashMap map = map5();
         Set s = map.keySet();
@@ -190,6 +205,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  Values.toArray contains all values
      */
+    @Test
     public void testValuesToArray() {
         CustomEntryConcurrentHashMap map = map5();
         Collection v = map.values();
@@ -206,6 +222,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *  entrySet.toArray contains all entries
      */
+    @Test
     public void testEntrySetToArray() {
         CustomEntryConcurrentHashMap map = map5();
         Set s = map.entrySet();
@@ -220,6 +237,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * values collection contains all values
      */
+    @Test
     public void testValues() {
         CustomEntryConcurrentHashMap map = map5();
         Collection s = map.values();
@@ -234,6 +252,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * entrySet contains all pairs
      */
+    @Test
     public void testEntrySet() {
         CustomEntryConcurrentHashMap map = map5();
         Set s = map.entrySet();
@@ -253,6 +272,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   putAll  adds all key-value pairs from the given map
      */
+    @Test
     public void testPutAll() {
         CustomEntryConcurrentHashMap empty = new CustomEntryConcurrentHashMap();
         CustomEntryConcurrentHashMap map = map5();
@@ -268,6 +288,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   putIfAbsent works when the given key is not present
      */
+    @Test
     public void testPutIfAbsent() {
         CustomEntryConcurrentHashMap map = map5();
         map.putIfAbsent(six, "Z");
@@ -277,6 +298,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   putIfAbsent does not add the pair if the key is already present
      */
+    @Test
     public void testPutIfAbsent2() {
         CustomEntryConcurrentHashMap map = map5();
         assertEquals("A", map.putIfAbsent(one, "Z"));
@@ -285,6 +307,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   replace fails when the given key is not present
      */
+    @Test
     public void testReplace() {
         CustomEntryConcurrentHashMap map = map5();
         assertNull(map.replace(six, "Z"));
@@ -294,6 +317,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   replace succeeds if the key is already present
      */
+    @Test
     public void testReplace2() {
         CustomEntryConcurrentHashMap map = map5();
         assertNotNull(map.replace(one, "Z"));
@@ -304,6 +328,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace value fails when the given key not mapped to expected value
      */
+    @Test
     public void testReplaceValue() {
         CustomEntryConcurrentHashMap map = map5();
         assertEquals("A", map.get(one));
@@ -314,6 +339,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace value succeeds when the given key mapped to expected value
      */
+    @Test
     public void testReplaceValue2() {
         CustomEntryConcurrentHashMap map = map5();
         assertEquals("A", map.get(one));
@@ -325,6 +351,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   remove removes the correct key-value pair from the map
      */
+    @Test
     public void testRemove() {
         CustomEntryConcurrentHashMap map = map5();
         map.remove(five);
@@ -335,6 +362,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(key,value) removes only if pair present
      */
+    @Test
     public void testRemove2() {
         CustomEntryConcurrentHashMap map = map5();
         map.remove(five, "E");
@@ -349,6 +377,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      *   size returns the correct values
      */
+    @Test
     public void testSize() {
         CustomEntryConcurrentHashMap map = map5();
         CustomEntryConcurrentHashMap empty = new CustomEntryConcurrentHashMap();
@@ -359,6 +388,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * toString contains toString of elements
      */
+    @Test
     public void testToString() {
         CustomEntryConcurrentHashMap map = map5();
         String s = map.toString();
@@ -372,6 +402,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * Cannot create with negative capacity
      */
+    @Test
     public void testConstructor1() {
         try {
             new CustomEntryConcurrentHashMap(-1,0,1);
@@ -382,6 +413,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * Cannot create with negative concurrency level
      */
+    @Test
     public void testConstructor2() {
         try {
             new CustomEntryConcurrentHashMap(1,0,-1);
@@ -392,6 +424,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * Cannot create with only negative capacity
      */
+    @Test
     public void testConstructor3() {
         try {
             new CustomEntryConcurrentHashMap(-1);
@@ -402,6 +435,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * get(null) throws NPE
      */
+    @Test
     public void testGet_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -413,6 +447,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * containsKey(null) throws NPE
      */
+    @Test
     public void testContainsKey_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -424,6 +459,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * containsValue(null) throws NPE
      */
+    @Test
     public void testContainsValue_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -435,6 +471,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * contains(null) throws NPE
      */
+    @Test
     public void testContains_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -446,6 +483,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * put(null,x) throws NPE
      */
+    @Test
     public void testPut1_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -457,6 +495,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * put(x, null) throws NPE
      */
+    @Test
     public void testPut2_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -468,6 +507,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * putIfAbsent(null, x) throws NPE
      */
+    @Test
     public void testPutIfAbsent1_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -479,6 +519,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(null, x) throws NPE
      */
+    @Test
     public void testReplace_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -490,6 +531,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(null, x, y) throws NPE
      */
+    @Test
     public void testReplaceValue_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -501,6 +543,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * putIfAbsent(x, null) throws NPE
      */
+    @Test
     public void testPutIfAbsent2_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -513,6 +556,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(x, null) throws NPE
      */
+    @Test
     public void testReplace2_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -524,6 +568,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(x, null, y) throws NPE
      */
+    @Test
     public void testReplaceValue2_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -535,6 +580,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * replace(x, y, null) throws NPE
      */
+    @Test
     public void testReplaceValue3_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -547,6 +593,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(null) throws NPE
      */
+    @Test
     public void testRemove1_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -559,6 +606,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(null, x) throws NPE
      */
+    @Test
     public void testRemove2_NullPointerException() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -571,6 +619,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * remove(x, null) returns false
      */
+    @Test
     public void testRemove3() {
         try {
             CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
@@ -584,6 +633,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * A deserialized map equals original
      */
+    @Test
     public void testSerialization() {
         CustomEntryConcurrentHashMap q = map5();
 
@@ -609,6 +659,7 @@ public class ConcurrentHashMapJUnitTest extends JSR166TestCase{
     /**
      * SetValue of an EntrySet entry sets value in the map.
      */
+    @Test
     public void testSetValueWriteThrough() {
         // Adapted from a bug report by Eric Zoerner
         CustomEntryConcurrentHashMap map = new CustomEntryConcurrentHashMap(2, 5.0f, 1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/CountedMapLoopsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/CountedMapLoopsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/CountedMapLoopsJUnitTest.java
index fed909f..bba6ffb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/CountedMapLoopsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/CountedMapLoopsJUnitTest.java
@@ -37,13 +37,14 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class CountedMapLoopsJUnitTest extends JSR166TestCase {
+public class CountedMapLoopsJUnitTest extends JSR166TestCase { // TODO: reformat
 
     static int nkeys       = 100000;
     static int pinsert     = 60;
@@ -55,10 +56,7 @@ public class CountedMapLoopsJUnitTest extends JSR166TestCase {
 
     static final ExecutorService pool = Executors.newCachedThreadPool();
 
-    public CountedMapLoopsJUnitTest(String name) {
-      super(name);
-    }
-
+    @Test
     public void testCountedMapLoops() throws Exception {
       main(new String[0]);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/IntMapCheckJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/IntMapCheckJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/IntMapCheckJUnitTest.java
index 1534f93..c04f724 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/IntMapCheckJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/IntMapCheckJUnitTest.java
@@ -25,22 +25,29 @@
  */
 package com.gemstone.gemfire.internal.util.concurrent.cm;
 
-import java.io.*;
-import java.util.Map;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Set;
+import java.util.IdentityHashMap;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.Random;
-import java.util.IdentityHashMap;
-import java.util.Enumeration;
+import java.util.Set;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class IntMapCheckJUnitTest extends JSR166TestCase {
+public class IntMapCheckJUnitTest extends JSR166TestCase { // TODO: reformat
 
     static int absentSize;
     static int absentMask;
@@ -52,10 +59,7 @@ public class IntMapCheckJUnitTest extends JSR166TestCase {
         if (!b) throw new Error("Failed Assertion");
     }
 
-    public IntMapCheckJUnitTest(String name) {
-      super(name);
-    }
-
+    @Test
     public void testIntMapCheck() throws Exception {
       main(new String[0]);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapCheckJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapCheckJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapCheckJUnitTest.java
index e1330c3..db2c63a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapCheckJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapCheckJUnitTest.java
@@ -25,22 +25,29 @@
  */
 package com.gemstone.gemfire.internal.util.concurrent.cm;
 
-import java.io.*;
-import java.util.Map;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.IdentityHashMap;
 import java.util.Iterator;
-import java.util.Set;
+import java.util.Map;
 import java.util.Random;
-import java.util.IdentityHashMap;
-import java.util.Enumeration;
+import java.util.Set;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class MapCheckJUnitTest extends JSR166TestCase {
+public class MapCheckJUnitTest extends JSR166TestCase { // TODO: reformat
 
     static final int absentSize = 1 << 17;
     static final int absentMask = absentSize - 1;
@@ -54,10 +61,7 @@ public class MapCheckJUnitTest extends JSR166TestCase {
         if (!b) throw new Error("Failed Assertion");
     }
 
-    public MapCheckJUnitTest(String name) {
-      super(name);
-    }
-
+    @Test
     public void testMapCheck() throws Exception {
       main(new String[0]);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapLoopsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapLoopsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapLoopsJUnitTest.java
index 58f4647..39baedb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapLoopsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/MapLoopsJUnitTest.java
@@ -28,7 +28,6 @@
  * Expert Group and released to the public domain. Use, modify, and
  * redistribute this code in any way without acknowledgement.
  */
-
 package com.gemstone.gemfire.internal.util.concurrent.cm;
 
 import java.util.Map;
@@ -37,13 +36,15 @@ import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class MapLoopsJUnitTest extends JSR166TestCase {
+public class MapLoopsJUnitTest extends JSR166TestCase { // TODO: reformat
+
     static int nkeys       = 1000;
     static int pinsert     = 60;
     static int premove     = 2;
@@ -54,10 +55,7 @@ public class MapLoopsJUnitTest extends JSR166TestCase {
 
     static final ExecutorService pool = Executors.newCachedThreadPool();
 
-    public MapLoopsJUnitTest(String name) {
-      super(name);
-    }
-
+  @Test
     public void testMapLoops() throws Exception {
       main(new String[0]);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/RLJBarJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/RLJBarJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/RLJBarJUnitTest.java
index 2de98f3..077c8be 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/RLJBarJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/RLJBarJUnitTest.java
@@ -23,16 +23,16 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.ReentrantLock;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class RLJBarJUnitTest extends JSR166TestCase
-{
+public class RLJBarJUnitTest extends JSR166TestCase { // TODO: reformat
 
-    public static final int ITERS = 10;
+  public static final int ITERS = 10;
   public static boolean OneKey = false ; 			// alloc once or once per iteration
 
   public static boolean UseBar = false ;
@@ -47,10 +47,7 @@ public class RLJBarJUnitTest extends JSR166TestCase
   public static int quiesce = 0 ;
   public static Condition EndCondition = End.newCondition();
 
-  public RLJBarJUnitTest(String name) {
-    super(name);
-  }
-
+  @Test
   public void testRLJBar() throws Exception {
     main(new String[0]);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/StringMapLoopsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/StringMapLoopsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/StringMapLoopsJUnitTest.java
index b8d3462..2945ee6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/StringMapLoopsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/cm/StringMapLoopsJUnitTest.java
@@ -36,13 +36,14 @@ import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.util.JSR166TestCase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.JSR166TestCase;
 
 @Category(IntegrationTest.class)
-public class StringMapLoopsJUnitTest extends JSR166TestCase {
+public class StringMapLoopsJUnitTest extends JSR166TestCase { // TODO: reformat
 
     static int nkeys       = 1000;
     static int pinsert     = 60;
@@ -54,10 +55,7 @@ public class StringMapLoopsJUnitTest extends JSR166TestCase {
 
     static final ExecutorService pool = Executors.newCachedThreadPool();
 
-    public StringMapLoopsJUnitTest(String name) {
-      super(name);
-    }
-
+    @Test
     public void testStringMapLoops() throws Exception {
       main(new String[0]);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
index 9d314dd..8cbbf03 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
@@ -16,7 +16,33 @@
  */
 package com.gemstone.gemfire.management;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import javax.management.InstanceNotFoundException;
+import javax.management.JMException;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.FixedPartitionAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
@@ -25,17 +51,13 @@ import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
 import com.gemstone.gemfire.management.internal.ManagementConstants;
 import com.gemstone.gemfire.management.internal.NotificationHub.NotificationHubListener;
 import com.gemstone.gemfire.management.internal.SystemManagementService;
-import com.gemstone.gemfire.test.dunit.*;
-
-import javax.management.*;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-
-import static com.jayway.awaitility.Awaitility.to;
-import static com.jayway.awaitility.Awaitility.waitAtMost;
-import static org.hamcrest.Matchers.equalTo;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class checks and verifies various data and operations exposed through
@@ -44,13 +66,10 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * Goal of the Test : MemberMBean gets created once cache is created. Data like
  * config data and stats are of proper value To check proper federation of
  * MemberMBean including remote ops and remote data access
- * 
- * 
  */
+@Category(DistributedTest.class)
 public class CacheManagementDUnitTest extends ManagementTestBase {
 
-  private static final long serialVersionUID = 1L;
-
   private final String VERIFY_CONFIG_METHOD = "verifyConfigData";
 
   private final String VERIFY_REMOTE_CONFIG_METHOD = "verifyConfigDataRemote";
@@ -63,7 +82,6 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
 
   static List<FixedPartitionAttributes> fpaList = new ArrayList<FixedPartitionAttributes>();
 
-
   static final List<Notification> notifList = new ArrayList<Notification>();
   
   // This must be bigger than the dunit ack-wait-threshold for the revoke
@@ -71,12 +89,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
   // 60 seconds.
   private static final int MAX_WAIT = 70 * 1000;
 
-
-
-  public CacheManagementDUnitTest(String name) {
-    super(name);
-  }
-
+  @Test
   public void testGemFireConfigData() throws Exception {
      initManagement(false);
    
@@ -91,16 +104,13 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     args[0] = configMap;
     getManagingNode().invoke(
         CacheManagementDUnitTest.class, VERIFY_REMOTE_CONFIG_METHOD, args);
- 
   }
 
   /**
    * Tests each and every operations that is defined on the MemberMXBean
-   * 
-   * @throws Exception
    */
+  @Test
   public void testMemberMBeanOperations() throws Exception {
-    
     initManagement(false);
     
     for (VM vm : managedNodeList) {
@@ -109,22 +119,17 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
       
       createLocalRegion(vm,"testRegion");
 
-
-
       String log = (String) vm.invoke(() -> CacheManagementDUnitTest.fetchLog());
       assertNotNull(log);
       LogWriterUtils.getLogWriter().info(
           "<ExpectedString> Log Of Member is " + log.toString()
               + "</ExpectedString> ");
 
-     
-
       vm.invoke(() -> CacheManagementDUnitTest.fetchJVMMetrics());
 
       vm.invoke(() -> CacheManagementDUnitTest.fetchOSMetrics());
 
       vm.invoke(() -> CacheManagementDUnitTest.shutDownMember());
-
     }
     
     VM managingNode = getManagingNode();
@@ -132,13 +137,12 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     args[0] = 1;// Only locator member wont be shutdown
     managingNode.invoke(CacheManagementDUnitTest.class,
         "assertExpectedMembers", args);
-    
   }
 
   /**
    * Invoke remote operations on MemberMBean
-   * @throws Exception
    */
+  @Test
   public void testMemberMBeanOpsRemote() throws Exception {
     initManagement(false);
     getManagingNode().invoke(() -> CacheManagementDUnitTest.invokeRemoteOps());
@@ -147,9 +151,8 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
   /**
    * Creates and starts a manager.
    * Multiple Managers
-   * 
-   * @throws Exception
    */
+  @Test
   public void testManager() throws Exception {
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
@@ -173,15 +176,13 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     startManagingNode(managingNode);
     checkManagerView(managingNode, member);
     stopManagingNode(managingNode);
-
   }
   
   /**
    * Creates and starts a manager.
    * Multiple Managers
-   * 
-   * @throws Exception
    */
+  @Test
   public void testManagerShutdown() throws Exception {
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
@@ -204,6 +205,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     checkNonManagerView(managingNode);
   }
   
+  @Test
   public void testServiceCloseManagedNode() throws Exception{
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
@@ -223,9 +225,9 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     
     closeCache(node3);
     validateServiceResource(node3);
-
   }
   
+  @Test
   public void testGetMBean() throws Exception{
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
@@ -242,9 +244,9 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     startManagingNode(managingNode);
 
     checkGetMBean(managingNode);
-
   }
   
+  @Test
   public void testQueryMBeans() throws Exception{
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
@@ -261,7 +263,6 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     startManagingNode(managingNode);
 
     checkQueryMBeans(managingNode);
-
   }
 
   protected void checkQueryMBeans(final VM vm) {
@@ -286,13 +287,10 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
           assertTrue(names.contains(memberMBeanName));
 
         }
-        
-        
+
         Set<ObjectName> names = managementService.queryMBeanNames(cache
             .getDistributedSystem().getDistributedMember());
         assertTrue(!superSet.contains(names));
-         
-
       }
     };
     vm.invoke(validateServiceResource);
@@ -330,7 +328,6 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
       }
     };
     vm.invoke(validateServiceResource);
-
   }
 
   protected void validateServiceResource(final VM vm) {
@@ -344,19 +341,13 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
         
         SystemManagementService service = (SystemManagementService)managementService;
         assertNull(service.getLocalManager());
-        
-        
-
       }
     };
     vm.invoke(validateServiceResource);
-
   }
   
   /**
    * Creates a Distributed Region
-   * 
-   * @param vm
    */
   protected AsyncInvocation checkManagerView(final VM vm,
       final DistributedMember oneManager) {
@@ -387,10 +378,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
   
   /**
    * Add any Manager clean up asserts here
-   * 
-   * @param vm
    */
-
   protected void checkNonManagerView(final VM vm) {
     SerializableRunnable checkNonManagerView = new SerializableRunnable(
         "Check Non Manager View") {
@@ -420,10 +408,8 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
       }
     };
     vm.invoke(checkNonManagerView);
-
   }
   
-
   public static Map<DistributedMember, DistributionConfig> verifyConfigData() {
     GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
     ManagementService service = getManagementService();
@@ -431,7 +417,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
         .getDistributedSystem()).getConfig();
     MemberMXBean bean = service.getMemberMXBean();
     GemFireProperties data = bean.listGemFireProperties();
-    assertEquals(config, data);
+    assertConfigEquals(config, data);
     Map<DistributedMember, DistributionConfig> configMap = new HashMap<DistributedMember, DistributionConfig>();
     configMap.put(cache.getMyId(), config);
     return configMap;
@@ -451,21 +437,19 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
       MemberMXBean bean = MBeanUtil.getMemberMbeanProxy(member);
       GemFireProperties data = bean.listGemFireProperties();
       DistributionConfig config = configMap.get(member);
-      assertEquals(config, data);
-
+      assertConfigEquals(config, data);
     }
-
   }
 
   /**
    * Asserts that distribution config and gemfireProperty composite types hold
    * the same values
    */
-  public static void assertEquals(DistributionConfig config,
+  public static void assertConfigEquals(DistributionConfig config,
       GemFireProperties data) {
 
     assertEquals(data.getMemberName(), config.getName());
-    // **TODO **/
+    // **TODO **
     String memberGroups = null;
 
     assertEquals(data.getMcastPort(), config.getMcastPort());
@@ -475,7 +459,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     assertEquals(data.getTcpPort(), config.getTcpPort());
     assertEquals(removeVMDir(data.getCacheXMLFile()), removeVMDir(config.getCacheXmlFile()
         .getAbsolutePath()));
-    // **TODO **/
+    // **TODO **
     String configFile = null;
     String configFile1 = null;
     assertEquals(data.getMcastTTL(), config.getMcastTtl());
@@ -489,7 +473,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
         .getStatisticSamplingEnabled());
     assertEquals(removeVMDir(data.getStatisticArchiveFile()), removeVMDir(config
         .getStatisticArchiveFile().getAbsolutePath()));
-    // ** TODO **//
+    // ** TODO **
     String includeFile = null;
     assertEquals(data.getAckWaitThreshold(), config.getAckWaitThreshold());
     assertEquals(data.getAckSevereAlertThreshold(), config
@@ -512,7 +496,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     assertEquals(data.getMcastByteAllowance(), config.getMcastFlowControl()
         .getByteAllowance());
     assertEquals(data.getMcastRechargeThreshold(), config.getMcastFlowControl()
-        .getRechargeThreshold());
+        .getRechargeThreshold(), 0);
     assertEquals(data.getMcastRechargeBlockMs(), config.getMcastFlowControl()
         .getRechargeBlockMs());
     assertEquals(data.getUdpFragmentSize(), config.getUdpFragmentSize());
@@ -573,7 +557,6 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     assertEquals(data.getStatisticSampleRate(), config.getStatisticSampleRate());
   }
 
-  
   private static String removeVMDir(String string) {
     return string.replaceAll("vm.", "");
   }
@@ -631,7 +614,6 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     LogWriterUtils.getLogWriter().info(
         "<ExpectedString> JVMMetrics is " + metrics.toString()
             + "</ExpectedString> ");
-
   }
 
   public static void fetchOSMetrics() {
@@ -642,14 +624,12 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     LogWriterUtils.getLogWriter().info(
         "<ExpectedString> OSMetrics is " + metrics.toString()
             + "</ExpectedString> ");
-
   }
 
   public static void shutDownMember() {
     MemberMXBean bean = getManagementService()
         .getMemberMXBean();
     bean.shutDownMember();
-
   }
 
   public static void assertExpectedMembers(int expectedMemberCount) {
@@ -667,10 +647,8 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
       }
 
     }, MAX_WAIT, 500, true);
-
   }
 
-
   public static void invokeRemoteOps() throws Exception {
     GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
     Set<DistributedMember> otherMemberSet = cache.getDistributionManager()
@@ -690,21 +668,11 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
       LogWriterUtils.getLogWriter().info(
           "<ExpectedString> Boolean Data Check " +bean.isManager()
               + "</ExpectedString> ");
-      
     }
   }
 
-  public void verifyStatistics() {
-
-  }
-
-  public void invokeOperations() {
-
-  }
-  
-  
+  @Test
   public void testNotification() throws Exception {
-
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
     VM node2 = managedNodeList.get(1);
@@ -724,11 +692,10 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
 
     // Step : 3 : Verify Notification count, notification region sizes
     countNotificationsAndCheckRegionSize(node1, node2, node3, managingNode);
-
   }
 
+  @Test
   public void testNotificationManagingNodeFirst() throws Exception {
-
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
     VM node2 = managedNodeList.get(1);
@@ -748,11 +715,10 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
 
     // Step : 3 : Verify Notification count, notification region sizes
     countNotificationsAndCheckRegionSize(node1, node2, node3, managingNode);
-
   }
   
+  @Test
   public void testRedundancyZone() throws Exception {
-
     List<VM> managedNodeList = getManagedNodeList();
     VM node1 = managedNodeList.get(0);
     VM node2 = managedNodeList.get(1);
@@ -765,17 +731,11 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
     node1.invoke(new SerializableRunnable("Assert Redundancy Zone") {
 
       public void run() {
-
         ManagementService service = ManagementService.getExistingManagementService(getCache());
         MemberMXBean bean = service.getMemberMXBean();
         assertEquals("ARMY_ZONE", bean.getRedundancyZone());
-
-        
-
       }
     });
-
-
   }
 
   protected void attchListenerToDSMBean(final VM vm) {
@@ -799,7 +759,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
         try {
           mbeanServer.addNotificationListener(MBeanJMXAdapter.getDistributedSystemName(), nt, null, null);
         } catch (InstanceNotFoundException e) {
-          fail("Failed With Exception "  + e);
+          throw new AssertionError("Failed With Exception ", e);
         }
 
       }


[03/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
index 8614a80..c178454 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
@@ -16,9 +16,34 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.Delta;
 import com.gemstone.gemfire.DeltaTestImpl;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.query.CqAttributes;
@@ -35,27 +60,24 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- * 
  * Tests the PR delta propagation functionality.
- * 
  */
-public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class PRDeltaPropagationDUnitTest extends JUnit4DistributedTestCase {
   
   private final static Compressor compressor = SnappyCompressor.getDefaultInstance();
 
-  private static final long serialVersionUID = 1L;
-
   protected static Cache cache = null;
 
   protected static VM dataStore1 = null;
@@ -93,7 +115,6 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   /*
    * cq 
    */
-  //private static final String CQ = "SELECT * FROM "+Region.SEPARATOR+REGION_NAME;
   private static final String CQ = "SELECT * FROM "+Region.SEPARATOR+REGION_NAME + " p where p.intVar < 9";
     
   private static int numValidCqEvents = 0;
@@ -102,10 +123,6 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   private static boolean queryDestroyExecuted = false;
   private static boolean notADeltaInstanceObj = false;
 
-  public PRDeltaPropagationDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -121,12 +138,12 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   /**
-   *  1) Put delta objects on accessor node.
-   *  2) From accessor to primary delta gets propagated as part of <code>PutMessage</code> delta.
-   *  3) From primary to secondary delta gets propagated as part RR distribution.
-   * 
+   * 1) Put delta objects on accessor node.
+   * 2) From accessor to primary delta gets propagated as part of <code>PutMessage</code> delta.
+   * 3) From primary to secondary delta gets propagated as part RR distribution.
    */
-  public void testDeltaPropagationForPR() throws Throwable {
+  @Test
+  public void testDeltaPropagationForPR() throws Exception {
     createCacheInAllPRVms();
     createDeltaPR(Boolean.FALSE);
     put();
@@ -136,10 +153,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   /**
-   *  Monitor number of times constructor is called
-   *  Without copy or cloning, we should have 1 instance
+   * Monitor number of times constructor is called
+   * Without copy or cloning, we should have 1 instance
    */
-  public void testConstructorCountWithoutCloning() throws Throwable {
+  @Test
+  public void testConstructorCountWithoutCloning() throws Exception {
 
     clearConstructorCounts();
     createCacheInAllPRVms();
@@ -156,11 +174,12 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   /**
-   *  Monitor number of times constructor is called
-   *  With cloning, we should have more than 1 instance
-   *  on members receiving delta updates
+   * Monitor number of times constructor is called
+   * With cloning, we should have more than 1 instance
+   * on members receiving delta updates
    */
-  public void testConstructorCountWithCloning() throws Throwable {
+  @Test
+  public void testConstructorCountWithCloning() throws Exception {
 
     clearConstructorCounts();
     createCacheInAllPRVms();
@@ -178,10 +197,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   /**
-   *  Create partition with cloning disabled, then
-   *  enable cloning and verify proper operation 
+   * Create partition with cloning disabled, then
+   * enable cloning and verify proper operation
    */
-  public void testConstructorCountWithMutator() throws Throwable {
+  @Test
+  public void testConstructorCountWithMutator() throws Exception {
 
     clearConstructorCounts();
     createCacheInAllPRVms();
@@ -238,7 +258,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     assertFalse(copy);
   }
   
-  private void clearConstructorCounts() throws Throwable {
+  private void clearConstructorCounts() throws Exception {
     setBuildCount(0);
     dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.setBuildCount(0));
     dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.setBuildCount(0));
@@ -255,8 +275,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   /**
    * Check delta propagation works properly with PR failover.    
    */
-
-  public void testDeltaPropagationForPRFailover() throws Throwable {
+  @Test
+  public void testDeltaPropagationForPRFailover() throws Exception {
     Object args[] = new Object[] { REGION_NAME, new Integer(1), new Integer(50),
         new Integer(8), Boolean.FALSE, null };
     Integer port1 = (Integer)dataStore1.invoke(
@@ -290,7 +310,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));    
   }
 
-  public void testDeltaPropagationForPRFailoverWithCompression() throws Throwable {
+  @Test
+  public void testDeltaPropagationForPRFailoverWithCompression() throws Exception {
     Object args[] = new Object[] { REGION_NAME, new Integer(1), new Integer(50),
         new Integer(8), Boolean.FALSE, compressor };
     Integer port1 = (Integer)dataStore1.invoke(
@@ -332,8 +353,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   /**
    * Check full object gets resend if delta can not be applied    
    */
-
-  public void testDeltaPropagationForPRWithExpiry() throws Throwable {
+  @Test
+  public void testDeltaPropagationForPRWithExpiry() throws Exception {
     createCacheInAllPRVms();
     createDeltaPR(Boolean.TRUE);
     putWithExpiry();
@@ -342,12 +363,12 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   /**
-   *  1) Put delta objects on client feeder connected PR accessor bridge server.
-   *  2) From accessor to data store delta gets propagated as part of <code>PutMessage</code> delta.
-   *  3) From data store to client delta should get propagated.
-   * 
+   * 1) Put delta objects on client feeder connected PR accessor bridge server.
+   * 2) From accessor to data store delta gets propagated as part of <code>PutMessage</code> delta.
+   * 3) From data store to client delta should get propagated.
    */
-  public void testDeltaPropagationPRAccessorAsBridgeServer() throws Throwable {
+  @Test
+  public void testDeltaPropagationPRAccessorAsBridgeServer() throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
         new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@ -372,9 +393,9 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
    * datastore node. This invalid delta exception propagated back to client
    * through accessor. 
    * 4) Client sends full object in response.
-   * 
    */
-  public void testDeltaPropagationPRAccessorAsBridgeServerWithDeltaException() throws Throwable {
+  @Test
+  public void testDeltaPropagationPRAccessorAsBridgeServerWithDeltaException() throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
         new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@ -396,14 +417,11 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     // perform invalidate on accessor
     dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.invalidateDeltaKey());
     
-    /*Thread.sleep(2000);*/
-
     test = new DeltaTestImpl();
     test.setStr("DELTA");
     deltaPR.put(DELTA_KEY, test);
 
-/*    putWithExpiry();*/    
-    deltaPR.put(LAST_KEY, "");    
+    deltaPR.put(LAST_KEY, "");
     client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
     client1.invoke(() -> PRDeltaPropagationDUnitTest.checkForFullObject());    
   }
@@ -416,10 +434,10 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
    * datastore node. This invalid delta exception propagated back to client
    * through accessor. 
    * 4) Client sends full object in response.
-   * 
    */
+  @Test
   public void testDeltaPropagationClientEmptyPRAccessorAsBridgeServerWithDeltaException()
-      throws Throwable {
+      throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(0),
         new Integer(0), new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(0),
@@ -462,18 +480,17 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
    * datastore node. This invalid delta exception propagated back to client
    * through accessor. 
    * 4) Client sends full object in response.
-   * 
    */
-  public void testDeltaPropagationReplicatedRegionPeerWithDeltaException() throws Throwable {
+  @Test
+  public void testDeltaPropagationReplicatedRegionPeerWithDeltaException() throws Exception {
     Object args1[] = new Object[] {Boolean.FALSE, Boolean.TRUE};
     Object args2[] = new Object[] {Boolean.TRUE, Boolean.FALSE};
-//  server 1 with empty data policy
+    //  server 1 with empty data policy
     Integer port1 = (Integer)dataStore1.invoke(
         PRDeltaPropagationDUnitTest.class, "createServerCache", args1);
     
     // server 2 with non empty data policy
-   dataStore2.invoke(
-        PRDeltaPropagationDUnitTest.class, "createServerCache", args2);
+    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "createServerCache", args2);
     
     createClientCache(port1, Boolean.FALSE, Boolean.FALSE,  Boolean.FALSE);
 
@@ -505,8 +522,9 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
    * 2) Second client attached to datastore. Register CQ.
    * 3) Varifies that no data loss, event revcieved on second client 
    */
+  @Test
   public void testCqClientConnectAccessorAndDataStore()
-      throws Throwable {
+      throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(1),
         new Integer(0), new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(1),
@@ -555,14 +573,15 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   /**
-   * Toplogy: PR: Accessor, dataStore.
+   * Topology: PR: Accessor, dataStore.
    * client and client1 connected to PR accessor; 
    * client puts delta objects on dataStore via accessor
-   * Accesor gets adjunctMessage about put
+   * Accessor gets adjunctMessage about put
    * Verify on client1 that queryUpdate and queryDestroy are executed properly
    */
+  @Test
   public void testClientOnAccessorReceivesCqEvents()
-      throws Throwable {
+      throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(1),
         new Integer(0), new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(1),
@@ -607,8 +626,9 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
    * client puts delta objects on accessor
    * Verify on client1 that queryUpdate and queryDestroy are executed properly
    */  
+  @Test
   public void testCQClientOnRedundantBucketReceivesCQEvents()
-      throws Throwable {
+      throws Exception {
     // args for accessor
     Object args1[] = new Object[] { REGION_NAME, new Integer(1),
         new Integer(0), new Integer(2), Boolean.FALSE, null };
@@ -665,8 +685,9 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
    * Verify that client1 receives 2 deltas for 2 updates (due to RI)
    * Verify on client1 that queryUpdate and queryDestroy are executed properly
    */  
+  @Test
   public void testCQRIClientOnRedundantBucketReceivesDeltaAndCQEvents()
-      throws Throwable {
+      throws Exception {
     // args for accessor
     Object args1[] = new Object[] { REGION_NAME, new Integer(1),
         new Integer(0), new Integer(2), Boolean.FALSE, null };
@@ -712,13 +733,13 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   /**
-   *  1) Put delta objects on client feeder connected to PR accessor bridge server.
-   *  2) From accessor to data store delta gets propagated as part of <code>PutMessage</code> delta.
-   *  3) From data store to accessor delta + full value gets propagated as part of Adjunct Message.
-   *  4) From accessor to client delta should get propagated.
-   * 
+   * 1) Put delta objects on client feeder connected to PR accessor bridge server.
+   * 2) From accessor to data store delta gets propagated as part of <code>PutMessage</code> delta.
+   * 3) From data store to accessor delta + full value gets propagated as part of Adjunct Message.
+   * 4) From accessor to client delta should get propagated.
    */
-  public void testDeltaPropagationWithAdjunctMessaging() throws Throwable {
+  @Test
+  public void testDeltaPropagationWithAdjunctMessaging() throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
         new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@ -736,13 +757,13 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   /**
-   *  1) Accessor is a Feeder.From accessor to data store delta gets propagated as part of <code>PutMessage</code> delta.
-   *  2) From data store to accessor delta + full value gets propagted as part of Adjunct Message.
-   *  3) From accessor to a client with data policy normal delta should get propagated.
-   *  4) From accessor to client with data policy empty full value should get propagated.
-   * 
+   * 1) Accessor is a Feeder.From accessor to data store delta gets propagated as part of <code>PutMessage</code> delta.
+   * 2) From data store to accessor delta + full value gets propagted as part of Adjunct Message.
+   * 3) From accessor to a client with data policy normal delta should get propagated.
+   * 4) From accessor to client with data policy empty full value should get propagated.
    */
-  public void testDeltaPropagationWithAdjunctMessagingForEmptyClient() throws Throwable {
+  @Test
+  public void testDeltaPropagationWithAdjunctMessagingForEmptyClient() throws Exception {
     Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
         new Integer(8), Boolean.FALSE, null };
     Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@ -766,14 +787,15 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   /**
-   *  1) One accessor and one datastore is defined with a PR with zero redundant copies.
-   *  2) Client is connected only to the accessor.
-   *  3) One delta put is performed on datastore.
-   *  4) Flag to cause toDelta() throw an exception is set on datastore.
-   *  5) Another delta put is performed on datastore.
-   *  6) Verify that the second delta put fails and value on datastore is same as the one put by first delta update. 
+   * 1) One accessor and one datastore is defined with a PR with zero redundant copies.
+   * 2) Client is connected only to the accessor.
+   * 3) One delta put is performed on datastore.
+   * 4) Flag to cause toDelta() throw an exception is set on datastore.
+   * 5) Another delta put is performed on datastore.
+   * 6) Verify that the second delta put fails and value on datastore is same as the one put by first delta update.
    */
-  public void testDeltaPropagationWithAdjunctMessagingAndBadDelta() throws Throwable {
+  @Test
+  public void testDeltaPropagationWithAdjunctMessagingAndBadDelta() throws Exception {
     Object accessor[] = new Object[] { REGION_NAME, 0, 0, 8, Boolean.FALSE, null };
     Object dataStore[] = new Object[] { REGION_NAME, 0, 50, 8, Boolean.FALSE, null };
 
@@ -807,8 +829,6 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     DeltaTestImpl.resetDeltaInvokationCounters();
   }
 
-  
-  
   // check and reset delta counters
   public static void fromDeltaCounter(Integer count) {
     assertTrue("FromDelta counters do not match, expected: " + count.intValue()
@@ -818,7 +838,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   public static void checkIsFailed() {
-    assertFalse("Full value is not recieved by server", isFailed);
+    assertFalse("Full value is not reeived by server", isFailed);
   }
   
   public static Boolean isFailed() {
@@ -840,7 +860,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
   
   public static void createCacheInVm() {
-    new PRDeltaPropagationDUnitTest("temp").createCache(new Properties());
+    new PRDeltaPropagationDUnitTest().createCache(new Properties());
   }
 
   public void createCache(Properties props) {
@@ -933,7 +953,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
       Boolean isEmpty) throws Exception {
 
     Properties props = new Properties();
-    new PRDeltaPropagationDUnitTest("temp").createCache(props);
+    new PRDeltaPropagationDUnitTest().createCache(props);
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setConcurrencyChecksEnabled(true);
@@ -950,6 +970,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     AttributesMutator am = deltaPR.getAttributesMutator();
     if (isListAttach.booleanValue()) {
       am.addCacheListener(new CacheListenerAdapter() {
+        @Override
         public void afterCreate(EntryEvent event) {
           if (event.getNewValue() == null)
             isFailed = true;
@@ -958,7 +979,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
             lastKeyReceived = true;
           }
         }
-        
+
+        @Override
         public void afterUpdate(EntryEvent event) {
           if (event.getNewValue() == null)
             isFailed = true;
@@ -977,7 +999,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   
   public static void createClientCache(Integer port1,
       Boolean subscriptionEnable, Boolean isEmpty, Boolean isCq) throws Exception {
-    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest("temp");
+    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -1008,21 +1030,25 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     
     factory.setPoolName(p.getName());
     factory.setCloningEnabled(false);
-    factory.addCacheListener(new CacheListenerAdapter(){
-    public void afterCreate(EntryEvent event) {
+    factory.addCacheListener(new CacheListenerAdapter() {
+      @Override
+      public void afterCreate(EntryEvent event) {
         if (LAST_KEY.equals(event.getKey())) {          
-        lastKeyReceived = true;
-      }}});
+          lastKeyReceived = true;
+        }
+      }
+    });
 
     RegionAttributes attrs = factory.create();
     deltaPR = cache.createRegion(REGION_NAME, attrs);
-    //deltaPR.create(DELTA_KEY, new PRDeltaTestImpl());
-    if(subscriptionEnable.booleanValue())
+    if (subscriptionEnable.booleanValue()) {
       deltaPR.registerInterest("ALL_KEYS");
+    }
     pool = p;
     if (isCq.booleanValue()) {
       CqAttributesFactory cqf = new CqAttributesFactory();
       CqListenerAdapter cqlist = new CqListenerAdapter() {
+        @Override
         @SuppressWarnings("synthetic-access")
         public void onEvent(CqEvent cqEvent) {
           if (LAST_KEY.equals(cqEvent.getKey().toString())) {
@@ -1065,7 +1091,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   }
 
   public static void createClientCache(Integer port1, Integer port2) throws Exception {
-    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest("temp");
+    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -1085,10 +1111,13 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     factory.setCloningEnabled(false);
     factory.setConcurrencyChecksEnabled(true);
     factory.addCacheListener(new CacheListenerAdapter(){
-    public void afterCreate(EntryEvent event) {
+      @Override
+      public void afterCreate(EntryEvent event) {
         if (LAST_KEY.equals(event.getKey())) {
-        lastKeyReceived = true;
-      }}});
+          lastKeyReceived = true;
+        }
+      }
+    });
 
     RegionAttributes attrs = factory.create();
     deltaPR = cache.createRegion(REGION_NAME, attrs);
@@ -1215,15 +1244,19 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
   public static Boolean verifyQueryUpdateExecuted() {
     return PRDeltaPropagationDUnitTest.queryUpdateExecuted;
   }
+
   public static Boolean verifyQueryDestroyExecuted() {
     return PRDeltaPropagationDUnitTest.queryDestroyExecuted;
   }
+
   public static Boolean checkVMRecievesDeltaObjectThrCQListner() {
     return PRDeltaPropagationDUnitTest.notADeltaInstanceObj;
   }
+
   public static boolean isLastKeyReceived() {
     return lastKeyReceived;
   }
+
   public static void verifyDeltaSent(Integer deltas) {
     CacheClientNotifier ccn = ((CacheServerImpl)cache
         .getCacheServers().toArray()[0]).getAcceptor()
@@ -1275,6 +1308,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
     public PRDeltaTestImpl() {
     }
 
+    @Override
     public void toDelta(DataOutput out) throws IOException {
       super.toDelta(out);
       if (isBadToDelta) {
@@ -1283,6 +1317,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
       deltaSent++;
     }
 
+    @Override
     public void fromDelta(DataInput in) throws IOException {
       super.fromDelta(in);
       if (isBadFromDelta) {
@@ -1299,6 +1334,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
       return deltaApplied;
     }
 
+    @Override
     public String toString() {
       return "PRDeltaTestImpl[deltaApplied=" + deltaApplied + "]"
           + super.toString();


[24/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
index e70d260..c0bbe9a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.EOFException;
 import java.io.IOException;
 import java.io.Serializable;
@@ -58,6 +67,7 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
+@Category(DistributedTest.class)
 public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends PRClientServerTestBase {
   private static final String TEST_FUNCTION7 = TestFunction.TEST_FUNCTION7;
 
@@ -67,13 +77,14 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
 
   private static int retryCount = 0;
 
-  public PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest(String name) {
-    super(name);
+  public PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest() {
+    super();
   }
 
   /*
    * Execution of the function on server with
    */
+  @Test
   public void testServerAllKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -85,6 +96,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
   /*
    * Execution of the function on server with
    */
+  @Test
   public void testServerGetAllFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.getAll());
@@ -93,6 +105,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
   /*
    * Execution of the function on server with
    */
+  @Test
   public void testServerPutAllFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.putAll());
@@ -102,6 +115,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the function on server with single key as the routing object
    * and using the name of the function
    */
+  @Test
   public void testServerSingleKeyExecution_byName() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -116,6 +130,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * of HA then system should retry the function execution. After 5th attempt
    * function will send Boolean as last result.
    */
+  @Test
   public void testserverSingleKeyExecution_FunctionInvocationTargetException() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.serverSingleKeyExecution_FunctionInvocationTargetException());
@@ -124,6 +139,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
   /*
    * Execution of the function on server with bucket as filter
    */
+  @Test
   public void testBucketFilter(){
     createScenarioForBucketFilter();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_BUCKET_FILTER);
@@ -140,6 +156,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
     client.invoke(() -> PRClientServerTestBase.serverBucketFilterExecution(bucketFilterSet));
   }
   
+  @Test
   public void testBucketFilterOverride(){
     createScenarioForBucketFilter();
     Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_BUCKET_FILTER);
@@ -158,6 +175,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
     
   }
 
+  @Test
   public void testServerSingleKeyExecution_SocketTimeOut() {
     createScenario();
     Function function = new TestFunction(true,
@@ -171,6 +189,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the function on server with single key as the routing object
    * and using the instance of the function
    */
+  @Test
   public void testServerSingleKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -183,6 +202,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the inline function on server with single key as the routing
    * object
    */
+  @Test
   public void testServerSingleKeyExecution_byInlineFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.serverSingleKeyExecution_Inline());
@@ -192,6 +212,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the function on server with set multiple keys as the routing
    * object and using the name of the function
    */
+  @Test
   public void testserverMultiKeyExecution_byName() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -203,6 +224,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
     server3.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.checkBucketsOnServer());
   }
 
+  @Test
   public void testserverMultiKeyExecution_SocektTimeOut() {
     createScenario();
     Function function = new TestFunction(true,
@@ -216,6 +238,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the inline function on server with set multiple keys as the
    * routing object
    */
+  @Test
   public void testserverMultiKeyExecution_byInlineFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.serverMultiKeyExecution_Inline());
@@ -228,6 +251,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * After 5th attempt function will send Boolean as last result.
    */
   @Category(FlakyTest.class) // GEODE-600: network sensitive, random ports, configs lots of PoolFactory network attributes
+  @Test
   public void testserverMultiKeyExecution_FunctionInvocationTargetException() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.serverMultiKeyExecution_FunctionInvocationTargetException());
@@ -237,6 +261,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the function on server with set multiple keys as the routing
    * object and using the name of the function
    */
+  @Test
   public void testserverMultiKeyExecutionNoResult_byName() {
     createScenario();
     Function function = new TestFunction(false, TEST_FUNCTION7);
@@ -249,6 +274,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Execution of the function on server with set multiple keys as the routing
    * object and using the instance of the function
    */
+  @Test
   public void testserverMultiKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -262,6 +288,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * that the routing logic works correctly such that there is not extra
    * execution
    */
+  @Test
   public void testserverMultiKeyExecutionOnASingleBucket_byName() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -275,6 +302,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * that the routing logic works correctly such that there is not extra
    * execution
    */
+  @Test
   public void testserverMultiKeyExecutionOnASingleBucket_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -287,6 +315,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerFailoverWithTwoServerAliveHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -320,6 +349,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerCacheClosedFailoverWithTwoServerAliveHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -347,6 +377,7 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends P
     assertEquals(2, l.size());
   }
 
+  @Test
   public void testBug40714() {
     createScenario();
     server1.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.registerFunction());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
index 1a83608..1a78dd3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.EOFException;
 import java.io.IOException;
 import java.io.Serializable;
@@ -55,6 +64,7 @@ import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
+@Category(DistributedTest.class)
 public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest extends
     PRClientServerTestBase {
   private static final String TEST_FUNCTION7 = TestFunction.TEST_FUNCTION7;
@@ -65,13 +75,14 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
 
   private static int retryCount = 0;
 
-  public PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest(String name) {
-    super(name);
+  public PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest() {
+    super();
   }
 
   /*
    * Execution of the function on server with
    */
+  @Test
   public void testServerAllKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -83,6 +94,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
   /*
    * Execution of the function on server with
    */
+  @Test
   public void testServerGetAllFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.getAll());
@@ -91,6 +103,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
   /*
    * Execution of the function on server with
    */
+  @Test
   public void testServerPutAllFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.putAll());
@@ -100,6 +113,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the function on server with single key as the routing object
    * and using the name of the function
    */
+  @Test
   public void testServerSingleKeyExecution_byName() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -114,11 +128,13 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * of HA then system should retry the function execution. After 5th attempt
    * function will send Boolean as last result.
    */
+  @Test
   public void testserverSingleKeyExecution_FunctionInvocationTargetException() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.serverSingleKeyExecution_FunctionInvocationTargetException());
   }
 
+  @Test
   public void testServerSingleKeyExecution_SocketTimeOut() {
     createScenario();
     Function function = new TestFunction(true,
@@ -132,6 +148,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the function on server with single key as the routing object
    * and using the instance of the function
    */
+  @Test
   public void testServerSingleKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -144,6 +161,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the inline function on server with single key as the routing
    * object
    */
+  @Test
   public void testServerSingleKeyExecution_byInlineFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.serverSingleKeyExecution_Inline());
@@ -153,6 +171,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the function on server with set multiple keys as the routing
    * object and using the name of the function
    */
+  @Test
   public void testserverMultiKeyExecution_byName() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -164,6 +183,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
     server3.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.checkBucketsOnServer());
   }
 
+  @Test
   public void testserverMultiKeyExecution_SocektTimeOut() {
     createScenario();
     Function function = new TestFunction(true,
@@ -177,6 +197,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the inline function on server with set multiple keys as the
    * routing object
    */
+  @Test
   public void testserverMultiKeyExecution_byInlineFunction() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.serverMultiKeyExecution_Inline());
@@ -188,6 +209,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * this is the case of HA then system should retry the function execution.
    * After 5th attempt function will send Boolean as last result.
    */
+  @Test
   public void testserverMultiKeyExecution_FunctionInvocationTargetException() {
     createScenario();
     client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.serverMultiKeyExecution_FunctionInvocationTargetException());
@@ -197,6 +219,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the function on server with set multiple keys as the routing
    * object and using the name of the function
    */
+  @Test
   public void testserverMultiKeyExecutionNoResult_byName() {
     createScenario();
     Function function = new TestFunction(false, TEST_FUNCTION7);
@@ -209,6 +232,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Execution of the function on server with set multiple keys as the routing
    * object and using the instance of the function
    */
+  @Test
   public void testserverMultiKeyExecution_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -222,6 +246,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * that the routing logic works correctly such that there is not extra
    * execution
    */
+  @Test
   public void testserverMultiKeyExecutionOnASingleBucket_byName() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -235,6 +260,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * that the routing logic works correctly such that there is not extra
    * execution
    */
+  @Test
   public void testserverMultiKeyExecutionOnASingleBucket_byInstance() {
     createScenario();
     Function function = new TestFunction(true, TEST_FUNCTION2);
@@ -247,6 +273,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerFailoverWithTwoServerAliveHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -284,6 +311,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
    * Ensure that the while executing the function if the servers is down then
    * the execution is failover to other available server
    */
+  @Test
   public void testServerCacheClosedFailoverWithTwoServerAliveHA()
       throws InterruptedException {
     IgnoredException.addIgnoredException("FunctionInvocationTargetException");
@@ -315,6 +343,7 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
     assertEquals(2, l.size());
   }
 
+  @Test
   public void testBug40714() {
     createScenario();
     server1.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.registerFunction());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
index bedead7..b011e0e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.EOFException;
 import java.io.IOException;
 import java.io.Serializable;
@@ -62,8 +71,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
     
     private static int retryCount = 0;
     
-    public PRClientServerRegionFunctionExecutionSingleHopDUnitTest(String name) {
-      super(name);
+    public PRClientServerRegionFunctionExecutionSingleHopDUnitTest() {
+      super();
     }
 
     @Override
@@ -76,7 +85,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
     /*
      * Execution of the function on server with 
      */
-    public void testServerAllKeyExecution_byInstance(){
+  @Test
+  public void testServerAllKeyExecution_byInstance(){
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -88,7 +98,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
     /*
      * Execution of the function on server with 
      */
-    public void testServerGetAllFunction(){
+  @Test
+  public void testServerGetAllFunction(){
       createScenario();
       client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.getAll());
     }
@@ -96,7 +107,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
     /*
      * Execution of the function on server with 
      */
-    public void testServerPutAllFunction(){
+  @Test
+  public void testServerPutAllFunction(){
       createScenario();
       client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.putAll());
     }    
@@ -104,7 +116,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the function on server with single key as the routing
      * object and using the name of the function
      */   
-    public void testServerSingleKeyExecution_byName() {
+  @Test
+  public void testServerSingleKeyExecution_byName() {
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -118,12 +131,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * of HA then system should retry the function execution. After 5th attempt
      * function will send Boolean as last result.
      */
-    public void testserverSingleKeyExecution_FunctionInvocationTargetException() {
+  @Test
+  public void testserverSingleKeyExecution_FunctionInvocationTargetException() {
       createScenario();
       client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecution_FunctionInvocationTargetException());
     }
 
-    public void testServerSingleKeyExecution_SocketTimeOut() {
+  @Test
+  public void testServerSingleKeyExecution_SocketTimeOut() {
       createScenario();
       Function function = new TestFunction(true,
           TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
@@ -143,7 +158,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the function on server with single key as the routing
      * object and using the instance of the function
      */
-    public void testServerSingleKeyExecution_byInstance() {
+  @Test
+  public void testServerSingleKeyExecution_byInstance() {
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -155,7 +171,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the inline function on server with single key as the routing
      * object
      */   
-    public void testServerSingleKeyExecution_byInlineFunction() {
+  @Test
+  public void testServerSingleKeyExecution_byInlineFunction() {
       createScenario();
       client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverSingleKeyExecution_Inline());
     }
@@ -164,7 +181,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the function on server with set multiple keys as the routing
      * object and using the name of the function
      */
-    public void testserverMultiKeyExecution_byName(){
+  @Test
+  public void testserverMultiKeyExecution_byName(){
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -178,7 +196,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
     /*
      * Execution of the function on server with bucket as filter
      */
-    public void testBucketFilter(){
+  @Test
+  public void testBucketFilter(){
       createScenarioForBucketFilter();
       Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_BUCKET_FILTER);
       registerFunctionAtServer(function);
@@ -193,7 +212,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
       client.invoke(() -> PRClientServerTestBase.serverBucketFilterExecution(bucketFilterSet));      
     }
     
-    public void testBucketFilterOverride(){
+  @Test
+  public void testBucketFilterOverride(){
       createScenarioForBucketFilter();
       Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_BUCKET_FILTER);
       registerFunctionAtServer(function);
@@ -211,7 +231,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
       
     }
     
-    public void testserverMultiKeyExecution_SocektTimeOut(){
+  @Test
+  public void testserverMultiKeyExecution_SocektTimeOut(){
       createScenario();
       Function function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
       registerFunctionAtServer(function);
@@ -223,7 +244,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the inline function on server with set multiple keys as the routing
      * object
      */
-    public void testserverMultiKeyExecution_byInlineFunction(){
+  @Test
+  public void testserverMultiKeyExecution_byInlineFunction(){
       createScenario();
       client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.serverMultiKeyExecution_Inline());
     }
@@ -234,7 +256,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * this is the case of HA then system should retry the function execution.
      * After 5th attempt function will send Boolean as last result.
      */
-    public void testserverMultiKeyExecution_FunctionInvocationTargetException() {
+  @Test
+  public void testserverMultiKeyExecution_FunctionInvocationTargetException() {
       IgnoredException.addIgnoredException("FunctionException: IOException while sending");
       IgnoredException.addIgnoredException("java.net.SocketException: Software caused connection abort");
       createScenario();
@@ -245,7 +268,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the function on server with set multiple keys as the routing
      * object and using the name of the function
      */
-    public void testserverMultiKeyExecutionNoResult_byName(){
+  @Test
+  public void testserverMultiKeyExecutionNoResult_byName(){
       IgnoredException.addIgnoredException("Cannot send result");
       createScenario();
       Function function = new TestFunction(false,TEST_FUNCTION7);
@@ -258,7 +282,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Execution of the function on server with set multiple keys as the routing
      * object and using the instance of the function
      */
-    public void testserverMultiKeyExecution_byInstance(){
+  @Test
+  public void testserverMultiKeyExecution_byInstance(){
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -271,7 +296,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * that the routing logic works correctly such that there is not extra
      * execution
      */
-    public void testserverMultiKeyExecutionOnASingleBucket_byName(){
+  @Test
+  public void testserverMultiKeyExecutionOnASingleBucket_byName(){
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -284,7 +310,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * that the routing logic works correctly such that there is not extra
      * execution
      */
-    public void testserverMultiKeyExecutionOnASingleBucket_byInstance(){
+  @Test
+  public void testserverMultiKeyExecutionOnASingleBucket_byInstance(){
       createScenario();
       Function function = new TestFunction(true,TEST_FUNCTION2);
       registerFunctionAtServer(function);
@@ -296,7 +323,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Ensure that the while executing the function if the servers is down then 
      * the execution is failover to other available server
      */
-    public void testServerFailoverWithTwoServerAliveHA()
+  @Test
+  public void testServerFailoverWithTwoServerAliveHA()
         throws InterruptedException {
       ArrayList commonAttributes = createCommonServerAttributes(
           "TestPartitionedRegion", null, 1, 13, null);
@@ -328,7 +356,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
      * Ensure that the while executing the function if the servers is down then 
      * the execution is failover to other available server
      */
-    public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws InterruptedException{
+  @Test
+  public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws InterruptedException{
       ArrayList commonAttributes = createCommonServerAttributes("TestPartitionedRegion",
           null, 1, 13, null);
       createClientServerScenarion(commonAttributes,20, 20, 20);
@@ -352,7 +381,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
       assertEquals(2, l.size());
     }
 
-    public void testBug40714() {
+  @Test
+  public void testBug40714() {
       createScenario();
       server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.registerFunction());
       server1.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest.registerFunction());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
index c6164de..ce7ab16 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
@@ -16,7 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryOperation;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionResolver;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -24,21 +47,21 @@ import com.gemstone.gemfire.cache.execute.Function;
 import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public class PRClientServerTestBase extends CacheTestCase {
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+
+public class PRClientServerTestBase extends JUnit4CacheTestCase {
 
   protected VM server1 = null;
 
@@ -79,13 +102,13 @@ public class PRClientServerTestBase extends CacheTestCase {
   private boolean isSelector = false;
   
   public PRClientServerTestBase(String name, boolean isSingleHop, boolean isSelector) {
-    super(name);
+    super();
     this.isSingleHop = isSingleHop;
     this.isSelector = isSelector;
   }
 
-  public PRClientServerTestBase(String name) {
-    super(name);
+  public PRClientServerTestBase() {
+    super();
   }
 
   @Override
@@ -575,7 +598,7 @@ public class PRClientServerTestBase extends CacheTestCase {
   }
   
   public static void createCacheInVm(Properties props) {
-    new PRClientServerTestBase("temp").createCache(props);
+    new PRClientServerTestBase().createCache(props);
   }
 
   private void createCache(Properties props) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
index 17f33f0..952395c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -76,7 +85,8 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * 
  */
 @SuppressWarnings("synthetic-access")
-public class PRColocationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PRColocationDUnitTest extends JUnit4CacheTestCase {
 
   VM accessor = null;
 
@@ -112,8 +122,8 @@ public class PRColocationDUnitTest extends CacheTestCase {
 
   Object[] attributeObjects = null;
 
-  public PRColocationDUnitTest(String name) {
-    super(name);
+  public PRColocationDUnitTest() {
+    super();
   }
 
   @Override
@@ -129,6 +139,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    /*
    * Test for bug 41820 
    */
+  @Test
   public void testDestroyColocatedPartitionedRegion() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -163,6 +174,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
   /*
    * Test for checking the colocation of the regions which forms the tree
    */
+  @Test
   public void testColocatedPartitionedRegion() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -286,6 +298,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
   /*
    * Test for checking the colocation of the regions which forms the tree
    */
+  @Test
   public void testColocatedPartitionedRegion_NoFullPath() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -406,6 +419,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     
     accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "K" ));
   }
+  @Test
   public void testColocatedSubPartitionedRegion() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(1);
@@ -527,6 +541,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootK/K" ));
   }
   
+  @Test
   public void testColocatedSubPartitionedRegion_NoFullPath() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(1);
@@ -648,6 +663,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions( "rootK/K" ));
   }
   
+  @Test
   public void testColocatedPRWithAccessorOnDifferentNode1() throws Throwable {
 
     createCacheInAllVms();
@@ -721,6 +737,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     ex.remove();
   }
 
+  @Test
   public void testColocatedPRWithAccessorOnDifferentNode2() throws Throwable {
 
     createCacheInAllVms();
@@ -792,6 +809,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     ex.remove();
   }
   
+  @Test
   public void testColocatedPRWithPROnDifferentNode1() throws Throwable {
 
     createCacheInAllVms();
@@ -929,6 +947,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testColocatedPRWithLocalDestroy() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -999,6 +1018,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     ex.remove();
   }
   
+  @Test
   public void testColocatedPRWithDestroy() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -1090,6 +1110,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testColocatedPRWithClose() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -1135,6 +1156,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
   /*
    * Test For partition Region with Key Based Routing Resolver
    */
+  @Test
   public void testPartitionResolverPartitionedRegion() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(0);
@@ -1192,6 +1214,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    * Test added to check the colocation of regions
    * Also checks for the colocation of the buckets  
    */ 
+  @Test
   public void testColocationPartitionedRegion() throws Throwable {
     // Create Cache in all VMs VM0,VM1,VM2,VM3 
     
@@ -1278,6 +1301,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    * 
    * @throws Throwable
    */
+  @Test
   public void testColocationPartitionedRegionWithNullColocationSpecifiedOnOneNode()
       throws Throwable {
     try {
@@ -1328,6 +1352,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    * Test added to check the colocation of regions
    * Also checks for the colocation of the buckets with redundancy specified 
    */ 
+  @Test
   public void testColocationPartitionedRegionWithRedundancy() throws Throwable {
 
     // Create Cache in all VMs VM0,VM1,VM2,VM3
@@ -1425,6 +1450,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    * Confirm that the redundancy must be the same for colocated partitioned regions
    * @throws Exception
    */
+  @Test
   public void testRedundancyRestriction() throws Exception {
     final String rName = getUniqueName();
     final Integer red0 = Integer.valueOf(0);
@@ -1454,6 +1480,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    * created.
    * @throws Throwable
    */
+  @Test
   public void testColocatedPRRedundancyRecovery() throws Throwable {
     createCacheInAllVms();
     redundancy = new Integer(1);
@@ -1552,6 +1579,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testColocationPartitionedRegionWithKeyPartitionResolver()
       throws Throwable {
     // Create Cache in all VMs VM0,VM1,VM2,VM3
@@ -1595,6 +1623,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     accessor.invoke(() -> PRColocationDUnitTest.executeFunction());
   }
 
+  @Test
   public void testColocatedPRRedundancyRecovery2() throws Throwable {
     createCacheInAllVms();
     
@@ -1741,6 +1770,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
    * 
    * @throws Throwable
    */
+  @Test
   public void testSimulaneousChildRegionCreation() throws Throwable {
     createCacheInAllVms();
     
@@ -2550,7 +2580,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
   }
   
   public static void createCacheInVm() {
-    new PRColocationDUnitTest("temp").getCache();
+    new PRColocationDUnitTest().getCache();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
index 3e83159..d776e01 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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;
+
 /**
  * This is a dunit test for PartitionedRegion creation and Region API's
  * for put and get functionality in case of Custom Partitioning.
@@ -39,11 +48,12 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.*;
 
+@Category(DistributedTest.class)
 public class PRCustomPartitioningDUnitTest extends
     PartitionedRegionDUnitTestCase {
 
-  public PRCustomPartitioningDUnitTest(String name) {
-    super(name);
+  public PRCustomPartitioningDUnitTest() {
+    super();
   }
 
   protected static Cache cache = null;
@@ -70,7 +80,7 @@ public class PRCustomPartitioningDUnitTest extends
     Properties props = new Properties();
     //props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "0");
     //props.setProperty(DistributionConfig.LOCATORS_NAME, "");
-    new PRCustomPartitioningDUnitTest("temp").createCache(props);
+    new PRCustomPartitioningDUnitTest().createCache(props);
   }
   
   private void createCache(Properties props) throws Exception
@@ -413,6 +423,7 @@ public class PRCustomPartitioningDUnitTest extends
    * This is a PartitionedRegion test for Custom Partitioning . 4 VMs are used to create the PR with
    * and without(Only Accessor) the DataStore.
    */
+  @Test
   public void testPartitionedRegionOperationsCustomPartitioning()
       throws Exception {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
index 00f66f4..1223690 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
@@ -16,46 +16,94 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryOperation;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionResolver;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionException;
+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.partition.PartitionRegionHelper;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DM;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.LonerDistributionManager;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.EntrySnapshot;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalDataSet;
+import com.gemstone.gemfire.internal.cache.PartitionAttributesImpl;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionDUnitTestCase;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionTestHelper;
 import com.gemstone.gemfire.internal.cache.execute.data.CustId;
 import com.gemstone.gemfire.internal.cache.execute.data.Customer;
 import com.gemstone.gemfire.internal.cache.execute.data.Order;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.Serializable;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class PRFunctionExecutionDUnitTest extends PartitionedRegionDUnitTestCase {
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-public class PRFunctionExecutionDUnitTest extends
-    PartitionedRegionDUnitTestCase {
   private static final String TEST_FUNCTION7 = TestFunction.TEST_FUNCTION7;
   private static final String TEST_FUNCTION2 = TestFunction.TEST_FUNCTION2;
+
   static Cache cache = null;
   static String regionName = null;
-  private static final long serialVersionUID = 1L;
 
-  public PRFunctionExecutionDUnitTest(String name) {
-    super(name);
+  @Override
+  public final void postTearDown() throws Exception {
+    cache = null;
+    regionName = null;
   }
 
   /**
    * Test to validate that the function execution is successful on PR with Loner Distributed System
-   * @throws Exception
    */
+  @Test
   public void testFunctionExecution() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -103,6 +151,7 @@ public class PRFunctionExecutionDUnitTest extends
         });
   }
 
+  @Test
   public void testHAFunctionExecution() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -156,9 +205,8 @@ public class PRFunctionExecutionDUnitTest extends
   /**
    * Test remote execution by a pure accessor which doesn't have the function
    * factory present.
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteSingleKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -244,11 +292,9 @@ public class PRFunctionExecutionDUnitTest extends
    * FunctionInvocationTargetException. As this is the case of HA then system
    * should retry the function execution. After 5th attempt function will send
    * Boolean as last result. factory present.
-   *
-   * @throws Exception
    */
-  public void testLocalSingleKeyExecution_byName_FunctionInvocationTargetException()
-      throws Exception {
+  @Test
+  public void testLocalSingleKeyExecution_byName_FunctionInvocationTargetException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore = host.getVM(3);
@@ -289,18 +335,15 @@ public class PRFunctionExecutionDUnitTest extends
           }
         });
   }
- 
- 
+
   /**
    * Test remote execution by a pure accessor which doesn't have the function
    * factory present.Function throws the FunctionInvocationTargetException. As
    * this is the case of HA then system should retry the function execution.
    * After 5th attempt function will send Boolean as last result.
-   *
-   * @throws Exception
    */
-  public void testRemoteSingleKeyExecution_byName_FunctionInvocationTargetException()
-      throws Exception {
+  @Test
+  public void testRemoteSingleKeyExecution_byName_FunctionInvocationTargetException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM accessor = host.getVM(2);
@@ -367,9 +410,8 @@ public class PRFunctionExecutionDUnitTest extends
   /**
    * Test remote execution by a pure accessor which doesn't have the function
    * factory present.
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteSingleKeyExecution_byInstance() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -454,9 +496,8 @@ public class PRFunctionExecutionDUnitTest extends
 
   /**
    * Test remote execution of inline function by a pure accessor
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteSingleKeyExecution_byInlineFunction() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -534,9 +575,8 @@ public class PRFunctionExecutionDUnitTest extends
    * function factory present.
    * ResultCollector = DefaultResultCollector
    * haveResults = true;
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -633,7 +673,7 @@ public class PRFunctionExecutionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
-  
+  @Test
   public void testRemoteMultiKeyExecution_BucketMoved() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -716,6 +756,7 @@ public class PRFunctionExecutionDUnitTest extends
     
   }
   
+  @Test
   public void testLocalMultiKeyExecution_BucketMoved() throws Exception {
     IgnoredException.addIgnoredException("BucketMovedException");
     final String rName = getUniqueName();
@@ -781,19 +822,15 @@ public class PRFunctionExecutionDUnitTest extends
     assertEquals(2, l.size());
     
   }
-  
-  
-  
+
   /**
    * Test remote execution by a pure accessor which doesn't have the function
    * factory present.Function throws the FunctionInvocationTargetException. As
    * this is the case of HA then system should retry the function execution.
    * After 5th attempt function will send Boolean as last result.
-   *
-   * @throws Exception
    */
-  public void testRemoteMultipleKeyExecution_byName_FunctionInvocationTargetException()
-      throws Exception {
+  @Test
+  public void testRemoteMultipleKeyExecution_byName_FunctionInvocationTargetException() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM accessor = host.getVM(3);
@@ -868,6 +905,7 @@ public class PRFunctionExecutionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
  
+  @Test
   public void testRemoteMultiKeyExecutionHA_CacheClose() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -965,6 +1003,7 @@ public class PRFunctionExecutionDUnitTest extends
     assertEquals(2, l.size());
   }
  
+  @Test
   public void testRemoteMultiKeyExecutionHA_Disconnect() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1081,9 +1120,8 @@ public class PRFunctionExecutionDUnitTest extends
    * Test multi-key remote execution of inline function by a pure accessor
    * ResultCollector = DefaultResultCollector
    * haveResults = true;
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_byInlineFunction() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1168,14 +1206,14 @@ public class PRFunctionExecutionDUnitTest extends
     });
     assertEquals(Boolean.TRUE, o);
   }
+
   /**
    * Test multi-key remote execution by a pure accessor which doesn't have the
    * function factory present.
    * ResultCollector = CustomResultCollector
    * haveResults = true;
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutionWithCollector_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1250,8 +1288,8 @@ public class PRFunctionExecutionDUnitTest extends
    * function factory present.
    * ResultCollector = DefaultResultCollector
    * haveResults = false;
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutionNoResult_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1333,8 +1371,8 @@ public class PRFunctionExecutionDUnitTest extends
    * haveResults = true;
    * result Timeout = 10 milliseconds
    * expected result to be 0.(as the execution gets the timeout)
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_timeout() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1412,8 +1450,8 @@ public class PRFunctionExecutionDUnitTest extends
    * function factory present.
    * ResultCollector = CustomResultCollector
    * haveResults = false;
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutionWithCollectorNoResult_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1487,12 +1525,12 @@ public class PRFunctionExecutionDUnitTest extends
     });
     assertEquals(Boolean.TRUE, o);
   }
+
   /**
    * Test multi-key remote execution by a pure accessor which doesn't have the
    * function factory present.
-   *
-   * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_byInstance() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1596,12 +1634,10 @@ public class PRFunctionExecutionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
 
-  
   /**
    * Test bucketFilter functionality
-   *
-   * @throws Exception
    */
+  @Test
   public void testBucketFilter_1() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1731,6 +1767,7 @@ public class PRFunctionExecutionDUnitTest extends
     
   }
   
+  @Test
   public void testBucketFilterOverride() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1813,14 +1850,13 @@ public class PRFunctionExecutionDUnitTest extends
    
     
   }
-  
-  
+
   /**
    * Test ability to execute a multi-key function by a local data store
    * ResultCollector = DefaultResultCollector
    * haveResult = true
-   * @throws Exception
    */
+  @Test
   public void testLocalMultiKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1899,9 +1935,8 @@ public class PRFunctionExecutionDUnitTest extends
 
   /**
    * Test ability to execute a multi-key function by a local data store
-   *
-   * @throws Exception
    */
+  @Test
   public void testLocalMultiKeyExecution_byInstance() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -1983,9 +2018,8 @@ public class PRFunctionExecutionDUnitTest extends
    * Ensure that the execution is limited to a single bucket put another way,
    * that the routing logic works correctly such that there is not extra
    * execution
-   *
-   * @throws Exception
    */
+  @Test
   public void testMultiKeyExecutionOnASingleBucket_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -2066,11 +2100,9 @@ public class PRFunctionExecutionDUnitTest extends
    * Ensure that the execution is limited to a single bucket put another way,
    * that the routing logic works correctly such that there is not extra
    * execution
-   *
-   * @throws Exception
    */
-  public void testMultiKeyExecutionOnASingleBucket_byInstance()
-      throws Exception {
+  @Test
+  public void testMultiKeyExecutionOnASingleBucket_byInstance() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore0 = host.getVM(0);
@@ -2148,11 +2180,9 @@ public class PRFunctionExecutionDUnitTest extends
 
   /**
    * Ensure that the execution is happening all the PR as a whole
-   *
-   * @throws Exception
    */
-  public void testExecutionOnAllNodes_byName()
-      throws Exception {
+  @Test
+  public void testExecutionOnAllNodes_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore0 = host.getVM(0);
@@ -2216,13 +2246,6 @@ public class PRFunctionExecutionDUnitTest extends
           assertEquals(Boolean.TRUE, l.iterator().next());
         }
         return Boolean.TRUE;
-//        for (int i=0; i<4; i++) {
-//          List l = ((List)rc1.getResult());
-//          assertIndexDetailsEquals(4, l.size());
-//          assertIndexDetailsEquals(Boolean.TRUE, l.iterator().next());
-//        }
-//
-//        return Boolean.TRUE;
       }
     });
     assertEquals(Boolean.TRUE, o);
@@ -2230,11 +2253,9 @@ public class PRFunctionExecutionDUnitTest extends
  
   /**
    * Ensure that the execution is happening all the PR as a whole
-   *
-   * @throws Exception
    */
-  public void testExecutionOnAllNodes_byInstance()
-      throws Exception {
+  @Test
+  public void testExecutionOnAllNodes_byInstance() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore0 = host.getVM(0);
@@ -2319,11 +2340,9 @@ public class PRFunctionExecutionDUnitTest extends
  
   /**
    * Ensure that the execution of inline function is happening all the PR as a whole
-   *
-   * @throws Exception
    */
-  public void testExecutionOnAllNodes_byInlineFunction()
-      throws Exception {
+  @Test
+  public void testExecutionOnAllNodes_byInlineFunction() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore0 = host.getVM(0);
@@ -2406,6 +2425,7 @@ public class PRFunctionExecutionDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
    
+  @Test
   public void testBug40714() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -2514,11 +2534,9 @@ public class PRFunctionExecutionDUnitTest extends
   /**
    * Ensure that the execution is happening on all the PR as a whole
    * with LocalReadPR as LocalDataSet
-   *
-   * @throws Exception
    */
-  public void testExecutionOnAllNodes_LocalReadPR()
-      throws Exception {
+  @Test
+  public void testExecutionOnAllNodes_LocalReadPR() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore0 = host.getVM(0);
@@ -2598,11 +2616,9 @@ public class PRFunctionExecutionDUnitTest extends
   /**
    * Ensure that the execution is happening on all the PR as a whole
    * with LocalReadPR as LocalDataSet
-   *
-   * @throws Exception
    */
-  public void testExecutionOnMultiNodes_LocalReadPR()
-      throws Exception {
+  @Test
+  public void testExecutionOnMultiNodes_LocalReadPR() throws Exception {
     //final String rName = getUniqueName();
     final String rName1 = "CustomerPartitionedRegionName";
     final String rName2 = "OrderPartitionedRegionName";
@@ -2731,8 +2747,8 @@ public class PRFunctionExecutionDUnitTest extends
   /**
    * Assert the {@link RegionFunctionContext} yields the proper objects.
    */
-  public void testLocalDataContext() throws Exception
-  {
+  @Test
+  public void testLocalDataContext() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM accessor = host.getVM(1);
@@ -2806,8 +2822,8 @@ public class PRFunctionExecutionDUnitTest extends
   /**
    * Assert the {@link RegionFunctionContext} yields the proper objects.
    */
-  public void testLocalDataContextWithColocation() throws Exception
-  {
+  @Test
+  public void testLocalDataContextWithColocation() throws Exception {
     String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM accessor = host.getVM(1);
@@ -2950,7 +2966,7 @@ public class PRFunctionExecutionDUnitTest extends
    * This tests make sure that, in case of LonerDistributedSystem we dont get ClassCast Exception.
    * Just making sure that the function executed on lonerDistribuedSystem
    */
- 
+  @Test
   public void testBug41118() {
     Host host = Host.getHost(0);
     final VM lonerVM = host.getVM(1);
@@ -2958,7 +2974,7 @@ public class PRFunctionExecutionDUnitTest extends
   }
  
   public static void bug41118(){
-    InternalDistributedSystem ds = new PRFunctionExecutionDUnitTest("temp").getSystem();
+    InternalDistributedSystem ds = new PRFunctionExecutionDUnitTest().getSystem();
     assertNotNull(ds);
     ds.disconnect();
     Properties props = new Properties();
@@ -3056,6 +3072,7 @@ public class PRFunctionExecutionDUnitTest extends
     }
   }
 
+  @Test
   public void testFunctionExecutionException_41779() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
index fa4fd62..c0e6bcc 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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 java.util.HashMap;
 import java.util.HashSet;
@@ -48,6 +57,7 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
+@Category(DistributedTest.class)
 public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitTestCase {
 
   private static final String TEST_FUNCTION_TIMEOUT = TestFunction.TEST_FUNCTION_TIMEOUT;
@@ -55,14 +65,15 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
   
   private static final long serialVersionUID = 1L;
 
-  public PRFunctionExecutionTimeOutDUnitTest(String name) {
-    super(name);
+  public PRFunctionExecutionTimeOutDUnitTest() {
+    super();
   }
   
   /**
    * Test remote execution by a pure accessor. Then test it using timeout and multiple getResult.
    * @throws Exception
    */
+  @Test
   public void testRemoteSingleKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -238,6 +249,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
    * 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -405,6 +417,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
    * 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutionWithCollector_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -500,6 +513,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
    * Then test it using timeout.
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecutionNoResult_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -578,6 +592,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
    * Test multi-key remote execution by a pure accessor.
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_timeout() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -670,6 +685,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
    * @throws Exception
    */
   @Category(FlakyTest.class) // GEODE-1020: suspect string: BucketMovedException, missing fail in expected exception, eats exceptions
+  @Test
   public void testLocalMultiKeyExecution_byName() throws Exception {
     IgnoredException.addIgnoredException("BucketMovedException");
     final String rName = getUniqueName();
@@ -795,6 +811,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends PartitionedRegionDUnitT
    * Then test it using timeout and multiple getResult.
    * @throws Exception
    */
+  @Test
   public void testExecutionOnAllNodes_byName()
       throws Exception {
     final String rName = getUniqueName();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
index 458ac5d..3fc5f61 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.util.ArrayList;
 import java.util.HashMap;
@@ -52,6 +61,7 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class PRFunctionExecutionWithResultSenderDUnitTest extends
     PartitionedRegionDUnitTestCase {
   private static final String TEST_FUNCTION7 = TestFunction.TEST_FUNCTION7;
@@ -60,8 +70,8 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
   
   private static final long serialVersionUID = 1L;
 
-  public PRFunctionExecutionWithResultSenderDUnitTest(String name) {
-    super(name);
+  public PRFunctionExecutionWithResultSenderDUnitTest() {
+    super();
   }
 
   /**
@@ -70,6 +80,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testRemoteSingleKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -161,6 +172,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testRemoteExecution_NoLastResult() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -240,6 +252,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testRemoteMultiKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -336,6 +349,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
    * haveResult = true
    * @throws Exception
    */
+  @Test
   public void testLocalMultiKeyExecution_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -406,6 +420,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testLocalExecution_NoLastResult() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -464,6 +479,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
    * 
    * @throws Exception
    */
+  @Test
   public void testExecutionOnAllNodes_NoLastResult()
       throws Exception {
     final String rName = getUniqueName();
@@ -532,6 +548,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
     assertEquals(Boolean.TRUE, o);
   }
   
+  @Test
   public void testExecutionOnAllNodes_byName() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
@@ -630,6 +647,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
     return attr.create();
   }
 
+  @Test
   public void testlonerSystem_Bug41832() throws Exception {
     final String rName = getUniqueName();
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
index 6f34acd..b5fab1e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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;
+
 /**
  * This is a dunit test for PartitionedRegion creation and Region API's
  * for put and get functionality in case of Custom Partitioning.
@@ -58,11 +67,12 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
+@Category(DistributedTest.class)
 public class PRPerformanceTestDUnitTest extends
     PartitionedRegionDUnitTestCase {
 
-  public PRPerformanceTestDUnitTest(String name) {
-    super(name);
+  public PRPerformanceTestDUnitTest() {
+    super();
   }
 
   protected static Cache cache = null;
@@ -85,7 +95,7 @@ public class PRPerformanceTestDUnitTest extends
   
   public static void createCacheInVm() throws Exception{
     Properties props = new Properties();
-    new PRPerformanceTestDUnitTest("temp").createCache(props);
+    new PRPerformanceTestDUnitTest().createCache(props);
   }
   
   private void createCache(Properties props) throws Exception
@@ -317,6 +327,7 @@ public class PRPerformanceTestDUnitTest extends
    * This is a PartitionedRegion test for Custom Prtitioning . 4 VMs are used to create the PR with
    * and without(Only Accessor) the DataStore.
    */
+  @Test
   public void testPartitionedRegionOperationsCustomPartitioning()
       throws Exception {
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
index c0b04a6..b06887f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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 java.util.HashSet;
 import java.util.Iterator;
@@ -54,6 +63,7 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable;
  * execute transactions.  
  *
  */
+@Category(DistributedTest.class)
 public class PRTransactionDUnitTest extends PRColocationDUnitTest {
 
   public static final int VERIFY_TX = 0;
@@ -78,30 +88,36 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
 
   final int perfOrderShipmentPairs = 1;
 
-  public PRTransactionDUnitTest(String name) {
-    super(name);
+  public PRTransactionDUnitTest() {
+    super();
   }
 
+  @Test
   public void testBasicPRTransactionRedundancy0() {
     basicPRTXInFunction(0, true);
   }
 
+  @Test
   public void testBasicPRTransactionRedundancy1() {
     basicPRTXInFunction(1, true);
   }
 
+  @Test
   public void testBasicPRTransactionRedundancy2() {
     basicPRTXInFunction(2, true);
   }
 
+  @Test
   public void testBasicPRTransactionNoDataRedundancy0() {
     basicPRTXInFunction(0, false);
   }
 
+  @Test
   public void testBasicPRTransactionNoDataRedundancy1() {
     basicPRTXInFunction(1, false);
   }
 
+  @Test
   public void testBasicPRTransactionNoDataRedundancy2() {
     basicPRTXInFunction(2, false);
   }
@@ -311,14 +327,17 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
     return false;
   }
   
+  @Test
   public void testPRTXInCacheListenerRedundancy0() {
     basicPRTXInCacheListener(0);
   }
 
+  @Test
   public void testPRTXInCacheListenerRedundancy1() {
     basicPRTXInCacheListener(1);
   }
 
+  @Test
   public void testPRTXInCacheListenerRedundancy2() {
     basicPRTXInCacheListener(2);
   }
@@ -466,6 +485,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
 
   }
   
+  @Test
   public void testRepeatableRead() throws Exception {
     createColocatedPRs(1);
     SerializableCallable registerFunction = new SerializableCallable(
@@ -514,6 +534,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
 
   }
 
+  @Test
   public void testPRTXPerformance() throws Exception {
     defaultStringSize = 1024;
 
@@ -630,36 +651,47 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
   }
 
   // Don't want to run the test twice
+  @Test
   public void testColocatedPartitionedRegion() throws Throwable {
   }
 
+  @Test
   public void testColocationPartitionedRegion() throws Throwable {
   }
 
+  @Test
   public void testColocationPartitionedRegionWithRedundancy() throws Throwable {
   }
 
+  @Test
   public void testPartitionResolverPartitionedRegion() throws Throwable {
   }
 
+  @Test
   public void testColocationPartitionedRegionWithNullColocationSpecifiedOnOneNode() {
   }
   @Override
+  @Test
   public void testColocatedPRRedundancyRecovery() throws Throwable {
   }
   @Override
+  @Test
   public void testColocatedPRWithAccessorOnDifferentNode1() throws Throwable {
   }
   @Override
+  @Test
   public void testColocatedPRWithAccessorOnDifferentNode2() throws Throwable {
   }
   @Override
+  @Test
   public void testColocatedPRWithDestroy() throws Throwable {
   }
   @Override
+  @Test
   public void testColocatedPRWithLocalDestroy() throws Throwable {
   }
   @Override
+  @Test
   public void testColocatedPRWithPROnDifferentNode1() throws Throwable {
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionWithVersionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionWithVersionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionWithVersionsDUnitTest.java
index 085f4a9..0b8588d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionWithVersionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionWithVersionsDUnitTest.java
@@ -16,10 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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;
+
+@Category(DistributedTest.class)
 public class PRTransactionWithVersionsDUnitTest extends PRTransactionDUnitTest {
 
-  public PRTransactionWithVersionsDUnitTest(String name) {
-    super(name);
+  public PRTransactionWithVersionsDUnitTest() {
+    super();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PerformanceTestFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PerformanceTestFunction.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PerformanceTestFunction.java
index eecaa65..08e0f33 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PerformanceTestFunction.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PerformanceTestFunction.java
@@ -16,12 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Set;
 
-import junit.framework.Assert;
-
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.execute.FunctionAdapter;
 import com.gemstone.gemfire.cache.execute.FunctionContext;
@@ -46,7 +46,7 @@ public class PerformanceTestFunction extends FunctionAdapter {
       Region fcd = PartitionRegionHelper.getLocalDataForContext(prContext);
       for (Iterator i = allKeysSet.iterator(); i.hasNext();) {
         Object val = fcd.get(i.next());
-        Assert.assertNotNull(val);
+        assertNotNull(val);
         vals.add(val);
       }
       context.getResultSender().lastResult(vals);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
index f2ab3e2..d5e07f0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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 java.util.HashMap;
 import java.util.Iterator;
@@ -35,13 +44,14 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
+@Category(DistributedTest.class)
 public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
 
 
   private static final long serialVersionUID = 3873751456134028508L;
   
-  public SingleHopGetAllPutAllDUnitTest(String name) {
-    super(name);
+  public SingleHopGetAllPutAllDUnitTest() {
+    super();
     
   }
   
@@ -51,6 +61,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
    * hosting the data. 
    */
   @Ignore("Disabled due to bug #50618")
+  @Test
   public void testServerGetAllFunction(){
     createScenario();
     client.invoke(() -> SingleHopGetAllPutAllDUnitTest.getAll());
@@ -140,6 +151,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
    * Will also have to see if the function was routed from client to all the servers
    * hosting the data. 
    */
+  @Test
   public void testServerPutAllFunction(){
     createScenario();
     client.invoke(() -> SingleHopGetAllPutAllDUnitTest.putAll());


[26/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
index 421ab5b..0d1fea9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
@@ -16,24 +16,34 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.concurrent.atomic.AtomicInteger;
+
 import com.gemstone.gemfire.CancelException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.io.Serializable;
-import java.util.ArrayList;
-
-import util.TestException;
-
-import junit.framework.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * This class tests the response of GemFire to various
@@ -41,19 +51,15 @@ import junit.framework.Assert;
  * 
  * @since GemFire 5.1
  */
+@Category(DistributedTest.class)
 public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   
   static final String REGION_NAME = "SystemFailureDUnitTest";
   static final Scope SCOPE = Scope.DISTRIBUTED_ACK;
   
   volatile static Object newValue, oldValue;
-  
-  public SystemFailureDUnitTest(String name) {
-    super(name);
-  }
-
-  /////////  Public test methods
 
+  @Test
   public void testNullFailure() {
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("TODO: this test needs to use VM#bounce.");
     try {
@@ -68,13 +74,13 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   /**
    * @see StackOverflowError
    */
-  public void _testStackOverflow()
+  @Ignore("TODO")
+  @Test
+  public void testStackOverflow()
     throws CacheException, InterruptedException {
     String exceptions =
       StackOverflowError.class.getName() 
       + "||"
-//      + OutOfMemoryError.class.getName()
-//      + "||"
       + AssertionError.class.getName();
     
     try {
@@ -101,7 +107,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testOutOfMemory()
+  @Ignore("TODO")
+  @Test
+  public void testOutOfMemory()
     throws CacheException, InterruptedException {
   
     String exceptions =
@@ -132,7 +140,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testPersistentOutOfMemory()
+  @Ignore("TODO")
+  @Test
+  public void testPersistentOutOfMemory()
     throws CacheException, InterruptedException {
   
     String exceptions =
@@ -164,7 +174,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testMemoryMonitor()
+  @Ignore("TODO")
+  @Test
+  public void testMemoryMonitor()
     throws CacheException, InterruptedException {
   
     String exceptions =
@@ -196,7 +208,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
      * @throws CacheException
      * @throws InterruptedException
      */
-    public void _testInternalError()
+    @Ignore("TODO")
+    @Test
+    public void testInternalError()
     throws CacheException, InterruptedException {
       String exceptions =
         InternalError.class.getName()
@@ -226,7 +240,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testUnknownError()
+  @Ignore("TODO")
+  @Test
+  public void testUnknownError()
       throws CacheException, InterruptedException {
     String exceptions =
       UnknownError.class.getName()
@@ -270,11 +286,13 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   }
   
   /**
-     * Create some sort of horrible failure that is <em>not</em>
-     * a VirtualMachineError.
-     */
-    public void _testError()
-    throws CacheException, InterruptedException {
+   * Create some sort of horrible failure that is <em>not</em>
+   * a VirtualMachineError.
+   */
+  @Ignore("TODO")
+  @Test
+  public void testError()
+  throws CacheException, InterruptedException {
     // In this case we do NOT expect a failure
     String exceptions =
       Error.class.getName();
@@ -282,7 +300,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
     try {
       String name = "testError";
       doCreateEntry(name);
-      Assert.assertTrue(doVerifyConnected());
+      assertTrue(doVerifyConnected());
       
        doMessage(
           "<ExpectedException action=add>"
@@ -326,59 +344,37 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   /**
    * Verify that listener gets called, and exactly once.
    */
-  public void _testListener()
+  @Ignore("TODO")
+  @Test
+  public void testListener()
       throws CacheException, InterruptedException {
 
-  String exceptions =
-      Error.class.getName();
-  try {
-    String name = "testListener";
-    doExec("setListener1");
-    
-    doMessage(
-        "<ExpectedException action=add>"
+    String exceptions =
+        Error.class.getName();
+    try {
+      String name = "testListener";
+      doExec("setListener1");
+
+      doMessage(
+          "<ExpectedException action=add>"
+          + exceptions
+          + "</ExpectedException>");
+      doCreateEntry(name);
+
+      Integer count = (Integer)doExec("getListenerCount");
+      assertEquals(1, count.intValue());
+      doVerifyDisconnected();
+    }
+    finally {
+      doMessage(
+        "<ExpectedException action=remove>"
         + exceptions
         + "</ExpectedException>");
-    doCreateEntry(name);
+      resetVM();
+    }
 
-    Integer count = (Integer)doExec("getListenerCount");
-    Assert.assertEquals(1, count.intValue());
-    doVerifyDisconnected();
   }
-  finally {
-    doMessage(
-      "<ExpectedException action=remove>"
-      + exceptions
-      + "</ExpectedException>");
-    resetVM();
-  }
-
-}
 
-//  protected static void doReset() {
-//    // TODO instead of trying to patch up this VM, Lise should create
-//    // me a brand spanking new one
-//    throw new TestException("Sorry, ask Lise to fix this");
-//    
-//    // You'll have to un-comment some methods in order to make
-//    // the following hack work ONCE on a VM...
-////    try {
-////      Thread.sleep(5000);
-////    }
-////    catch (InterruptedException e) {
-////      fail("interrupted");
-////    }
-////    
-////    SystemFailure.reset(); <--- here
-////    DistributedCacheTestCase.cache = null;
-////
-////    // Discard the existing cache instance
-////    GemFireCache.clearInstance(); <--- here
-////    
-////    // This is just to stop the stat sampler thread
-////    HostStatSampler.emergencyStop(); <--- here
-//  }
-  
   private void resetVM() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
@@ -454,7 +450,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
     }
     
     // At this point, the cache we peeked earlier should be unavailable
-    Assert.assertTrue(GemFireCacheImpl.getInstance() == null);
+    assertTrue(GemFireCacheImpl.getInstance() == null);
     
     // Ditto for the distributed system
     InternalDistributedSystem ids = (InternalDistributedSystem)
@@ -556,7 +552,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
       private void forceOutOfMemory() {
         peskyMemory = new ArrayList();
         // Allocate this _before_ exhausting memory :-)
-        final TestException whoops = new TestException("Timeout!");
+        final AssertionError whoops = new AssertionError("Timeout!");
         try {
           for (;;) {
             peskyMemory.add(new long[100000]);
@@ -618,7 +614,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
       
       peskyMemory = new ArrayList();
       // Allocate this _before_ exhausting memory :-)
-      final TestException whoops = new TestException("Timeout!");
+      final AssertionError whoops = new AssertionError("Timeout!");
       
       // Fill up a lot of memory
       for (;;) {
@@ -748,7 +744,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
       listener = listener_error;
     }
     else {
-      throw new TestException("don't know which listener: " + which);
+      throw new AssertionError("don't know which listener: " + which);
     }
     return listener;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
index fefbc60..667a654 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -27,70 +29,70 @@ import com.gemstone.gemfire.InvalidDeltaException;
 
 public final class TestDelta implements Delta, DataSerializable, Cloneable {
 
-    public boolean hasDelta;
-    public String info;
-    public int serializations;
-    public int deserializations;
-    public int deltas;
-    public int clones;
-    
-    public TestDelta() {
-    }
+  public boolean hasDelta;
+  public String info;
+  public int serializations;
+  public int deserializations;
+  public int deltas;
+  public int clones;
+
+  public TestDelta() {
+  }
+
+  public TestDelta(boolean hasDelta, String info) {
+    this.hasDelta = hasDelta;
+    this.info = info;
+  }
 
-    public TestDelta(boolean hasDelta, String info) {
-      this.hasDelta = hasDelta;
-      this.info = info;
-    }
-    
-    public synchronized void checkFields(final int serializations, final int deserializations, final int deltas, final int clones) {
-      DeltaSizingDUnitTest.assertEquals(serializations, this.serializations);
-      DeltaSizingDUnitTest.assertEquals(deserializations, this.deserializations);
-      DeltaSizingDUnitTest.assertEquals(deltas, this.deltas);
-      DeltaSizingDUnitTest.assertEquals(clones, this.clones);
-    }
+  public synchronized void checkFields(final int serializations, final int deserializations, final int deltas, final int clones) {
+    assertEquals(serializations, this.serializations);
+    assertEquals(deserializations, this.deserializations);
+    assertEquals(deltas, this.deltas);
+    assertEquals(clones, this.clones);
+  }
 
-    public synchronized void fromDelta(DataInput in) throws IOException,
-        InvalidDeltaException {
+  public synchronized void fromDelta(DataInput in) throws IOException,
+      InvalidDeltaException {
 //      new Exception("DAN - From Delta Called").printStackTrace();
-      this.hasDelta = true;
-      info = DataSerializer.readString(in);
-      deltas++;
-    }
+    this.hasDelta = true;
+    info = DataSerializer.readString(in);
+    deltas++;
+  }
 
-    public boolean hasDelta() {
-      return hasDelta;
-    }
+  public boolean hasDelta() {
+    return hasDelta;
+  }
 
-    public synchronized void toDelta(DataOutput out) throws IOException {
+  public synchronized void toDelta(DataOutput out) throws IOException {
 //      new Exception("DAN - To Delta Called").printStackTrace();
-      DataSerializer.writeString(info, out);
-    }
+    DataSerializer.writeString(info, out);
+  }
 
-    public synchronized void fromData(DataInput in) throws IOException,
-        ClassNotFoundException {
+  public synchronized void fromData(DataInput in) throws IOException,
+      ClassNotFoundException {
 //      new Exception("DAN - From Data Called").printStackTrace();
-      info = DataSerializer.readString(in);
-      serializations = in.readInt();
-      deserializations = in.readInt();
-      deltas = in.readInt();
-      clones = in.readInt();
-      deserializations++;
-    }
+    info = DataSerializer.readString(in);
+    serializations = in.readInt();
+    deserializations = in.readInt();
+    deltas = in.readInt();
+    clones = in.readInt();
+    deserializations++;
+  }
 
-    public synchronized void toData(DataOutput out) throws IOException {
+  public synchronized void toData(DataOutput out) throws IOException {
 //      new Exception("DAN - To Data Called").printStackTrace();
-      serializations++;
-      DataSerializer.writeString(info, out);
-      out.writeInt(serializations);
-      out.writeInt(deserializations);
-      out.writeInt(deltas);
-      out.writeInt(clones);
-    }
+    serializations++;
+    DataSerializer.writeString(info, out);
+    out.writeInt(serializations);
+    out.writeInt(deserializations);
+    out.writeInt(deltas);
+    out.writeInt(clones);
+  }
 
-    @Override
-    public synchronized Object clone() throws CloneNotSupportedException {
+  @Override
+  public synchronized Object clone() throws CloneNotSupportedException {
 //    new Exception("DAN - Clone Called").printStackTrace();
-      clones++;
-      return super.clone();
-    } 
-  }
\ No newline at end of file
+    clones++;
+    return super.clone();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
index 8c5384a..f3716ea 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
@@ -19,6 +19,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Delta;
 import com.gemstone.gemfire.InvalidDeltaException;
 import com.gemstone.gemfire.cache.*;
@@ -49,7 +58,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
 /**
  *
  */
-public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class TransactionsWithDeltaDUnitTest extends JUnit4CacheTestCase {
 
   private static final String D_REFERENCE = "ref";
   private static final String CUSTOMER = "Customer";
@@ -58,8 +68,8 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public TransactionsWithDeltaDUnitTest(String name) {
-    super(name);
+  public TransactionsWithDeltaDUnitTest() {
+    super();
   }
 
   private Integer createRegionOnServer(VM vm, final boolean startServer, final boolean accessor) {
@@ -204,6 +214,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testTxWithCloning() {
     AttributesFactory af = new AttributesFactory();
     af.setDataPolicy(DataPolicy.REPLICATE);
@@ -212,6 +223,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
     basicTest(af.create());
   }
   
+  @Test
   public void testExceptionThrown() {
     AttributesFactory af = new AttributesFactory();
     af.setDataPolicy(DataPolicy.REPLICATE);
@@ -308,6 +320,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testClientServerDelta() {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
index 419245d..89f71d9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
@@ -16,7 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryPoolMXBean;
+import java.util.Properties;
+import java.util.Set;
+import javax.management.ListenerNotFoundException;
+import javax.management.NotificationEmitter;
+
+import org.apache.logging.log4j.Logger;
+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.CacheFactory;
+import com.gemstone.gemfire.cache.LowMemoryException;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.control.ResourceManager;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
@@ -24,34 +47,16 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.Resou
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.apache.logging.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import util.TestException;
 
-import javax.management.ListenerNotFoundException;
-import javax.management.NotificationEmitter;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class MemoryMonitorJUnitTest {
   private static Logger logger = LogService.getLogger();
   
   public static final int SYSTEM_LISTENERS = 1;
+
   DistributedSystem ds;
   GemFireCacheImpl cache;
+
   @Before
   public void setUp() throws Exception {
     Properties p = new Properties();
@@ -94,7 +99,6 @@ public class MemoryMonitorJUnitTest {
    * 2. listeners are invoked
    * 3. duplicate safe and critical events are not delivered
    * 4. stats are updated
-   * @throws Exception
    */
   @Test
   public void testInvokeListeners() throws Exception{
@@ -353,7 +357,7 @@ public class MemoryMonitorJUnitTest {
       caughtException = true;
     }
     if(expectLowMemEx && !caughtException){
-      throw new TestException("An expected exception was not thrown");
+      throw new AssertionError("An expected exception was not thrown");
     }
     //make region healthy
     heapMonitor.updateStateAndSendEvent(91);
@@ -361,7 +365,7 @@ public class MemoryMonitorJUnitTest {
     try{
       region.put("key-1", "value-2");      
     } catch(LowMemoryException low){      
-      throw new TestException("Unexpected exception:",low);
+      throw new AssertionError("Unexpected exception:",low);
     }
     if (useTransaction) {
       cache.getCacheTransactionManager().commit();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
index 488dcf6..e16f1ae 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
@@ -16,7 +16,48 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.*;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+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.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventListener;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
@@ -28,31 +69,36 @@ import com.gemstone.gemfire.cache.partition.PartitionRebalanceInfo;
 import com.gemstone.gemfire.cache.partition.PartitionRegionHelper;
 import com.gemstone.gemfire.cache.partition.PartitionRegionInfo;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.BucketRegion;
+import com.gemstone.gemfire.internal.cache.ColocationHelper;
+import com.gemstone.gemfire.internal.cache.DiskStoreImpl;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.PRHARedundancyProvider;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter;
 import com.gemstone.gemfire.internal.cache.partitioned.BucketCountLoadProbe;
 import com.gemstone.gemfire.internal.cache.partitioned.LoadProbe;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.TimeoutException;
-
-import static org.mockito.Matchers.*;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
 @SuppressWarnings("synthetic-access")
-public class RebalanceOperationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RebalanceOperationDUnitTest extends JUnit4CacheTestCase {
 
   private static final long MAX_WAIT = 60;
   
@@ -68,17 +114,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "resource.manager.threads");
   }
 
-  /**
-   * @param name
-   */
-  public RebalanceOperationDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testRecoverRedundancySimulation() {
     recoverRedundancy(true);
   }
    
+  @Test
   public void testRecoverRedundancy() {
     recoverRedundancy(false);
   }
@@ -284,10 +325,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testEnforceIP() {
     enforceIp(false);
   }
   
+  @Test
   public void testEnforceIPSimulation() {
     enforceIp(true);
   }
@@ -399,10 +442,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testEnforceZone() {
     enforceZone(false);
   }
   
+  @Test
   public void testEnforceZoneSimulation() {
     enforceZone(true);
   }
@@ -603,6 +648,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testEnforceZoneWithMultipleRegions() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -805,10 +851,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     return results;
   }
   
+  @Test
   public void testRecoverRedundancyBalancingSimulation() {
     recoverRedundancyBalancing(true);
   }
   
+  @Test
   public void testRecoverRedundancyBalancing() {
     recoverRedundancyBalancing(false);
   }
@@ -936,6 +984,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     return (DistributedMember) vm.invoke(createPrRegion);
   }
   
+  @Test
   public void testRecoverRedundancyBalancingIfCreateBucketFails() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1073,10 +1122,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     vm2.invoke(checkRedundancyFixed);
   }
   
+  @Test
   public void testRecoverRedundancyColocatedRegionsSimulation() {
     recoverRedundancyColocatedRegions(true);
   }
   
+  @Test
   public void testRecoverRedundancyColocatedRegions() {
     recoverRedundancyColocatedRegions(false);
   }
@@ -1199,6 +1250,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRecoverRedundancyParallelAsyncEventQueueSimulation() throws NoSuchFieldException, SecurityException {
     Invoke.invokeInEveryVM(new SerializableRunnable() {
 
@@ -1214,6 +1266,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRecoverRedundancyParallelAsyncEventQueue() {
     recoverRedundancyParallelAsyncEventQueue(false);
   }
@@ -1382,6 +1435,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     return member1;
   }
   
+  @Test
   public void testCancelOperation() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1495,6 +1549,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test that the rebalancing operation picks up on 
    * a concurrent membership change
    */
+  @Test
   public void testMembershipChange() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1593,10 +1648,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
   }
   
   
+  @Test
   public void testMoveBucketsNoRedundancySimulation() {
     moveBucketsNoRedundancy(true);
   }
   
+  @Test
   public void testMoveBucketsNoRedundancy() {
     moveBucketsNoRedundancy(false);
   }
@@ -1721,10 +1778,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testFilterRegionsSimulation() {
     filterRegions(true);
   }
   
+  @Test
   public void testFilterRegions() {
     filterRegions(false);
   }
@@ -1865,10 +1924,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testMoveBucketsWithRedundancySimulation() {
     moveBucketsWithRedundancy(true);
   }
 
+  @Test
   public void testMoveBucketsWithRedundancy() {
     moveBucketsWithRedundancy(false);
   }
@@ -1989,6 +2050,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
   /** A test that the stats when overflowing entries to disk
    * are correct and we still rebalance correctly
    */
+  @Test
   public void testMoveBucketsOverflowToDisk() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2199,6 +2261,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
   /**
    * Test to make sure we balance buckets between three hosts with redundancy
    */
+  @Test
   public void testMoveBucketsNestedPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2311,10 +2374,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     vm2.invoke(checkBalance);
   }
   
+  @Test
   public void testMoveBucketsColocatedRegionsSimulation() {
     moveBucketsColocatedRegions(true);
   }
   
+  @Test
   public void testMoveBucketsColocatedRegions() {
     moveBucketsColocatedRegions(false);
   }
@@ -2444,6 +2509,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForPut() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2456,6 +2522,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForInvalidate() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2468,6 +2535,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForDestroy() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2480,6 +2548,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForCacheLoader() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2640,18 +2709,22 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRecoverRedundancyWithOfflinePersistenceSimulation() throws Throwable {
     recoverRedundancyWithOfflinePersistence(true, false);
   }
    
+  @Test
   public void testRecoverRedundancyWithOfflinePersistence() throws Throwable {
     recoverRedundancyWithOfflinePersistence(false, false);
   }
   
+  @Test
   public void testRecoverRedundancyWithOfflinePersistenceAccessorSimulation() throws Throwable {
     recoverRedundancyWithOfflinePersistence(true, true);
   }
    
+  @Test
   public void testRecoverRedundancyWithOfflinePersistenceAccessor() throws Throwable {
     recoverRedundancyWithOfflinePersistence(false, true);
   }
@@ -2909,14 +2982,17 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     assertEquals(vm2Buckets, getBucketList("region1", vm2));
   }
   
+  @Test
   public void testMoveBucketsWithUnrecoveredValues() {
     moveBucketsWithUnrecoveredValuesRedundancy(false);
   }
   
+  @Test
   public void testBalanceBucketsByCountSimulation() {
     balanceBucketsByCount(true);
   }
   
+  @Test
   public void testBalanceBucketsByCount() {
     balanceBucketsByCount(false);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
index 49e07b4..8b9bbaf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
@@ -16,41 +16,32 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
 import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
- * 
  * Disk region Perf test for Overflow only with ASync writes. 1) Performance of
  * get operation for entry in memory.
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private static int counter = 0;
 
-  static int counter = 0;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
 //    Properties properties = new Properties();
     diskProps.setBytesThreshold(10000l);
@@ -61,10 +52,8 @@ public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTesting
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -73,21 +62,17 @@ public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTesting
     }
   }
 
- 
   private static int ENTRY_SIZE = 1024;
   
   /* OP_COUNT can be increased/decrease as per the requirement.
    * If required to be set as higher value such as 1000000
    * one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
-   *    
    */
-  
   private static int OP_COUNT = 1000;
 
   @Test
-  public void testPopulatefor1Kbwrites()
-  {
+  public void testPopulatefor1Kbwrites() {
 //    RegionAttributes ra = region.getAttributes();
 //    final String key = "K";
     final byte[] value = new byte[ENTRY_SIZE];
@@ -129,8 +114,5 @@ public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTesting
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is in memory :" + statsGet);
-
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
index dcb6af1..be87bc1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
@@ -16,12 +16,10 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -40,17 +38,24 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * which will fault in.
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private static int ENTRY_SIZE = 1024 * 5;
+
+  /**
+   * Do not change the value OP_COUNT = 400
+   * The test case is dependent on this value.
+   */
+  private static int OP_COUNT = 400;
+
+  private static int HALF_OP_COUNT = OP_COUNT / 2;
+
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setTimeInterval(1000l);
     diskProps.setBytesThreshold(10000l);
@@ -58,13 +63,10 @@ public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingB
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
         diskProps);
     log = ds.getLogWriter();
-
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -73,20 +75,8 @@ public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingB
     }
   }
 
- 
-  private static int ENTRY_SIZE = 1024 * 5;
-  
- /* Do not change the value OP_COUNT = 400
-  * The test case is dependent on this value.
-  */
-  
-  private static int OP_COUNT = 400;
-
-  private static int HALF_OP_COUNT = OP_COUNT / 2;
-
   @Test
-  public void testPopulatefor5Kbwrites()
-  {
+  public void testPopulatefor5Kbwrites() {
 //    RegionAttributes ra = region.getAttributes();
     LRUStatistics lruStats = getLRUStats(region);
     // Put in larger stuff until we start evicting
@@ -153,15 +143,10 @@ public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingB
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is fauting in :" + statsGet);
-
   }
 
-  protected LRUStatistics getLRUStats(Region region)
-  {
+  private LRUStatistics getLRUStats(Region region) {
     return ((LocalRegion)region).getEvictionController().getLRUHelper()
         .getStats();
-
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
index 95a456c..223f04e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
@@ -16,16 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
 import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
@@ -34,35 +30,36 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 /**
  * Disk region Perf test for Overflow only with Sync writes. 1) Performance of
  * get operation for entry in memory.
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskRegionTestingBase {
+
+  private static int ENTRY_SIZE = 1024;
+
+  private static int OP_COUNT = 10000;
 
-  LogWriter log = null;
+  private static int counter = 0;
 
-  static int counter = 0;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
+  @Override
+  protected final void preSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
-    super.setUp();
+  }
 
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setOverFlowCapacity(100000);
     region = DiskRegionHelperFactory
-        .getSyncOverFlowOnlyRegion(cache, diskProps);
-    
+      .getSyncOverFlowOnlyRegion(cache, diskProps);
+
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -71,15 +68,8 @@ public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskReg
     }
   }
 
-  
-
-  private static int ENTRY_SIZE = 1024;
-
-  private static int OP_COUNT = 10000;
-
   @Test
-  public void testPopulatefor1Kbwrites()
-  {
+  public void testPopulatefor1Kbwrites() {
 //    RegionAttributes ra = region.getAttributes();
 //    final String key = "K";
     final byte[] value = new byte[ENTRY_SIZE];
@@ -122,8 +112,5 @@ public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskReg
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is in memory :" + statsGet);
-
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
index 208b39f..945a3e5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
@@ -16,22 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
 import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
-import com.gemstone.gemfire.internal.cache.*;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
@@ -40,19 +38,26 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * which will fault in.
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBase {
+
+  private static int ENTRY_SIZE = 1024 * 5;
+
+  /**
+   * Do not change the value OP_COUNT = 400
+   * The test case is dependent on this value.
+   */
+  private static int OP_COUNT = 400;
+
+  private static int HALF_OP_COUNT = OP_COUNT / 2;
 
-  LogWriter log = null;
+  private static int counter = 0;
 
-  static int counter = 0;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setOverFlowCapacity(1000);
     region = DiskRegionHelperFactory
@@ -61,10 +66,8 @@ public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBa
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -73,20 +76,8 @@ public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBa
     }
   }
 
- 
-  private static int ENTRY_SIZE = 1024 * 5;
-
-  /* Do not change the value OP_COUNT = 400
-   * The test case is dependent on this value.
-   */
-  
-  private static int OP_COUNT = 400;
-
-  private static int HALF_OP_COUNT = OP_COUNT / 2;
-
   @Test
-  public void testPopulatefor5Kbwrites()
-  {
+  public void testPopulatefor5Kbwrites() throws Exception {
 //    RegionAttributes ra = region.getAttributes();
 
     LRUStatistics lruStats = getLRUStats(region);
@@ -155,15 +146,11 @@ public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBa
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is fauting in :" + statsGet);
-
   }
 
-  protected LRUStatistics getLRUStats(Region region)
-  {
+  private LRUStatistics getLRUStats(Region region) {
     return ((LocalRegion)region).getEvictionController().getLRUHelper()
         .getStats();
-
   }
 
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
index b014cb2..2031fec 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
@@ -16,19 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
+import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
+import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
+import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
+import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
-import com.gemstone.gemfire.internal.cache.*;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
@@ -37,28 +38,22 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * 1) Performance of Get Operation for Entry faulting in from current Op Log 2)
  * Performance of Get operation for Entry faulting in from previous Op Log 3)
  * Performance of Get operation for Entry faulting in from H Tree
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
-    DiskRegionTestingBase
-{
+public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends DiskRegionTestingBase {
 
+  private static int counter = 0;
 
-  
-  LogWriter log = null;
+  private static int ENTRY_SIZE = 1024;
 
-  static int counter = 0;
+  private volatile boolean afterHavingCompacted = false;
 
-  private static int ENTRY_SIZE = 1024;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setRegionName("OverflowAsyncRollingOpLogRegion");
     diskProps.setDiskDirs(dirs);
     this.log = ds.getLogWriter();
@@ -69,13 +64,10 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
     diskProps.setMaxOplogSize(10485760l);
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
         diskProps);
-
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -84,8 +76,6 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
     }
   }
 
-  
-
   @Test
   public void testGetPerfRollingOpog()
   {
@@ -94,7 +84,7 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
     
   }
 
-  public void populateFirst0k_10Kbwrites()
+  private void populateFirst0k_10Kbwrites()
   {
     
    final byte[] value = new byte[ENTRY_SIZE];
@@ -128,9 +118,8 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
             + statsGet);
 
   }
-  
-  protected volatile boolean afterHavingCompacted = false;
-  public void populateSecond10kto20kwrites()
+
+  private void populateSecond10kto20kwrites()
   {
     afterHavingCompacted = false;
     DiskRegionTestingBase.setCacheObserverCallBack();
@@ -208,11 +197,12 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
             + statsGet2);
     DiskRegionTestingBase.unSetCacheObserverCallBack();
   }
-/**
- * getLRUStats
- * @param region1
- * @return
- */
+
+  /**
+   * getLRUStats
+   * @param region1
+   * @return
+   */
   protected LRUStatistics getLRUStats(Region region1)
   {
     return ((LocalRegion)region1).getEvictionController().getLRUHelper()
@@ -221,4 +211,3 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
   }
 
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
index d94cf73..da0bb5e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
@@ -51,10 +51,8 @@ public class DiskRegionOverflowSyncRollingOpLogJUnitTest extends
 
   DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     this.log = ds.getLogWriter();
     diskProps.setRolling(true);
@@ -62,16 +60,8 @@ public class DiskRegionOverflowSyncRollingOpLogJUnitTest extends
     diskProps.setCompactionThreshold(100);
     region = DiskRegionHelperFactory
         .getSyncOverFlowOnlyRegion(cache, diskProps);
-
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-    
-  }
-  
   @Test
   public void testGetPerfRollingOpog()
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
index 5ec4af8..feef5c7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
@@ -16,17 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
@@ -37,43 +35,28 @@ import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 /**
  * Consolidated Disk Region Perftest. Overflow, Persist, OverflowWithPersist
  * modes are tested for Sync, AsyncWithBuffer and AsyncWithoutBufer writes.
- *  
  */
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
-public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
-{
-  LogWriter log = null;
+public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase {
 
-  String stats = null;
+  private static int counter = 0;
 
-  String stats_ForSameKeyputs = null;
+  private LogWriter log = null;
 
-  static int counter = 0;
+  private String stats = null;
 
-  // protected static File[] dirs = null;
+  private String stats_ForSameKeyputs = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-
-  }
-
-  //*********Test Cases **************
-  //********Overflowonly tests *********
   @Test
-  public void testOverflowSync1()
-  {
+  public void testOverflowSync1() throws Exception {
     try {
       //Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowSync1Dir1");
@@ -116,8 +99,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testOverflowSync1
 
   @Test
-  public void testOverflowASyncWithBuffer2()
-  {
+  public void testOverflowASyncWithBuffer2() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithBuffer2Dir1");
@@ -161,8 +143,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
      } //end of testOverflowASyncWithBuffer2
 
   @Test
-  public void testOverflowASyncWithoutBuffer3()
-  {
+  public void testOverflowASyncWithoutBuffer3() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithoutBuffer3Dir1");
@@ -207,10 +188,8 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     
   } //end of testOverflowASyncWithoutBuffer3
 
-  //******** PersistOnly Tests ****************
   @Test
-  public void testpersistSync4()
-  {
+  public void testpersistSync4() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistSync4Dir1");
@@ -252,8 +231,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testPersistSync4
 
   @Test
-  public void testpersistASyncWithBuffer5()
-  {
+  public void testpersistASyncWithBuffer5() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistASyncWithBuffer5Dir1");
@@ -298,8 +276,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testPersistASyncWithBuffer5
 
   @Test
-  public void testPersistASyncWithoutBuffer6()
-  {
+  public void testPersistASyncWithoutBuffer6() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistASyncWithoutBuffer6Dir1");
@@ -345,10 +322,8 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     
   } //end of testPersistASyncWithoutBuffer
 
-  //*************Persist with Overflow tests ****************
   @Test
-  public void testPersistOverflowSync7()
-  {
+  public void testPersistOverflowSync7() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowSync7Dir1");
@@ -392,8 +367,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testPersistOverflowSync
 
   @Test
-  public void testPersistOverflowASyncWithBuffer8()
-  {
+  public void testPersistOverflowASyncWithBuffer8() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithBuffer8Dir1");
@@ -440,8 +414,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testpersistOverflowASyncWithBuffer8
 
   @Test
-  public void testPersistOverflowASyncWithoutBuffer9()
-  {
+  public void testPersistOverflowASyncWithoutBuffer9() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithoutBuffer9Dir1");
@@ -487,7 +460,6 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     
   } //end of testPersistOverflowASyncWithoutBuffer9
 
-  //************** test data population *******************
   public static int ENTRY_SIZE = 1024;
   
   /**
@@ -495,15 +467,12 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
    * If required to be set as higher value such as 1000000
    * one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
-   *    
    */
-  
   public static int OP_COUNT = 100;
 
   public static boolean UNIQUE_KEYS = Boolean.getBoolean("DRP.UNIQUE_KEYS");
 
-  public void populateData()
-  {
+  public void populateData() {
     //Put for validation.
     putForValidation(region);
     
@@ -530,8 +499,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     log.info(stats);
   }
 
-  public void populateDataPutOnSameKey()
-  {
+  public void populateDataPutOnSameKey() {
 //  Put for validation.
     putForValidation(region);
     final byte[] value = new byte[ENTRY_SIZE];
@@ -556,15 +524,13 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     log.info(stats_ForSameKeyputs);
   }
 
-  protected static void deleteFiles()
-  {
+  protected static void deleteFiles() {
     for (int i = 0; i < 4; i++) {
       File[] files = dirs[i].listFiles();
       for (int j = 0; j < files.length; j++) {
         files[j].delete();
       }
     }
-
   }
 
 }// end of DiskRegionPerfJUnitTest

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
index f086325..8f6e14f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
@@ -16,6 +16,13 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
@@ -25,32 +32,19 @@ import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Arrays;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 /**
  * Disk region perf test for Persist only with sync writes.
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase
-{
+public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(true);
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
@@ -58,29 +52,19 @@ public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
-
-  
-
   private static int ENTRY_SIZE = 1024;
   
   /* OP_COUNT can be increased/decrease as per the requirement.
    * If required to be set as higher value such as 1000000
    * one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
-   *    
    */
   private static int OP_COUNT = 1000;
 
   private static boolean UNIQUE_KEYS = Boolean.getBoolean("DRP.UNIQUE_KEYS");
 
   @Test
-  public void testPopulate1kbwrites()
-  {
+  public void testPopulate1kbwrites() {
     RegionAttributes ra = region.getAttributes();
 //    final String key = "K";
     final byte[] value = new byte[ENTRY_SIZE];
@@ -172,8 +156,7 @@ public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testPopulate5kbwrites()
-  {
+  public void testPopulate5kbwrites() {
     ENTRY_SIZE = 1024 * 5;
     
     /* OP_COUNT can be increased/decrease as per the requirement.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
index 1c06543..10a6f20 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
@@ -16,66 +16,52 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import static org.junit.Assert.*;
+
 import java.io.File;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
+import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
+import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Consolidated Disk Region Perftest. Overflow, Persist, OverflowWithPersist
  * modes are tested for Sync, AsyncWithBuffer and AsyncWithoutBufer writes.
  * Roling oplog is set to true with maxOplogSize = 20 mb
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBase {
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  LogWriter log = null;
+  private LogWriter log = null;
 
-  String stats = null;
+  private String stats = null;
 
-  String stats_ForSameKeyputs = null;
+  private String stats_ForSameKeyputs = null;
 
   /**
    * To run DiskRegionRollOpLogPerfJUnitTest to produce the Perf numbers set
    * runPerfTest to true. Also ,one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
    */
-  boolean runPerfTest = false;
+  private boolean runPerfTest = false;
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-
-  }
-
-  //*********Test Cases **************
-  //********Overflowonly tests *********
   @Test
-  public void testOverflowSyncRollOlg1()
-  {
+  public void testOverflowSyncRollOlg1() {
     try {
       //Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowSyncRollOlg1Dir1");
@@ -124,8 +110,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testOverflowSync1
 
   @Test
-  public void testOverflowASyncWithBufferRollOlg2()
-  {
+  public void testOverflowASyncWithBufferRollOlg2() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithBufferRollOlg2Dir1");
@@ -177,8 +162,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testOverflowASyncWithBuffer2
 
   @Test
-  public void testOverflowASyncWithoutBufferRollOlg3()
-  {
+  public void testOverflowASyncWithoutBufferRollOlg3() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithoutBufferRollOlg3Dir1");
@@ -229,10 +213,8 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     deleteFiles();
   } //end of testOverflowASyncWithoutBuffer3
 
-  //******** PersistOnly Tests ****************
   @Test
-  public void testpersistSyncRollOlg4()
-  {
+  public void testpersistSyncRollOlg4() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistSyncRollOlg4Dir1");
@@ -281,8 +263,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testPersistSync4
 
   @Test
-  public void testpersistASyncWithBufferRollOlg5()
-  {
+  public void testpersistASyncWithBufferRollOlg5() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistASyncWithBufferRollOlg5Dir1");
@@ -334,8 +315,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testPersistASyncWithBuffer5
 
   @Test
-  public void testPersistASyncWithoutBufferRollOlg6()
-  {
+  public void testPersistASyncWithoutBufferRollOlg6() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistASyncWithoutBufferRollOlg6Dir1");
@@ -386,10 +366,8 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     closeDown();
   } //end of testPersistASyncWithoutBuffer
 
-  //*************Persist with Overflow tests ****************
   @Test
-  public void testPersistOverflowSyncRollOlg7()
-  {
+  public void testPersistOverflowSyncRollOlg7() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowSyncRollOlg7Dir1");
@@ -440,8 +418,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testPersistOverflowSync
 
   @Test
-  public void testPersistOverflowASyncWithBufferRollOlg8()
-  {
+  public void testPersistOverflowASyncWithBufferRollOlg8() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithBufferRollOlg8Dir1");
@@ -494,8 +471,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testpersistOverflowASyncWithBuffer8
 
   @Test
-  public void testPersistOverflowASyncWithoutBufferRollOlg9()
-  {
+  public void testPersistOverflowASyncWithoutBufferRollOlg9() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithoutBufferRollOlg9Dir1");
@@ -547,7 +523,6 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     closeDown();
   } //end of testPersistOverflowASyncWithoutBuffer9
 
-  //************** test data population *******************
   public static int ENTRY_SIZE = 1024;
 
   /**
@@ -555,15 +530,12 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
    * be set as higher value such as 1000000, one needs to set the VM heap size
    * accordingly. (For example:Default setting in build.xml is <jvmarg
    * value="-Xmx256M"/>
-   *  
    */
-
   public static int OP_COUNT = 1000;
 
   public static boolean UNIQUE_KEYS = Boolean.getBoolean("DRP.UNIQUE_KEYS");
 
-  public void populateData0to60k()
-  {
+  public void populateData0to60k() {
     final byte[] value = new byte[ENTRY_SIZE];
     Arrays.fill(value, (byte)77);
     for (int i = 0; i < 60000; i++) {
@@ -571,11 +543,9 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
       // System.out.println(i);
     }
     System.out.println(" done with putting first 60k entries");
-
   }
 
-  public void populateData60kto100k()
-  {
+  public void populateData60kto100k() {
     //  Put for validation.
     putForValidation(region);
     final byte[] value = new byte[ENTRY_SIZE];
@@ -599,8 +569,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     log.info(stats);
   }
 
-  public void populateDataPutOnSameKey()
-  {
+  public void populateDataPutOnSameKey() {
     //  Put for validation.
     putForValidation(region);
     final byte[] value = new byte[ENTRY_SIZE];
@@ -624,15 +593,12 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     log.info(stats_ForSameKeyputs);
   }
 
-  protected static void deleteFiles()
-  {
+  protected static void deleteFiles() {
     for (int i = 0; i < 4; i++) {
       File[] files = dirs[i].listFiles();
       for (int j = 0; j < files.length; j++) {
         files[j].delete();
       }
     }
-
   }
-
 }// end of DiskRegionRollOpLogPerfJUnitTest

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
index 8875895..8a0605f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
@@ -16,11 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+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.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
-import com.gemstone.gemfire.cache.execute.*;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
@@ -30,28 +48,21 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.tier.ClientHandShake;
 import com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.ArrayList;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class Bug51193DUnitTest extends DistributedTestCase {
+public class Bug51193DUnitTest extends JUnit4DistributedTestCase {
 
-  public Bug51193DUnitTest(String name) {
-    super(name);
-  }
 
-  private static GemFireCacheImpl cache;
-  
   private static final String REGION_NAME = "Bug51193DUnitTest_region";
-  
+
+  private static GemFireCacheImpl cache;
+
   private static VM server0;
   
   private VM client0;
@@ -89,10 +100,7 @@ public class Bug51193DUnitTest extends DistributedTestCase {
       Properties props = new Properties();
       props.setProperty(LOCATORS, "");
       props.setProperty(MCAST_PORT, "0");
-//      props.setProperty("statistic-archive-file", "client_" + OSProcess.getId()
-//          + ".gfs");
-//      props.setProperty("statistic-sampling-enabled", "true");
-      DistributedSystem ds = new Bug51193DUnitTest("Bug51193DUnitTest")
+      DistributedSystem ds = new Bug51193DUnitTest()
           .getSystem(props);
       ds.disconnect();
       ClientCacheFactory ccf = new ClientCacheFactory(props);
@@ -114,7 +122,7 @@ public class Bug51193DUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
 
-    Bug51193DUnitTest test = new Bug51193DUnitTest("Bug51193DUnitTest");
+    Bug51193DUnitTest test = new Bug51193DUnitTest();
     DistributedSystem ds = test.getSystem(props);
     ds.disconnect();
     cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
@@ -176,26 +184,32 @@ public class Bug51193DUnitTest extends DistributedTestCase {
     client0.invoke(() -> Bug51193DUnitTest.executeFunction( mode, timeout ));
   }
 
+  @Test
   public void testExecuteFunctionReadsDefaultTimeout() throws Throwable {
     doTest(false, 0, "server");
   }
 
+  @Test
   public void testExecuteRegionFunctionReadsDefaultTimeout() throws Throwable {
     doTest(false, 0, "region");
   }
 
+  @Test
   public void testExecuteRegionFunctionSingleHopReadsDefaultTimeout() throws Throwable {
     doTest(true, 0, "region");
   }
 
+  @Test
   public void testExecuteFunctionReadsTimeout() throws Throwable {
     doTest(false, 6000, "server");
   }
 
+  @Test
   public void testExecuteRegionFunctionReadsTimeout() throws Throwable {
     doTest(false, 6000, "region");
   }
 
+  @Test
   public void testExecuteRegionFunctionSingleHopReadsTimeout() throws Throwable {
     doTest(true, 6000, "region");
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 67d66b7..7e396c4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
@@ -49,6 +58,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.concurrent.Callable;
 
+@Category(DistributedTest.class)
 public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBase {
   private static final String TEST_FUNCTION1 = TestFunction.TEST_FUNCTION1;
 
@@ -58,8 +68,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   static final String retryRegionName = "RetryDataRegion";
   static Region metaDataRegion;
   
-  public ClientServerFunctionExecutionDUnitTest(String name) {
-    super(name);
+  public ClientServerFunctionExecutionDUnitTest() {
+    super();
   }
 
   @Override
@@ -67,6 +77,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     IgnoredException.addIgnoredException("java.net.ConnectException");
   }
 
+  @Test
   public void test_Bug_43126_Function_Not_Registered()
       throws InterruptedException {
     createScenario();
@@ -80,6 +91,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     }
   }
 
+  @Test
   public void test_Bug43126() throws InterruptedException {
     createScenario();
     Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
@@ -90,6 +102,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the function on server using the name of the function
    */   
+  @Test
   public void testServerExecution_byName() {
     createScenario();
 
@@ -105,6 +118,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   }
   
   
+  @Test
   public void testServerExecution_sendException() {
     createScenario();
 
@@ -122,6 +136,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the function on server using the name of the function
    */   
+  @Test
   public void testServerExecution_NoLastResult() {
     createScenario();
 
@@ -136,6 +151,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution_NoLastResult( isByName, function, toRegister));
   }
 
+  @Test
   public void testServerExecution_byName_WithoutRegister() {
     createScenario();
 
@@ -152,6 +168,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the inline function on server 
    */   
+  @Test
   public void testServerExecution_byInlineFunction() {
     createScenario();
     LogWriterUtils.getLogWriter().info("ClientServerFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
@@ -163,6 +180,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the inline function on server 
    */   
+  @Test
   public void testServerExecution_byInlineFunction_InvalidAttrbiutes() {
     createScenario();
     LogWriterUtils.getLogWriter().info("ClientServerFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
@@ -172,6 +190,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the inline function on server
    */
+  @Test
   public void testBug40714() {
     createScenario();
     LogWriterUtils.getLogWriter()
@@ -247,6 +266,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the function on server using the name of the function
    */   
+  @Test
   public void testServerExecution_SocketTimeOut() {
     createScenario();
     function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
@@ -259,6 +279,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution( isByName, function, toRegister));
   }
 
+  @Test
   public void testServerExecution_SocketTimeOut_WithoutRegister() {
     createScenario();
     function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
@@ -277,6 +298,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
    * the execution is failover to other available server
    */
   @SuppressWarnings("rawtypes")
+  @Test
   public void testOnServerFailoverWithOneServerDownHA()
       throws InterruptedException {
     //The test code appears to trigger this because the first
@@ -302,6 +324,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testOnServerFailoverWithTwoServerDownHA()
       throws InterruptedException {
     //The test code appears to trigger this because the first
@@ -332,6 +355,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
    * Ensure that the while executing the function if the servers are down then 
    * the execution shouldn't failover to other available server
    */
+  @Test
   public void testOnServerFailoverNonHA()
       throws InterruptedException {
     //The test code appears to trigger this because the first
@@ -360,6 +384,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
    * As this is the case of HA then system should retry the function execution. After 5th attempt
    * function will send Boolean as last result.
    */
+  @Test
   public void testOnServerExecution_FunctionInvocationTargetException() {
     createScenario();
     function = new TestFunction(true, TestFunction.TEST_FUNCTION_ONSERVER_REEXECUTE_EXCEPTION);



[33/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
index 22efdea..1c9b401 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
@@ -16,6 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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 static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import javax.naming.Context;
+import javax.transaction.UserTransaction;
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import com.gemstone.gemfire.cache.*;
@@ -52,6 +76,7 @@ import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter;
 /**
  * Tests the basic client-server transaction functionality
  */
+@Category(DistributedTest.class)
 public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest {
 
   protected static final int MAX_ENTRIES = 10;
@@ -59,8 +84,8 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
 
   protected static final String OTHER_REGION = "OtherRegion";
 
-  public ClientServerTransactionDUnitTest(String name) {
-    super(name);
+  public ClientServerTransactionDUnitTest() {
+    super();
   }
 
   @Override
@@ -195,6 +220,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
   
   
 
+  @Test
   public void testTwoPoolsNotAllowed() {
     Host host = Host.getHost(0);
     VM datastore1 = host.getVM(0);
@@ -265,6 +291,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
   }
   
 
+  @Test
   public void testCleanupAfterClientFailure() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -343,22 +370,27 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
     }
   }
 
+  @Test
   public void testBasicCommitOnEmpty() {
     doBasicTransaction(false, false, true);
   }
   
+  @Test
   public void testBasicCommitOnEmptyUsingJTA() {
     doBasicTransaction(false, true, true);
   }
 
+  @Test
   public void testBasicCommit() {
     doBasicTransaction(true, false, true);
   }
   
+  @Test
   public void testBasicCommitUsingJTA() {
     doBasicTransaction(true, true, true);
   }
   
+  @Test
   public void testBasicRollbackUsingJTA() {
     doBasicTransaction(true, true, false);
   }
@@ -498,10 +530,12 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
     verifyVersionTags(client, server, null, null);
   }  
   
+  @Test
   public void testTXCreationAndCleanupAtCommit() throws Exception {
     doBasicChecks(true);
   }
 
+  @Test
   public void testTXCreationAndCleanupAtRollback() throws Exception {
     doBasicChecks(false);
   }
@@ -572,6 +606,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
   }
   
   
+  @Test
   public void testPutallRollbackInServer() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM server = host.getVM(0);
@@ -597,6 +632,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
 	    });
 	  }
   
+  @Test
   public void testPutallRollbackInClient() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM server = host.getVM(0);
@@ -691,7 +727,8 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
     });
   }
 
-public void testClientCommitAndDataStoreGetsEvent() throws Exception {
+  @Test
+  public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
     VM datastore = host.getVM(1);
@@ -742,6 +779,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   
   
   
+  @Test
   public void testClientCreateAndTwoInvalidates() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM accessor = host.getVM(0);
@@ -786,6 +824,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   
   
   
+  @Test
   public void testClientCommitsAndJustGets() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM accessor = host.getVM(0);
@@ -825,6 +864,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
 	  }
   
   
+  @Test
   public void testClientDoesUnsupportedLocalOps() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM accessor = host.getVM(0);
@@ -878,6 +918,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
 	  }
 
   
+  @Test
   public void testClientCommitsWithRIAndOnlyGetsOneEvent() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -927,6 +968,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testDatastoreCommitsWithPutAllAndRI() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM accessor = host.getVM(0);
@@ -994,6 +1036,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   
   
   
+  @Test
   public void testClientCommitsWithPutAllAndRI() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM accessor = host.getVM(0);
@@ -1048,6 +1091,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
 	  }
   
   
+  @Test
   public void testClientRollsbackWithPutAllAndRI() throws Exception {
 	    Host host = Host.getHost(0);
 	    VM accessor = host.getVM(0);
@@ -1101,6 +1145,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
 	    });
 	  }
   
+  @Test
   public void testClientInitiatedInvalidates() throws Exception {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -1275,6 +1320,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   /**
    * client connectes to an accessor and completes a transaction
    */
+  @Test
   public void testServerDelegate() {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1313,10 +1359,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testCommitWithPRAccessor() {
     doTxWithPRAccessor(true);
   }
   
+  @Test
   public void testRollbackWithPRAccessor() {
     doTxWithPRAccessor(false);
   }
@@ -1400,6 +1448,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * there is one txState and zero or more txProxyStates
    * @throws Exception
    */
+  @Test
   public void testConnectionAffinity() throws Exception {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -1491,6 +1540,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * pool connects to the accessor and datastore
    * we then close the server in the accessor and verify failover
    */
+  @Test
   public void testFailover() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -1500,6 +1550,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     doFailoverWork(accessor, null, datastore, client, true, false);
   }
   
+  @Test
   public void testFailoverAndCachingProxy() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -1513,6 +1564,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * pool connects to two accessors.
    * we then close the server in first accessor and verify failover
    */
+  @Test
   public void testFailoverWithP2PMessaging() {
     Host host = Host.getHost(0);
     VM accessor1 = host.getVM(0);
@@ -1523,6 +1575,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     doFailoverWork(accessor1, accessor2, datastore, client, false, false);
   }
   
+  @Test
   public void testFailoverWithP2PMessagingAndCachingProxy() {
     Host host = Host.getHost(0);
     VM accessor1 = host.getVM(0);
@@ -1624,6 +1677,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testGetEntry() {
     Host host = Host.getHost(0);
     //VM accessor = host.getVM(0);
@@ -1677,6 +1731,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   
   
   
+  @Test
   public void testBug42920() {
     Host host = Host.getHost(0);
     VM datastore = host.getVM(1);
@@ -1889,6 +1944,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testTXListenerOnRedundant() {
     Host host = Host.getHost(0);
     VM datastore1 = host.getVM(0);
@@ -1937,6 +1993,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     assertEquals(1, listenerInvokedCount);
   }
   
+  @Test
   public void testBasicFunctionExecution() {
     Host host = Host.getHost(0);
     VM datastore = host.getVM(0);
@@ -1944,6 +2001,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     doBasicFunctionExecution(client, null, datastore);
   }
   
+  @Test
   public void testRemotedFunctionExecution() {
     Host host = Host.getHost(0);
     VM datastore = host.getVM(0);
@@ -2026,6 +2084,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testEmptyTX() {
     Host host = Host.getHost(0);
     VM datastore = host.getVM(0);
@@ -2045,6 +2104,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testSuspendResumeOnDifferentThreads() {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);
@@ -2103,177 +2163,221 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   
   
   @Override
+  @Test
   public void testPRTXGet() {
   }
 
   @Override
+  @Test
   public void testPRTXGetOnRemoteWithLoader() {
   }
 
   @Override
+  @Test
   public void testPRTXGetEntryOnRemoteSide() {
   }
 
   @Override
+  @Test
   public void testPRTXGetOnLocalWithLoader() {
   }
 
   @Override
+  @Test
   public void testNonColocatedTX() {
   }
 
   @Override
+  @Test
   public void testRemoteExceptionThrown() {
   }
 
   @Override
+  @Test
   public void testSizeForTXHostedOnRemoteNode() {
   }
 
   @Override
+  @Test
   public void testSizeOnAccessor() {
   }
 
   @Override
+  @Test
   public void testKeysIterator() {
   }
 
   @Override
+  @Test
   public void testValuesIterator() {
   }
 
   @Override
+  @Test
   public void testEntriesIterator() {
   }
 
   @Override
+  @Test
   public void testKeysIterator1() {
   }
 
   @Override
+  @Test
   public void testValuesIterator1() {
   }
 
   @Override
+  @Test
   public void testEntriesIterator1() {
   }
 
   @Override
+  @Test
   public void testKeysIteratorOnDestroy() {
   }
 
   @Override
+  @Test
   public void testValuesIteratorOnDestroy() {
   }
 
   @Override
+  @Test
   public void testEntriesIteratorOnDestroy() {
   }
 
   @Override
+  @Test
   public void testKeysIterator1OnDestroy() {
   }
 
   @Override
+  @Test
   public void testValuesIterator1OnDestroy() {
   }
 
   @Override
+  @Test
   public void testEntriesIterator1OnDestroy() {
   }
 
   @Override
+  @Test
   public void testKeyIterationOnRR() {
   }
 
   @Override
+  @Test
   public void testValuesIterationOnRR() {
   }
 
   @Override
+  @Test
   public void testEntriesIterationOnRR() {
   }
 
   @Override
+  @Test
   public void testIllegalIteration() {
   }
 
   @Override
+  @Test
   public void testTxFunctionOnRegion() {
   }
 
   @Override
+  @Test
   public void testTxFunctionOnMember() {
   }
 
   @Override
+  @Test
   public void testNestedTxFunction() {
   }
 
   @Override
+  @Test
   public void testDRFunctionExecution() {
   }
 
   @Override
+  @Test
   public void testTxFunctionWithOtherOps() {
   }
 
   @Override
+  @Test
   public void testRemoteJTACommit() {
   }
 
   @Override
+  @Test
   public void testRemoteJTARollback() {
   }
 
   @Override
+  @Test
   public void testOriginRemoteIsTrueForRemoteReplicatedRegions() {
   }
 
   @Override
+  @Test
   public void testRemoteCreateInReplicatedRegion() {
   }
 
   @Override
+  @Test
   public void testRemoteTxCleanupOnCrash() {
   }
 
   @Override
+  @Test
   public void testNonColocatedPutAll() {
   }
 
   @Override
+  @Test
   public void testDestroyCreateConflation() {
   }
 
   @Override
+  @Test
   public void testTXWithRI() throws Exception {
   }
 
   @Override
+  @Test
   public void testBug43176() {
   }
 
   @Override
+  @Test
   public void testTXWithRICommitInDatastore() throws Exception {
   }
 
   @Override
+  @Test
   public void testListenersNotInvokedOnSecondary() {
   }
 
   @Override
+  @Test
   public void testBug33073() {
   }
 
   @Override
+  @Test
   public void testBug43081() throws Exception {
   }
 
   @Override
+  @Test
   public void testBug45556() {
   }
 
+  @Test
   public void testBug42942() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2316,6 +2420,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testOnlyGet() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2337,6 +2442,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testBug43237() {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2412,6 +2518,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * start 3 servers, accessor has r1 and r2; ds1 has r1, ds2 has r2
    * stop server after distributing commit but b4 replying to client
    */
+  @Test
   public void testFailoverAfterCommitDistribution() {
     Host host = Host.getHost(0);
     VM accessor = host.getVM(0);
@@ -2526,6 +2633,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * start a tx in a thread, obtain local locks and wait. start
    * another tx and commit, make sure 2nd thread gets CCE
    */
+  @Test
   public void testClientTxLocks() {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2608,6 +2716,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     }
   }
   
+  @Test
   public void testBasicResumableTX() {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -2649,10 +2758,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * transactional ops in functions, commit is done using internal
    * ClientCommitFunction.
    */
+  @Test
   public void testClientCommitFunction() {
     doFunctionWork(true);
   }
   
+  @Test
   public void testClientRollbackFunction() {
     doFunctionWork(false);
   }
@@ -2756,9 +2867,11 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     }
   }
   
+  @Test
   public void testClientCommitFunctionWithFailure() {
     doFunctionWithFailureWork(true);
   }
+  @Test
   public void testRollbackFunctionWithFailure() {
     doFunctionWithFailureWork(false);
   }
@@ -2831,9 +2944,11 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * start an accessor and two peers, then commit transaction
    * from accessor
    */
+  @Test
   public void testCommitFunctionFromPeer() {
     doTestFunctionFromPeer(true);
   }
+  @Test
   public void testRollbackFunctionFromPeer() {
     doTestFunctionFromPeer(false);
   }
@@ -2888,6 +3003,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testBug43752() {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -2917,6 +3033,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     });
   }
   
+  @Test
   public void testSuspendTimeout() throws Exception {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -2971,6 +3088,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
   /**
    * test that re-tried operations from client do not result in multiple ops in tx
    */
+  @Test
   public void testEventTracker() {
     Host host = Host.getHost(0);
     VM delegate = host.getVM(0);
@@ -3081,6 +3199,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * verify that the exception does not cause the client to failover to the second server
    * see bug 51666
    */
+  @Test
   public void testTransactionException() {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -3173,6 +3292,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
    * that the client ignores this region.
    * see bug 51922
    */
+  @Test
   public void testNotAllRegionsHaveClient() {
     disconnectAllFromDS();
     Host host = Host.getHost(0);
@@ -3239,6 +3359,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception {
     
   }
 
+  @Test
   public void testAdjunctMessage() {
     Host host = Host.getHost(0);
     VM server1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ComplexDiskRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ComplexDiskRegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ComplexDiskRegionJUnitTest.java
index bc33f3a..1506f96 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ComplexDiskRegionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ComplexDiskRegionJUnitTest.java
@@ -16,43 +16,31 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import org.junit.After;
-import org.junit.Before;
+import static org.junit.Assert.*;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.StatisticsFactory;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.internal.cache.DirectoryHolder;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Unit testing for ComplexDiskRegion API's
- * 
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class ComplexDiskRegionJUnitTest extends DiskRegionTestingBase
-{
+public class ComplexDiskRegionJUnitTest extends DiskRegionTestingBase {
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
-
-  
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
   @Override
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = true;
   }
 
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     DiskStoreImpl.SET_IGNORE_PREALLOCATE = false;
   }
 
@@ -63,8 +51,7 @@ public class ComplexDiskRegionJUnitTest extends DiskRegionTestingBase
    * The test will test that an oplog is correctly being added to be rolled
    */
   @Test
-  public void testAddToBeCompacted()
-  {
+  public void testAddToBeCompacted() {
     deleteFiles();
     diskProps.setRolling(false);
     diskProps.setAllowForceCompaction(true);
@@ -113,11 +100,9 @@ public class ComplexDiskRegionJUnitTest extends DiskRegionTestingBase
     oplog3.destroy();
     closeDown();
     deleteFiles();
-
   }
 
   /**
-   *  
    * Test method for
    * 'com.gemstone.gemfire.internal.cache.ComplexDiskRegion.removeFirstOplog(Oplog)'
    * 
@@ -125,8 +110,7 @@ public class ComplexDiskRegionJUnitTest extends DiskRegionTestingBase
    * the firs to be rolled).
    */
   @Test
-  public void testRemoveFirstOplog()
-  {
+  public void testRemoveFirstOplog() {
     deleteFiles();
     diskProps.setRolling(false);
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
index 6c1dac1..ab3a5de 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -32,7 +41,8 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *
  */
-public class ConcurrentDestroySubRegionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentDestroySubRegionDUnitTest extends JUnit4CacheTestCase {
 
   @Override
   public final void postSetUp() throws Exception {
@@ -45,10 +55,11 @@ public class ConcurrentDestroySubRegionDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public ConcurrentDestroySubRegionDUnitTest(String name) {
-    super(name);
+  public ConcurrentDestroySubRegionDUnitTest() {
+    super();
   }
 
+  @Test
   public void test() throws Throwable {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -109,6 +120,7 @@ public class ConcurrentDestroySubRegionDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testPartitionedRegion() throws Throwable {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java
index 0cab6f9..aeef265 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java
@@ -16,12 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
+import static org.junit.Assert.*;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -36,25 +32,9 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * A region operation is done on the same key that is about to be rolled or has
  * just been rolled and the region operation is verified to have been correctly
  * executed.
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
-    DiskRegionTestingBase
-{
-
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
-  }
-
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
+public class ConcurrentFlushingAndRegionOperationsJUnitTest extends DiskRegionTestingBase {
 
   protected boolean alreadyComeHere = false;
 
@@ -84,8 +64,8 @@ public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
     region.put("Key", "Value1");
     ((LocalRegion)region).getDiskRegion().flushForTesting();
     try {
-      Assert.assertEquals("Value2", region.get("Key"));
-      Assert.assertEquals("Value2", getValueOnDisk(region));
+      assertEquals("Value2", region.get("Key"));
+      assertEquals("Value2", getValueOnDisk(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
@@ -118,7 +98,7 @@ public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
     region.put("Key", "Value1");
     ((LocalRegion)region).getDiskRegion().flushForTesting();
     try {
-      Assert.assertEquals("Value1", getValueOnDisk(region));
+      assertEquals("Value1", getValueOnDisk(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
@@ -320,7 +300,7 @@ public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
           long newOplogOffset = id.getOffsetInOplog();
           id.setOplogId(oldOplogId);
           id.setOffsetInOplog(oldOplogOffset);
-          Assert.assertEquals("Value1", ((LocalRegion)region).getDiskRegion()
+          assertEquals("Value1", ((LocalRegion)region).getDiskRegion()
               .getNoBuffer(id));
           id.setOplogId(newOplogId);
           id.setOffsetInOplog(newOplogOffset);
@@ -336,7 +316,7 @@ public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
     ((LocalRegion)region).getDiskRegion().flushForTesting();
     try {
 //       region.getCache().getLogger().info("getting value2");
-      Assert.assertEquals("Value2", region.get("Key"));
+      assertEquals("Value2", region.get("Key"));
     }
     catch (Exception e) {
       logWriter.error("Exception occured", e);
@@ -346,7 +326,7 @@ public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
     ((LocalRegion)region).getDiskRegion().flushForTesting();
 
     try {
-      Assert.assertEquals("Value2", getValueOnDisk(region));
+      assertEquals("Value2", getValueOnDisk(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
@@ -372,7 +352,7 @@ public class ConcurrentFlushingAndRegionOperationsJUnitTest extends
     region.put("Key", "Value1");
     ((LocalRegion)region).getDiskRegion().flushForTesting();
     try {
-      Assert.assertEquals("Value1", getValueOnDisk(region));
+      assertEquals("Value1", getValueOnDisk(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java
index 315caff..3b7c6df 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java
@@ -16,20 +16,23 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
-public class ConcurrentMapLocalJUnitTest {
+public class ConcurrentMapLocalJUnitTest { // TODO: reformat
 
   private Cache cache;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java
index 919556d..7f03ad1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java
@@ -14,14 +14,31 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/**
- * 
- */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.Delta;
 import com.gemstone.gemfire.InvalidDeltaException;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
@@ -29,32 +46,29 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.client.internal.DestroyOp;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.MembershipManager;
 import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.AssertionFailedError;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * tests for the concurrentMapOperations. there are more tests in ClientServerMiscDUnitTest
- *
  */
-public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentMapOpsDUnitTest extends JUnit4CacheTestCase {
 
-  protected static final String REP_REG_NAME = "repRegion";
-  protected static final String PR_REG_NAME = "prRegion";
+  private static final String REP_REG_NAME = "repRegion";
+  private static final String PR_REG_NAME = "prRegion";
   private static final int MAX_ENTRIES = 113;
   
   enum OP {PUTIFABSENT, REPLACE, REMOVE}
@@ -79,11 +93,11 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
 
-  protected Region createReplicateRegion() {
+  private Region createReplicateRegion() {
     return getCache().createRegionFactory(RegionShortcut.REPLICATE).setConcurrencyChecksEnabled(true).create(REP_REG_NAME);
   }
 
-  protected Region createPartitionedRegion() {
+  private Region createPartitionedRegion() {
     return getCache().createRegionFactory(RegionShortcut.PARTITION).setConcurrencyChecksEnabled(true).create(PR_REG_NAME);
   }
 
@@ -151,8 +165,8 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
       }
     });
   }
-  
-   static abstract class AbstractConcMapOpsListener implements CacheListener<Integer, String> {
+
+  private static abstract class AbstractConcMapOpsListener implements CacheListener<Integer, String> {
     public void afterCreate(EntryEvent<Integer, String> event) {
       validate(event);
     }
@@ -179,15 +193,15 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     }
     abstract void validate(EntryEvent event);
   }
-  
-  static class NotInvokedListener extends AbstractConcMapOpsListener {
+
+  private static class NotInvokedListener extends AbstractConcMapOpsListener {
     @Override
     void validate(EntryEvent event) {
       fail("should not be called.  Event="+event);
     }
   }
 
-  static class InitialCreatesListener extends AbstractConcMapOpsListener {
+  private static class InitialCreatesListener extends AbstractConcMapOpsListener {
     AtomicInteger numCreates = new AtomicInteger();
     @Override
     void validate(EntryEvent event) {
@@ -197,14 +211,9 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
       numCreates.incrementAndGet();
     }
   }
-  /**
-   * @param name
-   */
-  public ConcurrentMapOpsDUnitTest(String name) {
-    super(name);
-  }
 
   // test for bug #42164
+  @Test
   public void testListenerNotInvokedForRejectedOperation() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -324,10 +333,12 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testBug42162() {
     dotestConcOps(false);
   }
   
+  @Test
   public void testBug42162EmptyClient() {
     dotestConcOps(true);
   }
@@ -372,7 +383,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
         final Region r = getCache().getRegion(REP_REG_NAME);
         final Region pr = getCache().getRegion(PR_REG_NAME);
         WaitCriterion wc = new WaitCriterion() {
-          AssertionFailedError e = null;
+          AssertionError e = null;
           public boolean done() {
             try {
               if (!emptyClient) {
@@ -389,7 +400,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
               assertNull(pr.putIfAbsent("keyForNull", null));
               assertNull(r.putIfAbsent("clientNullKey", null));
               assertNull(pr.putIfAbsent("clientNullKey", null));
-            } catch (AssertionFailedError ex) {
+            } catch (AssertionError ex) {
               r.getCache().getLoggerI18n().fine("SWAP:caught ", ex);
               e = ex;
               return false;
@@ -424,7 +435,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
         final Region r = getCache().getRegion(REP_REG_NAME);
         final Region pr = getCache().getRegion(PR_REG_NAME);
         WaitCriterion wc = new WaitCriterion() {
-          AssertionFailedError e = null;
+          AssertionError e = null;
           public boolean done() {
             try {
               assertEquals("value2", r.putIfAbsent("key0", null));
@@ -438,7 +449,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
               assertNull(r.replace("NoKeyOnServer", "value"));
               assertTrue(r.replace("clientNullKey", null, "newValue"));
               assertTrue(pr.replace("clientNullKey", null, "newValue"));
-            } catch (AssertionFailedError ex) {
+            } catch (AssertionError ex) {
               e = ex;
               return false;
             }
@@ -463,6 +474,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testNullValueFromNonEmptyClients() {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -496,10 +508,12 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
 
+  @Test
   public void testPutIfAbsent() {
     doPutIfAbsentWork(false);
   }
   
+  @Test
   public void testPutIfAbsentCS() {
     doPutIfAbsentWork(true);
   }
@@ -547,10 +561,12 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testRemove() {
     doRemoveWork(false);
   }
   
+  @Test
   public void testRemoveCS() {
     doRemoveWork(true);
   }
@@ -609,10 +625,12 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testReplaceCS() {
     doReplaceWork(true);
   }
   
+  @Test
   public void testReplace() {
     doReplaceWork(false);
   }
@@ -674,15 +692,19 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testBug42167() {
     do42167Work(false, REP_REG_NAME);
   }
+  @Test
   public void testBug42167PR() {
     do42167Work(false, PR_REG_NAME);
   }
+  @Test
   public void testBug42167Empty() {
     do42167Work(true, REP_REG_NAME);
   }
+  @Test
   public void testBug42167EmptyPR() {
     do42167Work(true, PR_REG_NAME);
   }
@@ -759,9 +781,11 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testBug42189() {
     doBug42189Work(REP_REG_NAME);
   }
+  @Test
   public void testBug42189PR() {
     doBug42189Work(PR_REG_NAME);
   }
@@ -802,13 +826,25 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
       }
     });
   }
-  
-  public void _testBug42195() {
+
+  /**
+   * Replicate Region test for bug #42195: putIfAbsent from client does not put old value in local cache
+   */
+  @Ignore("TODO")
+  @Test
+  public void testBug42195() {
     doPutIfAbsentPutsKeyInLocalClientCacheWork(REP_REG_NAME);
   }
-  public void _testBug42195PR() {
+
+  /**
+   * Partitioned Region test for bug #42195: putIfAbsent from client does not put old value in local cache
+   */
+  @Ignore("TODO")
+  @Test
+  public void testBug42195PR() {
     doPutIfAbsentPutsKeyInLocalClientCacheWork(PR_REG_NAME);
   }
+
   private void doPutIfAbsentPutsKeyInLocalClientCacheWork(final String regionName) {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);
@@ -836,9 +872,11 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testReplacePutsKeyInLocalClientCache() {
     doReplacePutsKeyInLocalClientCacheWork(REP_REG_NAME);
   }
+  @Test
   public void testReplacePutsKeyInLocalClientCachePR() {
     doReplacePutsKeyInLocalClientCacheWork(PR_REG_NAME);
   }
@@ -961,15 +999,19 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
       }
     });
   }
+  @Test
   public void testWithDelta() {
     doTestWithDeltaWork(false, REP_REG_NAME);
   }
+  @Test
   public void testWithDeltaPR() {
     doTestWithDeltaWork(false, PR_REG_NAME);
   }  
+  @Test
   public void testWithDeltaCS() {
     doTestWithDeltaWork(true, REP_REG_NAME);
   }
+  @Test
   public void testWithDeltaPRCS() {
     doTestWithDeltaWork(true, PR_REG_NAME);
   }
@@ -1005,26 +1047,32 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase {
   }
   
   /** test putIfAbsent with failover & retry.  This is bugs 42559 and 43640 */
+  @Test
   public void testRetriedPutIfAbsent() throws Exception {
     doRetriedOperation(Operation.PUT_IF_ABSENT, false);
   }
   
+  @Test
   public void testRetriedReplace() throws Exception {
     doRetriedOperation(Operation.REPLACE, false);
   }
 
+  @Test
   public void testRetriedRemove() throws Exception {
     doRetriedOperation(Operation.REMOVE, false);
   }
 
+  @Test
   public void testRetriedPutIfAbsentPR() throws Exception {
     doRetriedOperation(Operation.PUT_IF_ABSENT, false);
   }
   
+  @Test
   public void testRetriedReplacePR() throws Exception {
     doRetriedOperation(Operation.REPLACE, false);
   }
 
+  @Test
   public void testRetriedRemovePR() throws Exception {
     doRetriedOperation(Operation.REMOVE, false);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRegionOperationsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRegionOperationsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRegionOperationsJUnitTest.java
index 754fb34..032301f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRegionOperationsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRegionOperationsJUnitTest.java
@@ -16,9 +16,7 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.util.Collection;
 import java.util.Iterator;
@@ -31,8 +29,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -60,12 +56,9 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * recover the old values and again the two regions are checked for equality.
  *  * This test is run for all modes persist, persist+overflow, overflow only in
  * syn and async mode.
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
-{
+public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase {
 
   private int numberOfPutsThreads = 5;
 
@@ -107,10 +100,8 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
 
   private static int counter = 0;
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     counter++;
     if (longTest) {
       TIME_TO_RUN = 10000;
@@ -122,12 +113,6 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
     }
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
-
   @Test
   public void testPersistSyncConcurrency()
   {
@@ -330,11 +315,10 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
         p);
     validate(region1, region2);
   }
+
   /**
    * Tests the bug where a get operation on an evicted entry fails to get value
    * as the oplog is deleted by the roller, but the entry was not rolled.
-   * 
-   *  
    */
   @Test
   public void testBug35048()
@@ -445,7 +429,6 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
     ThreadUtils.join(t1, 30 * 1000);
     ThreadUtils.join(t2, 30 * 1000);
     assertTrue(!failure);
-
   }
 
   private final AtomicBoolean timeToStop = new AtomicBoolean();
@@ -459,9 +442,9 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
     try {
       startLine.await();
     } catch (InterruptedException ie) {
-      fail("unexpected " + ie);
+      throw new AssertionError("unexpected ", ie);
     } catch (BrokenBarrierException ex) {
-      fail("unexpected " + ex);
+      throw new AssertionError("unexpected ", ex);
     }
   }
   
@@ -691,7 +674,7 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
       catch (Exception e) {
         exceptionOccuredInGets = true;
         logWriter.severe("Exception occured in get ", e);
-        fail(" failed during get due to " + e);
+        throw new AssertionError(" failed during get due to ", e);
       }
     } finally {
       if (lock != null) {
@@ -764,7 +747,7 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
     catch (Exception e) {
       exceptionOccuredInClears = true;
       logWriter.severe("Exception occured in clear=",e);
-      fail("Exception occured in clear");
+      throw new AssertionError("Exception occured in clear", e);
     }
   }
 
@@ -776,8 +759,6 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
    * because a clear operation stop/starts the roller) & the destroy operation
    * actually joined with the new thread ( different from the one on which
    * notification was issued to exit).
-   * 
-   *  
    */
   @Test
   public void testConcurrentClearAndRegionDestroyBug()
@@ -912,8 +893,7 @@ public class ConcurrentRegionOperationsJUnitTest extends DiskRegionTestingBase
       catch (Exception e) {
         exceptionOccuredInForceRolls = true;
         logWriter.severe("Exception occured in forceRolling ", e);
-        fail(" Exception occured here");
-
+        throw new AssertionError(" Exception occured here", e);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRollingAndRegionOperationsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRollingAndRegionOperationsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRollingAndRegionOperationsJUnitTest.java
index 4a8210f..224b700 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRollingAndRegionOperationsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentRollingAndRegionOperationsJUnitTest.java
@@ -16,31 +16,18 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
-
-import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.EntryNotFoundException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.internal.cache.CacheObserver;
-import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
-import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
-import com.gemstone.gemfire.internal.cache.DiskEntry;
-import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
-import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
-import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.internal.cache.RegionEntry;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
@@ -51,13 +38,9 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * A region operation is done on the same key that is about to be rolled or has
  * just been rolled and the region operation is verified to have been correctly
  * executed.
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class ConcurrentRollingAndRegionOperationsJUnitTest extends
-    DiskRegionTestingBase
-{
+public class ConcurrentRollingAndRegionOperationsJUnitTest extends DiskRegionTestingBase {
 
   protected volatile boolean hasBeenNotified;
 
@@ -65,12 +48,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
 
   protected boolean encounteredFailure = false;
 
-
-  @Before
-  public void setUp() throws Exception
-  {
+  @Override
+  protected final void preSetUp() throws Exception {
     this.hasBeenNotified = false;
-    super.setUp();
   }
 
   void putBeforeRoll(final Region region)
@@ -99,16 +79,16 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
     try {
-      Assert.assertEquals("Value2", getValueOnDisk(region));
+      assertEquals("Value2", getValueOnDisk(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
-      fail("Entry not found although was supposed to be there");
+      throw new AssertionError("Entry not found although was supposed to be there", e);
     }
   }
 
@@ -138,17 +118,17 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
     try {
-      Assert.assertEquals("Value1", getValueOnDisk(region));
-      Assert.assertEquals("Value1", getValueInHTree(region));
+      assertEquals("Value1", getValueOnDisk(region));
+      assertEquals("Value1", getValueInHTree(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
-      fail("Entry not found although was supposed to be there");
+      throw new AssertionError("Entry not found although was supposed to be there", e);
     }
   }
 
@@ -173,7 +153,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
@@ -182,7 +162,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     }
     catch (Exception e) {
       logWriter.error("Exception occured", e);
-      fail("failed while trying to destroy due to " + e);
+      throw new AssertionError("failed while trying to destroy due to ", e);
     }
     boolean entryNotFound = false;
     try {
@@ -226,7 +206,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
@@ -277,17 +257,17 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
     region.put("Key", "Value2");
     try {
-      Assert.assertEquals("Value2", getValueOnDisk(region));
+      assertEquals("Value2", getValueOnDisk(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
-      fail("Entry not found although was supposed to be there");
+      throw new AssertionError("Entry not found although was supposed to be there", e);
     }
   }
 
@@ -312,18 +292,18 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
     region.get("Key");
     try {
-      Assert.assertEquals("Value1", getValueOnDisk(region));
-      Assert.assertEquals("Value1", getValueInHTree(region));
+      assertEquals("Value1", getValueOnDisk(region));
+      assertEquals("Value1", getValueInHTree(region));
     }
     catch (EntryNotFoundException e) {
       logWriter.error("Exception occured", e);
-      fail("Entry not found although was supposed to be there");
+      throw new AssertionError("Entry not found although was supposed to be there", e);
     }
   }
 
@@ -348,7 +328,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
@@ -357,7 +337,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     }
     catch (Exception e1) {
       logWriter.error("Exception occured", e1);
-      fail("encounter exception when not expected " + e1);
+      throw new AssertionError("encounter exception when not expected ", e1);
     }
     boolean entryNotFound = false;
     try {
@@ -400,7 +380,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
           assertTrue(hasBeenNotified);
         }
         catch (InterruptedException e) {
-          fail("exception not expected here");
+          throw new AssertionError("exception not expected here", e);
         }
       }
     }
@@ -444,7 +424,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         ((DiskEntry)re).getDiskId());
   }
 
-  public void DARREL_DISABLE_testSyncPutBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncPutBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -457,7 +439,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncPutBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncPutBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -470,7 +454,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncPutAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncPutAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -483,7 +469,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncPutAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncPutAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -496,7 +484,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncGetBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncGetBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -509,7 +499,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncGetBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncGetBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -522,7 +514,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncGetAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncGetAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -535,7 +529,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncGetAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncGetAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -548,7 +544,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncClearBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncClearBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -561,7 +559,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncClearBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncClearBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -574,7 +574,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncClearAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncClearAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -587,7 +589,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncClearAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncClearAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -600,7 +604,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncDelBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncDelBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -613,7 +619,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncDelBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncDelBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -626,7 +634,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testSyncDelAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testSyncDelAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -639,7 +649,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testAsyncDelAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testAsyncDelAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -652,7 +664,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     region.destroyRegion();
   }
 
-  public void DARREL_DISABLE_testCloseBeforeRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testCloseBeforeRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -664,7 +678,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     closeBeforeRoll(region);
   }
 
-  public void DARREL_DISABLE_testCloseAfterRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testCloseAfterRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -679,7 +695,9 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         diskRegionProperties, Scope.LOCAL);
   }
 
-  public void DARREL_DISABLE_testconcurrentPutAndRoll()
+  @Ignore("TODO:DARREL_DISABLE: test is disabled")
+  @Test
+  public void testconcurrentPutAndRoll()
   {
     DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
     diskRegionProperties.setDiskDirs(dirs);
@@ -722,7 +740,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
                 testFailed = true;
                 failureCause = "Exception occured when it was not supposed to occur, Exception is "
                     + e + "in concurrentPutAndRoll";
-                fail("exception not expected here");
+                throw new AssertionError("exception not expected here", e);
               }
             }
           }
@@ -739,7 +757,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
             testFailed = true;
             failureCause = "Exception occured when it was not supposed to occur, Exception is "
                 + e + "in concurrentPutAndRoll";
-            fail("exception not expected here");
+            throw new AssertionError("exception not expected here", e);
           }
         }
         startTime = System.currentTimeMillis();
@@ -766,7 +784,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         }
       }
       catch (InterruptedException e) {
-        fail("exception not expected here");
+        throw new AssertionError("exception not expected here", e);
       }
     }
     if (this.totalTime < 2000) {
@@ -782,8 +800,6 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
    * is not yet destroyed but by the time a basicGet is done,the oplog gets
    * destroyed & the get operation sees the file length zero or it may encounter
    * null pointer exception while retrieving the oplog.
-   * 
-   *  
    */
   @Test
   public void testConcurrentRollingAndGet()
@@ -826,8 +842,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
                   catch (Exception e) {
                     encounteredFailure = true;
                     logWriter.error("Test encountered exception ", e);
-                    fail(" Test failed as could not obtain value from disk.Exception = "
-                        + e);
+                    throw new AssertionError(" Test failed as could not obtain value from disk.Exception = ", e);
                   }
 
                 }
@@ -854,9 +869,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
       }
       catch (InterruptedException e) {
         logWriter.error("Main thread encountered exception ", e);
-
-        fail(" Test failed as main thread encountered exception = " + e);
-
+        throw new AssertionError(" Test failed as main thread encountered exception = ", e);
       }
     }
 
@@ -897,7 +910,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         }
         catch (Exception e) {
           logWriter.error("Exception occured", e);
-          fail("Exception occured when it was not supposed to occur");
+          throw new AssertionError("Exception occured when it was not supposed to occur", e);
         }
       }
     });
@@ -911,13 +924,13 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         }
       }
       catch (InterruptedException e) {
-        fail("exception not expected here");
+        throw new AssertionError("exception not expected here", e);
       }
     }
     try {
       th.join(5000);
     } catch (InterruptedException ignore) {
-      fail("exception not expected here");
+      throw new AssertionError("exception not expected here", ignore);
     }
     assertFalse(th.isAlive());
     assertFalse(failureCause, testFailed);
@@ -938,7 +951,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         }
         catch (Exception e) {
           logWriter.error("Exception occured", e);
-          fail("Exception occured when it was not supposed to occur");
+          throw new AssertionError("Exception occured when it was not supposed to occur", e);
         }
       }
     });
@@ -958,7 +971,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
     try {
       th.join(5000);
     } catch (InterruptedException ignore) {
-      fail("exception not expected here");
+      throw new AssertionError("exception not expected here", ignore);
     }
     assertFalse(th.isAlive());
     assertFalse(failureCause, testFailed);
@@ -987,7 +1000,7 @@ public class ConcurrentRollingAndRegionOperationsJUnitTest extends
         testFailed = true;
         failureCause = "Exception occured when it was not supposed to occur, due to "
             + e;
-        fail("Exception occured when it was not supposed to occur, due to " + e);
+        throw new AssertionError("Exception occured when it was not supposed to occur, due to ", e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConflationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConflationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConflationJUnitTest.java
index d7493de..238d641 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConflationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConflationJUnitTest.java
@@ -34,7 +34,6 @@ import static org.junit.Assert.*;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
- * 
  * This test does a check that conflation in the buffer happen correctly
  * 
  * Conflation cases tested include:
@@ -47,198 +46,164 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * <li> create, invalidate, modify
  * </ul>
  * The test is done for persist only, overflow only and persist + overflow only (async modes).
- * 
- *
  */
 @Category(IntegrationTest.class)
-public class ConflationJUnitTest extends DiskRegionTestingBase
-{
+public class ConflationJUnitTest extends DiskRegionTestingBase {
+  
   private DiskRegionProperties diskProps = new DiskRegionProperties();
 
+  private long flushCount;
+
   @Override
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setBytesThreshold(100000000);
     diskProps.setTimeInterval(100000000);
     diskProps.setSynchronous(false);
   }
 
-
-
-  protected void createOverflowOnly()
-  {
-    region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
-        diskProps);
-  }
-
-  protected void createPersistOnly()
-  {
+  private void createPersistOnly() {
     region = DiskRegionHelperFactory
         .getAsyncPersistOnlyRegion(cache, diskProps);
   }
 
-  protected void createOverflowAndPersist()
-  {
+  private void createOverflowAndPersist() {
     region = DiskRegionHelperFactory.getAsyncOverFlowAndPersistRegion(cache,
         diskProps);
   }
 
   /**
    * do a put followed by a put
-   *  
    */
-  void putAndPut()
-  {
+  private void putAndPut() {
     region.put(new Integer(1), new Integer(1));
     region.put(new Integer(1), new Integer(2));
   }
 
   /**
    * do a put followed by a destroy on the same entry
-   *  
    */
-  void putAndDestroy()
-  {
+  private void putAndDestroy() {
     region.put(new Integer(1), new Integer(1));
     try {
       region.destroy(new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
+      logWriter.error("Exception occurred",e);
       fail(" failed to destory Integer");
     }
   }
 
   /**
    * do a put destroy the same entry and put it again
-   *  
    */
-  void putDestroyPut()
-  {
+  private void putDestroyPut() {
     putAndDestroy();
     region.put(new Integer(1), new Integer(2));
   }
 
   /**
    * put a key and then invalidate it
-   *  
    */
-  void putAndInvalidate()
-  {
+  private void putAndInvalidate() {
     region.put(new Integer(1), new Integer(1));
     try {
       region.invalidate(new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-      fail(" failed to invalidate Integer");
+      logWriter.error("Exception occurred",e);
+      throw new AssertionError(" failed to invalidate Integer", e);
     }
   }
 
   /**
    * put a key, invalidate it and the perform a put on it
-   *  
    */
-  void putInvalidatePut()
-  {
+  private void putInvalidatePut() {
     putAndInvalidate();
     region.put(new Integer(1), new Integer(2));
   }
 
   /**
    * do a create and then a put on the same key
-   *  
    */
-  void createAndPut()
-  {
+  private void createAndPut() {
     try {
       region.create(new Integer(1), new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-       fail(" failed in trying to create");
+      logWriter.error("Exception occurred",e);
+      throw new AssertionError(" failed in trying to create", e);
     }
     region.put(new Integer(1), new Integer(2));
   }
 
   /**
    * do a create and then a destroy
-   *  
    */
-  void createAndDestroy()
-  {
+  private void createAndDestroy() {
     try {
       region.create(new Integer(1), new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-      fail(" failed in trying to create");
+      logWriter.error("Exception occurred", e);
+      throw new AssertionError("failed in trying to create", e);
     }
     try {
       region.destroy(new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-      fail(" failed to destory Integer");
+      logWriter.error("Exception occurred", e);
+      throw new AssertionError("failed to destroy Integer", e);
     }
   }
 
   /**
    * do a create then destroy the entry and create it again
-   *  
    */
-  void createDestroyCreate()
-  {
+  private void createDestroyCreate() {
     createAndDestroy();
     try {
       region.create(new Integer(1), new Integer(2));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-      fail(" failed in trying to create");
+      logWriter.error("Exception occurred", e);
+      throw new AssertionError("failed in trying to create", e);
     }
   }
 
   /**
    * create an entry and then invalidate it
-   *  
    */
-  void createAndInvalidate()
-  {
+  private void createAndInvalidate() {
     try {
       region.create(new Integer(1), new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-      fail(" failed in trying to create");
+      logWriter.error("Exception occurred", e);
+      throw new AssertionError("failed in trying to create", e);
     }
     try {
       region.invalidate(new Integer(1));
     }
     catch (Exception e) {
-      logWriter.error("Exception occured",e);
-      fail(" failed to invalidate Integer");
+      logWriter.error("Exception occurred", e);
+      throw new AssertionError("failed to invalidate Integer", e);
     }
   }
 
   /**
    * create an entry, invalidate it and then perform a put on the same key
-   *  
    */
-  void createInvalidatePut()
-  {
+  private void createInvalidatePut() {
     createAndInvalidate();
     region.put(new Integer(1), new Integer(2));
   }
 
   /**
    * validate whether a modification of an entry was correctly done
-   *  
    */
-  void validateModification()
-  {
+  private void validateModification() {
     Collection entries = ((LocalRegion)region).entries.regionEntries();
     if (entries.size() != 1) {
       fail("expected size to be 1 but is not so");
@@ -247,16 +212,14 @@ public class ConflationJUnitTest extends DiskRegionTestingBase
     DiskId id = ((DiskEntry)entry).getDiskId();
     Object obj = ((LocalRegion)region).getDiskRegion().get(id);
     if (!(obj.equals(new Integer(2)))) {
-      fail(" incorrect modification");
+      fail("incorrect modification");
     }
   }
 
   /**
    * validate whether nothing was written
-   */  
- 
-  void validateNothingWritten()
-  {
+   */
+  private void validateNothingWritten() {
     Collection entries = ((LocalRegion)region).entries.regionEntries();
     //We actually will have a tombstone in the region, hence
     //the 1 entry
@@ -264,19 +227,12 @@ public class ConflationJUnitTest extends DiskRegionTestingBase
       fail("expected size to be 1 but is " + entries.size());
     }
     assertEquals(this.flushCount, getCurrentFlushCount());
-//     Oplog oplog = ((LocalRegion)region).getDiskRegion().getChild();
-//     if (oplog.getOplogSize() != 0) {
-//       fail(" expected zero bytes to have been written but is "
-//           + oplog.getOplogSize());
-//     }
   }
   
   /**
    * validate whether invalidate was done
-   *  
    */
-  void validateTombstone()
-  {
+  private void validateTombstone() {
     Collection entries = ((LocalRegion)region).entries.regionEntries();
     if (entries.size() != 1) {
       fail("expected size to be 1 but is " + entries.size());
@@ -289,10 +245,8 @@ public class ConflationJUnitTest extends DiskRegionTestingBase
 
   /**
    * validate whether invalidate was done
-   *  
    */
-  void validateInvalidate()
-  {
+  private void validateInvalidate() {
     Collection entries = ((LocalRegion)region).entries.regionEntries();
     if (entries.size() != 1) {
       fail("expected size to be 1 but is " + entries.size());
@@ -305,31 +259,26 @@ public class ConflationJUnitTest extends DiskRegionTestingBase
     }
   }
 
-  private long flushCount;
-
   private long getCurrentFlushCount() {
     return ((LocalRegion)region).getDiskStore().getStats().getFlushes();
   }
-  void pauseFlush() {
+
+  private void pauseFlush() {
     ((LocalRegion)region).getDiskRegion().pauseFlusherForTesting();
     this.flushCount = getCurrentFlushCount();
   }
   
   /**
    * force a flush on the region
-   *  
    */
-  void forceFlush()
-  {
+  private void forceFlush() {
     ((LocalRegion)region).getDiskRegion().flushForTesting();
   }
 
   /**
    * all the operations done here
-   *  
    */
-  void allTest()
-  {
+  private void allTest() {
     pauseFlush();
     createAndPut();
     forceFlush();
@@ -370,16 +319,13 @@ public class ConflationJUnitTest extends DiskRegionTestingBase
     forceFlush();
     validateInvalidate();
     region.clear();
-
   }
 
   /**
    * test conflation for perist only
-   *  
    */
   @Test
-  public void testPersistOnlyConflation()
-  {
+  public void testPersistOnlyConflation() throws Exception {
     createPersistOnly();
     allTest();
     closeDown();
@@ -387,22 +333,11 @@ public class ConflationJUnitTest extends DiskRegionTestingBase
 
   /**
    * test conflation for overflow and persist
-   *  
    */
   @Test
-  public void testOverFlowAndPersistOnlyConflation()
-  {
-    try {
-      createOverflowAndPersist();
-      allTest();
-      closeDown();
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      fail(e.toString());
-    }
+  public void testOverFlowAndPersistOnlyConflation() throws Exception {
+    createOverflowAndPersist();
+    allTest();
+    closeDown();
   }
-
- 
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
index d585d26..c0be121 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
@@ -16,29 +16,31 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /** A test of 46438 - missing response to an update attributes message */
-public class ConnectDisconnectDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConnectDisconnectDUnitTest extends JUnit4CacheTestCase {
   
-  static {
-//    System.setProperty("DistributionManager.VERBOSE", "true");
-  }
-
-
   private IgnoredException ex;
 
-  public ConnectDisconnectDUnitTest(String name) {
-    super(name);
-  }
-  
-  
-  // see bugs #50785 and #46438 
+  // see bugs #50785 and #46438
+  @Test
   public void testManyConnectsAndDisconnects() throws Throwable {
 //    invokeInEveryVM(new SerializableRunnable() {
 //
@@ -63,7 +65,7 @@ public class ConnectDisconnectDUnitTest extends CacheTestCase {
   
   static int LOCATOR_PORT;
   static String LOCATORS_STRING;
-  
+
   static int[] locatorPorts;
   
   public void setLocatorPorts(int[] ports) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaFaultInDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaFaultInDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaFaultInDUnitTest.java
index 78855fd..83436da 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaFaultInDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaFaultInDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -35,16 +44,18 @@ import com.gemstone.gemfire.test.dunit.VM;
  * we fault out and in a delta object.
  *
  */
-public class DeltaFaultInDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DeltaFaultInDUnitTest extends JUnit4CacheTestCase {
   
 
   /**
    * @param name
    */
-  public DeltaFaultInDUnitTest(String name) {
-    super(name);
+  public DeltaFaultInDUnitTest() {
+    super();
   }
 
+  @Test
   public void test() throws Exception {
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);


[46/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationJUnitTest.java
index 792ef99..8f21a8b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationJUnitTest.java
@@ -27,9 +27,37 @@
 package com.gemstone.gemfire.cache.query.functional;
 
 import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.query.CacheUtils;
+import com.gemstone.gemfire.cache.query.Index;
+import com.gemstone.gemfire.cache.query.IndexStatistics;
+import com.gemstone.gemfire.cache.query.IndexType;
+import com.gemstone.gemfire.cache.query.Query;
+import com.gemstone.gemfire.cache.query.QueryInvalidException;
+import com.gemstone.gemfire.cache.query.QueryService;
+import com.gemstone.gemfire.cache.query.SelectResults;
+import com.gemstone.gemfire.cache.query.Utils;
 import com.gemstone.gemfire.cache.query.data.ComparableWrapper;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.DefaultQueryService;
@@ -48,791 +76,654 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.FileUtil;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
-import java.io.File;
-import java.util.*;
+@Category(IntegrationTest.class)
+public class IndexCreationJUnitTest {
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
+  private ObjectType resType1=null;
+  private ObjectType resType2= null;
 
-@Category(IntegrationTest.class)
-public class IndexCreationJUnitTest{
-    ObjectType resType1=null;
-    ObjectType resType2= null;
-    
-    int resSize1=0;
-    int resSize2=0;
-    
-    Iterator itert1=null;
-    Iterator itert2=null;
-    
-    Set set1=null;
-    Set set2=null;
-    
-    String s1;
-    String s2;
-    
-    @Before
+  private int resSize1=0;
+  private int resSize2=0;
+
+  private Iterator itert1=null;
+  private Iterator itert2=null;
+
+  private Set set1=null;
+  private Set set2=null;
+
+  private String s1;
+  private String s2;
+
+  @Before
   public void setUp() throws java.lang.Exception {
-        CacheUtils.startCache();
-        Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
-        for(int i=0;i<4;i++){
-            region.put(""+i, new Portfolio(i));
-            //  CacheUtils.log(new Portfolio(i));
-        }
-        
+    CacheUtils.startCache();
+    Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
+    for (int i = 0; i < 4; i++) {
+      region.put("" + i, new Portfolio(i));
     }
-    
-    @After
+  }
+
+  @After
   public void tearDown() throws java.lang.Exception {
-        CacheUtils.closeCache();
-    }
-    
-    @Test
+    CacheUtils.closeCache();
+  }
+
+  @Test
   public void testIndexCreation() throws Exception {
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        
-        Index i1 = qs.createIndex("statusIndex", IndexType.FUNCTIONAL,"status","/portfolios, positions");
-        //TASK ICM1
-        Index i2 = qs.createIndex("secIdIndex", IndexType.FUNCTIONAL,"b.secId","/portfolios pf, pf.positions.values b");
-        //TASK ICM2
-        Index i5= qs.createIndex("intFunctionIndex", IndexType.FUNCTIONAL,"intFunction(pf.getID)","/portfolios pf, pf.positions b");
-        Index i6 = qs.createIndex("statusIndex6", IndexType.FUNCTIONAL,"a.status","/portfolios.values.toArray a, positions");
-        Index i7 = qs.createIndex("statusIndex7", IndexType.FUNCTIONAL,"a.status","/portfolios.getValues().asList() a, positions");
-        Index i8 = qs.createIndex("statusIndex8", IndexType.FUNCTIONAL,"a.status","/portfolios.values.asSet a, positions");
-        //TASK ICM6
-        Object indices[]={i1,i2,i5,i6,i7,i8};   //remove any commented Index
-        // from Array
-        
-        for(int j=0;j<indices.length;j++){
-            CacheUtils.log(((IndexProtocol)indices[j]).isValid());
-            boolean r = ((IndexProtocol)indices[j]).isValid();
-            assertTrue("Test: testIndexCreation FAILED", r);
-            CacheUtils.log(((IndexProtocol)indices[j]).getName());
-            CacheUtils.log("Test: testIndexCreation PASS");
-        }
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+
+    Index i1 = qs.createIndex("statusIndex", IndexType.FUNCTIONAL, "status", "/portfolios, positions");
+    //TASK ICM1
+    Index i2 = qs.createIndex("secIdIndex", IndexType.FUNCTIONAL, "b.secId", "/portfolios pf, pf.positions.values b");
+    //TASK ICM2
+    Index i5 = qs.createIndex("intFunctionIndex", IndexType.FUNCTIONAL, "intFunction(pf.getID)", "/portfolios pf, pf.positions b");
+    Index i6 = qs.createIndex("statusIndex6", IndexType.FUNCTIONAL, "a.status", "/portfolios.values.toArray a, positions");
+    Index i7 = qs.createIndex("statusIndex7", IndexType.FUNCTIONAL, "a.status", "/portfolios.getValues().asList() a, positions");
+    Index i8 = qs.createIndex("statusIndex8", IndexType.FUNCTIONAL, "a.status", "/portfolios.values.asSet a, positions");
+    //TASK ICM6
+    Object indices[] = { i1, i2, i5, i6, i7, i8 };   //remove any commented Index
+    // from Array
+
+    for (int j = 0; j < indices.length; j++) {
+      CacheUtils.log(((IndexProtocol) indices[j]).isValid());
+      boolean r = ((IndexProtocol) indices[j]).isValid();
+      assertTrue("Test: testIndexCreation FAILED", r);
+      CacheUtils.log(((IndexProtocol) indices[j]).getName());
+      CacheUtils.log("Test: testIndexCreation PASS");
     }
-    
-    @Test
+  }
+
+  @Test
   public void testIndexCreationWithImports() throws Exception {
-        // Task ID ICM 16
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        
-        Index idx;
-        
-        try {
-            idx = qs.createIndex("importsIndex", IndexType.FUNCTIONAL, "status",
-                    "/portfolios, (map<string,Position>)positions");
-            fail("Should have thrown a QueryInvalidException"); // can't find type
-            // Position
-        } catch (QueryInvalidException e) {
-            // pass
-        }
-        
-        idx = qs.createIndex("importsIndex", IndexType.FUNCTIONAL, "status",
-                "/portfolios, (map<string,Position>)positions",
-                "import com.gemstone.gemfire.cache.\"query\".data.Position");
-        qs.removeIndex(idx);
-        
-        idx = qs.createIndex("importsIndex2", IndexType.FUNCTIONAL, "status",
-                "/portfolios, positions TYPE Position",
-                "import com.gemstone.gemfire.cache.\"query\".data.Position");
+    // Task ID ICM 16
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+
+    Index idx;
+
+    try {
+      idx = qs.createIndex("importsIndex", IndexType.FUNCTIONAL, "status", "/portfolios, (map<string,Position>)positions");
+      fail("Should have thrown a QueryInvalidException"); // can't find type
+      // Position
+    } catch (QueryInvalidException e) {
+      // pass
     }
-    
-    @Test
+
+    idx = qs.createIndex("importsIndex", IndexType.FUNCTIONAL, "status", "/portfolios, (map<string,Position>)positions", "import com.gemstone.gemfire.cache.\"query\".data.Position");
+    qs.removeIndex(idx);
+
+    idx = qs.createIndex("importsIndex2", IndexType.FUNCTIONAL, "status", "/portfolios, positions TYPE Position", "import com.gemstone.gemfire.cache.\"query\".data.Position");
+  }
+
+  @Test
   public void testSimilarIndexCreation() throws Exception {
-        // Task ID: ICM17
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-//        boolean exceptionoccured = true;
-        qs.createIndex("statusIndex", IndexType.FUNCTIONAL,"status","/portfolios, positions");
-        qs.createIndex("secIdIndex", IndexType.FUNCTIONAL,"b.secId","/portfolios pf, pf.positions.values b");
-        try {
-            qs.createIndex("secIdIndexDuplicate", IndexType.FUNCTIONAL,"b.secId","/portfolios pf, pf.positions.values b");
-            fail("testSimilarIndexCreation: Allowed duplicate index creation");
-        } catch (Exception e) {
-            // testSimilarIndexCreation: Exception if duplicate index is
-            // created with diffrenet name but same from clause & expression
-        }
-        
-        try {
-            qs.createIndex("secIdIndexDuplicate", IndexType.FUNCTIONAL,"b1.secId","/portfolios pf1, pf1.positions.values b1");
-            fail("testSimilarIndexCreation: Allowed duplicate index creation");
-        } catch ( Exception e) {
-            // testSimilarIndexCreation: Exception if duplicate index is
-            // created with diffrenet name but same from clause & expression
-        }
-        //com.gemstone.gemfire.cache.query.IndexExistsException: Similar Index
-        // Exists
-        try {
-            qs.createIndex("statusIndexDuplicate", IndexType.FUNCTIONAL,"b.status","/portfolios b, positions");
-            fail("testSimilarIndexCreation: Allowed duplicate index creation");
-        } catch ( Exception e) {
-            // testSimilarIndexCreation: Exception if duplicate index is
-            // created with diffrenet name but same from clause & expression
-        }
+    // Task ID: ICM17
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    //        boolean exceptionoccured = true;
+    qs.createIndex("statusIndex", IndexType.FUNCTIONAL, "status", "/portfolios, positions");
+    qs.createIndex("secIdIndex", IndexType.FUNCTIONAL, "b.secId", "/portfolios pf, pf.positions.values b");
+    try {
+      qs.createIndex("secIdIndexDuplicate", IndexType.FUNCTIONAL, "b.secId", "/portfolios pf, pf.positions.values b");
+      fail("testSimilarIndexCreation: Allowed duplicate index creation");
+    } catch (Exception e) {
+      // testSimilarIndexCreation: Exception if duplicate index is
+      // created with diffrenet name but same from clause & expression
     }
-    
-    @Test
+
+    try {
+      qs.createIndex("secIdIndexDuplicate", IndexType.FUNCTIONAL, "b1.secId", "/portfolios pf1, pf1.positions.values b1");
+      fail("testSimilarIndexCreation: Allowed duplicate index creation");
+    } catch (Exception e) {
+      // testSimilarIndexCreation: Exception if duplicate index is
+      // created with diffrenet name but same from clause & expression
+    }
+    //com.gemstone.gemfire.cache.query.IndexExistsException: Similar Index
+    // Exists
+    try {
+      qs.createIndex("statusIndexDuplicate", IndexType.FUNCTIONAL, "b.status", "/portfolios b, positions");
+      fail("testSimilarIndexCreation: Allowed duplicate index creation");
+    } catch (Exception e) {
+      // testSimilarIndexCreation: Exception if duplicate index is
+      // created with diffrenet name but same from clause & expression
+    }
+  }
+
+  @Test
   public void testInvalidImportsIndexCreation() throws Exception {
-      // Task ID: Invalid Indexes: ICM15 
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            qs.createIndex("typeIndex", IndexType.FUNCTIONAL,"\"type\"","/portfolios pf, pf.positions b","pf.position1");
-            // projection attributes are not yet implemented
-            // last parameter is the imports statement, so this is a syntax
-            // error
-            fail("Should have thrown an exception since imports are invalid");
-            //TASK ICM7
-        } catch (QueryInvalidException e){
-            // pass
-        }
+    // Task ID: Invalid Indexes: ICM15
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    try {
+      qs.createIndex("typeIndex", IndexType.FUNCTIONAL, "\"type\"", "/portfolios pf, pf.positions b", "pf.position1");
+      // projection attributes are not yet implemented
+      // last parameter is the imports statement, so this is a syntax
+      // error
+      fail("Should have thrown an exception since imports are invalid");
+      //TASK ICM7
+    } catch (QueryInvalidException e) {
+      // pass
     }
-    public void _BUGtestElementIndexCreation() throws Exception {
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            qs.createIndex("funcReturnSecIdIndex", IndexType.FUNCTIONAL,"pf.funcReturnSecId(element(select distinct pos from /portfolios pf, pf.positions.values as pos where pos.sharesOutstanding = 5000))","/portfolios pf, pf.positions b");
-            //TASK ICM8: InvalidIndexCreation
-            //      Query q = qs.newQuery("(element(select distinct pos from
-            // /portfolios pf, pf.positions.values as pos where
-            // pos.sharesOutstanding = 5000))");
-            //      Object r=q.execute();
-            //      CacheUtils.log(Utils.printResult(r));
-        } catch (Exception e){
-            e.printStackTrace();
-            fail("Test Case:testElementIndexCreation FAILED");
-        }
+  }
+
+  @Ignore("TODO: disabled and has no assertions")
+  @Test
+  public void testElementIndexCreation() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    qs.createIndex("funcReturnSecIdIndex", IndexType.FUNCTIONAL, "pf.funcReturnSecId(element(select distinct pos from /portfolios pf, pf.positions.values as pos where pos.sharesOutstanding = 5000))", "/portfolios pf, pf.positions b");
+    //TASK ICM8: InvalidIndexCreation
+    //      Query q = qs.newQuery("(element(select distinct pos from
+    // /portfolios pf, pf.positions.values as pos where
+    // pos.sharesOutstanding = 5000))");
+    //      Object r=q.execute();
+    //      CacheUtils.log(Utils.printResult(r));
+  }
+
+  @Test
+  public void testIndexCreationOnNVLFunction() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Query query = null;
+    qs.createIndex("NVLIndex1", IndexType.FUNCTIONAL, "nvl(pf.position2, pf.position1).secId", "/portfolios pf");
+
+    query = CacheUtils.getQueryService()
+                      .newQuery("select distinct * from /portfolios pf where nvl(pf.position2, pf.position1).secId = 'SUN'");
+    QueryObserverImpl observer = new QueryObserverImpl();
+    QueryObserverHolder.setInstance(observer);
+    query.execute();
+
+    if (!observer.isIndexesUsed) {
+      fail("NO INDEX USED");
     }
-    
-    @Test
-  public void testIndexCreationOnNVLFunction() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      Query query = null;
-//      Object result = null;
-      try {
-        qs.createIndex("NVLIndex1",IndexType.FUNCTIONAL, "nvl(pf.position2, pf.position1).secId", "/portfolios pf");
-        
-        query = CacheUtils.getQueryService().newQuery("select distinct * from /portfolios pf where nvl(pf.position2, pf.position1).secId = 'SUN'");
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        query.execute();
-        
-        if(!observer.isIndexesUsed){
-            fail("NO INDEX USED");
-        }
-        
-        
-        query = CacheUtils.getQueryService().newQuery("select distinct nvl(pf.position2, 'inProjection') from /portfolios pf where nvl(pf.position2, pf.position1).secId = 'SUN'");
-        observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        query.execute();
-        
-        if(!observer.isIndexesUsed && observer.indexesUsed.size() != 1){
-          fail("NO INDEX USED");
-        }
-        
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail("Test Case:testElementIndexCreation FAILED");
-      }
+
+
+    query = CacheUtils.getQueryService()
+                      .newQuery("select distinct nvl(pf.position2, 'inProjection') from /portfolios pf where nvl(pf.position2, pf.position1).secId = 'SUN'");
+    observer = new QueryObserverImpl();
+    QueryObserverHolder.setInstance(observer);
+    query.execute();
+
+    if (!observer.isIndexesUsed && observer.indexesUsed.size() != 1) {
+      fail("NO INDEX USED");
     }
-    
-    @Test
+  }
+
+  @Test
   public void testIndexCreationWithImport() throws Exception {
-        // Task ID: ICM16
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        Index i3 = qs.createIndex("typeIndex", IndexType.FUNCTIONAL,"\"type\"","/portfolios type Portfolio, positions b","IMPORT com.gemstone.gemfire.cache.\"query\".data.Portfolio");
-        //TASK ICM3 Region 'IMPORT' not found:....[BUG : Verified Fixed ]
-        try{
-            //  Index i4=(Index)qs.createIndex("boolFunctionIndex",
-            // IndexType.FUNCTIONAL,"boolFunction(pf.status)","/portfolios pf,
-            // pf.positions.values b");
-            //TASK ICM5 com.gemstone.gemfire.cache.query.IndexInvalidException
-            
-            Object indices[]={i3};   //remove any commented Index from Array
-            
-            for(int j=0;j<indices.length;j++){
-                CacheUtils.log(((IndexProtocol)indices[j]).isValid());
-                boolean r = ((IndexProtocol)indices[j]).isValid();
-                if(r==true){
-                    CacheUtils.log(((IndexProtocol)indices[j]).getName());
-                    CacheUtils.log("Test: testIndexCreation PASS");
-                } else{
-                    fail("Test: testIndexCreation FAILED");
-                }
-            }
-        } catch(Exception e){
-            e.printStackTrace();
-            fail();
-        }
-    } 
-    @Test
+    // Task ID: ICM16
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i3 = qs.createIndex("typeIndex", IndexType.FUNCTIONAL, "\"type\"", "/portfolios type Portfolio, positions b", "IMPORT com.gemstone.gemfire.cache.\"query\".data.Portfolio");
+    //TASK ICM3 Region 'IMPORT' not found:....[BUG : Verified Fixed ]
+    //  Index i4=(Index)qs.createIndex("boolFunctionIndex",
+    // IndexType.FUNCTIONAL,"boolFunction(pf.status)","/portfolios pf,
+    // pf.positions.values b");
+    //TASK ICM5 com.gemstone.gemfire.cache.query.IndexInvalidException
+
+    Object indices[] = { i3 };   //remove any commented Index from Array
+
+    for (int j = 0; j < indices.length; j++) {
+      CacheUtils.log(((IndexProtocol) indices[j]).isValid());
+      boolean r = ((IndexProtocol) indices[j]).isValid();
+      if (r == true) {
+        CacheUtils.log(((IndexProtocol) indices[j]).getName());
+        CacheUtils.log("Test: testIndexCreation PASS");
+      } else {
+        fail("Test: testIndexCreation FAILED");
+      }
+    }
+  }
+
+  @Test
   public void testComparisonBetnWithAndWithoutIndexCreationComparableObject() throws Exception {
-        // Task ID IUM10
-        SelectResults r[][]= new SelectResults[4][2];
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        String queries[] = {
-            "select distinct * from /portfolios pf where pf.getCW(pf.ID) = $1",
-                    "select distinct * from /portfolios pf where pf.getCW(pf.ID) > $1",
-                    "select distinct * from /portfolios pf where pf.getCW(pf.ID) < $1",
-                    "select distinct * from /portfolios pf where pf.getCW(pf.ID) != $1"
-                    // TASK IUM 10
-        };
-        for (int i = 0; i < queries.length; i++) {
-            Query q = null;
-            try {
-                q = CacheUtils.getQueryService().newQuery(queries[i]);
-                Object params[] = new Object[1];
-                params[0] = new ComparableWrapper(1);
-                QueryObserverImpl observer = new QueryObserverImpl();
-                QueryObserverHolder.setInstance(observer);
-                r[i][0] = (SelectResults)q.execute(params);
-                
-                if(!observer.isIndexesUsed){
-                    CacheUtils.log("NO INDEX USED");
-                }
-                CacheUtils.log(Utils.printResult(r[i][0]));
-                resType1 =(r[i][0]).getCollectionType().getElementType();
-                resSize1 =((r[i][0]).size());
-                CacheUtils.log("Result Type= "+resType1);
-                CacheUtils.log("Result Size= "+resSize1);
-                set1=((r[i][0]).asSet());
-                // Iterator iter=set1.iterator();
-                
-            } catch (Exception e) {
-                e.printStackTrace();
-                fail(q.getQueryString());
-            }
-        }
-        
-        //  Create an Index on status and execute the same query again.
-        
-        qs = CacheUtils.getQueryService();
-        qs.createIndex("cIndex", IndexType.FUNCTIONAL,"pf.getCW(pf.ID)","/portfolios pf");
-        
-        for (int i = 0; i < queries.length; i++) {
-            Query q = null;
-            try {
-                q = CacheUtils.getQueryService().newQuery(queries[i]);
-                Object params[] = new Object[1];
-                params[0] = new ComparableWrapper(1);
-                QueryObserverImpl observer2 = new QueryObserverImpl();
-                QueryObserverHolder.setInstance(observer2);
-                r[i][1] = (SelectResults)q.execute(params);
-                if(observer2.isIndexesUsed){
-                    CacheUtils.log("YES INDEX IS USED!");
-                } else {
-                    fail("FAILED: Index NOT Used");
-                }
-                CacheUtils.log(Utils.printResult(r[i][1]));
-                resType2 =(r[i][1]).getCollectionType().getElementType();
-                resSize2 =((r[i][1]).size());
-                set2=((r[i][1]).asSet());
-                
-            } catch (Exception e) {
-                e.printStackTrace();
-                fail(q.getQueryString());
-            }
-        }
-        /*for(int j = 0; j <= 3 ; j++){
-            if ((((SelectResults)r[j][0]).getCollectionType().getElementType()).equals(((SelectResults)r[j][1]).getCollectionType().getElementType())){
-                CacheUtils.log("Both Search Results are of the same Type i.e.--> "+((SelectResults)r[j][0]).getCollectionType().getElementType());
-            }else {
-                fail("FAILED:Search result Type is different in both the cases");
-            }
-            if (((SelectResults)r[j][0]).size()==((SelectResults)r[j][1]).size() || ((SelectResults)r[j][1]).size()!= 0 ){
-                CacheUtils.log("Both Search Results are non-zero and are of Same Size i.e.  Size= "+((SelectResults)r[j][1]).size());
-            }else {
-                fail("FAILED:Search result Type is different in both the cases");
-            }
-            set2=(((SelectResults)r[j][1]).asSet());
-            set1=(((SelectResults)r[j][0]).asSet());
-            if (!set1.equals(set2)){
-                fail();
-            }
-            
-        }*/
-        CacheUtils.compareResultsOfWithAndWithoutIndex(r, this);
-    }  
-    
+    // Task ID IUM10
+    SelectResults r[][] = new SelectResults[4][2];
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    String queries[] = {
+      "select distinct * from /portfolios pf where pf.getCW(pf.ID) = $1",
+      "select distinct * from /portfolios pf where pf.getCW(pf.ID) > $1",
+      "select distinct * from /portfolios pf where pf.getCW(pf.ID) < $1",
+      "select distinct * from /portfolios pf where pf.getCW(pf.ID) != $1"
+      // TASK IUM 10
+    };
+    for (int i = 0; i < queries.length; i++) {
+      Query q = null;
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      Object params[] = new Object[1];
+      params[0] = new ComparableWrapper(1);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][0] = (SelectResults) q.execute(params);
+
+      if (!observer.isIndexesUsed) {
+        CacheUtils.log("NO INDEX USED");
+      }
+      CacheUtils.log(Utils.printResult(r[i][0]));
+      resType1 = (r[i][0]).getCollectionType().getElementType();
+      resSize1 = ((r[i][0]).size());
+      CacheUtils.log("Result Type= " + resType1);
+      CacheUtils.log("Result Size= " + resSize1);
+      set1 = ((r[i][0]).asSet());
+      // Iterator iter=set1.iterator();
+    }
+
+    //  Create an Index on status and execute the same query again.
+
+    qs = CacheUtils.getQueryService();
+    qs.createIndex("cIndex", IndexType.FUNCTIONAL, "pf.getCW(pf.ID)", "/portfolios pf");
+
+    for (int i = 0; i < queries.length; i++) {
+      Query q = null;
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      Object params[] = new Object[1];
+      params[0] = new ComparableWrapper(1);
+      QueryObserverImpl observer2 = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer2);
+      r[i][1] = (SelectResults) q.execute(params);
+      if (observer2.isIndexesUsed) {
+        CacheUtils.log("YES INDEX IS USED!");
+      } else {
+        fail("FAILED: Index NOT Used");
+      }
+      CacheUtils.log(Utils.printResult(r[i][1]));
+      resType2 = (r[i][1]).getCollectionType().getElementType();
+      resSize2 = ((r[i][1]).size());
+      set2 = ((r[i][1]).asSet());
+    }
+    CacheUtils.compareResultsOfWithAndWithoutIndex(r, this);
+  }
+
   @Test
   public void testIndexCreationWithIndexOperatorUsage() throws Exception {
     // Task ID : ICM 18
     QueryService qs;
     qs = CacheUtils.getQueryService();
 
-    String[] queries = { "select distinct * from /portfolios pf where pf.collectionHolderMap[(pf.ID).toString()].arr[pf.ID] != -1" };
+    String[] queries = {
+      "select distinct * from /portfolios pf where pf.collectionHolderMap[(pf.ID).toString()].arr[pf.ID] != -1"
+    };
 
     Object r[][] = new Object[queries.length][2];
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = qs.newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        r[i][0] = q.execute();
-        CacheUtils.log("Executed query:" + queries[i]);
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
-      }
+      q = qs.newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      r[i][0] = q.execute();
+      CacheUtils.log("Executed query:" + queries[i]);
     }
-    Index i1 = qs.createIndex("fIndex", IndexType.FUNCTIONAL, "sIter",
-        "/portfolios pf, pf.collectionHolderMap[(pf.ID).toString()].arr sIter");
-    Index i2 = qs.createIndex("cIndex", IndexType.FUNCTIONAL,
-        "pf.collectionHolderMap[(pf.ID).toString()].arr[pf.ID]",
-        "/portfolios pf");
+    Index i1 = qs.createIndex("fIndex", IndexType.FUNCTIONAL, "sIter", "/portfolios pf, pf.collectionHolderMap[(pf.ID).toString()].arr sIter");
+    Index i2 = qs.createIndex("cIndex", IndexType.FUNCTIONAL, "pf.collectionHolderMap[(pf.ID).toString()].arr[pf.ID]", "/portfolios pf");
     // BUG # 32498
     // Index i3 = qs.createIndex("nIndex", IndexType.FUNCTIONAL,
     // "pf.collectionHolderMap[((pf.ID%2)).toString()].arr[pf.ID]","/portfolios
     // pf");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = qs.newQuery(queries[i]);
-        CacheUtils.getLogger().info("Executing query: " + queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r[i][1] = q.execute();
-        SelectResults results = (SelectResults) r[i][1];
-        assertTrue(results.size() > 0);
-        CacheUtils.log("Executing query: " + queries[i]
-            + " with index created");
-        if (!observer.isIndexesUsed) {
-          fail("Index is NOT uesd");
-        }
-        Iterator itr = observer.indexesUsed.iterator();
-        assertTrue(itr.hasNext());
-        String temp = itr.next().toString();
-        assertEquals(temp, "cIndex");
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = qs.newQuery(queries[i]);
+      CacheUtils.getLogger().info("Executing query: " + queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][1] = q.execute();
+      SelectResults results = (SelectResults) r[i][1];
+      assertTrue(results.size() > 0);
+      CacheUtils.log("Executing query: " + queries[i] + " with index created");
+      if (!observer.isIndexesUsed) {
+        fail("Index is NOT uesd");
       }
+      Iterator itr = observer.indexesUsed.iterator();
+      assertTrue(itr.hasNext());
+      String temp = itr.next().toString();
+      assertEquals(temp, "cIndex");
     }
 
     CacheUtils.log(((RangeIndex) i1).dump());
     CacheUtils.log(((CompactRangeIndex) i2).dump());
-    
+
     StructSetOrResultsSet ssOrrs = new StructSetOrResultsSet();
-    ssOrrs.CompareQueryResultsWithoutAndWithIndexes(r,queries.length,queries);
+    ssOrrs.CompareQueryResultsWithoutAndWithIndexes(r, queries.length, queries);
     // CacheUtils.log(((RangeIndex)i3).dump());
     // Index i3 =
     // qs.createIndex("Task6Index",IndexType.FUNCTIONAL,"pos.secId","/portfolios
     // pf, pf.positions.values pos");
-    }  
-    @Test
+  }
+
+  @Test
   public void testIndexCreationOnKeys() throws Exception {
-        // Task ID : ICM 9
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            Index i1 = qs.createIndex("kIndex", IndexType.FUNCTIONAL, "pf","/portfolios.keys pf");
-            Index i2 = qs.createIndex("k1Index", IndexType.FUNCTIONAL, "key","/portfolios.entries");
-            Index i3 = qs.createIndex("k2Index", IndexType.FUNCTIONAL, "pf","/portfolios.keys.toArray pf");
-            //Index i4 = qs.createIndex("k3Index", IndexType.FUNCTIONAL,
-            // "pf","/portfolios.keys().toArray() pf");
-            Index i5 = qs.createIndex("k4Index", IndexType.FUNCTIONAL, "pf","/portfolios.getKeys.asList pf");
-            // Index i5 = qs.createIndex("k5Index", IndexType.FUNCTIONAL,
-            // "pf","/portfolios.getKeys.asList() pf");
-            Index i6 = qs.createIndex("k5Index", IndexType.FUNCTIONAL, "pf","/portfolios.getKeys.asSet() pf");
-            //Index i5 = qs.createIndex("k5Index", IndexType.FUNCTIONAL,
-            // "pf","/portfolios.getKeys.asSet pf");
-            CacheUtils.log(((CompactRangeIndex)i1).dump());
-            CacheUtils.log(((CompactRangeIndex)i2).dump());
-            CacheUtils.log(((CompactRangeIndex)i3).dump());
-            CacheUtils.log(((CompactRangeIndex)i5).dump());
-            CacheUtils.log(((CompactRangeIndex)i6).dump());
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-    }   
-    @Test
+    // Task ID : ICM 9
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i1 = qs.createIndex("kIndex", IndexType.FUNCTIONAL, "pf", "/portfolios.keys pf");
+    Index i2 = qs.createIndex("k1Index", IndexType.FUNCTIONAL, "key", "/portfolios.entries");
+    Index i3 = qs.createIndex("k2Index", IndexType.FUNCTIONAL, "pf", "/portfolios.keys.toArray pf");
+    //Index i4 = qs.createIndex("k3Index", IndexType.FUNCTIONAL,
+    // "pf","/portfolios.keys().toArray() pf");
+    Index i5 = qs.createIndex("k4Index", IndexType.FUNCTIONAL, "pf", "/portfolios.getKeys.asList pf");
+    // Index i5 = qs.createIndex("k5Index", IndexType.FUNCTIONAL,
+    // "pf","/portfolios.getKeys.asList() pf");
+    Index i6 = qs.createIndex("k5Index", IndexType.FUNCTIONAL, "pf", "/portfolios.getKeys.asSet() pf");
+    //Index i5 = qs.createIndex("k5Index", IndexType.FUNCTIONAL,
+    // "pf","/portfolios.getKeys.asSet pf");
+    CacheUtils.log(((CompactRangeIndex) i1).dump());
+    CacheUtils.log(((CompactRangeIndex) i2).dump());
+    CacheUtils.log(((CompactRangeIndex) i3).dump());
+    CacheUtils.log(((CompactRangeIndex) i5).dump());
+    CacheUtils.log(((CompactRangeIndex) i6).dump());
+  }
+
+  @Test
   public void testIndexCreationOnRegionEntry() throws Exception {
-        // Task ID : ICM11
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            Index i1 = qs.createIndex("r1Index", IndexType.FUNCTIONAL, "secId","/portfolios.values['1'].positions.values");
-            qs.createIndex("r12Index", IndexType.FUNCTIONAL, "secId","/portfolios['1'].positions.values");
-            CacheUtils.log(((CompactRangeIndex)i1).dump());
-            //CacheUtils.log(((RangeIndex)i2).dump());
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail();
-        }
-        
+    // Task ID : ICM11
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i1 = qs.createIndex("r1Index", IndexType.FUNCTIONAL, "secId", "/portfolios.values['1'].positions.values");
+    qs.createIndex("r12Index", IndexType.FUNCTIONAL, "secId", "/portfolios['1'].positions.values");
+    CacheUtils.log(((CompactRangeIndex) i1).dump());
+    //CacheUtils.log(((RangeIndex)i2).dump());
+  }
+
+
+  /**
+   * Creation of index on a path derived from Region.Entry object obtained
+   * via entrySet , fails as that function was not supported in the
+   * QRegion & DummyQRegion
+   */
+  @Test
+  public void testBug36823() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    qs.createIndex("entryIndex", IndexType.FUNCTIONAL, "value.getID()", "/portfolios.entrySet pf");
+    Region rgn = CacheUtils.getRegion("/portfolios");
+    rgn.put("4", new Portfolio(4));
+    rgn.put("5", new Portfolio(5));
+    Query qr = qs.newQuery("Select distinct * from /portfolios.entrySet pf where pf.value.getID() = 4");
+    SelectResults sr = (SelectResults) qr.execute();
+    assertEquals(sr.size(), 1);
+  }
+
+  /**
+   * Creation of index on key path derived from Region.Entry object obtained
+   * via keySet , fails as that function was not supported in the
+   * QRegion & DummyQRegion
+   */
+  @Test
+  public void testBug36590() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+
+    qs.createIndex("keyIndex", IndexType.FUNCTIONAL, "keys", "/portfolios.keySet keys");
+    Region rgn = CacheUtils.getRegion("/portfolios");
+    rgn.put("4", new Portfolio(4));
+    rgn.put("5", new Portfolio(5));
+    Query qr = qs.newQuery("Select distinct  * from /portfolios.keySet keys where keys = '4'");
+    SelectResults sr = (SelectResults) qr.execute();
+    assertEquals(sr.size(), 1);
+  }
+
+  /**
+   * The Index maintenance has a bug as it does not re-evaluate the
+   * index maintenance collection in the IMQEvaluator when an entry
+   * gets modified & so the index resultset is messed up
+   */
+  @Test
+  public void testBug36591() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i1 = qs.createIndex("keyIndex", IndexType.FUNCTIONAL, "ks.hashCode", "/portfolios.keys ks");
+    Region rgn = CacheUtils.getRegion("/portfolios");
+    rgn.put("4", new Portfolio(4));
+    rgn.put("5", new Portfolio(5));
+    CacheUtils.log(((CompactRangeIndex) i1).dump());
+
+    Query qr = qs.newQuery("Select distinct * from /portfolios.keys keys where keys.hashCode >= $1");
+    SelectResults sr = (SelectResults) qr.execute(new Object[] { new Integer(-1) });
+    assertEquals(6, sr.size());
+  }
+
+  /**
+   * Creation of index on a path derived from Region.Entry object obtained
+   * via entrySet , fails as that function was not supported in the
+   * QRegion & DummyQRegion
+   */
+  @Test
+  public void testBug43519() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index index = qs.createIndex("shortIndex", IndexType.FUNCTIONAL, "p.shortID", "/portfolios p");
+    Region rgn = CacheUtils.getRegion("/portfolios");
+    for (int i = 1; i <= 10; i++) {
+      String key = "" + i;
+      Portfolio p = new Portfolio(i);
+      p.shortID = new Short(key);
+      // addToIndex
+      rgn.put(key, p);
+      // updateIndex
+      rgn.put(key, p);
+      if (i % 2 == 0) {
+        // destroy from index.
+        rgn.destroy(key);
+      }
     }
-    
-    
-    
-    /**
-     * Creation of index on a path derived from Region.Entry object obtained
-     * via entrySet , fails as that function was not supported in the
-     * QRegion & DummyQRegion
-     */
-    @Test
-  public void testBug36823() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      try{
-          qs.createIndex("entryIndex", IndexType.FUNCTIONAL, "value.getID()","/portfolios.entrySet pf");         
-          Region rgn = CacheUtils.getRegion("/portfolios");
-          rgn.put("4",new Portfolio(4));
-          rgn.put("5",new Portfolio(5));
-          Query qr = qs.newQuery("Select distinct * from /portfolios.entrySet pf where pf.value.getID() = 4");
-          SelectResults sr = (SelectResults)qr.execute();
-          assertEquals(sr.size(),1);
-      }catch(Exception e) {
-        CacheUtils.getLogger().error(e);
-        fail("Test failed because of exception. e="+e);        
-      }     
+    Query qr = qs.newQuery("Select p.shortID from /portfolios p where p.shortID < 5");
+    SelectResults sr = (SelectResults) qr.execute();
+    assertEquals(sr.size(), 2);
+  }
+
+  /**
+   * Test the Index maiantenance as it may use the method keys() of QRegion
+   * instead of DummyQRegion while running an IndexMaintenanceQuery
+   */
+  @Test
+  public void testIMQFailureAsMethodKeysNAInDummyQRegion() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i1 = qs.createIndex("keyIndex", IndexType.FUNCTIONAL, "ks.hashCode", "/portfolios.keys() ks");
+    Region rgn = CacheUtils.getRegion("/portfolios");
+    rgn.put("4", new Portfolio(4));
+    rgn.put("5", new Portfolio(5));
+    CacheUtils.log(((CompactRangeIndex) i1).dump());
+
+    Query qr = qs.newQuery("Select distinct keys.hashCode  from /portfolios.keys() keys where keys.hashCode >= $1");
+    SelectResults sr = (SelectResults) qr.execute(new Object[] { new Integer(-1) });
+    assertEquals(6, sr.size());
+  }
+
+  @Test
+  public void testIndexCreationWithFunctions() throws Exception {
+    // Task ID : ICM14
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i1 = qs.createIndex("SetSecIDIndex1", IndexType.FUNCTIONAL, "b.secId", "/portfolios.asSet pf, pf.positions.values b");
+    Index i2 = qs.createIndex("ListSecIDIndex2", IndexType.FUNCTIONAL, "b.secId", "/portfolios.asList pf, pf.positions.values b");
+    Index i3 = qs.createIndex("ArraySecIDIndex3", IndexType.FUNCTIONAL, "b.secId", "/portfolios.toArray pf, pf.positions.values b");
+    CacheUtils.log(((RangeIndex) i1).dump());
+    CacheUtils.log(((RangeIndex) i2).dump());
+    CacheUtils.log(((RangeIndex) i3).dump());
+  }
+
+  @Test
+  public void testInvalidIndexes() throws Exception {
+    //Task ID: ICM15
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    try {
+      Index i1 = qs.createIndex("r1Index", IndexType.FUNCTIONAL, "secId", "/portfolios.toArray[1].positions.values");
+      CacheUtils.log(((RangeIndex) i1).dump());
+      fail("Index creation should have failed");
+    } catch (Exception e) {
     }
-    
-    
-    /**
-     * Creation of index on key path derived from Region.Entry object obtained
-     * via keySet , fails as that function was not supported in the
-     * QRegion & DummyQRegion
-     */
-    @Test
-  public void testBug36590() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      try{
-          qs.createIndex("keyIndex", IndexType.FUNCTIONAL, "keys","/portfolios.keySet keys");         
-          Region rgn = CacheUtils.getRegion("/portfolios");
-          rgn.put("4",new Portfolio(4));
-          rgn.put("5",new Portfolio(5));
-          Query qr = qs.newQuery("Select distinct  * from /portfolios.keySet keys where keys = '4'");
-          SelectResults sr = (SelectResults)qr.execute();
-          assertEquals(sr.size(),1);
-      }catch(Exception e) {
-        CacheUtils.getLogger().error(e);
-        fail("Test failed because of exception. e="+e);        
-      }     
+    try {
+      Index i2 = qs.createIndex("r12Index", IndexType.FUNCTIONAL, "secId", "/portfolios.asList[1].positions.values");
+      CacheUtils.log(((RangeIndex) i2).dump());
+      fail("Index creation should have failed");
+    } catch (Exception e) {
     }
-    
-    /**
-     * The Index maiantenance has a bug as it does not re-evaluate the 
-     * index maintenance collection in the IMQEvaluator when an entry
-     * gets modified & so the index resultset is messed up
-     */
-    @Test
-  public void testBug36591() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      try{
-          Index i1 = qs.createIndex("keyIndex", IndexType.FUNCTIONAL, "ks.hashCode","/portfolios.keys ks");         
-          Region rgn = CacheUtils.getRegion("/portfolios");
-          rgn.put("4",new Portfolio(4));
-          rgn.put("5",new Portfolio(5));
-          CacheUtils.log(((CompactRangeIndex)i1).dump());
-          
-          Query qr = qs.newQuery("Select distinct * from /portfolios.keys keys where keys.hashCode >= $1");
-          SelectResults sr = (SelectResults)qr.execute(new Object[]{new Integer(-1)});
-          assertEquals(6,sr.size());
-      }catch(Exception e) {
-        CacheUtils.getLogger().error(e);
-        fail("Test failed because of exception. e="+e);        
-      }   
+  }
+
+  @Test
+  public void testIndexCreationWithFunctionsinFromClause() throws Exception {
+    // Task ID: ICM13
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    //      BUG #32586 : FIXED
+    Index i1 = qs.createIndex("Index11", IndexType.FUNCTIONAL, "status", "/portfolios.values.toArray()");
+    Index i2 = qs.createIndex("Index12", IndexType.FUNCTIONAL, "ID", "/portfolios.values.asSet");
+    Index i3 = qs.createIndex("Index13", IndexType.FUNCTIONAL, "ID", "/portfolios.values.asList");
+
+    qs.createIndex("Index14", IndexType.FUNCTIONAL, "value.ID", "/portfolios.entries.toArray()");
+    qs.createIndex("Index15", IndexType.FUNCTIONAL, "value.ID", "/portfolios.entries.asSet");
+    qs.createIndex("Index16", IndexType.FUNCTIONAL, "value.ID", "/portfolios.entries.asList");
+
+    //      BUG #32586 : FIXED
+    qs.createIndex("Index17", IndexType.FUNCTIONAL, "kIter", "/portfolios.keys.toArray() kIter");
+    qs.createIndex("Index18", IndexType.FUNCTIONAL, "kIter", "/portfolios.keys.asSet kIter");
+    qs.createIndex("Index19", IndexType.FUNCTIONAL, "kIter", "/portfolios.keys.asList kIter");
+
+    CacheUtils.log(((CompactRangeIndex) i1).dump());
+    CacheUtils.log(((CompactRangeIndex) i2).dump());
+    CacheUtils.log(((CompactRangeIndex) i3).dump());
+  }
+
+  @Test
+  public void testIndexObjectTypeWithRegionConstraint() throws Exception {
+    QueryService qs;
+    qs = CacheUtils.getQueryService();
+    Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL, "b.secId", "/portfolios pf, pf.positions.values b");
+    ObjectType type = ((IndexProtocol) i1).getResultSetType();
+    String fieldNames[] = { "index_iter1", "index_iter2" };
+    ObjectType fieldTypes[] = { new ObjectTypeImpl(Portfolio.class), new ObjectTypeImpl(Object.class) };
+    //ObjectType expectedType = new StructTypeImpl( fieldNames,fieldTypes);
+    ObjectType expectedType = new StructTypeImpl(fieldNames, fieldTypes);
+    if (!(type instanceof StructType && type.equals(expectedType))) {
+      fail("The ObjectType obtained from index is not of the expected type. Type obtained from index=" + type);
     }
-    
-    /**
-     * Creation of index on a path derived from Region.Entry object obtained
-     * via entrySet , fails as that function was not supported in the
-     * QRegion & DummyQRegion
-     */
-    @Test
-  public void testBug43519() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      try{
-          Index index = qs.createIndex("shortIndex", IndexType.FUNCTIONAL, "p.shortID","/portfolios p");         
-          Region rgn = CacheUtils.getRegion("/portfolios");
-          for (int i=1; i <= 10; i++) {
-            String key ="" + i;
-            Portfolio p = new Portfolio(i);
-            p.shortID = new Short(key);
-            // addToIndex
-            rgn.put(key, p);
-            // updateIndex
-            rgn.put(key, p);
-            if (i %2 == 0) {
-              // destroy from index.
-              rgn.destroy(key);
-            }
-          }
-          Query qr = qs.newQuery("Select p.shortID from /portfolios p where p.shortID < 5");
-          SelectResults sr = (SelectResults)qr.execute();
-          assertEquals(sr.size(),2);
-      }catch(Exception e) {
-        CacheUtils.getLogger().error(e);
-        fail("Test failed because of exception. e="+e);        
-      }     
+
+    Index i2 = qs.createIndex("Index2", IndexType.FUNCTIONAL, "pf.ID", "/portfolios.values pf");
+    type = ((IndexProtocol) i2).getResultSetType();
+
+    expectedType = new ObjectTypeImpl(Portfolio.class);
+    if (!type.equals(expectedType)) {
+      fail("The ObjectType obtained from index is not of the expected type. Type obtained from index=" + type);
     }
 
-    /**
-     * Test the Index maiantenance as it may use the method keys() of QRegion
-     * instead of DummyQRegion while running an IndexMaintenanceQuery
-     */
-    @Test
-  public void testIMQFailureAsMethodKeysNAInDummyQRegion() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      try{
-          Index i1 = qs.createIndex("keyIndex", IndexType.FUNCTIONAL, "ks.hashCode","/portfolios.keys() ks");         
-          Region rgn = CacheUtils.getRegion("/portfolios");
-          rgn.put("4",new Portfolio(4));
-          rgn.put("5",new Portfolio(5));
-          CacheUtils.log(((CompactRangeIndex)i1).dump());
-          
-          Query qr = qs.newQuery("Select distinct keys.hashCode  from /portfolios.keys() keys where keys.hashCode >= $1");
-          SelectResults sr = (SelectResults)qr.execute(new Object[]{new Integer(-1)});
-          assertEquals(6,sr.size());
-      }catch(Exception e) {
-        CacheUtils.getLogger().error(e);
-        fail("Test failed because of exception. e="+e);        
-      }   
+    Index i3 = qs.createIndex("Index3", IndexType.FUNCTIONAL, "pos.secId", "/portfolios['0'].positions.values pos");
+    type = ((IndexProtocol) i3).getResultSetType();
+
+    expectedType = new ObjectTypeImpl(Object.class);
+    if (!type.equals(expectedType)) {
+      fail("The ObjectType obtained from index is not of the expected type. Type obtained from index=" + type);
     }
-    
-    
-    @Test
-  public void testIndexCreationWithFunctions() throws Exception {
-        // Task ID : ICM14
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            Index i1 = qs.createIndex("SetSecIDIndex1", IndexType.FUNCTIONAL,"b.secId","/portfolios.asSet pf, pf.positions.values b");
-            Index i2 = qs.createIndex("ListSecIDIndex2", IndexType.FUNCTIONAL,"b.secId","/portfolios.asList pf, pf.positions.values b");
-            Index i3 = qs.createIndex("ArraySecIDIndex3", IndexType.FUNCTIONAL,"b.secId","/portfolios.toArray pf, pf.positions.values b");
-            CacheUtils.log(((RangeIndex)i1).dump());
-            CacheUtils.log(((RangeIndex)i2).dump());
-            CacheUtils.log(((RangeIndex)i3).dump());
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail();
-        }
-    }  
-    @Test
-  public void testInvalidIndexes() {
-        //Task ID: ICM15
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            Index i1 = qs.createIndex("r1Index", IndexType.FUNCTIONAL, "secId","/portfolios.toArray[1].positions.values");
-            CacheUtils.log(((RangeIndex)i1).dump());
-            fail("Index creation should have failed");
-        } catch (Exception e) {
-            //e.printStackTrace();
-            Assert.assertTrue(true);
-        }
-        try{
-            Index i2 = qs.createIndex("r12Index", IndexType.FUNCTIONAL, "secId","/portfolios.asList[1].positions.values");
-            CacheUtils.log(((RangeIndex)i2).dump());
-            fail("Index creation should have failed");
-        } catch (Exception e) {
-            //e.printStackTrace();
-            Assert.assertTrue(true);
-        }
+
+    Index i4 = qs.createIndex("Index4", IndexType.PRIMARY_KEY, "ID", "/portfolios");
+    type = ((IndexProtocol) i4).getResultSetType();
+
+    expectedType = new ObjectTypeImpl(Portfolio.class);
+    if (!type.equals(expectedType)) {
+      fail("The ObjectType obtained from index is not of the expected type. Type obtained from index=" + type);
     }
-    @Test
-  public void testIndexCreationWithFunctionsinFromClause() throws Exception {
-        // Task ID: ICM13
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        try{
-            //      BUG #32586 : FIXED
-            Index i1 = qs.createIndex("Index11", IndexType.FUNCTIONAL,"status","/portfolios.values.toArray()");
-            Index i2 = qs.createIndex("Index12", IndexType.FUNCTIONAL,"ID","/portfolios.values.asSet");
-            Index i3 = qs.createIndex("Index13", IndexType.FUNCTIONAL,"ID","/portfolios.values.asList");
-            
-            qs.createIndex("Index14", IndexType.FUNCTIONAL,"value.ID","/portfolios.entries.toArray()");
-            qs.createIndex("Index15", IndexType.FUNCTIONAL,"value.ID","/portfolios.entries.asSet");
-            qs.createIndex("Index16", IndexType.FUNCTIONAL,"value.ID","/portfolios.entries.asList");
-            
-            //      BUG #32586 : FIXED
-            qs.createIndex("Index17", IndexType.FUNCTIONAL,"kIter","/portfolios.keys.toArray() kIter");
-            qs.createIndex("Index18", IndexType.FUNCTIONAL,"kIter","/portfolios.keys.asSet kIter");
-            qs.createIndex("Index19", IndexType.FUNCTIONAL,"kIter","/portfolios.keys.asList kIter");
-            
-            CacheUtils.log(((CompactRangeIndex)i1).dump());
-            CacheUtils.log(((CompactRangeIndex)i2).dump());
-            CacheUtils.log(((CompactRangeIndex)i3).dump());
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail();
-        }
+  }
+
+  @Test
+  public void testIndexOnOverflowRegion() throws Exception {
+    String regionName = "portfolios_overflow";
+
+    // overflow region.
+    AttributesFactory attributesFactory = new AttributesFactory();
+    attributesFactory.setValueConstraint(Portfolio.class);
+    attributesFactory.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK));
+
+    Region region = CacheUtils.createRegion(regionName, attributesFactory.create(), true);
+
+    for (int i = 0; i < 4; i++) {
+      region.put(new Portfolio(i), new Portfolio(i));
     }
-    
-    @Test
-  public void testIndexObjectTypeWithRegionConstraint() {
-      QueryService qs;
-      qs = CacheUtils.getQueryService();
-      try{
-          Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL,"b.secId","/portfolios pf, pf.positions.values b");
-          ObjectType type = ((IndexProtocol)i1).getResultSetType();
-          String fieldNames [] = {"index_iter1","index_iter2"};
-          ObjectType fieldTypes [] = { new ObjectTypeImpl(Portfolio.class),new ObjectTypeImpl(Object.class) };
-          //ObjectType expectedType = new StructTypeImpl( fieldNames,fieldTypes);
-          ObjectType expectedType = new StructTypeImpl( fieldNames,fieldTypes);
-          if( !(type instanceof StructType && type.equals(expectedType)) ){
-            fail("The ObjectType obtained from index is not of the expected type. Type obtained from index="+type);
-          }
-          
-          Index i2 = qs.createIndex("Index2", IndexType.FUNCTIONAL,"pf.ID","/portfolios.values pf");
-          type = ((IndexProtocol)i2).getResultSetType();
-                   
-          expectedType = new ObjectTypeImpl( Portfolio.class);
-          if( ! type.equals(expectedType) ){
-            fail("The ObjectType obtained from index is not of the expected type. Type obtained from index="+type);
-          }
-          
-          Index i3 = qs.createIndex("Index3", IndexType.FUNCTIONAL,"pos.secId","/portfolios['0'].positions.values pos");
-          type = ((IndexProtocol)i3).getResultSetType();
-                   
-          expectedType = new ObjectTypeImpl( Object.class);
-          if( ! type.equals(expectedType) ){
-            fail("The ObjectType obtained from index is not of the expected type. Type obtained from index="+type);
-          }
-          
-          Index i4 = qs.createIndex("Index4", IndexType.PRIMARY_KEY,"ID","/portfolios");
-          type = ((IndexProtocol)i4).getResultSetType();
-                   
-          expectedType = new ObjectTypeImpl( Portfolio.class);
-          if( ! type.equals(expectedType) ){
-            fail("The ObjectType obtained from index is not of the expected type. Type obtained from index="+type);
-          }
-          
-         
-      } catch (Exception e) {
-          e.printStackTrace();
-          fail();
-      }
+
+    QueryService qs = CacheUtils.getQueryService();
+    // Currently supported with compact range-index.
+    Index i1 = qs.createIndex("idIndex", IndexType.FUNCTIONAL, "pf.ID", "/portfolios_overflow pf");
+    Index i2 = qs.createIndex("keyIdIndex", IndexType.FUNCTIONAL, "key.ID", "/portfolios_overflow.keys key");
+
+    // Not yet supported with range-index.
+    try {
+      Index i3 = qs.createIndex("idIndex2", IndexType.FUNCTIONAL, "pf.ID", "/portfolios_overflow pf, pf.positions pos");
+      fail("Range index not supported on overflow region.");
+    } catch (UnsupportedOperationException ex) {
+      // Expected.
     }
-    
-    @Test
-  public void testIndexOnOverflowRegion() throws Exception
-    {
-      String regionName = "portfolios_overflow";
-      
-      // overflow region.
-      AttributesFactory attributesFactory = new AttributesFactory();
-      attributesFactory.setValueConstraint(Portfolio.class);
-      attributesFactory.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(
-          1, EvictionAction.OVERFLOW_TO_DISK));
-      
-      Region region = CacheUtils.createRegion(regionName, attributesFactory.create(), true);
-      
-      for(int i=0;i<4;i++){
-        region.put(new Portfolio(i), new Portfolio(i));
-      }
-      
-      QueryService qs = CacheUtils.getQueryService();
-      // Currently supported with compact range-index.
-      Index i1 = qs.createIndex("idIndex", IndexType.FUNCTIONAL, "pf.ID", "/portfolios_overflow pf");
-      Index i2 = qs.createIndex("keyIdIndex", IndexType.FUNCTIONAL, "key.ID", "/portfolios_overflow.keys key");
-
-      // Not yet supported with range-index.
-      try {
-        Index i3 = qs.createIndex("idIndex2", IndexType.FUNCTIONAL, "pf.ID", "/portfolios_overflow pf, pf.positions pos");
-        fail("Range index not supported on overflow region.");
-      } catch (UnsupportedOperationException ex){
-        // Expected.
-        Assert.assertTrue(true);
-      }
 
-      // Execute query.
-      String[] queryStr = new String[] {
-        "Select * from /portfolios_overflow pf where pf.ID = 2",
-        "Select * from /portfolios_overflow.keys key where key.ID = 2",
-        "Select * from /portfolios_overflow pf where pf.ID > 1",
-        "Select * from /portfolios_overflow pf where pf.ID < 2",
-      };
-      
-      int[] resultSize = new int[] {
-          1,
-          1,
-          2,
-          2
-      };
-      
-      for (int i=0; i < queryStr.length; i++){
-        Query q = qs.newQuery(queryStr[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        SelectResults results = (SelectResults)q.execute();      
-        if(!observer.isIndexesUsed){
-          fail("Index not used for query. " + queryStr[i]);
-        }
-        assertEquals(results.size(), resultSize[i]); 
-      }
-      
-      for(int i=0;i<10;i++){
-        region.put(new Portfolio(i), new Portfolio(i));
+    // Execute query.
+    String[] queryStr = new String[] {
+      "Select * from /portfolios_overflow pf where pf.ID = 2",
+      "Select * from /portfolios_overflow.keys key where key.ID = 2",
+      "Select * from /portfolios_overflow pf where pf.ID > 1",
+      "Select * from /portfolios_overflow pf where pf.ID < 2",
+    };
+
+    int[] resultSize = new int[] {
+      1, 1, 2, 2
+    };
+
+    for (int i = 0; i < queryStr.length; i++) {
+      Query q = qs.newQuery(queryStr[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      SelectResults results = (SelectResults) q.execute();
+      if (!observer.isIndexesUsed) {
+        fail("Index not used for query. " + queryStr[i]);
       }
-      
-      // Persistent overflow region.
-      
+      assertEquals(results.size(), resultSize[i]);
+    }
+
+    for (int i = 0; i < 10; i++) {
+      region.put(new Portfolio(i), new Portfolio(i));
     }
-    
+
+    // Persistent overflow region.
+
+  }
+
   @Test
-  public void testMapKeyIndexCreation_1_NonCompactType() throws Exception
-  {
+  public void testMapKeyIndexCreation_1_NonCompactType() throws Exception {
     QueryService qs;
     qs = CacheUtils.getQueryService();
-    Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL, "pf.positions[*]",
-        "/portfolios pf");
-    assertEquals(i1.getCanonicalizedIndexedExpression(),"index_iter1.positions[*]");
-    assertTrue(i1 instanceof CompactMapRangeIndex);  
+    Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL, "pf.positions[*]", "/portfolios pf");
+    assertEquals(i1.getCanonicalizedIndexedExpression(), "index_iter1.positions[*]");
+    assertTrue(i1 instanceof CompactMapRangeIndex);
   }
-   
+
   @Test
-  public void testMapKeyIndexCreation_2_NonCompactType() throws Exception
-  {
+  public void testMapKeyIndexCreation_2_NonCompactType() throws Exception {
     QueryService qs;
     qs = CacheUtils.getQueryService();
-    Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL,
-        "pf.positions['key1','key2','key3']", "/portfolios pf");
-    assertEquals(i1.getCanonicalizedIndexedExpression(),
-        "index_iter1.positions['key1','key2','key3']");
+    Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL, "pf.positions['key1','key2','key3']", "/portfolios pf");
+    assertEquals(i1.getCanonicalizedIndexedExpression(), "index_iter1.positions['key1','key2','key3']");
     assertTrue(i1 instanceof CompactMapRangeIndex);
-    CompactMapRangeIndex mri = (CompactMapRangeIndex)i1;
+    CompactMapRangeIndex mri = (CompactMapRangeIndex) i1;
     Object mapKeys[] = mri.getMapKeysForTesting();
-    assertEquals(mapKeys.length,3);
+    assertEquals(mapKeys.length, 3);
     Set<String> keys = new HashSet<String>();
     keys.add("key1");
     keys.add("key2");
     keys.add("key3");
-    for(Object key:mapKeys) {
+    for (Object key : mapKeys) {
       keys.remove(key);
     }
     assertTrue(keys.isEmpty());
-    String [] patterns = mri.getPatternsForTesting();
-    assertEquals(patterns.length,3);
+    String[] patterns = mri.getPatternsForTesting();
+    assertEquals(patterns.length, 3);
     Set<String> patternsSet = new HashSet<String>();
     patternsSet.add("index_iter1.positions['key1']");
     patternsSet.add("index_iter1.positions['key2']");
     patternsSet.add("index_iter1.positions['key3']");
-    for(String ptrn:patterns) {
+    for (String ptrn : patterns) {
       patternsSet.remove(ptrn);
     }
     assertTrue(patternsSet.isEmpty());
-    assertEquals(mri.getIndexedExpression(),"pf.positions['key1','key2','key3']");
-
+    assertEquals(mri.getIndexedExpression(), "pf.positions['key1','key2','key3']");
   }
-  
 
   /**
    * Test for bug 46872, make sure
@@ -844,12 +735,12 @@ public class IndexCreationJUnitTest{
     InternalDistributedSystem.getAnyInstance().disconnect();
     File file = new File("persistData0");
     file.mkdir();
-    
+
     {
       Properties props = new Properties();
       props.setProperty(NAME, "test");
       props.setProperty(MCAST_PORT, "0");
-      props.setProperty(CACHE_XML_FILE, IndexCreationJUnitTest.class.getResource("index-creation-with-eviction.xml").toURI().getPath());
+      props.setProperty(CACHE_XML_FILE, getClass().getResource("index-creation-with-eviction.xml").toURI().getPath());
       DistributedSystem ds = DistributedSystem.connect(props);
 
       // Create the cache which causes the cache-xml-file to be parsed
@@ -859,11 +750,12 @@ public class IndexCreationJUnitTest{
       for (int i = 0; i < 100; i++) {
         Portfolio pf = new Portfolio(i);
         pf.setCreateTime(i);
-        region.put(""+ i, pf);
+        region.put("" + i, pf);
       }
-      
+
       //verify that a query on the creation time works as expected
-      SelectResults results = (SelectResults)qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L").execute();
+      SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L")
+                                                .execute();
       assertEquals("OQL index results did not match", 1, results.size());
       cache.close();
       ds.disconnect();
@@ -875,21 +767,21 @@ public class IndexCreationJUnitTest{
       props.setProperty(MCAST_PORT, "0");
       //Using a different cache.xml that changes some region properties
       //That will force the disk code to copy the region entries.
-      props.setProperty(CACHE_XML_FILE,
-          IndexCreationJUnitTest.class.getResource("index-creation-without-eviction.xml").toURI().getPath());
+      props.setProperty(CACHE_XML_FILE, getClass().getResource("index-creation-without-eviction.xml").toURI().getPath());
       DistributedSystem ds = DistributedSystem.connect(props);
       Cache cache = CacheFactory.create(ds);
       QueryService qs = cache.getQueryService();
       Region region = cache.getRegion("mainReportRegion");
 
       //verify that a query on the creation time works as expected
-      SelectResults results = (SelectResults)qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L").execute();
+      SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L")
+                                                .execute();
       assertEquals("OQL index results did not match", 1, results.size());
       ds.disconnect();
       FileUtil.delete(file);
     }
   }
- 
+
   @Test
   public void testIndexCreationFromXMLForLocalScope() throws Exception {
     InternalDistributedSystem.getAnyInstance().disconnect();
@@ -899,66 +791,66 @@ public class IndexCreationJUnitTest{
     Properties props = new Properties();
     props.setProperty(NAME, "test");
     props.setProperty(MCAST_PORT, "0");
-    props
-        .setProperty(CACHE_XML_FILE, IndexCreationJUnitTest.class.getResource("index-creation-without-eviction.xml").toURI().getPath());
+    props.setProperty(CACHE_XML_FILE, getClass().getResource("index-creation-without-eviction.xml").toURI().getPath());
     DistributedSystem ds = DistributedSystem.connect(props);
     Cache cache = CacheFactory.create(ds);
     Region localRegion = cache.getRegion("localRegion");
     for (int i = 0; i < 100; i++) {
       Portfolio pf = new Portfolio(i);
-      localRegion.put(""+ i, pf);
+      localRegion.put("" + i, pf);
     }
     QueryService qs = cache.getQueryService();
     Index ind = qs.getIndex(localRegion, "localIndex");
-    assertNotNull("Index localIndex should have been created ",ind);
+    assertNotNull("Index localIndex should have been created ", ind);
     // verify that a query on the creation time works as expected
-    SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM " + localRegion.getFullPath() + " Where ID > 0").execute();
+    SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM " + localRegion.getFullPath() + " Where ID > 0")
+                                              .execute();
     assertEquals("OQL index results did not match", 99, results.size());
     ds.disconnect();
     FileUtil.delete(file);
   }
- 
+
   @Test
   public void testIndexCreationFromXMLForDiskLocalScope() throws Exception {
     InternalDistributedSystem.getAnyInstance().disconnect();
-    File file = new File("persistData0");
+    File file = new File("persistData0"); // TODO: use TemporaryFolder
     file.mkdir();
 
     Properties props = new Properties();
     props.setProperty(NAME, "test");
     props.setProperty(MCAST_PORT, "0");
-    props
-        .setProperty(CACHE_XML_FILE, IndexCreationJUnitTest.class.getResource("index-creation-without-eviction.xml").toURI().getPath());
+    props.setProperty(CACHE_XML_FILE, getClass().getResource("index-creation-without-eviction.xml").toURI().getPath());
     DistributedSystem ds = DistributedSystem.connect(props);
     Cache cache = CacheFactory.create(ds);
     Region localDiskRegion = cache.getRegion("localDiskRegion");
     for (int i = 0; i < 100; i++) {
       Portfolio pf = new Portfolio(i);
-      localDiskRegion.put(""+ i, pf);
+      localDiskRegion.put("" + i, pf);
     }
     QueryService qs = cache.getQueryService();
     Index ind = qs.getIndex(localDiskRegion, "localDiskIndex");
-    assertNotNull("Index localIndex should have been created ",ind);
+    assertNotNull("Index localIndex should have been created ", ind);
     // verify that a query on the creation time works as expected
-    SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM " + localDiskRegion.getFullPath() + " Where status = 'active'").execute();
+    SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM " + localDiskRegion.getFullPath() + " Where status = 'active'")
+                                              .execute();
     assertEquals("OQL index results did not match", 50, results.size());
     ds.disconnect();
     FileUtil.delete(file);
   }
-  
+
   @Test
   public void testIndexInitializationForOverFlowRegions() throws Exception {
     InternalDistributedSystem.getAnyInstance().disconnect();
     File file = new File("persistData0");
     file.mkdir();
-    
+
     {
       Properties props = new Properties();
       props.setProperty(NAME, "test");
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
       props.setProperty(ENABLE_TIME_STATISTICS, "true");
-      props.setProperty(CACHE_XML_FILE, IndexCreationJUnitTest.class.getResource("index-recovery-overflow.xml").toURI().getPath());
+      props.setProperty(CACHE_XML_FILE, getClass().getResource("index-recovery-overflow.xml").toURI().getPath());
       DistributedSystem ds = DistributedSystem.connect(props);
 
       // Create the cache which causes the cache-xml-file to be parsed
@@ -968,19 +860,20 @@ public class IndexCreationJUnitTest{
       for (int i = 0; i < 100; i++) {
         Portfolio pf = new Portfolio(i);
         pf.setCreateTime(i);
-        region.put(""+ i, pf);
+        region.put("" + i, pf);
       }
-      
+
       IndexStatistics is1 = qs.getIndex(region, "status").getStatistics();
       assertEquals(2, is1.getNumberOfKeys());
       assertEquals(100, is1.getNumberOfValues());
-      
+
       IndexStatistics is2 = qs.getIndex(region, "ID").getStatistics();
       assertEquals(100, is2.getNumberOfKeys());
       assertEquals(100, is2.getNumberOfValues());
-            
+
       //verify that a query on the creation time works as expected
-      SelectResults results = (SelectResults)qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L").execute();
+      SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L")
+                                                .execute();
       assertEquals("OQL index results did not match", 1, results.size());
       cache.close();
       ds.disconnect();
@@ -992,72 +885,76 @@ public class IndexCreationJUnitTest{
       props.setProperty(MCAST_PORT, "0");
       props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
       props.setProperty(ENABLE_TIME_STATISTICS, "true");
-      props.setProperty(CACHE_XML_FILE, IndexCreationJUnitTest.class.getResource("index-recovery-overflow.xml").toURI().getPath());
+      props.setProperty(CACHE_XML_FILE, getClass().getResource("index-recovery-overflow.xml").toURI().getPath());
       DistributedSystem ds = DistributedSystem.connect(props);
       Cache cache = CacheFactory.create(ds);
       QueryService qs = cache.getQueryService();
       Region region = cache.getRegion("mainReportRegion");
-      
-      assertTrue("Index initialization time should not be 0.", ((LocalRegion)region).getCachePerfStats().getIndexInitializationTime() > 0);
+
+      assertTrue("Index initialization time should not be 0.", ((LocalRegion) region).getCachePerfStats()
+                                                                                     .getIndexInitializationTime() > 0);
 
       IndexStatistics is1 = qs.getIndex(region, "status").getStatistics();
       assertEquals(2, is1.getNumberOfKeys());
       assertEquals(100, is1.getNumberOfValues());
-      
+
       IndexStatistics is2 = qs.getIndex(region, "ID").getStatistics();
       assertEquals(100, is2.getNumberOfKeys());
       assertEquals(100, is2.getNumberOfValues());
-            
+
       //verify that a query on the creation time works as expected
-      SelectResults results = (SelectResults)qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L").execute();
+      SelectResults results = (SelectResults) qs.newQuery("<trace>SELECT * FROM /mainReportRegion.entrySet mr Where mr.value.createTime > 1L and mr.value.createTime < 3L")
+                                                .execute();
       assertEquals("OQL index results did not match", 1, results.size());
       ds.disconnect();
       FileUtil.delete(file);
     }
   }
- 
+
   @Test
   public void testIndexCreationWithoutLoadingData() throws Exception {
     QueryService qs;
     qs = CacheUtils.getQueryService();
-    
-    Index i1 = ((DefaultQueryService)qs).createIndex("statusIndex", IndexType.FUNCTIONAL,"status","/portfolios", null, false);
-    Index i2 = ((DefaultQueryService)qs).createIndex("secIndex", IndexType.FUNCTIONAL,"pos.secId","/portfolios p, p.positions.values pos", null, false);
-    Index i3 = ((DefaultQueryService)qs).createIndex("statusHashIndex", IndexType.HASH,"status","/portfolios", null, false);
-    
+
+    Index i1 = ((DefaultQueryService) qs).createIndex("statusIndex", IndexType.FUNCTIONAL, "status", "/portfolios", null, false);
+    Index i2 = ((DefaultQueryService) qs).createIndex("secIndex", IndexType.FUNCTIONAL, "pos.secId", "/portfolios p, p.positions.values pos", null, false);
+    Index i3 = ((DefaultQueryService) qs).createIndex("statusHashIndex", IndexType.HASH, "status", "/portfolios", null, false);
+
     assertEquals("Index should have been empty ", 0, i1.getStatistics().getNumberOfKeys());
     assertEquals("Index should have been empty ", 0, i1.getStatistics().getNumberOfValues());
     assertEquals("Index should have been empty ", 0, i2.getStatistics().getNumberOfKeys());
     assertEquals("Index should have been empty ", 0, i2.getStatistics().getNumberOfValues());
     assertEquals("Index should have been empty ", 0, i3.getStatistics().getNumberOfKeys());
     assertEquals("Index should have been empty ", 0, i3.getStatistics().getNumberOfValues());
-    
+
     qs.removeIndexes();
-    
-    i1 = ((DefaultQueryService)qs).createIndex("statusIndex", IndexType.FUNCTIONAL,"status","/portfolios", null, true);
-    i2 = ((DefaultQueryService)qs).createIndex("secIndex", IndexType.FUNCTIONAL,"pos.secId","/portfolios p, p.positions.values pos", null, true);
-    i3 = ((DefaultQueryService)qs).createIndex("statusHashIndex", IndexType.HASH,"status","/portfolios", null, true);
-    
+
+    i1 = ((DefaultQueryService) qs).createIndex("statusIndex", IndexType.FUNCTIONAL, "status", "/portfolios", null, true);
+    i2 = ((DefaultQueryService) qs).createIndex("secIndex", IndexType.FUNCTIONAL, "pos.secId", "/portfolios p, p.positions.values pos", null, true);
+    i3 = ((DefaultQueryService) qs).createIndex("statusHashIndex", IndexType.HASH, "status", "/portfolios", null, true);
+
     assertEquals("Index should not have been empty ", 2, i1.getStatistics().getNumberOfKeys());
     assertEquals("Index should not have been empty ", 4, i1.getStatistics().getNumberOfValues());
     assertEquals("Index should not have been empty ", 8, i2.getStatistics().getNumberOfKeys());
     assertEquals("Index should not have been empty ", 8, i2.getStatistics().getNumberOfValues());
-    assertEquals("Index should not have been empty ", 0, i3.getStatistics().getNumberOfKeys()); // hash index does not have keys
+    assertEquals("Index should not have been empty ", 0, i3.getStatistics()
+                                                           .getNumberOfKeys()); // hash index does not have keys
     assertEquals("Index should not have been empty ", 4, i3.getStatistics().getNumberOfValues());
   }
-  
-    class QueryObserverImpl extends QueryObserverAdapter{
-        boolean isIndexesUsed = false;
-        ArrayList indexesUsed = new ArrayList();
-        
-        public void beforeIndexLookup(Index index, int oper, Object key) {
-            indexesUsed.add(index.getName());
-        }
-        
-        public void afterIndexLookup(Collection results) {
-            if(results != null){
-                isIndexesUsed = true;
-            }
-        }
+
+  private static class QueryObserverImpl extends QueryObserverAdapter {
+
+    boolean isIndexesUsed = false;
+    ArrayList indexesUsed = new ArrayList();
+
+    public void beforeIndexLookup(Index index, int oper, Object key) {
+      indexesUsed.add(index.getName());
     }
+
+    public void afterIndexLookup(Collection results) {
+      if (results != null) {
+        isIndexesUsed = true;
+      }
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbt.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbt.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbt.java
deleted file mode 100755
index 0ba43dd..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbt.java
+++ /dev/null
@@ -1,176 +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.
- */
-/*
- * IndexUsageWithAliasAsProjAtrbt.java
- *
- * Created on May 4, 2005, 11:10 AM
- */
-package com.gemstone.gemfire.cache.query.functional;
-
-import com.gemstone.gemfire.cache.Region;
-import junit.framework.TestCase;
-import com.gemstone.gemfire.cache.query.*;
-import com.gemstone.gemfire.cache.query.data.Portfolio;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
-import com.gemstone.gemfire.cache.query.types.ObjectType;
-import java.util.*;
-
-public class IndexUsageWithAliasAsProjAtrbt extends TestCase{
-    ObjectType resType1=null;
-    ObjectType resType2= null;
-    
-    
-    int resSize1=0;
-    int resSize2=0;
-    
-    Iterator itert1=null;
-    Iterator itert2=null;
-    
-    Set set1=null;
-    Set set2=null;
-    
-    String s1;
-    String s2;
-    
-    public IndexUsageWithAliasAsProjAtrbt(String testName){
-        super(testName);
-    }
-    
-    protected void setUp() throws java.lang.Exception {
-        CacheUtils.startCache();
-    }
-    
-    protected void tearDown() throws java.lang.Exception {
-        CacheUtils.closeCache();
-    }
-    
-    public void testComparisonBetnWithAndWithoutIndexCreation() throws Exception {
-        //TASK IUM 7
-        Region region = CacheUtils.createRegion("portfolios", Portfolio.class);
-        for(int i=0;i<4;i++){
-            region.put(""+i, new Portfolio(i));
-        }
-        QueryService qs;
-        qs = CacheUtils.getQueryService();
-        String queries[] = {
-            // IUM 7
-            "Select distinct security from /portfolios, secIds security where length > 1",
-            // IUM 8         
-            "Select distinct security from /portfolios , secIds security where length > 2 AND (intern <> 'SUN' OR intern <> 'DELL' )",
-            // IUM 9 
-            "Select distinct  security from /portfolios  pos , secIds security where length > 2 and pos.ID > 0"         
-                    
-        };
-        SelectResults r[][]= new SelectResults[queries.length][2];
-        
-        for (int i = 0; i < queries.length; i++) {
-            Query q = null;
-            try {
-                q = CacheUtils.getQueryService().newQuery(queries[i]);
-               r[i][0] = (SelectResults)q.execute();
-                
-                QueryObserverImpl observer = new QueryObserverImpl();
-                QueryObserverHolder.setInstance(observer);
-                if(!observer.isIndexesUsed){
-                    CacheUtils.log("NO INDEX USED");
-                }else {
-                  fail("If index were not there how did they get used ???? ");
-                }
-                
-            } catch (Exception e) {
-                e.printStackTrace();
-                fail(q.getQueryString());
-            }
-        }
-        
-        //  Create an Index on status and execute the same query again.
-        
-        qs = CacheUtils.getQueryService();
-        qs.createIndex("lengthIndex", IndexType.FUNCTIONAL,"length","/portfolios,secIds, positions.values");
-
-        String queries2[] = {
-            // IUM 7
-            "Select distinct security from /portfolios, secIds security where length > 1", 
-            // IUM 8
-            "Select distinct security from /portfolios , secIds security where length > 2 AND (intern <> 'SUN' OR intern <> 'DELL' )",        
-            // IUM 9 
-          "Select distinct  security from /portfolios  pos , secIds security where length > 2 and pos.ID > 0"         
-                    
-        };
-        for (int i = 0; i < queries.length; i++) {
-            Query q = null;
-            try {
-                q = CacheUtils.getQueryService().newQuery(queries[i]);
-               r[i][1] = (SelectResults) q.execute();
-                
-                QueryObserverImpl observer2 = new QueryObserverImpl();
-                QueryObserverHolder.setInstance(observer2);
-                if(observer2.isIndexesUsed == true){
-                    CacheUtils.log("YES INDEX IS USED!");
-                }else {
-                  fail("Index should have been used!!! ");
-                }
-                
-            } catch (Exception e) {
-                e.printStackTrace();
-                fail(q.getQueryString());
-            }
-        }
-        
-       CacheUtils.compareResultsOfWithAndWithoutIndex(r,this);
-    }
-    public void testNestedQResultComposition() throws Exception{
-        Region region = CacheUtils.createRegion("pos", Portfolio.class);
-        for(int i=0;i<4;i++){
-            region.put(""+i, new Portfolio(i));
-        }
-        CacheUtils.getQueryService();
-        String queries[] = {
-          //"select distinct * from /pos, positions where value!=null",
-          //"select distinct intern from /pos,names where length>=3",
-            "select distinct nm from /pos prt,names nm where ID>0",
-            "select distinct prt from /pos prt, names where names[3]='ddd'"
-        };
-        try{
-            for(int i=0;i<queries.length;i++){
-                Query q = CacheUtils.getQueryService().newQuery(queries[i]);
-                q.execute();
-             //   CacheUtils.log(Utils.printResult(result));
-                
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-            fail();
-        }
-    }
-    
-    class QueryObserverImpl extends QueryObserverAdapter{
-        boolean isIndexesUsed = false;
-        ArrayList indexesUsed = new ArrayList();
-        
-        public void beforeIndexLookup(Index index, int oper, Object key) {
-            indexesUsed.add(index.getName());
-        }
-        
-        public void afterIndexLookup(Collection results) {
-            if(results != null){
-                isIndexesUsed = true;
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbtJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbtJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbtJUnitTest.java
index 08b76e7..4a7b56a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbtJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexUsageWithAliasAsProjAtrbtJUnitTest.java
@@ -21,12 +21,10 @@
  */
 package com.gemstone.gemfire.cache.query.functional;
 
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
 
 import org.junit.After;
 import org.junit.Before;
@@ -43,27 +41,10 @@ import com.gemstone.gemfire.cache.query.SelectResults;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
-import com.gemstone.gemfire.cache.query.types.ObjectType;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
-public class IndexUsageWithAliasAsProjAtrbtJUnitTest{
-  ObjectType resType1=null;
-  ObjectType resType2= null;
-
-
-  int resSize1=0;
-  int resSize2=0;
-
-  Iterator itert1=null;
-  Iterator itert2=null;
-
-  Set set1=null;
-  Set set2=null;
-
-  String s1;
-  String s2;
-
+public class IndexUsageWithAliasAsProjAtrbtJUnitTest {
 
   @Before
   public void setUp() throws java.lang.Exception {
@@ -97,20 +78,14 @@ public class IndexUsageWithAliasAsProjAtrbtJUnitTest{
 
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        QueryObserverImpl observer = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer);
-        r[i][0] =(SelectResults) q.execute();
-        if(!observer.isIndexesUsed){
-          CacheUtils.log("NO INDEX USED");
-        }else {
-          fail("If index were not there how did they get used ???? ");
-        }              
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      QueryObserverImpl observer = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer);
+      r[i][0] =(SelectResults) q.execute();
+      if(!observer.isIndexesUsed){
+        CacheUtils.log("NO INDEX USED");
+      }else {
+        fail("If index were not there how did they get used ???? ");
       }
     }
 
@@ -120,29 +95,23 @@ public class IndexUsageWithAliasAsProjAtrbtJUnitTest{
     qs.createIndex("lengthIndex", IndexType.FUNCTIONAL,"length","/portfolios,secIds, positions.values");
     for (int i = 0; i < queries.length; i++) {
       Query q = null;
-      try {
-        q = CacheUtils.getQueryService().newQuery(queries[i]);
-        QueryObserverImpl observer2 = new QueryObserverImpl();
-        QueryObserverHolder.setInstance(observer2);
-        r[i][1] = (SelectResults)q.execute();
-
-        if(observer2.isIndexesUsed){
-          CacheUtils.log("YES INDEX IS USED!");
-        }
-        else {
-          fail("Index should have been used!!! ");
-        }              
-
-      } catch (Exception e) {
-        e.printStackTrace();
-        fail(q.getQueryString());
+      q = CacheUtils.getQueryService().newQuery(queries[i]);
+      QueryObserverImpl observer2 = new QueryObserverImpl();
+      QueryObserverHolder.setInstance(observer2);
+      r[i][1] = (SelectResults)q.execute();
+
+      if(observer2.isIndexesUsed){
+        CacheUtils.log("YES INDEX IS USED!");
+      }
+      else {
+        fail("Index should have been used!!! ");
       }
     }
     CacheUtils.compareResultsOfWithAndWithoutIndex(r,this);        
-
   }
+
   @Test
-  public void testQueryResultComposition() throws Exception{
+  public void testQueryResultComposition() throws Exception {
     Region region = CacheUtils.createRegion("pos", Portfolio.class);
     for(int i=0;i<4;i++){
       region.put(""+i, new Portfolio(i));
@@ -154,27 +123,22 @@ public class IndexUsageWithAliasAsProjAtrbtJUnitTest{
         "select distinct nm from /pos prt,names nm where ID>0",
         "select distinct prt from /pos prt, names where names[3]='ddd'"
     };
-    try{
-      for(int i=0;i<queries.length;i++){
-        Query q = CacheUtils.getQueryService().newQuery(queries[i]);
-        q.execute();
-        //   CacheUtils.log(Utils.printResult(result));
-
-      }
-    }catch (Exception e){
-      e.printStackTrace();
-      fail();
+    for(int i=0;i<queries.length;i++){
+      Query q = CacheUtils.getQueryService().newQuery(queries[i]);
+      q.execute();
     }
   }
 
-  class QueryObserverImpl extends QueryObserverAdapter{
+  private static class QueryObserverImpl extends QueryObserverAdapter{
     boolean isIndexesUsed = false;
     ArrayList indexesUsed = new ArrayList();
 
+    @Override
     public void beforeIndexLookup(Index index, int oper, Object key) {
       indexesUsed.add(index.getName());
     }
 
+    @Override
     public void afterIndexLookup(Collection results) {
       if(results != null){
         isIndexesUsed = true;



[39/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 4ecf3e3..a8a512e 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
@@ -17,13 +17,13 @@
 package com.gemstone.gemfire.cache30;
 
 import static com.gemstone.gemfire.internal.lang.ThrowableUtils.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static org.junit.Assume.*;
 
 import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.DataInput;
 import java.io.DataInputStream;
 import java.io.DataOutput;
-import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -42,11 +42,10 @@ import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import junit.framework.Assert;
-import junit.framework.AssertionFailedError;
-
 import org.apache.logging.log4j.Logger;
+import org.junit.AfterClass;
 import org.junit.Ignore;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.DataSerializable;
@@ -107,26 +106,22 @@ import com.gemstone.gemfire.internal.cache.TXManagerImpl;
 import com.gemstone.gemfire.internal.cache.TXStateProxy;
 import com.gemstone.gemfire.internal.cache.Token;
 import com.gemstone.gemfire.internal.cache.TombstoneService;
-import com.gemstone.gemfire.internal.cache.versions.RegionVersionHolder;
 import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector;
-import com.gemstone.gemfire.internal.cache.versions.VMRegionVersionVector;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.offheap.MemoryAllocatorImpl;
 import com.gemstone.gemfire.internal.offheap.StoredObject;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
-import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
 /**
@@ -136,37 +131,23 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
   private static final Logger logger = LogService.getLogger();
-  
-  Properties props = new Properties();
-
-  final int putRange_1Start = 1;
-
-  final int putRange_1End = 5;
-
-  final int putRange_2Start = 6;
-
-  final int putRange_2End = 10;
 
-  final int putRange_3Start = 11;
-
-  final int putRange_3End = 15;
-
-  final int putRange_4Start = 16;
-
-  final int putRange_4End = 20;
-
-  final int removeRange_1Start = 2;
-
-  final int removeRange_1End = 4;
-
-  final int removeRange_2Start = 7;
-
-  final int removeRange_2End = 9;
-
-  public MultiVMRegionTestCase(String name) {
-    super(name);
-  }
-  
+  private Properties props = new Properties();
+
+  private final int putRange_1Start = 1;
+  private final int putRange_1End = 5;
+  private final int putRange_2Start = 6;
+  private final int putRange_2End = 10;
+  private final int putRange_3Start = 11;
+  private final int putRange_3End = 15;
+  private final int putRange_4Start = 16;
+  private final int putRange_4End = 20;
+  private final int removeRange_1Start = 2;
+  private final int removeRange_1End = 4;
+  private final int removeRange_2Start = 7;
+  private final int removeRange_2End = 9;
+
+  @AfterClass
   public static void caseTearDown() throws Exception {
     disconnectAllFromDS();
   }
@@ -176,27 +157,17 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     CCRegion = null;
   }
 
-  // @todo can be used in tests
-//  protected CacheSerializableRunnable createRegionTask(final String name) {
-//    return new CacheSerializableRunnable("Create Region") {
-//      public void run2() throws CacheException {
-//        assertNotNull(createRegion(name));
-//      }
-//    };
-//  }
-
-
-  ////////  Test Methods
-
   /**
    * This is a for the ConcurrentMap operations.
    * 4 VMs are used to
    * create the region and operations are performed on one of the nodes
    */
+  @Test
   public void testConcurrentOperations() throws Exception {
     SerializableRunnable createRegion = new CacheSerializableRunnable(
     "createRegion") {
 
+      @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
         RegionAttributes regionAttribs = getRegionAttributes();
@@ -227,6 +198,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     //String exceptionStr = "";
     VM vm0 = Host.getHost(0).getVM(0);
     vm0.invoke(new CacheSerializableRunnable("doConcurrentMapOperations") {
+      @Override
       public void run2() throws CacheException {
         Cache cache = getCache();
         final Region pr = cache.getRegion(rName);
@@ -344,6 +316,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
      */
     vm0.invoke(new CacheSerializableRunnable("destroyRegionOp") {
                
+       @Override
        public void run2() {
          Cache cache = getCache();
          Region pr = cache.getRegion(rName);
@@ -359,13 +332,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that doing a {@link Region#put put} in a distributed region
    * one VM updates the value in another VM.
    */
-  public void testDistributedUpdate() {
+  @Test
+  public void testDistributedUpdate() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -384,6 +359,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable put =
       new CacheSerializableRunnable("Put key/value") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -396,6 +372,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(put);
 
     vm0.invoke(new CacheSerializableRunnable("Update") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(name);
           region.put(key, newValue);
@@ -404,6 +381,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Validate update") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(name);
           Region.Entry entry = region.getEntry(key);
@@ -425,11 +403,10 @@ 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 {
-    if (getRegionAttributes().getScope() ==
-        Scope.DISTRIBUTED_NO_ACK) {
-      return;
-    }
+  @Ignore("TODO: test is DISABLED 4-16-04 - the current implementation assumes events are processed synchronously, which is no longer true")
+  @Test
+  public void testOrderedUpdates() throws Exception {
+    assumeFalse(getRegionAttributes().getScope() == Scope.DISTRIBUTED_NO_ACK);
 
     final String name = this.getUniqueName();
     final Object key = "KEY";
@@ -441,6 +418,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create region entry") {
+          @Override
           public void run2() throws CacheException {
             Region region = createRegion(name);
             region.create(key, null);
@@ -451,11 +429,13 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm1.invoke(new CacheSerializableRunnable("Set listener") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(name);
           region.setUserAttribute(new LinkedBlockingQueue());
           region.getAttributesMutator().addCacheListener(new
             CacheListenerAdapter() {
+              @Override
               public void afterUpdate(EntryEvent e) {
                 Region region2 = e.getRegion();
                 LinkedBlockingQueue queue =
@@ -467,7 +447,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                   queue.put(value);
 
                 } catch (InterruptedException ex) {
-                  com.gemstone.gemfire.test.dunit.Assert.fail("Why was I interrupted?", ex);
+                  fail("Why was I interrupted?", ex);
                 }
               }
             });
@@ -476,6 +456,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
     AsyncInvocation ai1 =
       vm1.invokeAsync(new CacheSerializableRunnable("Verify") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -489,7 +470,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                 assertEquals(i, value.intValue());
 
               } catch (InterruptedException ex) {
-                com.gemstone.gemfire.test.dunit.Assert.fail("Why was I interrupted?", ex);
+                fail("Why was I interrupted?", ex);
               }
             }
           }
@@ -497,6 +478,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     AsyncInvocation ai0 =
       vm0.invokeAsync(new CacheSerializableRunnable("Populate") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -511,10 +493,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     ThreadUtils.join(ai1, 30 * 1000);
 
     if (ai0.exceptionOccurred()) {
-      com.gemstone.gemfire.test.dunit.Assert.fail("ai0 failed", ai0.getException());
+      fail("ai0 failed", ai0.getException());
 
     } else if (ai1.exceptionOccurred()) {
-      com.gemstone.gemfire.test.dunit.Assert.fail("ai1 failed", ai1.getException());
+      fail("ai1 failed", ai1.getException());
     }
   }
 
@@ -522,7 +504,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that doing a distributed get results in a
    * <code>netSearch</code>.
    */
-  public void testDistributedGet() {
+  @Test
+  public void testDistributedGet() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -534,6 +517,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm1 = host.getVM(1);
 
     vm0.invoke(new CacheSerializableRunnable("Populate region") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           region.put(key, value);
@@ -541,6 +525,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     SerializableRunnable get = new CacheSerializableRunnable("Distributed get") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           assertEquals(value, region.get(key));
@@ -556,15 +541,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * in one VM does not effect a region in a different VM that does
    * not have that key defined.
    */
-  public void testDistributedPutNoUpdate()
-    throws InterruptedException {
-
+  @Test
+  public void testDistributedPutNoUpdate() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -583,6 +568,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     final Object value = "VALUE";
 
     vm0.invoke(new CacheSerializableRunnable("Put key/value") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -593,6 +579,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     Thread.sleep(250);
 
     vm1.invoke(new CacheSerializableRunnable("Verify no update") {
+        @Override
         public void run2() throws CacheException {
           Region region = getRootRegion().getSubregion(name);
           Region.Entry entry = region.getEntry(key);
@@ -612,7 +599,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * VM defines that entry.  The first VM updates the entry.  The
    * second VM should see the updated value.
    */
-  public void testDefinedEntryUpdated() {
+  @Test
+  public void testDefinedEntryUpdated() throws Exception {
     final String name = this.getUniqueName();
     final Object key = "KEY";
     final Object oldValue = "OLD_VALUE";
@@ -624,6 +612,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -633,6 +622,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Create and populate") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -640,6 +630,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new CacheSerializableRunnable("Define entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -648,6 +639,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm0.invoke(new CacheSerializableRunnable("Update entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -655,6 +647,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     Invoke.invokeRepeatingIfNecessary(vm1, new CacheSerializableRunnable("Get entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -668,13 +661,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that {@linkplain Region#destroy destroying} an entry is
    * propagated to all VMs that define that entry.
    */
-  public void testDistributedDestroy() throws InterruptedException {
+  @Test
+  public void testDistributedDestroy() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
 //DebuggerSupport.waitForJavaDebugger(getLogWriter(), " about to create region");
             Region region = createRegion(name);
@@ -699,6 +694,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable put =
       new CacheSerializableRunnable("Put key/value") {
+          @Override
           public void run2() throws CacheException {
 //DebuggerSupport.waitForJavaDebugger(getLogWriter(), " about to put");
             Region region =
@@ -716,6 +712,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable verifyPut =
       new CacheSerializableRunnable("Verify Put") {
+          @Override
           public void run2() throws CacheException {
             Region root = getRootRegion();
             assertTrue(!root.isDestroyed());
@@ -731,6 +728,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm2.invoke(verifyPut);
 
     vm0.invoke(new CacheSerializableRunnable("Destroy Entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -741,6 +739,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     CacheSerializableRunnable verifyDestroy =
       new CacheSerializableRunnable("Verify entry destruction") {
+          @Override
           public void run2() throws CacheException {
             Region root = getRootRegion();
             assertTrue(!root.isDestroyed());
@@ -758,15 +757,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that {@linkplain Region#destroy destroying} a region is
    * propagated to all VMs that define that region.
    */
-  public void testDistributedRegionDestroy()
-    throws InterruptedException {
-
+  @Test
+  public void testDistributedRegionDestroy() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -778,6 +777,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm0 = host.getVM(0);
 
     vm0.invoke(new CacheSerializableRunnable("Destroy Region") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -787,11 +787,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     Invoke.invokeInEveryVM(new CacheSerializableRunnable("Verify region destruction") {
+      @Override
       public void run2() throws CacheException {
         WaitCriterion ev = new WaitCriterion() {
+          @Override
           public boolean done() {
             return getRootRegion().getSubregion(name) == null;
           }
+          @Override
           public String description() {
             return "Waiting for region " + name + " to be destroyed";
           }
@@ -807,10 +810,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a {@linkplain Region#localDestroy} does not effect
    * other VMs that define that entry.
    */
-  public void testLocalDestroy() throws InterruptedException {
-    if (!supportsLocalDestroyAndLocalInvalidate()) {
-      return;
-    }
+  @Test
+  public void testLocalDestroy() throws Exception {
+    assumeTrue(supportsLocalDestroyAndLocalInvalidate());
+
     // test not valid for persistBackup region since they have to be
     // mirrored KEYS_VALUES
     if (getRegionAttributes().getDataPolicy().withPersistence()) return;
@@ -821,6 +824,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -840,6 +844,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable put =
       new CacheSerializableRunnable("Put key/value") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -853,6 +858,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     Thread.sleep(250);
 
     vm0.invoke(new CacheSerializableRunnable("Local Destroy Entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -864,6 +870,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable verify =
       new CacheSerializableRunnable("Verify entry existence") {
+          @Override
           public void run2() throws CacheException {
             Region region = getRootRegion().getSubregion(name);
             assertNotNull(region.getEntry(key));
@@ -876,15 +883,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a {@link Region#localDestroyRegion} is not propagated
    * to other VMs that define that region.
    */
-  public void testLocalRegionDestroy()
-    throws InterruptedException {
-
+  @Test
+  public void testLocalRegionDestroy() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -900,6 +907,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     Thread.sleep(250);
 
     vm0.invoke(new CacheSerializableRunnable("Local Destroy Region") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -911,6 +919,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable verify =
       new CacheSerializableRunnable("Verify region existence") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -924,13 +933,15 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that {@linkplain Region#invalidate invalidating} an entry is
    * propagated to all VMs that define that entry.
    */
-  public void testDistributedInvalidate() {
+  @Test
+  public void testDistributedInvalidate() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -952,6 +963,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable put =
       new CacheSerializableRunnable("Put key/value") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -965,6 +977,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm2.invoke(put);
 
     vm0.invoke(new CacheSerializableRunnable("Invalidate Entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -975,6 +988,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     CacheSerializableRunnable verify =
       new CacheSerializableRunnable("Verify entry invalidation") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -999,7 +1013,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that {@linkplain Region#invalidate invalidating} an entry
    * in multiple VMs does not cause any problems.
    */
-  public void testDistributedInvalidate4() throws InterruptedException {
+  @Test
+  public void testDistributedInvalidate4() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -1008,6 +1023,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -1022,6 +1038,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable put =
         new CacheSerializableRunnable("put entry") {
+            @Override
             public void run2() throws CacheException {
               Region region =
                   getRootRegion().getSubregion(name);
@@ -1037,6 +1054,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
       SerializableRunnable invalidate =
       new CacheSerializableRunnable("Invalidate Entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1052,6 +1070,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable verify =
       new CacheSerializableRunnable("Verify entry invalidation") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -1071,17 +1090,17 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that {@linkplain Region#invalidateRegion invalidating} a
    * region is propagated to all VMs that define that entry.
    */
-  public void testDistributedRegionInvalidate()
-    throws InterruptedException {
-    if (!supportsSubregions()) {
-      return;
-    }
+  @Test
+  public void testDistributedRegionInvalidate() throws Exception {
+    assumeTrue(supportsSubregions());
+
     final String name = this.getUniqueName();
     final String subname = "sub";
     final boolean useSubs = getRegionAttributes().getPartitionAttributes() == null;
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             Region region;
             region = createRegion(name);
@@ -1100,6 +1119,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable put =
       new CacheSerializableRunnable("Put key/value") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -1122,6 +1142,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm0 = host.getVM(0);
 
     vm0.invoke(new CacheSerializableRunnable("Invalidate Region") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1131,6 +1152,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     CacheSerializableRunnable verify =
       new CacheSerializableRunnable("Verify region invalidation") {
+          @Override
           public void run2() throws CacheException {
             Region region =
               getRootRegion().getSubregion(name);
@@ -1165,7 +1187,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a {@link CacheListener} is invoked in a remote VM.
    */
   @Category(FlakyTest.class) // GEODE-153 & GEODE-932: time sensitive, waitForInvocation (waitForCriterion), 3 second timeouts
-  public void testRemoteCacheListener() throws InterruptedException {
+  @Test
+  public void testRemoteCacheListener() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -1177,6 +1200,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable populate =
       new CacheSerializableRunnable("Create Region and Put") {
+          @Override
           public void run2() throws CacheException {
             Region region = createRegion(name);
             region.put(key, oldValue);
@@ -1191,10 +1215,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(populate);
 
     vm1.invoke(new CacheSerializableRunnable("Set listener") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterUpdate2(EntryEvent event) {
                 assertEquals(Operation.UPDATE, event.getOperation());
                 assertEquals(region, event.getRegion());
@@ -1219,7 +1245,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                 try {
                   assertEquals(newValue, DataSerializer.readObject(dis));
                 } catch (Exception e) {
-                  com.gemstone.gemfire.test.dunit.Assert.fail("Unexpected Exception", e);
+                  fail("Unexpected Exception", e);
                 }
               }
             };
@@ -1238,6 +1264,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // If needed then do a flushIfNecessary(region) after adding the cache listener
 
     vm0.invoke(new CacheSerializableRunnable("Update") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1246,6 +1273,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Update") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
 
@@ -1253,6 +1281,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterInvalidate2(EntryEvent event) {
                 assertEquals(Operation.INVALIDATE, event.getOperation());
                 assertEquals(region, event.getRegion());
@@ -1272,7 +1301,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                 try {
                   assertEquals(newValue, DataSerializer.readObject(dis));
                 } catch (Exception e) {
-                  com.gemstone.gemfire.test.dunit.Assert.fail("Unexpected Exception", e);
+                  fail("Unexpected Exception", e);
                 }
               }
             };
@@ -1281,6 +1310,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Invalidate") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1289,6 +1319,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Invalidate") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
 
@@ -1296,6 +1327,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterDestroy2(EntryEvent event) {
                 assertTrue(event.getOperation().isDestroy());
                 assertEquals(region, event.getRegion());
@@ -1319,6 +1351,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1327,6 +1360,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Destroy") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
 
@@ -1334,6 +1368,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterRegionInvalidate2(RegionEvent event) {
                 assertEquals(Operation.REGION_INVALIDATE, event.getOperation());
                 assertEquals(region, event.getRegion());
@@ -1348,6 +1383,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Invalidate Region") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1356,6 +1392,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Invalidate Region") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
 
@@ -1363,6 +1400,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterRegionDestroy2(RegionEvent event) {
                 assertEquals(Operation.REGION_DESTROY, event.getOperation());
                 assertEquals(region, event.getRegion());
@@ -1377,6 +1415,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy Region") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1385,26 +1424,27 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Destroy Region") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
         }
       });
   }
 
-
   /**
    * Tests that a {@link CacheListener} is invoked in a remote VM.
    */
-  public void testRemoteCacheListenerInSubregion() throws InterruptedException {
-    if (!supportsSubregions()) {
-      return;
-    }
+  @Test
+  public void testRemoteCacheListenerInSubregion() throws Exception {
+    assumeTrue(supportsSubregions());
+
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -1415,6 +1455,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     final VM vm1 = host.getVM(1);
 
     vm0.invoke(new CacheSerializableRunnable("Create Root") {
+      @Override
       public void run2() throws CacheException {
         createRootRegion();
       }
@@ -1423,10 +1464,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm1.invoke(new CacheSerializableRunnable("Set listener") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterRegionInvalidate2(RegionEvent event) {
                 assertEquals(Operation.REGION_INVALIDATE, event.getOperation());
                 assertEquals(region, event.getRegion());
@@ -1441,12 +1484,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Invalidate Root Region") {
+        @Override
         public void run2() throws CacheException {
           getRootRegion().invalidateRegion(getSystem().getDistributedMember());
         }
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Invalidate Region") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
 
@@ -1454,6 +1499,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           final Region region =
             getRootRegion().getSubregion(name);
           listener = new TestCacheListener() {
+              @Override
               public void afterRegionDestroy2(RegionEvent event) {
                 assertEquals(Operation.REGION_DESTROY, event.getOperation());
                 assertEquals(region, event.getRegion());
@@ -1468,12 +1514,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy Root Region") {
+        @Override
         public void run2() throws CacheException {
           getRootRegion().destroyRegion(getSystem().getDistributedMember());
         }
       });
 
     vm1.invoke(new CacheSerializableRunnable("Verify Destroy Region") {
+        @Override
         public void run2() throws CacheException {
           listener.waitForInvocation(3000, 10);
         }
@@ -1493,10 +1541,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a {@link CacheLoader} is invoked in a remote VM.  This
    * essentially tests <code>netLoad</code>.
    */
-  public void testRemoteCacheLoader() throws InterruptedException {
-    if (!supportsNetLoad()) {
-      return;
-    }
+  @Test
+  public void testRemoteCacheLoader() throws Exception {
+    assumeTrue(supportsNetLoad());
+
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -1505,6 +1553,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -1520,10 +1569,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
 
     vm1.invoke(new CacheSerializableRunnable("Set CacheLoader") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           loader = new TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 assertEquals(region, helper.getRegion());
@@ -1538,6 +1589,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Remote load") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1546,6 +1598,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new SerializableRunnable("Verify loader") {
+        @Override
         public void run() {
           assertTrue(loader.wasInvoked());
         }
@@ -1556,10 +1609,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that the parameter passed to a remote {@link CacheLoader}
    * is actually passed.
    */
-  public void testRemoteCacheLoaderArg() throws InterruptedException {
-    if (!supportsNetLoad()) {
-      return;
-    }
+  @Test
+  public void testRemoteCacheLoaderArg() throws Exception {
+    assumeTrue(supportsNetLoad());
+
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -1569,6 +1622,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
             // Can't test non-Serializable callback argument here
@@ -1587,10 +1641,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm1.invoke(new CacheSerializableRunnable("Set CacheLoader") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           loader = new TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 assertEquals(region, helper.getRegion());
@@ -1606,6 +1662,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Remote load") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1627,6 +1684,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new SerializableRunnable("Verify loader") {
+        @Override
         public void run() {
           assertTrue(loader.wasInvoked());
         }
@@ -1637,24 +1695,23 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a remote {@link CacheLoader} that throws a {@link
    * CacheLoaderException} results is propagated back to the caller.
    */
-  public void testRemoteCacheLoaderException() throws InterruptedException {
-    if (!supportsNetLoad()) {
-      return;
-    }
+  @Test
+  public void testRemoteCacheLoaderException() throws Exception {
+    assumeTrue(supportsNetLoad());
+
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
     final Object key = "KEY";
-//    final Object value = "VALUE";
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
         };
 
-
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1663,10 +1720,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm1.invoke(new CacheSerializableRunnable("Set CacheLoader") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           loader = new TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 assertEquals(region, helper.getRegion());
@@ -1683,6 +1742,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Remote load") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1697,23 +1757,21 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new SerializableRunnable("Verify loader") {
+        @Override
         public void run() {
           assertTrue(loader.wasInvoked());
         }
       });
   }
 
+  @Test
+  public void testCacheLoaderWithNetSearch() throws Exception {
+    assumeTrue(supportsNetLoad());
 
-  public void testCacheLoaderWithNetSearch() throws CacheException {
-    if (!supportsNetLoad()) {
-      return;
-    }
     // some tests use mirroring by default (e.g. persistBackup regions)
     // if so, then this test won't work right
-    if (getRegionAttributes().getDataPolicy().withReplication()
-        || getRegionAttributes().getDataPolicy().isPreloaded()) {
-      return;
-    }
+    assumeFalse(getRegionAttributes().getDataPolicy().withReplication());
+    assumeFalse(getRegionAttributes().getDataPolicy().isPreloaded());
 
     final String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -1723,20 +1781,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // use vm on other gemfire system
     VM vm1 = host.getVM(1);
     vm1.invoke(new CacheSerializableRunnable("set remote value") {
+      @Override
       public void run2() throws CacheException {
-//        final TestCacheLoader remoteloader = new TestCacheLoader() {
-//            public Object load2(LoaderHelper helper)
-//              throws CacheLoaderException {
-//
-//              assertIndexDetailsEquals(key, helper.getKey());
-//              assertIndexDetailsEquals(name, helper.getRegion().getName());
-//              return value;
-//            }
-//          };
-//
-//        AttributesFactory factory =
-//          new AttributesFactory(getRegionAttributes());
-//        factory.setCacheLoader(remoteloader);
         Region rgn = createRegion(name);
         rgn.put(key, value);
         flushIfNecessary(rgn);
@@ -1744,6 +1790,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     });
 
     final TestCacheLoader loader1 = new TestCacheLoader() {
+        @Override
         public Object load2(LoaderHelper helper)
           throws CacheLoaderException {
 
@@ -1756,7 +1803,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
             assertEquals(value, result);
             return result;
           } catch (TimeoutException ex) {
-            com.gemstone.gemfire.test.dunit.Assert.fail("Why did I time out?", ex);
+            fail("Why did I time out?", ex);
           }
           return null;
         }
@@ -1779,13 +1826,13 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     // make sure value is still there in vm1
     vm1.invoke(new CacheSerializableRunnable("verify remote value") {
+      @Override
       public void run2() throws CacheException {
         Region rgn = getRootRegion().getSubregion(name);
         assertEquals(value, rgn.getEntry(key).getValue());
       }
     });
 
-//    com.gemstone.gemfire.internal.util.DebuggerSupport.waitForJavaDebugger(getLogWriter());
     assertEquals(value, region.get(key));
     // if global scope, then a netSearch is done BEFORE the loader is invoked,
     // so we get the value but the loader is never invoked.
@@ -1798,18 +1845,13 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     assertEquals(value, region.getEntry(key).getValue());
   }
 
-
-  public void testCacheLoaderWithNetLoad() throws CacheException {
-
-
+  @Test
+  public void testCacheLoaderWithNetLoad() throws Exception {
     // replicated regions and partitioned regions make no sense for this
     // test
-    if (getRegionAttributes().getDataPolicy().withReplication() ||
-        getRegionAttributes().getDataPolicy().isPreloaded() ||
-        getRegionAttributes().getPartitionAttributes() != null)
-    {
-      return;
-    }
+    assumeFalse(getRegionAttributes().getDataPolicy().withReplication());
+    assumeFalse(getRegionAttributes().getDataPolicy().isPreloaded());
+    assumeTrue(getRegionAttributes().getPartitionAttributes() == null);
 
     final String name = this.getUniqueName();
     final Object key = this.getUniqueName();
@@ -1819,8 +1861,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // use vm on other gemfire system
     VM vm1 = host.getVM(1);
     vm1.invoke(new CacheSerializableRunnable("set up remote loader") {
+      @Override
       public void run2() throws CacheException {
         final TestCacheLoader remoteloader = new TestCacheLoader() {
+            @Override
             public Object load2(LoaderHelper helper)
               throws CacheLoaderException {
 
@@ -1838,6 +1882,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     });
 
     final TestCacheLoader loader1 = new TestCacheLoader() {
+        @Override
         public Object load2(LoaderHelper helper)
           throws CacheLoaderException {
 
@@ -1850,7 +1895,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
             assertEquals(value, result);
             return result;
           } catch (TimeoutException ex) {
-            com.gemstone.gemfire.test.dunit.Assert.fail("Why did I time out?", ex);
+            fail("Why did I time out?", ex);
           }
           return null;
         }
@@ -1871,7 +1916,6 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     assertNotNull(entry);
     assertNull(entry.getValue());
 
-//    com.gemstone.gemfire.internal.util.DebuggerSupport.waitForJavaDebugger(getLogWriter());
     assertEquals(value, region.get(key));
 
     assertTrue(loader1.wasInvoked());
@@ -1883,15 +1927,16 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that {@link Region#get} returns <code>null</code> when
    * there is no remote loader.
    */
-  public void testNoRemoteCacheLoader() throws InterruptedException {
+  @Test
+  public void testNoRemoteCacheLoader() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
     final Object key = "KEY";
-//    final Object value = "VALUE";
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -1904,6 +1949,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Remote load") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -1917,19 +1963,21 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * the remote region has an invalid entry (that is, a key, but no
    * value).
    */
-  public void testNoLoaderWithInvalidEntry() {
-    if (!supportsNetLoad()) {
-      return;
-    }
+  @Test
+  public void testNoLoaderWithInvalidEntry() throws Exception {
+    assumeTrue(supportsNetLoad());
+
     final String name = this.getUniqueName();
     final Object key = "KEY";
     final Object value = "VALUE";
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             Region region = createRegion(name);
             loader = new TestCacheLoader() {
+                @Override
                 public Object load2(LoaderHelper helper)
                   throws CacheLoaderException {
 
@@ -1949,6 +1997,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     vm1.invoke(new CacheSerializableRunnable("Create invalid entry") {
+      @Override
       public void run2() throws CacheException {
         Region region =
           getRootRegion().getSubregion(name);
@@ -1957,16 +2006,17 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Remote get") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
-// DebuggerSupport.waitForJavaDebugger(getLogWriter());
           assertEquals(value, region.get(key));
           assertTrue(loader.wasInvoked());
         }
       });
 
     vm1.invoke(new SerializableRunnable("Verify loader") {
+        @Override
         public void run() {
           assertFalse(loader.wasInvoked());
         }
@@ -1978,7 +2028,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * <code>CacheWriter</code> arguments and {@link
    * CacheWriterException}s are propagated appropriately.
    */
-  public void testRemoteCacheWriter() throws InterruptedException {
+  @Test
+  public void testRemoteCacheWriter() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -1993,6 +2044,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             Region region = createRegion(name);
 
@@ -2023,10 +2075,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     ////////  Create
 
     vm1.invoke(new CacheSerializableRunnable("Set Writer") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           writer = new TestCacheWriter() {
+              @Override
               public void beforeCreate2(EntryEvent event)
                 throws CacheWriterException {
 
@@ -2056,6 +2110,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Create with Exception") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2076,12 +2131,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
       });
 
     vm0.invoke(new CacheSerializableRunnable("Create with Argument") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2099,6 +2156,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
@@ -2107,10 +2165,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     ////////  Update
 
     vm1.invoke(new CacheSerializableRunnable("Set Writer") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           writer = new TestCacheWriter() {
+              @Override
               public void beforeUpdate2(EntryEvent event)
                 throws CacheWriterException {
 
@@ -2142,6 +2202,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Update with Exception") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2166,12 +2227,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
       });
 
     vm0.invoke(new CacheSerializableRunnable("Update with Argument") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2185,6 +2248,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
@@ -2193,10 +2257,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     ////////  Destroy
 
     vm1.invoke(new CacheSerializableRunnable("Set Writer") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           writer = new TestCacheWriter() {
+              @Override
               public void beforeDestroy2(EntryEvent event)
                 throws CacheWriterException {
 
@@ -2227,6 +2293,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy with Exception") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2246,12 +2313,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy with Argument") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2265,6 +2334,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
        }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
@@ -2273,10 +2343,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     ////////  Region Destroy
 
     vm1.invoke(new CacheSerializableRunnable("Set Writer") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
           writer = new TestCacheWriter() {
+              @Override
               public void beforeRegionDestroy2(RegionEvent event)
                 throws CacheWriterException {
 
@@ -2300,6 +2372,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy with Exception") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2309,7 +2382,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
           } catch (CacheWriterException ex) {
             if (region.isDestroyed()) {
-              com.gemstone.gemfire.test.dunit.Assert.fail("should not have an exception if region is destroyed", ex);
+              fail("should not have an exception if region is destroyed", ex);
             }
             assertEquals(1, region.size());
             if (region.getAttributes().getOffHeap() && !(region instanceof PartitionedRegion)) {
@@ -2321,12 +2394,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
       });
 
     vm0.invoke(new CacheSerializableRunnable("Destroy with Argument") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2341,9 +2416,11 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
             GemFireCacheImpl gfc = (GemFireCacheImpl) getCache();
             final MemoryAllocatorImpl ma = (MemoryAllocatorImpl) gfc.getOffHeapStore();
             WaitCriterion waitForStatChange = new WaitCriterion() {
+              @Override
               public boolean done() {
                 return ma.getStats().getObjects() == 0;
               }
+              @Override
               public String description() {
                 return "never saw off-heap object count go to zero. Last value was " + ma.getStats().getObjects();
               }
@@ -2353,6 +2430,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify callback") {
+        @Override
         public void run() {
           assertTrue(writer.wasInvoked());
         }
@@ -2363,9 +2441,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that, when given a choice, a local <code>CacheWriter</code>
    * is invoked instead of a remote one.
    */
-  public void testLocalAndRemoteCacheWriters()
-    throws InterruptedException {
-
+  @Test
+  public void testLocalAndRemoteCacheWriters() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -2378,18 +2455,23 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm1 = host.getVM(1);
 
     vm0.invoke(new CacheSerializableRunnable("Create \"Local\" Region") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           writer = new TestCacheWriter() {
+              @Override
               public void beforeUpdate2(EntryEvent event)
                 throws CacheWriterException { }
 
+              @Override
               public void beforeCreate2(EntryEvent event)
                 throws CacheWriterException { }
 
+              @Override
               public void beforeDestroy2(EntryEvent event)
                 throws CacheWriterException { }
 
+              @Override
               public void beforeRegionDestroy2(RegionEvent event)
                 throws CacheWriterException { }
           };
@@ -2398,6 +2480,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
    SerializableRunnable create = new CacheSerializableRunnable("Create \"Local\" Region") {
+      @Override
       public void run2() throws CacheException {
         Region region = createRegion(name);
         writer = new TestCacheWriter() { };
@@ -2409,12 +2492,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable verify = new
       SerializableRunnable("Verify no callback") {
+        @Override
         public void run() {
           assertFalse(writer.wasInvoked());
         }
       };
 
     vm0.invoke(new CacheSerializableRunnable("Create entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2425,6 +2510,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(verify);
 
     vm0.invoke(new CacheSerializableRunnable("Update entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2435,6 +2521,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(verify);
 
     vm0.invoke(new CacheSerializableRunnable("Destroy entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2445,6 +2532,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(verify);
 
     vm0.invoke(new CacheSerializableRunnable("Destroy region") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2460,9 +2548,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * argument in place, the change is visible to the
    * <code>CacheWriter</code> even if it is in another VM.
    */
-  public void testCacheLoaderModifyingArgument()
-    throws InterruptedException {
-
+  @Test
+  public void testCacheLoaderModifyingArgument() throws Exception {
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -2473,6 +2560,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create =
       new CacheSerializableRunnable("Create Region") {
+          @Override
           public void run2() throws CacheException {
             createRegion(name);
           }
@@ -2487,10 +2575,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm1.invoke(create);
 
     CacheSerializableRunnable setLoader = new CacheSerializableRunnable("Set CacheLoader") {
+      @Override
       public void run2() throws CacheException {
         final Region region =
           getRootRegion().getSubregion(name);
         loader = new TestCacheLoader() {
+            @Override
             public Object load2(LoaderHelper helper)
               throws CacheLoaderException {
 
@@ -2509,10 +2599,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     // if  this is a partitioned region, we need the loader in both vms
     vm1.invoke(new CacheSerializableRunnable("Conditionally create second loader") {
+      @Override
       public void run2() throws CacheException {
         final Region region = getRootRegion().getSubregion(name);
         if (region.getAttributes().getPartitionAttributes() != null) {
           loader = new TestCacheLoader() {
+            @Override
             public Object load2(LoaderHelper helper)
               throws CacheLoaderException {
 
@@ -2528,9 +2620,11 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     });
 
     vm1.invoke(new CacheSerializableRunnable("Set CacheWriter") {
+        @Override
         public void run2() throws CacheException {
           final Region region = getRootRegion().getSubregion(name);
           writer = new TestCacheWriter() {
+              @Override
               public void beforeCreate2(EntryEvent event)
                 throws CacheWriterException {
 
@@ -2544,6 +2638,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Create entry") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2555,24 +2650,21 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm1.invoke(new CacheSerializableRunnable("Validate callback") {
+        @Override
         public void run2() throws CacheException {
-//          if (getRootRegion().getSubregion(name).getAttributes()
-//              .getPartitionAttributes() == null) { // bug 36500 - remove check when fixed
-            assertTrue(writer.wasInvoked());
-//          }
+          assertTrue(writer.wasInvoked());
         }
       });
   }
 
-
   /**
    * Tests that invoking <code>netSearch</code> in a remote loader
    * returns <code>null</code> instead of causing infinite recursion.
    */
-  public void testRemoteLoaderNetSearch() throws CacheException {
-    if (!supportsNetLoad()) {
-      return;
-    }
+  @Test
+  public void testRemoteLoaderNetSearch() throws Exception {
+    assumeTrue(supportsNetLoad());
+
     assertTrue(getRegionAttributes().getScope().isDistributed());
 
     final String name = this.getUniqueName();
@@ -2584,6 +2676,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm1 = host.getVM(1);
 
     SerializableRunnable create = new CacheSerializableRunnable("Get value") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           assertEquals(value, region.get(key));
@@ -2592,10 +2685,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
 
     vm0.invoke(new CacheSerializableRunnable("Create Region") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           region.getAttributesMutator().setCacheLoader(new
             TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
 
@@ -2603,7 +2698,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
                   assertNull(helper.netSearch(true));
 
                 } catch (TimeoutException ex) {
-                  com.gemstone.gemfire.test.dunit.Assert.fail("Why did I time out?", ex);
+                  fail("Why did I time out?", ex);
                 }
                 return value;
               }
@@ -2617,7 +2712,8 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
   /**
    * Tests that a local loader is preferred to a remote one
    */
-  public void testLocalCacheLoader() {
+  @Test
+  public void testLocalCacheLoader() throws Exception {
     final String name = this.getUniqueName();
     final Object key = "KEY";
     final Object value = "VALUE";
@@ -2627,9 +2723,11 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm1 = host.getVM(1);
 
     SerializableRunnable create = new CacheSerializableRunnable("Create \"remote\" region") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           loader = new TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 if (helper.getRegion().getAttributes().getPartitionAttributes() == null) {
@@ -2647,10 +2745,12 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
 
     vm0.invoke(new CacheSerializableRunnable("Create \"local\" region") {
+        @Override
         public void run2() throws CacheException {
           Region region = createRegion(name);
           region.getAttributesMutator().setCacheLoader(new
             TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 return value;
@@ -2663,6 +2763,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
 
     vm0.invoke(new CacheSerializableRunnable("Get") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2670,6 +2771,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       });
     vm1.invoke(new SerializableRunnable("Verify loader not invoked") {
+        @Override
         public void run() {
           assertFalse(loader.wasInvoked());
         }
@@ -2680,22 +2782,25 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that an entry update is propagated to other caches that
    * have that same entry defined.
    */
+  @Test
   public void testDistributedPut() throws Exception {
     final String rgnName = getUniqueName();
 
     SerializableRunnable create = new SerializableRunnable("testDistributedPut: Create Region") {
+      @Override
       public void run() {
         try {
           createRegion(rgnName);
           getSystem().getLogWriter().info("testDistributedPut: Created Region");
         }
         catch (CacheException e) {
-          com.gemstone.gemfire.test.dunit.Assert.fail("While creating region", e);
+          fail("While creating region", e);
         }
       }
     };
 
     SerializableRunnable newKey = new SerializableRunnable("testDistributedPut: Create Key") {
+      @Override
       public void run() {
         try {
           if (!getRegionAttributes().getDataPolicy().withReplication() &&
@@ -2707,7 +2812,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
          }
         }
         catch (CacheException e) {
-          com.gemstone.gemfire.test.dunit.Assert.fail("While creating region", e);
+          fail("While creating region", e);
         }
       }
     };
@@ -2738,6 +2843,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       getSystem().getLogWriter().info("testDistributedPut: Put Value");
 
       Invoke.invokeInEveryVMRepeatingIfNecessary(new CacheSerializableRunnable("testDistributedPut: Verify Received Value") {
+        @Override
         public void run2() {
           Region rgn1 = getRootRegion().getSubregion(rgnName);
           assertNotNull("Could not find entry for 'key'", rgn1.getEntry("key"));
@@ -2868,11 +2974,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that keys and values are pushed with {@link
    * DataPolicy#REPLICATE}.
    */
-  public void testReplicate() throws InterruptedException {
-    if (!supportsReplication()) {
-      return;
-    }
-    //pauseIfNecessary(100); // wait for previous tearDown to complete
+  @Test
+  public void testReplicate() throws Exception {
+    assumeTrue(supportsReplication());
 
     final String name = this.getUniqueName();
     final Object key1 = "KEY1";
@@ -2892,6 +2996,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create = new
       CacheSerializableRunnable("Create Mirrored Region") {
+        @Override
         public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -2909,6 +3014,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm2.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Put data") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2920,6 +3026,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     Invoke.invokeRepeatingIfNecessary(vm2, new CacheSerializableRunnable("Wait for update") {
+      @Override
       public void run2() throws CacheException {
         Region region = getRootRegion().getSubregion(name);
         assertNotNull(region.getEntry(key1));
@@ -2931,6 +3038,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // Destroy the local entries so we know that they are not found by
     // a netSearch
     vm0.invoke(new CacheSerializableRunnable("Remove local entries") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2940,6 +3048,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     Invoke.invokeRepeatingIfNecessary(vm2, new CacheSerializableRunnable("Verify keys") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -2966,10 +3075,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a newly-created mirrored region contains all of the
    * entries of another region.
    */
-  public void testGetInitialImage() {
-    if (!supportsReplication()) {
-      return;
-    }
+  @Test
+  public void testGetInitialImage() throws Exception {
+    assumeTrue(supportsReplication());
+
     final String name = this.getUniqueName();
     final Object key1 = "KEY1";
     final Object value1 = "VALUE1";
@@ -2984,6 +3093,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create = new
       CacheSerializableRunnable("Create Mirrored Region") {
+        @Override
         public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -2997,10 +3107,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
       };
 
-
     vm0.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Put data") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3015,6 +3125,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // Destroy the local entries so we know that they are not found by
     // a netSearch
     vm0.invoke(new CacheSerializableRunnable("Remove local entries") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3023,6 +3134,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm2.invoke(new CacheSerializableRunnable("Verify keys/values") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3042,18 +3154,18 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
   }
 
-
   private static final int CHUNK_SIZE = 500 * 1024; // == InitialImageOperation.CHUNK_SIZE_IN_BYTES
   private static final int NUM_ENTRIES = 100;
   private static final int VALUE_SIZE = CHUNK_SIZE * 10 / NUM_ENTRIES;
+
   /**
    * Tests that a newly-created mirrored region contains all of the
    * entries of another region, with a large quantity of data.
    */
-  public void testLargeGetInitialImage() {
-    if (!supportsReplication()) {
-      return;
-    }
+  @Test
+  public void testLargeGetInitialImage() throws Exception {
+    assumeTrue(supportsReplication());
+
     final String name = this.getUniqueName();
     final Integer[] keys = new Integer[NUM_ENTRIES];
     final byte[][] values = new byte[NUM_ENTRIES][];
@@ -3070,6 +3182,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     SerializableRunnable create = new
       CacheSerializableRunnable("Create Mirrored Region") {
+        @Override
         public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -3087,6 +3200,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm0.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Put data") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3101,6 +3215,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // Destroy the local entries so we know that they are not found by
     // a netSearch
     vm0.invoke(new CacheSerializableRunnable("Remove local entries") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3109,6 +3224,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm2.invoke(new CacheSerializableRunnable("Verify keys/values") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3129,11 +3245,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a mirrored region gets data pushed to it from a
    * non-mirrored region and the afterCreate event is invoked on a listener.
    */
-  public void testMirroredDataFromNonMirrored()
-    throws InterruptedException {
-    if (!supportsReplication()) {
-      return;
-    }
+  @Test
+  public void testMirroredDataFromNonMirrored() throws Exception {
+    assumeTrue(supportsReplication());
 
     final String name = this.getUniqueName();
     final Object key1 = "KEY1";
@@ -3148,6 +3262,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm2 = host.getVM(2); // use a VM on a different gemfire system
 
     SerializableRunnable create = new CacheSerializableRunnable("Populate non-mirrored region") {
+      @Override
       public void run2() throws CacheException {
         RegionAttributes ra = getRegionAttributes();
         AttributesFactory fac =
@@ -3173,6 +3288,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       List expectedValues = new ArrayList(Arrays.asList(new Object[] {
         value1, value2, value3}));
 
+      @Override
       public synchronized void afterCreate2(EntryEvent event) {
         //getLogWriter().info("Invoking afterCreate2 with key=" + event.getKey());
         int index = expectedKeys.indexOf(event.getKey());
@@ -3185,6 +3301,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     }
 
     vm0.invoke(new CacheSerializableRunnable("Create Mirrored Region") {
+        @Override
         public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -3204,6 +3321,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     // Destroy the local entries so we know that they are not found by
     // a netSearch
     vm2.invoke(new CacheSerializableRunnable("Remove local entries") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3215,6 +3333,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
       });
 
     vm0.invoke(new CacheSerializableRunnable("Verify keys/values and listener") {
+        @Override
         public void run2() throws CacheException {
           Region region =
             getRootRegion().getSubregion(name);
@@ -3247,11 +3366,9 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests that a mirrored region does not push data to a non-mirrored
    * region.
    */
-  public void testNoMirroredDataToNonMirrored()
-    throws InterruptedException {
-    if (!supportsReplication()) {
-      return;
-    }
+  @Test
+  public void testNoMirroredDataToNonMirrored() throws Exception {
+    assumeTrue(supportsReplication());
 
     final String name = this.getUniqueName();
     final Object key1 = "KEY1";
@@ -3266,12 +3383,14 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm2 = host.getVM(2); // use VM on different gemfire system
 
     vm0.invoke(new CacheSerializableRunnable("Create Non-mirrored Region") {
+        @Override
         public void run2() throws CacheException {
           createRegion(name, getRegionAttributes());
         }
       });
 
     SerializableRunnable create = new CacheSerializableRunnable("Populate mirrored region") {
+      @Override
       public void run2() throws CacheException {
         RegionAttributes ra = getRegionAttributes();
         AttributesFactory factory =
@@ -3294,6 +3413,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
     // Make sure that data wasn't pushed
     vm0.invoke(new CacheSerializableRunnable("Verify keys/values") {
+        @Override
         public void run2() throws CacheException {
           final Region region =
             getRootRegion().getSubregion(name);
@@ -3330,10 +3450,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
   /**
    * Tests that a local load occurs, even with mirroring
    */
-  public void testMirroredLocalLoad() {
-    if (!supportsReplication()) {
-      return;
-    }
+  @Test
+  public void testMirroredLocalLoad() throws Exception {
+    assumeTrue(supportsReplication());
+
     final String name = this.getUniqueName();
     final Object key = "KEY";
     final Object value = "VALUE";
@@ -3343,6 +3463,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm2 = host.getVM(2); // use VMs on different gemfire systems
 
     vm0.invoke(new CacheSerializableRunnable("Create region with loader") {
+        @Override
         public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -3353,6 +3474,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           }
           factory.setDataPolicy(DataPolicy.REPLICATE);
           factory.setCacheLoader(new TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 return value;
@@ -3363,6 +3485,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     });
 
     SerializableRunnable create = new CacheSerializableRunnable("Create region with bad loader") {
+      @Override
       public void run2() throws CacheException {
         RegionAttributes ra = getRegionAttributes();
         AttributesFactory factory =
@@ -3373,6 +3496,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
         }
         factory.setDataPolicy(DataPolicy.REPLICATE);
         loader = new TestCacheLoader() {
+          @Override
           public Object load2(LoaderHelper helper)
           throws CacheLoaderException {
 
@@ -3389,6 +3513,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm2.invoke(create);
 
     vm0.invoke(new CacheSerializableRunnable("Get") {
+      @Override
       public void run2() throws CacheException {
        Region region =
          getRootRegion().getSubregion(name);
@@ -3397,6 +3522,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     });
 
     vm2.invoke(new CacheSerializableRunnable("Verify no load") {
+      @Override
       public void run2() throws CacheException {
        assertFalse(loader.wasInvoked());
       }
@@ -3407,10 +3533,10 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
    * Tests sure that a <code>netLoad</code> occurs, even with
    * mirroring
    */
-  public void testMirroredNetLoad() {
-    if (!supportsReplication()) {
-      return;
-    }
+  @Test
+  public void testMirroredNetLoad() throws Exception {
+    assumeTrue(supportsReplication());
+
     final String name = this.getUniqueName();
     final Object key = "KEY";
     final Object value = "VALUE";
@@ -3420,6 +3546,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     VM vm2 = host.getVM(2); // use VMs on different gemfire systems
 
     SerializableRunnable create = new CacheSerializableRunnable("Create region with loader") {
+      @Override
       public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -3430,6 +3557,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
           }
           factory.setDataPolicy(DataPolicy.REPLICATE);
           factory.setCacheLoader(new TestCacheLoader() {
+              @Override
               public Object load2(LoaderHelper helper)
                 throws CacheLoaderException {
                 return value;
@@ -3441,6 +3569,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
 
 
     vm0.invoke(new CacheSerializableRunnable("Create region with bad loader") {
+        @Override
         public void run2() throws CacheException {
           RegionAttributes ra = getRegionAttributes();
           AttributesFactory factory =
@@ -3457,6 +3586,7 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
     vm2.invoke(create);
 
     vm0.invoke(new Cac

<TRUNCATED>


[51/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
GEODE-837: update tests from JUnit3 to JUnit4

* convert JUnit3 tests to use JUnit4 syntax and classes
* remove unused junit3 classes
* rename misnamed tests
* fixup and organize imports
* remove empty or worthless javadocs
* remove deadcode
* update from junit.framework.Assert to org.junit.Assert
* fix exception eating
* add usage of junit Assume
* remove some empty constructors
* increase getRepeatTimeoutMs to 2 minutes
* use getDiskDirs() and getUniqueName() for disk dirs in some tests
* move some setup code from ctor to setup
* change scope of some methods and vars to private
* add TODOs for further cleanup work
* remove some unecessary type casts
* annotate disabled tests with @Ignore and @Test
* change assertEquals with floats to call three arg version
* add some missing categories


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

Branch: refs/heads/develop
Commit: b914df23044db3b5e1b8cbfb5e425df8c88bb4c0
Parents: 7fb8a39
Author: Kirk Lund <kl...@apache.org>
Authored: Thu Jun 9 09:47:37 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Thu Jun 9 10:05:14 2016 -0700

----------------------------------------------------------------------
 convert_one_dunit_to_junit4.pl                  |   41 +
 etc/intellijIdeaCodeStyle.xml                   |  431 ++++-
 .../gemstone/gemfire/modules/SecondVMTest.java  |   46 +-
 .../session/internal/filter/CommonTests.java    |   16 +-
 .../modules/session/TestSessionsBase.java       |   57 +-
 ...stAPIOnRegionFunctionExecutionDUnitTest.java |   18 +-
 .../web/controllers/RestAPITestBase.java        |   65 +-
 .../RestAPIsAndInterOpsDUnitTest.java           |   17 +-
 ...tAPIsOnGroupsFunctionExecutionDUnitTest.java |   23 +-
 ...APIsOnMembersFunctionExecutionDUnitTest.java |   27 +-
 .../RestAPIsQueryAndFEJUnitTest.java            |  306 ++-
 .../controllers/RestAPIsWithSSLDUnitTest.java   |   24 +-
 .../com/gemstone/gemfire/JUnitTestSetup.java    |  143 --
 .../gemstone/gemfire/TestDataSerializer.java    |    2 -
 .../com/gemstone/gemfire/TimingTestCase.java    |   77 -
 .../cache/CacheRegionClearStatsDUnitTest.java   |   43 +-
 .../cache/ClientServerTimeSyncDUnitTest.java    |   17 +-
 .../cache/ConnectionPoolAndLoaderDUnitTest.java |  184 +-
 .../cache/ConnectionPoolAutoDUnitTest.java      |    7 +-
 .../gemfire/cache/ConnectionPoolDUnitTest.java  |  145 +-
 .../ClientServerRegisterInterestsDUnitTest.java |   39 +-
 .../internal/AutoConnectionSourceDUnitTest.java |   23 +-
 .../CacheServerSSLConnectionDUnitTest.java      |   45 +-
 .../internal/LocatorLoadBalancingDUnitTest.java |   20 +-
 .../cache/client/internal/LocatorTestBase.java  |   15 +-
 .../internal/SSLNoClientAuthDUnitTest.java      |   38 +-
 .../management/MemoryThresholdsDUnitTest.java   |  142 +-
 .../MemoryThresholdsOffHeapDUnitTest.java       |  130 +-
 .../management/ResourceManagerDUnitTest.java    |   41 +-
 .../mapInterface/PutAllGlobalLockJUnitTest.java |   39 +-
 .../PartitionRegionHelperDUnitTest.java         |   21 +-
 .../gemfire/cache/query/QueryJUnitTest.java     |    9 +-
 .../gemfire/cache/query/QueryTestUtils.java     |   23 +-
 .../query/dunit/CloseCacheAuthorization.java    |   11 +-
 .../query/dunit/CompactRangeIndexDUnitTest.java |   20 +-
 .../cache/query/dunit/GroupByDUnitImpl.java     |   32 +-
 .../dunit/GroupByPartitionedQueryDUnitTest.java |   13 +-
 .../query/dunit/GroupByQueryDUnitTest.java      |   16 +-
 .../cache/query/dunit/HashIndexDUnitTest.java   |   15 +-
 .../cache/query/dunit/HelperTestCase.java       |   47 +-
 .../dunit/NonDistinctOrderByDUnitImpl.java      |   25 +-
 .../NonDistinctOrderByPartitionedDUnitTest.java |   13 +-
 ...itionedRegionCompactRangeIndexDUnitTest.java |   35 +-
 .../query/dunit/PdxStringQueryDUnitTest.java    |   31 +-
 .../cache/query/dunit/QueryAuthorization.java   |   18 +-
 .../dunit/QueryDataInconsistencyDUnitTest.java  |   26 +-
 .../dunit/QueryIndexUsingXMLDUnitTest.java      |   82 +-
 .../QueryParamsAuthorizationDUnitTest.java      |   17 +-
 .../QueryUsingFunctionContextDUnitTest.java     |   61 +-
 .../query/dunit/QueryUsingPoolDUnitTest.java    |  154 +-
 .../cache/query/dunit/RemoteQueryDUnitTest.java |   79 +-
 ...esourceManagerWithQueryMonitorDUnitTest.java |  133 +-
 .../query/functional/ConstantsJUnitTest.java    |   21 +-
 .../query/functional/CountStarJUnitTest.java    |  535 +++---
 .../query/functional/FunctionJUnitTest.java     |   10 +-
 .../IUMRShuffleIteratorsJUnitTest.java          |  369 ++--
 .../IndexCreationDeadLockJUnitTest.java         |   79 +-
 .../functional/IndexCreationJUnitTest.java      | 1427 +++++++-------
 .../IndexUsageWithAliasAsProjAtrbt.java         |  176 --
 ...IndexUsageWithAliasAsProjAtrbtJUnitTest.java |   92 +-
 .../functional/LikePredicateJUnitTest.java      |   42 +-
 .../cache/query/functional/MiscJUnitTest.java   |  305 +--
 .../query/functional/NestedQueryJUnitTest.java  |   88 +-
 .../query/functional/NumericQueryJUnitTest.java |   42 +-
 .../query/functional/StructSetOrResultsSet.java |   86 +-
 .../query/functional/TestNewFunctionSSorRS.java |  128 --
 .../TestNewFunctionSSorRSIntegrationTest.java   |  128 ++
 .../index/AsynchIndexMaintenanceJUnitTest.java  |   52 +-
 .../index/CompactRangeIndexJUnitTest.java       |   91 +-
 ...rrentIndexInitOnOverflowRegionDUnitTest.java |   19 +-
 ...ndexOperationsOnOverflowRegionDUnitTest.java |   29 +-
 ...pdateWithInplaceObjectModFalseDUnitTest.java |   48 +-
 ...ConcurrentIndexUpdateWithoutWLDUnitTest.java |   61 +-
 .../index/CopyOnReadIndexDUnitTest.java         |   53 +-
 .../DeclarativeIndexCreationJUnitTest.java      |   50 +-
 .../internal/index/EquiJoinIntegrationTest.java |  437 +++++
 .../query/internal/index/EquijoinDUnitTest.java |  437 -----
 .../IndexTrackingQueryObserverDUnitTest.java    |   17 +-
 ...itializeIndexEntryDestroyQueryDUnitTest.java |   19 +-
 .../index/MultiIndexCreationDUnitTest.java      |   17 +-
 ...artitionedRegionEquiJoinIntegrationTest.java |  130 ++
 .../PartitionedRegionEquijoinDUnitTest.java     |  130 --
 .../index/PdxCopyOnReadQueryJUnitTest.java      |   17 +-
 .../index/PutAllWithIndexPerfDUnitTest.java     |   49 +-
 .../PRBasicIndexCreationDUnitTest.java          |   36 +-
 .../PRBasicIndexCreationDeadlockDUnitTest.java  |   15 +-
 .../PRBasicMultiIndexCreationDUnitTest.java     |   34 +-
 .../partitioned/PRBasicQueryDUnitTest.java      |   17 +-
 .../PRBasicRemoveIndexDUnitTest.java            |   59 +-
 .../PRColocatedEquiJoinDUnitTest.java           |   30 +-
 .../partitioned/PRInvalidQueryDUnitTest.java    |   15 +-
 .../partitioned/PRQueryCacheCloseDUnitTest.java |   16 +-
 .../query/partitioned/PRQueryDUnitHelper.java   |   14 +-
 .../query/partitioned/PRQueryDUnitTest.java     |   31 +-
 .../PRQueryRegionCloseDUnitTest.java            |   15 +-
 .../PRQueryRegionDestroyedDUnitTest.java        |   15 +-
 .../PRQueryRemoteNodeExceptionDUnitTest.java    |   31 +-
 .../snapshot/ParallelSnapshotDUnitTest.java     |   18 +-
 .../snapshot/SnapshotByteArrayDUnitTest.java    |   17 +-
 .../cache/snapshot/SnapshotDUnitTest.java       |   19 +-
 .../snapshot/SnapshotPerformanceDUnitTest.java  |   17 +-
 .../gemfire/cache30/Bug34387DUnitTest.java      |   18 +-
 .../gemfire/cache30/Bug34948DUnitTest.java      |   17 +-
 .../gemfire/cache30/Bug35214DUnitTest.java      |   17 +-
 .../gemfire/cache30/Bug38013DUnitTest.java      |   17 +-
 .../gemfire/cache30/Bug38741DUnitTest.java      |   58 +-
 .../gemfire/cache30/CacheCloseDUnitTest.java    |   17 +-
 .../gemfire/cache30/CacheListenerTestCase.java  |   20 +-
 .../gemfire/cache30/CacheLoaderTestCase.java    |   17 +-
 .../gemfire/cache30/CacheLogRollDUnitTest.java  |  144 +-
 .../gemfire/cache30/CacheMapTxnDUnitTest.java   |   73 +-
 ...cheRegionsReliablityStatsCheckDUnitTest.java |   30 +-
 .../cache30/CacheSerializableRunnable.java      |   28 +-
 .../cache30/CacheStatisticsDUnitTest.java       |   20 +-
 .../gemfire/cache30/CacheWriterTestCase.java    |   19 +-
 .../gemfire/cache30/CacheXml30DUnitTest.java    |   93 +-
 .../gemfire/cache30/CacheXml40DUnitTest.java    |   23 +-
 .../gemfire/cache30/CacheXml41DUnitTest.java    |   26 +-
 .../gemfire/cache30/CacheXml45DUnitTest.java    |   62 +-
 .../gemfire/cache30/CacheXml51DUnitTest.java    |   39 +-
 .../gemfire/cache30/CacheXml55DUnitTest.java    |   10 +-
 .../gemfire/cache30/CacheXml57DUnitTest.java    |   63 +-
 .../gemfire/cache30/CacheXml58DUnitTest.java    |   28 +-
 .../gemfire/cache30/CacheXml60DUnitTest.java    |   35 +-
 .../gemfire/cache30/CacheXml61DUnitTest.java    |   40 +-
 .../gemfire/cache30/CacheXml65DUnitTest.java    |   95 +-
 .../gemfire/cache30/CacheXml66DUnitTest.java    |   17 +-
 .../gemfire/cache30/CacheXml70DUnitTest.java    |   21 +-
 .../gemfire/cache30/CacheXml80DUnitTest.java    |   20 +-
 .../gemfire/cache30/CacheXml81DUnitTest.java    |   12 +-
 .../cache30/CacheXmlGeode10DUnitTest.java       |   45 +-
 .../gemfire/cache30/CacheXmlTestCase.java       |   22 +-
 .../gemfire/cache30/CallbackArgDUnitTest.java   |   18 +-
 .../cache30/ClearMultiVmCallBkDUnitTest.java    |  100 +-
 .../gemfire/cache30/ClearMultiVmDUnitTest.java  |   33 +-
 .../cache30/ClientMembershipDUnitTest.java      |   57 +-
 .../ClientMembershipSelectorDUnitTest.java      |    9 +-
 .../ClientRegisterInterestDUnitTest.java        |   49 +-
 ...ClientRegisterInterestSelectorDUnitTest.java |    9 +-
 .../cache30/ClientServerCCEDUnitTest.java       |   53 +-
 .../gemfire/cache30/ClientServerTestCase.java   |   10 +-
 .../ConcurrentLeaveDuringGIIDUnitTest.java      |   17 +-
 ...ibutedNoAckAsyncOverflowRegionDUnitTest.java |   21 +-
 ...iskDistributedNoAckAsyncRegionDUnitTest.java |   18 +-
 .../DiskDistributedNoAckRegionTestCase.java     |   15 +-
 ...ributedNoAckSyncOverflowRegionDUnitTest.java |   23 +-
 .../gemfire/cache30/DiskRegionDUnitTest.java    |   37 +-
 .../gemfire/cache30/DiskRegionTestImpl.java     |   14 +-
 .../cache30/DistAckMapMethodsDUnitTest.java     |   73 +-
 ...istributedAckOverflowRegionCCEDUnitTest.java |   18 +-
 ...tedAckOverflowRegionCCEOffHeapDUnitTest.java |   16 +-
 ...tributedAckPersistentRegionCCEDUnitTest.java |   71 +-
 ...dAckPersistentRegionCCEOffHeapDUnitTest.java |   15 +-
 .../DistributedAckRegionCCEDUnitTest.java       |  117 +-
 ...DistributedAckRegionCCEOffHeapDUnitTest.java |   19 +-
 ...istributedAckRegionCompressionDUnitTest.java |   12 +-
 .../cache30/DistributedAckRegionDUnitTest.java  |   31 +-
 .../DistributedAckRegionOffHeapDUnitTest.java   |   20 +-
 .../DistributedMulticastRegionDUnitTest.java    |   92 +-
 .../DistributedNoAckRegionCCEDUnitTest.java     |   54 +-
 ...stributedNoAckRegionCCEOffHeapDUnitTest.java |   16 +-
 .../DistributedNoAckRegionDUnitTest.java        |   45 +-
 .../DistributedNoAckRegionOffHeapDUnitTest.java |   15 +-
 .../gemfire/cache30/DynamicRegionDUnitTest.java |   17 +-
 .../gemfire/cache30/GlobalLockingDUnitTest.java |   27 +-
 .../cache30/GlobalRegionCCEDUnitTest.java       |   80 +-
 .../GlobalRegionCCEOffHeapDUnitTest.java        |   16 +-
 .../gemfire/cache30/GlobalRegionDUnitTest.java  |   15 +-
 .../cache30/GlobalRegionOffHeapDUnitTest.java   |   30 +-
 .../cache30/LRUEvictionControllerDUnitTest.java |   25 +-
 .../gemfire/cache30/LocalRegionDUnitTest.java   |   17 +-
 .../MemLRUEvictionControllerDUnitTest.java      |   22 +-
 .../gemfire/cache30/MultiVMRegionTestCase.java  | 1752 ++++++++++--------
 .../OffHeapLRUEvictionControllerDUnitTest.java  |   16 +-
 .../PRBucketSynchronizationDUnitTest.java       |   19 +-
 .../PartitionedRegionCompressionDUnitTest.java  |   14 +-
 .../cache30/PartitionedRegionDUnitTest.java     |  171 +-
 ...tionedRegionMembershipListenerDUnitTest.java |   14 +-
 .../PartitionedRegionOffHeapDUnitTest.java      |   20 +-
 .../cache30/PreloadedRegionTestCase.java        |   15 +-
 .../gemfire/cache30/ProxyDUnitTest.java         |   19 +-
 .../cache30/PutAllCallBkRemoteVMDUnitTest.java  |   29 +-
 .../cache30/PutAllCallBkSingleVMDUnitTest.java  |   21 +-
 .../gemfire/cache30/PutAllMultiVmDUnitTest.java |   30 +-
 .../gemfire/cache30/QueueMsgDUnitTest.java      |   65 +-
 .../cache30/RRSynchronizationDUnitTest.java     |   19 +-
 .../gemfire/cache30/ReconnectDUnitTest.java     |   22 +-
 .../ReconnectedCacheServerDUnitTest.java        |   18 +-
 .../cache30/RegionAttributesTestCase.java       |   16 +-
 .../cache30/RegionExpirationDUnitTest.java      |   23 +-
 .../RegionMembershipListenerDUnitTest.java      |   20 +-
 .../RegionReliabilityDistAckDUnitTest.java      |   14 +-
 .../RegionReliabilityDistNoAckDUnitTest.java    |   14 +-
 .../RegionReliabilityGlobalDUnitTest.java       |   14 +-
 .../RegionReliabilityListenerDUnitTest.java     |   31 +-
 .../cache30/RegionReliabilityTestCase.java      |   83 +-
 .../gemfire/cache30/RegionTestCase.java         |   66 +-
 .../gemfire/cache30/ReliabilityTestCase.java    |   23 +-
 .../cache30/RemoveAllMultiVmDUnitTest.java      |   30 +-
 .../gemfire/cache30/RequiredRolesDUnitTest.java |   38 +-
 .../cache30/RolePerformanceDUnitTest.java       |   31 +-
 .../gemfire/cache30/SearchAndLoadDUnitTest.java |   31 +-
 .../gemfire/cache30/SlowRecDUnitTest.java       |  178 +-
 .../gemfire/cache30/TXDistributedDUnitTest.java |   90 +-
 .../gemfire/cache30/TXOrderDUnitTest.java       |   58 +-
 .../cache30/TXRestrictionsDUnitTest.java        |   14 +-
 .../codeAnalysis/ClassAndMethodDetails.java     |   42 +-
 .../DistributedLockServiceDUnitTest.java        |  131 +-
 .../gemfire/distributed/LocatorDUnitTest.java   |   32 +-
 .../gemfire/distributed/RoleDUnitTest.java      |   35 +-
 .../distributed/SystemAdminDUnitTest.java       |   18 +-
 .../distributed/internal/Bug40751DUnitTest.java |   33 +-
 .../ConsoleDistributionManagerDUnitTest.java    |   54 +-
 .../internal/DistributionAdvisorDUnitTest.java  |   21 +-
 .../internal/DistributionManagerDUnitTest.java  |   88 +-
 .../gemfire/distributed/internal/LDM.java       |   12 +-
 .../internal/ProductUseLogDUnitTest.java        |   38 +-
 .../GemFireDeadlockDetectorDUnitTest.java       |   19 +-
 .../messenger/JGroupsMessengerJUnitTest.java    |   69 +-
 .../StreamingOperationManyDUnitTest.java        |   20 +-
 .../StreamingOperationOneDUnitTest.java         |   16 +-
 .../TcpServerBackwardCompatDUnitTest.java       |   31 +-
 .../internal/tcpserver/TcpServerJUnitTest.java  |   47 +-
 .../gemfire/disttx/CacheMapDistTXDUnitTest.java |   15 +-
 .../disttx/DistTXManagerImplJUnitTest.java      |   18 +-
 .../gemfire/disttx/DistTXOrderDUnitTest.java    |   24 +-
 .../disttx/DistTXRestrictionsDUnitTest.java     |   12 +-
 .../disttx/DistTXWithDeltaDUnitTest.java        |   14 +-
 .../disttx/DistributedTransactionDUnitTest.java |  101 +-
 .../gemfire/disttx/PRDistTXDUnitTest.java       |   35 +-
 .../disttx/PRDistTXWithVersionsDUnitTest.java   |   32 +-
 ...entPartitionedRegionWithDistTXDUnitTest.java |   14 +-
 ...wardCompatibilitySerializationDUnitTest.java |   16 +-
 .../ClassNotFoundExceptionDUnitTest.java        |   18 +-
 .../internal/JarClassLoaderJUnitTest.java       |   62 +-
 .../gemfire/internal/JarDeployerDUnitTest.java  |   55 +-
 .../internal/PdxDeleteFieldDUnitTest.java       |   41 +-
 .../gemfire/internal/PdxRenameDUnitTest.java    |   39 +-
 .../gemfire/internal/SSLConfigJUnitTest.java    |   79 +-
 .../gemfire/internal/cache/BackupDUnitTest.java |   27 +-
 .../internal/cache/Bug33359DUnitTest.java       |   24 +-
 .../internal/cache/Bug33726DUnitTest.java       |   21 +-
 .../Bug34179TooManyFilesOpenJUnitTest.java      |   77 +-
 .../internal/cache/Bug37241DUnitTest.java       |   28 +-
 .../internal/cache/Bug37377DUnitTest.java       |   30 +-
 .../internal/cache/Bug39079DUnitTest.java       |  479 +++--
 .../internal/cache/Bug40299DUnitTest.java       |   35 +-
 .../internal/cache/Bug40632DUnitTest.java       |   78 +-
 .../internal/cache/Bug41091DUnitTest.java       |   50 +-
 .../internal/cache/Bug41733DUnitTest.java       |   33 +-
 .../internal/cache/Bug41957DUnitTest.java       |   39 +-
 .../internal/cache/Bug42055DUnitTest.java       |   17 +-
 .../internal/cache/Bug45164DUnitTest.java       |   17 +-
 .../internal/cache/Bug45934DUnitTest.java       |   32 +-
 .../internal/cache/Bug47667DUnitTest.java       |   15 +-
 .../internal/cache/CacheAdvisorDUnitTest.java   |   25 +-
 .../cache/CacheLifecycleListenerJUnitTest.java  |   33 +-
 .../internal/cache/ClearDAckDUnitTest.java      |   48 +-
 .../internal/cache/ClearGlobalDUnitTest.java    |   28 +-
 .../cache/ClientServerGetAllDUnitTest.java      |   55 +-
 ...ServerInvalidAndDestroyedEntryDUnitTest.java |   56 +-
 .../ClientServerTransactionCCEDUnitTest.java    |   14 +-
 .../cache/ClientServerTransactionDUnitTest.java |  127 +-
 .../cache/ComplexDiskRegionJUnitTest.java       |   34 +-
 .../ConcurrentDestroySubRegionDUnitTest.java    |   18 +-
 ...entFlushingAndRegionOperationsJUnitTest.java |   38 +-
 .../cache/ConcurrentMapLocalJUnitTest.java      |   17 +-
 .../cache/ConcurrentMapOpsDUnitTest.java        |  130 +-
 .../ConcurrentRegionOperationsJUnitTest.java    |   40 +-
 ...rentRollingAndRegionOperationsJUnitTest.java |  173 +-
 .../internal/cache/ConflationJUnitTest.java     |  159 +-
 .../cache/ConnectDisconnectDUnitTest.java       |   34 +-
 .../internal/cache/DeltaFaultInDUnitTest.java   |   17 +-
 .../cache/DeltaPropagationDUnitTest.java        |   74 +-
 .../cache/DeltaPropagationStatsDUnitTest.java   |   63 +-
 .../internal/cache/DeltaSizingDUnitTest.java    |   24 +-
 .../cache/DiskOfflineCompactionJUnitTest.java   |   79 +-
 .../internal/cache/DiskOldAPIsJUnitTest.java    |   41 +-
 ...iskRandomOperationsAndRecoveryJUnitTest.java |   38 +-
 .../cache/DiskRegByteArrayDUnitTest.java        |   60 +-
 .../cache/DiskRegCacheXmlJUnitTest.java         |   84 +-
 .../DiskRegCachexmlGeneratorJUnitTest.java      |  124 +-
 .../internal/cache/DiskRegCbkChkJUnitTest.java  |   38 +-
 .../DiskRegOplogSwtchingAndRollerJUnitTest.java |  130 +-
 .../cache/DiskRegRecoveryJUnitTest.java         |  215 +--
 .../cache/DiskRegionAsyncRecoveryJUnitTest.java |   14 +-
 ...RegionChangingRegionAttributesJUnitTest.java |   51 +-
 .../cache/DiskRegionClearJUnitTest.java         |  167 +-
 .../DiskRegionIllegalArguementsJUnitTest.java   |   39 +-
 ...iskRegionIllegalCacheXMLvaluesJUnitTest.java |   58 +-
 .../internal/cache/DiskRegionJUnitTest.java     |  979 ++++------
 .../internal/cache/DiskRegionTestingBase.java   |  154 +-
 .../cache/DiskStoreFactoryJUnitTest.java        |   46 +-
 ...DistrbutedRegionProfileOffHeapDUnitTest.java |   34 +-
 .../cache/DistributedCacheTestCase.java         |   35 +-
 .../internal/cache/EventTrackerDUnitTest.java   |   58 +-
 .../internal/cache/EvictionDUnitTest.java       |   58 +-
 .../cache/EvictionObjectSizerDUnitTest.java     |   21 +-
 .../internal/cache/EvictionStatsDUnitTest.java  |   26 +-
 .../internal/cache/EvictionTestBase.java        |   48 +-
 .../internal/cache/FaultingInJUnitTest.java     |   77 +-
 .../cache/FixedPRSinglehopDUnitTest.java        |   80 +-
 .../internal/cache/GIIDeltaDUnitTest.java       |   40 +-
 .../internal/cache/GIIFlowControlDUnitTest.java |   19 +-
 .../internal/cache/GridAdvisorDUnitTest.java    |   40 +-
 .../HAOverflowMemObjectSizerDUnitTest.java      |   44 +-
 .../cache/IncrementalBackupDUnitTest.java       |   62 +-
 .../cache/InterruptClientServerDUnitTest.java   |   29 +-
 ...InterruptsConserveSocketsFalseDUnitTest.java |   15 +-
 .../internal/cache/InterruptsDUnitTest.java     |   28 +-
 .../internal/cache/IteratorDUnitTest.java       |   18 +-
 .../internal/cache/MapClearGIIDUnitTest.java    |  102 +-
 .../internal/cache/MapInterfaceJUnitTest.java   |   73 +-
 .../MultipleOplogsRollingFeatureJUnitTest.java  |  112 +-
 .../cache/NetSearchMessagingDUnitTest.java      |   40 +-
 .../cache/OffHeapEvictionDUnitTest.java         |   34 +-
 .../cache/OffHeapEvictionStatsDUnitTest.java    |   20 +-
 .../gemfire/internal/cache/OffHeapTestUtil.java |    8 +-
 .../cache/OfflineSnapshotJUnitTest.java         |   28 +-
 .../gemfire/internal/cache/OplogJUnitTest.java  |   32 +-
 .../cache/P2PDeltaPropagationDUnitTest.java     |   52 +-
 .../internal/cache/PRBadToDataDUnitTest.java    |   17 +-
 .../cache/PRDataStoreMemoryJUnitTest.java       |   27 +-
 .../cache/PartitionListenerDUnitTest.java       |   17 +-
 ...dRegionAPIConserveSocketsFalseDUnitTest.java |   20 +-
 .../cache/PartitionedRegionAPIDUnitTest.java    |   23 +-
 .../PartitionedRegionAsSubRegionDUnitTest.java  |   17 +-
 ...gionBucketCreationDistributionDUnitTest.java |   65 +-
 .../PartitionedRegionCacheCloseDUnitTest.java   |   15 +-
 ...rtitionedRegionCacheLoaderForRootRegion.java |   18 +-
 ...artitionedRegionCacheLoaderForSubRegion.java |   17 +-
 ...rtitionedRegionCacheXMLExampleDUnitTest.java |   27 +-
 .../PartitionedRegionCreationDUnitTest.java     |   23 +-
 .../cache/PartitionedRegionDUnitTestCase.java   |   25 +-
 ...rtitionedRegionDelayedRecoveryDUnitTest.java |   19 +-
 .../PartitionedRegionDestroyDUnitTest.java      |   15 +-
 .../PartitionedRegionEntryCountDUnitTest.java   |   17 +-
 .../PartitionedRegionEvictionDUnitTest.java     |   70 +-
 .../cache/PartitionedRegionHADUnitTest.java     |   17 +-
 ...onedRegionHAFailureAndRecoveryDUnitTest.java |   17 +-
 .../PartitionedRegionInvalidateDUnitTest.java   |   19 +-
 ...artitionedRegionLocalMaxMemoryDUnitTest.java |   19 +-
 ...nedRegionLocalMaxMemoryOffHeapDUnitTest.java |   16 +-
 .../PartitionedRegionMultipleDUnitTest.java     |   17 +-
 ...rtitionedRegionOffHeapEvictionDUnitTest.java |   19 +-
 .../cache/PartitionedRegionPRIDDUnitTest.java   |   15 +-
 .../cache/PartitionedRegionQueryDUnitTest.java  |   28 +-
 ...artitionedRegionRedundancyZoneDUnitTest.java |   72 +-
 ...tionedRegionSerializableObjectJUnitTest.java |   51 +-
 .../PartitionedRegionSingleHopDUnitTest.java    |  235 ++-
 ...RegionSingleHopWithServerGroupDUnitTest.java |  215 +--
 .../cache/PartitionedRegionSizeDUnitTest.java   |   18 +-
 .../cache/PartitionedRegionStatsDUnitTest.java  |   19 +-
 .../PartitionedRegionTestUtilsDUnitTest.java    |   34 +-
 .../PartitionedRegionWithSameNameDUnitTest.java |   24 +-
 .../internal/cache/PutAllDAckDUnitTest.java     |   25 +-
 .../internal/cache/PutAllGlobalDUnitTest.java   |   27 +-
 .../cache/RegionEntryFlagsJUnitTest.java        |    9 +-
 .../cache/RemoteTransactionCCEDUnitTest.java    |   17 +-
 .../cache/RemoteTransactionDUnitTest.java       |  177 +-
 .../internal/cache/RemoveAllDAckDUnitTest.java  |   22 +-
 .../internal/cache/RemoveDAckDUnitTest.java     |   28 +-
 .../internal/cache/RemoveGlobalDUnitTest.java   |   28 +-
 .../cache/SimpleDiskRegionJUnitTest.java        |   16 +-
 .../internal/cache/SingleHopStatsDUnitTest.java |   60 +-
 .../internal/cache/SizingFlagDUnitTest.java     |   35 +-
 .../internal/cache/SystemFailureDUnitTest.java  |  152 +-
 .../gemfire/internal/cache/TestDelta.java       |  112 +-
 .../cache/TransactionsWithDeltaDUnitTest.java   |   19 +-
 .../cache/control/MemoryMonitorJUnitTest.java   |   52 +-
 .../control/RebalanceOperationDUnitTest.java    |  124 +-
 ...skRegOverflowAsyncGetInMemPerfJUnitTest.java |   40 +-
 ...iskRegOverflowAsyncJUnitPerformanceTest.java |   55 +-
 ...lowSyncGetInMemPerfJUnitPerformanceTest.java |   53 +-
 ...DiskRegOverflowSyncJUnitPerformanceTest.java |   65 +-
 ...egionOverflowAsyncRollingOpLogJUnitTest.java |   67 +-
 ...RegionOverflowSyncRollingOpLogJUnitTest.java |   14 +-
 .../DiskRegionPerfJUnitPerformanceTest.java     |   78 +-
 .../DiskRegionPersistOnlySyncJUnitTest.java     |   45 +-
 ...DiskRegionRollOpLogJUnitPerformanceTest.java |   90 +-
 .../cache/execute/Bug51193DUnitTest.java        |   56 +-
 .../ClientServerFunctionExecutionDUnitTest.java |   29 +-
 .../execute/ColocationFailoverDUnitTest.java    |   19 +-
 ...ributedRegionFunctionExecutionDUnitTest.java |   96 +-
 .../FunctionExecution_ExceptionDUnitTest.java   |   23 +-
 .../execute/FunctionServiceStatsDUnitTest.java  |   90 +-
 .../cache/execute/LocalDataSetDUnitTest.java    |   25 +-
 .../execute/LocalDataSetIndexingDUnitTest.java  |   17 +-
 .../LocalFunctionExecutionDUnitTest.java        |   23 +-
 .../MemberFunctionExecutionDUnitTest.java       |   69 +-
 .../MultiRegionFunctionExecutionDUnitTest.java  |   27 +-
 .../OnGroupsFunctionExecutionDUnitTest.java     |   66 +-
 ...ntServerFunctionExecutionNoAckDUnitTest.java |   16 +-
 ...tServerRegionFunctionExecutionDUnitTest.java |   41 +-
 ...egionFunctionExecutionFailoverDUnitTest.java |   85 +-
 ...onFunctionExecutionNoSingleHopDUnitTest.java |   35 +-
 ...onExecutionSelectorNoSingleHopDUnitTest.java |   33 +-
 ...gionFunctionExecutionSingleHopDUnitTest.java |   76 +-
 .../cache/execute/PRClientServerTestBase.java   |   55 +-
 .../cache/execute/PRColocationDUnitTest.java    |   38 +-
 .../execute/PRCustomPartitioningDUnitTest.java  |   17 +-
 .../execute/PRFunctionExecutionDUnitTest.java   |  215 ++-
 .../PRFunctionExecutionTimeOutDUnitTest.java    |   21 +-
 ...ctionExecutionWithResultSenderDUnitTest.java |   22 +-
 .../execute/PRPerformanceTestDUnitTest.java     |   17 +-
 .../cache/execute/PRTransactionDUnitTest.java   |   36 +-
 .../PRTransactionWithVersionsDUnitTest.java     |   14 +-
 .../cache/execute/PerformanceTestFunction.java  |    6 +-
 .../execute/SingleHopGetAllPutAllDUnitTest.java |   16 +-
 .../cache/ha/BlockingHARegionJUnitTest.java     |  525 +++---
 .../cache/ha/Bug36853EventsExpiryDUnitTest.java |   81 +-
 .../internal/cache/ha/Bug48571DUnitTest.java    |   49 +-
 .../internal/cache/ha/Bug48879DUnitTest.java    |   26 +-
 .../cache/ha/EventIdOptimizationDUnitTest.java  |   54 +-
 .../internal/cache/ha/FailoverDUnitTest.java    |   76 +-
 .../internal/cache/ha/HABugInPutDUnitTest.java  |   57 +-
 .../internal/cache/ha/HAClearDUnitTest.java     |   62 +-
 .../cache/ha/HAConflationDUnitTest.java         |   66 +-
 .../internal/cache/ha/HADuplicateDUnitTest.java |   68 +-
 .../cache/ha/HAEventIdPropagationDUnitTest.java |  117 +-
 .../internal/cache/ha/HAExpiryDUnitTest.java    |   22 +-
 .../internal/cache/ha/HAGIIBugDUnitTest.java    |   36 +-
 .../internal/cache/ha/HAGIIDUnitTest.java       |  154 +-
 .../cache/ha/HARQAddOperationJUnitTest.java     |  188 +-
 .../cache/ha/HARQueueNewImplDUnitTest.java      |  297 ++-
 .../internal/cache/ha/HARegionDUnitTest.java    |   34 +-
 .../internal/cache/ha/HARegionJUnitTest.java    |  178 +-
 .../cache/ha/HARegionQueueDUnitTest.java        |  473 ++---
 .../cache/ha/HARegionQueueJUnitTest.java        |  684 +++----
 .../cache/ha/HASlowReceiverDUnitTest.java       |   35 +-
 .../ha/OperationsPropagationDUnitTest.java      |  149 +-
 .../internal/cache/ha/PutAllDUnitTest.java      |   56 +-
 .../internal/cache/ha/StatsBugDUnitTest.java    |   73 +-
 .../cache/ha/ThreadIdentifierJUnitTest.java     |    2 -
 .../cache/locks/TXLockServiceDUnitTest.java     |   61 +-
 .../internal/cache/lru/LRUClockJUnitTest.java   |  293 ++-
 .../cache/partitioned/Bug39356DUnitTest.java    |   25 +-
 .../cache/partitioned/Bug43684DUnitTest.java    |   60 +-
 .../cache/partitioned/Bug47388DUnitTest.java    |   68 +-
 .../cache/partitioned/Bug51400DUnitTest.java    |   39 +-
 .../partitioned/ElidedPutAllDUnitTest.java      |   17 +-
 .../partitioned/PartitionResolverDUnitTest.java |   31 +-
 .../PartitionedRegionLoaderWriterDUnitTest.java |   27 +-
 ...rtitionedRegionMetaDataCleanupDUnitTest.java |   19 +-
 .../partitioned/PersistPRKRFDUnitTest.java      |   15 +-
 ...tentColocatedPartitionedRegionDUnitTest.java |   28 +-
 .../PersistentPartitionedRegionDUnitTest.java   |  118 +-
 ...tentPartitionedRegionOldConfigDUnitTest.java |   14 +-
 .../PersistentPartitionedRegionTestBase.java    |   20 +-
 ...rtitionedRegionWithTransactionDUnitTest.java |   15 +-
 .../cache/partitioned/ShutdownAllDUnitTest.java |   51 +-
 ...treamingPartitionOperationManyDUnitTest.java |   17 +-
 ...StreamingPartitionOperationOneDUnitTest.java |   17 +-
 .../fixed/FixedPartitioningDUnitTest.java       |   41 +-
 .../fixed/FixedPartitioningTestBase.java        |   66 +-
 ...ngWithColocationAndPersistenceDUnitTest.java |   26 +-
 .../persistence/BackupInspectorJUnitTest.java   |    9 +-
 .../PersistentRVVRecoveryDUnitTest.java         |   27 +-
 .../PersistentRecoveryOrderDUnitTest.java       |  152 +-
 ...rsistentRecoveryOrderOldConfigDUnitTest.java |   14 +-
 .../PersistentReplicatedTestBase.java           |   23 +-
 .../GFSnapshotJUnitPerformanceTest.java         |   32 +-
 .../internal/cache/tier/Bug40396DUnitTest.java  |   20 +-
 ...mpatibilityHigherVersionClientDUnitTest.java |   46 +-
 .../cache/tier/sockets/Bug36269DUnitTest.java   |   85 +-
 .../cache/tier/sockets/Bug36457DUnitTest.java   |   47 +-
 .../cache/tier/sockets/Bug36805DUnitTest.java   |   44 +-
 .../cache/tier/sockets/Bug36829DUnitTest.java   |   78 +-
 .../cache/tier/sockets/Bug36995DUnitTest.java   |   76 +-
 .../cache/tier/sockets/Bug37210DUnitTest.java   |   55 +-
 .../cache/tier/sockets/Bug37805DUnitTest.java   |   31 +-
 .../CacheServerMaxConnectionsJUnitTest.java     |  129 +-
 .../cache/tier/sockets/CacheServerTestUtil.java |  234 +--
 .../CacheServerTransactionsDUnitTest.java       |   73 +-
 ...acheServerTransactionsSelectorDUnitTest.java |   14 +-
 .../tier/sockets/ClearPropagationDUnitTest.java |   52 +-
 .../tier/sockets/ClientConflationDUnitTest.java |   52 +-
 .../sockets/ClientInterestNotifyDUnitTest.java  |   55 +-
 .../ClientServerForceInvalidateDUnitTest.java   |  109 +-
 .../tier/sockets/ClientServerMiscDUnitTest.java |  109 +-
 .../ClientServerMiscSelectorDUnitTest.java      |   14 +-
 .../cache/tier/sockets/ConflationDUnitTest.java |   72 +-
 .../DataSerializerPropogationDUnitTest.java     |   69 +-
 .../DestroyEntryPropagationDUnitTest.java       |  159 +-
 .../sockets/DurableClientBug39997DUnitTest.java |   41 +-
 .../DurableClientQueueSizeDUnitTest.java        |   75 +-
 .../DurableClientReconnectAutoDUnitTest.java    |   28 +-
 .../DurableClientReconnectDUnitTest.java        |  306 +--
 .../sockets/DurableClientStatsDUnitTest.java    |   52 +-
 .../sockets/DurableRegistrationDUnitTest.java   |   48 +-
 .../sockets/DurableResponseMatrixDUnitTest.java |   87 +-
 .../sockets/EventIDVerificationDUnitTest.java   |   58 +-
 .../EventIDVerificationInP2PDUnitTest.java      |   32 +-
 .../ForceInvalidateEvictionDUnitTest.java       |   20 +-
 ...ForceInvalidateOffHeapEvictionDUnitTest.java |   16 +-
 .../cache/tier/sockets/HABug36738DUnitTest.java |   15 +-
 .../tier/sockets/HAInterestPart1DUnitTest.java  |   22 +-
 .../tier/sockets/HAInterestPart2DUnitTest.java  |   22 +-
 .../cache/tier/sockets/HAInterestTestCase.java  |   53 +-
 .../sockets/HAStartupAndFailoverDUnitTest.java  |   93 +-
 .../InstantiatorPropagationDUnitTest.java       |  160 +-
 .../tier/sockets/InterestListDUnitTest.java     |  576 +++---
 .../sockets/InterestListEndpointDUnitTest.java  |   70 +-
 .../InterestListEndpointPRDUnitTest.java        |   16 +-
 .../InterestListEndpointSelectorDUnitTest.java  |   14 +-
 .../sockets/InterestListFailoverDUnitTest.java  |   33 +-
 .../sockets/InterestListRecoveryDUnitTest.java  |  205 +-
 .../sockets/InterestRegrListenerDUnitTest.java  |   66 +-
 .../sockets/InterestResultPolicyDUnitTest.java  |   66 +-
 .../sockets/NewRegionAttributesDUnitTest.java   |   27 +-
 .../tier/sockets/ObjectPartListJUnitTest.java   |   16 +-
 .../sockets/RedundancyLevelPart1DUnitTest.java  |  258 ++-
 .../sockets/RedundancyLevelPart2DUnitTest.java  |  105 +-
 .../sockets/RedundancyLevelPart3DUnitTest.java  |   41 +-
 .../tier/sockets/RedundancyLevelTestBase.java   |   95 +-
 .../tier/sockets/RegionCloseDUnitTest.java      |   47 +-
 ...erInterestBeforeRegionCreationDUnitTest.java |   62 +-
 .../sockets/RegisterInterestKeysDUnitTest.java  |   53 +-
 .../RegisterInterestKeysPRDUnitTest.java        |   16 +-
 .../sockets/ReliableMessagingDUnitTest.java     |   55 +-
 .../sockets/UnregisterInterestDUnitTest.java    |   59 +-
 .../sockets/UpdatePropagationDUnitTest.java     |  118 +-
 .../sockets/UpdatePropagationPRDUnitTest.java   |    8 +-
 .../VerifyEventIDGenerationInP2PDUnitTest.java  |   32 +-
 ...UpdatesFromNonInterestEndPointDUnitTest.java |   56 +-
 .../cache/wan/AsyncEventQueueTestBase.java      |   93 +-
 .../asyncqueue/AsyncEventListenerDUnitTest.java |  134 +-
 .../AsyncEventListenerOffHeapDUnitTest.java     |   14 +-
 .../AsyncEventQueueStatsDUnitTest.java          |   19 +-
 .../AsyncEventQueueValidationsJUnitTest.java    |   34 +-
 .../ConcurrentAsyncEventQueueDUnitTest.java     |   21 +-
 ...ncurrentAsyncEventQueueOffHeapDUnitTest.java |   14 +-
 .../CommonParallelAsyncEventQueueDUnitTest.java |   15 +-
 ...ParallelAsyncEventQueueOffHeapDUnitTest.java |   14 +-
 .../CompressionCacheConfigDUnitTest.java        |   43 +-
 .../CompressionCacheListenerDUnitTest.java      |   17 +-
 ...ompressionCacheListenerOffHeapDUnitTest.java |   27 +-
 .../CompressionRegionConfigDUnitTest.java       |   22 +-
 .../CompressionRegionFactoryDUnitTest.java      |   17 +-
 .../CompressionRegionOperationsDUnitTest.java   |   24 +-
 ...ressionRegionOperationsOffHeapDUnitTest.java |   18 +-
 .../compression/CompressionStatsDUnitTest.java  |   17 +-
 .../datasource/AbstractPoolCacheJUnitTest.java  |  256 ++-
 .../datasource/DataSourceFactoryJUnitTest.java  |   86 +-
 .../internal/jta/ExceptionJUnitTest.java        |   27 +-
 .../jta/GlobalTransactionJUnitTest.java         |  138 +-
 .../jta/TransactionTimeOutJUnitTest.java        |  419 ++---
 .../internal/jta/dunit/ExceptionsDUnitTest.java |   39 +-
 .../jta/dunit/IdleTimeOutDUnitTest.java         |   51 +-
 .../jta/dunit/LoginTimeOutDUnitTest.java        |   70 +-
 .../jta/dunit/MaxPoolSizeDUnitTest.java         |   84 +-
 .../jta/dunit/TransactionTimeOutDUnitTest.java  |  134 +-
 .../dunit/TxnManagerMultiThreadDUnitTest.java   |  155 +-
 .../internal/jta/dunit/TxnTimeOutDUnitTest.java |  119 +-
 .../logging/LocatorLogFileJUnitTest.java        |   32 +-
 .../LogWriterDisabledPerformanceTest.java       |   30 +-
 .../logging/LogWriterPerformanceTest.java       |   46 +-
 .../logging/LoggingPerformanceTestCase.java     |   40 +-
 .../internal/logging/TestLogWriterFactory.java  |   12 +-
 .../log4j/Log4J2DisabledPerformanceTest.java    |   29 +-
 .../logging/log4j/Log4J2PerformanceTest.java    |   54 +-
 .../LogWriterLoggerDisabledPerformanceTest.java |   25 +-
 .../log4j/LogWriterLoggerPerformanceTest.java   |   58 +-
 .../offheap/OutOfOffHeapMemoryDUnitTest.java    |   42 +-
 .../process/LocalProcessLauncherDUnitTest.java  |   18 +-
 .../statistics/StatisticsDUnitTest.java         |   82 +-
 .../statistics/ValueMonitorJUnitTest.java       |   23 +-
 .../ConcurrentHashMapIteratorJUnitTest.java     |   43 +-
 .../concurrent/CopyOnWriteHashMapJUnitTest.java |   48 +-
 .../cm/ConcurrentHashMapJUnitTest.java          |   73 +-
 .../concurrent/cm/CountedMapLoopsJUnitTest.java |   10 +-
 .../concurrent/cm/IntMapCheckJUnitTest.java     |   26 +-
 .../util/concurrent/cm/MapCheckJUnitTest.java   |   26 +-
 .../util/concurrent/cm/MapLoopsJUnitTest.java   |   12 +-
 .../util/concurrent/cm/RLJBarJUnitTest.java     |   13 +-
 .../concurrent/cm/StringMapLoopsJUnitTest.java  |   10 +-
 .../management/CacheManagementDUnitTest.java    |  150 +-
 .../management/ClientHealthStatsDUnitTest.java  |  110 +-
 .../management/CompositeTypeTestDUnitTest.java  |   15 +-
 .../management/DLockManagementDUnitTest.java    |   16 +-
 .../management/DiskManagementDUnitTest.java     |   19 +-
 .../management/DistributedSystemDUnitTest.java  |   20 +-
 .../management/LocatorManagementDUnitTest.java  |   57 +-
 .../gemstone/gemfire/management/MBeanUtil.java  |   16 +-
 .../gemfire/management/ManagementTestBase.java  |   59 +-
 .../MemberMBeanAttributesDUnitTest.java         |   18 +-
 .../management/OffHeapManagementDUnitTest.java  |   52 +-
 .../gemfire/management/QueryDataDUnitTest.java  |   23 +-
 .../management/RegionManagementDUnitTest.java   |   24 +-
 ...ersalMembershipListenerAdapterDUnitTest.java |  306 +--
 .../stats/DistributedSystemStatsDUnitTest.java  |   15 +-
 .../internal/cli/CliUtilDUnitTest.java          |   51 +-
 .../internal/pulse/TestClientIdsDUnitTest.java  |   47 +-
 .../internal/pulse/TestFunctionsDUnitTest.java  |   15 +-
 .../internal/pulse/TestHeapDUnitTest.java       |   15 +-
 .../internal/pulse/TestLocatorsDUnitTest.java   |   15 +-
 .../pulse/TestSubscriptionsDUnitTest.java       |   50 +-
 .../DomainObjectsAsValuesJUnitTest.java         |   25 +-
 .../gemfire/memcached/IntegrationJUnitTest.java |   22 +-
 .../gemfire/pdx/AutoSerializableJUnitTest.java  |    9 -
 .../ClientsWithVersioningRetryDUnitTest.java    |   60 +-
 .../pdx/DistributedSystemIdDUnitTest.java       |   43 +-
 .../gemfire/pdx/JSONFormatterJUnitTest.java     |   58 +-
 .../pdx/JSONPdxClientServerDUnitTest.java       |   81 +-
 .../pdx/PDXAsyncEventQueueDUnitTest.java        |   18 +-
 .../gemfire/pdx/PdxClientServerDUnitTest.java   |   63 +-
 .../pdx/PdxDeserializationDUnitTest.java        |   20 +-
 .../gemfire/pdx/PdxSerializableDUnitTest.java   |   20 +-
 .../gemfire/pdx/PdxSerializableJUnitTest.java   |   59 +-
 .../gemfire/pdx/PdxStringJUnitTest.java         |   27 +-
 .../gemfire/pdx/PdxTypeExportDUnitTest.java     |   18 +-
 .../gemfire/pdx/VersionClassLoader.java         |   98 -
 .../gemfire/redis/RedisDistDUnitTest.java       |   57 +-
 .../security/ClientAuthorizationTestCase.java   |   49 +-
 .../DeltaClientPostAuthorizationDUnitTest.java  |    3 +-
 .../gemfire/security/SecurityTestUtils.java     |   79 +-
 .../gemfire/test/dunit/DistributedTestCase.java |   11 +-
 .../com/gemstone/gemfire/test/dunit/VM.java     |    4 +-
 .../cache/internal/JUnit3CacheTestCase.java     |    2 +-
 .../cache/internal/JUnit4CacheTestCase.java     |   43 +-
 .../internal/JUnit4DistributedTestCase.java     |    1 +
 .../test/dunit/tests/BasicDUnitTest.java        |   40 +-
 .../tests/GetDefaultDiskStoreNameDUnitTest.java |   13 +-
 .../dunit/tests/GetTestMethodNameDUnitTest.java |   13 +-
 ...ingGetPropertiesDisconnectsAllDUnitTest.java |   19 +-
 .../gemfire/test/dunit/tests/VMDUnitTest.java   |   21 +-
 ...WithLineMissingFromEndOfOutputJUnitTest.java |    3 +-
 ...hLineMissingFromMiddleOfOutputJUnitTest.java |    3 +-
 .../gemstone/gemfire/util/JSR166TestCase.java   |   23 +-
 .../gemfire/cache/query/cq/CQJUnitTest.java     |   51 +-
 .../cache/query/cq/dunit/CqDataDUnitTest.java   |   31 +-
 .../dunit/CqDataOptimizedExecuteDUnitTest.java  |   14 +-
 .../cq/dunit/CqDataUsingPoolDUnitTest.java      |  580 +++---
 ...qDataUsingPoolOptimizedExecuteDUnitTest.java |   14 +-
 .../cache/query/cq/dunit/CqPerfDUnitTest.java   |   23 +-
 .../cq/dunit/CqPerfUsingPoolDUnitTest.java      |   22 +-
 .../cache/query/cq/dunit/CqQueryDUnitTest.java  |  102 +-
 .../dunit/CqQueryOptimizedExecuteDUnitTest.java |   17 +-
 .../cq/dunit/CqQueryUsingPoolDUnitTest.java     |  543 +++---
 ...QueryUsingPoolOptimizedExecuteDUnitTest.java |   14 +-
 .../cq/dunit/CqResultSetUsingPoolDUnitTest.java |   29 +-
 ...ltSetUsingPoolOptimizedExecuteDUnitTest.java |   15 +-
 .../cache/query/cq/dunit/CqStateDUnitTest.java  |   39 +-
 .../cache/query/cq/dunit/CqStatsDUnitTest.java  |   20 +-
 .../dunit/CqStatsOptimizedExecuteDUnitTest.java |   14 +-
 .../cq/dunit/CqStatsUsingPoolDUnitTest.java     |   20 +-
 ...StatsUsingPoolOptimizedExecuteDUnitTest.java |   14 +-
 .../PartitionedRegionCqQueryDUnitTest.java      |  380 +---
 ...dRegionCqQueryOptimizedExecuteDUnitTest.java |   16 +-
 .../query/cq/dunit/PrCqUsingPoolDUnitTest.java  |   34 +-
 .../PrCqUsingPoolOptimizedExecuteDUnitTest.java |   14 +-
 .../cache/query/dunit/PdxQueryCQDUnitTest.java  |   17 +-
 .../cache/query/dunit/PdxQueryCQTestBase.java   |   43 +-
 .../dunit/QueryIndexUpdateRIDUnitTest.java      |   40 +-
 .../query/dunit/QueryMonitorDUnitTest.java      |   95 +-
 .../cache/snapshot/ClientSnapshotDUnitTest.java |   43 +-
 .../cache/PRDeltaPropagationDUnitTest.java      |  238 ++-
 .../internal/cache/PutAllCSDUnitTest.java       |  500 +++--
 .../cache/RemoteCQTransactionDUnitTest.java     |  223 ++-
 .../internal/cache/ha/CQListGIIDUnitTest.java   |  223 +--
 .../sockets/ClientToServerDeltaDUnitTest.java   |   88 +-
 .../DeltaPropagationWithCQDUnitTest.java        |   79 +-
 ...ToRegionRelationCQRegistrationDUnitTest.java |  106 +-
 .../sockets/DurableClientCrashDUnitTest.java    |   35 +-
 .../sockets/DurableClientNetDownDUnitTest.java  |   63 +-
 .../sockets/DurableClientSimpleDUnitTest.java   |  268 ++-
 .../tier/sockets/DurableClientTestCase.java     |  102 +-
 .../CacheServerManagementDUnitTest.java         |   21 +-
 .../internal/pulse/TestCQDUnitTest.java         |   18 +-
 .../internal/pulse/TestClientsDUnitTest.java    |   18 +-
 .../internal/pulse/TestServerDUnitTest.java     |   18 +-
 .../ClientPostAuthorizationDUnitTest.java       |    6 +-
 .../internal/LuceneEventListenerJUnitTest.java  |    7 +-
 .../tools/pulse/testbed/driver/PulseUITest.java |   62 +-
 .../tools/pulse/tests/PulseAbstractTest.java    |  177 +-
 .../tools/pulse/tests/PulseAutomatedTest.java   |   79 +-
 .../tools/pulse/tests/PulseBaseTest.java        |   77 +-
 .../cache/CacheXml70GatewayDUnitTest.java       |   18 +-
 .../cache/CacheXml80GatewayDUnitTest.java       |   17 +-
 .../internal/cache/UpdateVersionDUnitTest.java  |   90 +-
 .../cache/wan/CacheClientNotifierDUnitTest.java |   54 +-
 .../cache/wan/Simple2CacheServerDUnitTest.java  |   15 +-
 .../gemfire/internal/cache/wan/WANTestBase.java |  166 +-
 ...oncurrentParallelGatewaySenderDUnitTest.java |   25 +-
 ...ntParallelGatewaySenderOffHeapDUnitTest.java |   14 +-
 ...allelGatewaySenderOperation_1_DUnitTest.java |   23 +-
 ...allelGatewaySenderOperation_2_DUnitTest.java |   25 +-
 ...tSerialGatewaySenderOperationsDUnitTest.java |   14 +-
 ...GatewaySenderOperationsOffHeapDUnitTest.java |   14 +-
 .../ConcurrentWANPropogation_1_DUnitTest.java   |   21 +-
 .../ConcurrentWANPropogation_2_DUnitTest.java   |   22 +-
 .../cache/wan/disttx/DistTXWANDUnitTest.java    |   34 +-
 .../CommonParallelGatewaySenderDUnitTest.java   |   28 +-
 ...onParallelGatewaySenderOffHeapDUnitTest.java |   14 +-
 ...wWANConcurrencyCheckForDestroyDUnitTest.java |   20 +-
 .../wan/misc/NewWanAuthenticationDUnitTest.java |   33 +-
 .../cache/wan/misc/PDXNewWanDUnitTest.java      |   30 +-
 ...dRegion_ParallelWANPersistenceDUnitTest.java |   15 +-
 ...dRegion_ParallelWANPropogationDUnitTest.java |   15 +-
 .../SenderWithTransportFilterDUnitTest.java     |   57 +-
 ...downAllPersistentGatewaySenderDUnitTest.java |   14 +-
 .../wan/misc/WANLocatorServerDUnitTest.java     |   32 +-
 .../cache/wan/misc/WANSSLDUnitTest.java         |   17 +-
 .../wan/misc/WanAutoDiscoveryDUnitTest.java     |   24 +-
 .../cache/wan/misc/WanValidationsDUnitTest.java |   52 +-
 ...tewaySenderOperation_2_OffHeapDUnitTest.java |   14 +-
 ...tewaySenderOperation_2_OffHeapDUnitTest.java |   14 +-
 ...GatewaySenderOperationsOffHeapDUnitTest.java |   14 +-
 ...ewaySenderQueueOverflowOffHeapDUnitTest.java |   14 +-
 .../ParallelWANConflationOffHeapDUnitTest.java  |   14 +-
 ...nceEnabledGatewaySenderOffHeapDUnitTest.java |   14 +-
 ...ropogationConcurrentOpsOffHeapDUnitTest.java |   14 +-
 .../ParallelWANPropogationOffHeapDUnitTest.java |   14 +-
 ...erialGatewaySenderQueueOffHeapDUnitTest.java |   14 +-
 ...nceEnabledGatewaySenderOffHeapDUnitTest.java |   14 +-
 .../SerialWANPropogationOffHeapDUnitTest.java   |   14 +-
 ...ation_PartitionedRegionOffHeapDUnitTest.java |   14 +-
 ...allelGatewaySenderOperation_2_DUnitTest.java |   14 +-
 ...arallelGatewaySenderOperationsDUnitTest.java |   45 +-
 ...llelGatewaySenderQueueOverflowDUnitTest.java |   66 +-
 .../ParallelWANConflationDUnitTest.java         |   21 +-
 ...ersistenceEnabledGatewaySenderDUnitTest.java |   26 +-
 ...llelWANPropagationClientServerDUnitTest.java |   15 +-
 ...lelWANPropagationConcurrentOpsDUnitTest.java |   17 +-
 .../ParallelWANPropagationDUnitTest.java        |   32 +-
 ...ParallelWANPropagationLoopBackDUnitTest.java |   17 +-
 .../wan/parallel/ParallelWANStatsDUnitTest.java |   21 +-
 ...tewaySenderDistributedDeadlockDUnitTest.java |   26 +-
 ...rialGatewaySenderEventListenerDUnitTest.java |   17 +-
 .../SerialGatewaySenderOperationsDUnitTest.java |   25 +-
 .../SerialGatewaySenderQueueDUnitTest.java      |   44 +-
 ...ersistenceEnabledGatewaySenderDUnitTest.java |   21 +-
 .../SerialWANPropagationLoopBackDUnitTest.java  |   18 +-
 .../serial/SerialWANPropogationDUnitTest.java   |  185 +-
 ...NPropogation_PartitionedRegionDUnitTest.java |   21 +-
 .../SerialWANPropogationsFeatureDUnitTest.java  |   21 +-
 .../wan/serial/SerialWANStatsDUnitTest.java     |   22 +-
 .../management/WANManagementDUnitTest.java      |   17 +-
 .../pulse/TestRemoteClusterDUnitTest.java       |   15 +-
 .../cli/commands/CommandOverHttpDUnitTest.java  |    9 +
 .../ConnectCommandWithHttpAndSSLDUnitTest.java  |   35 +-
 741 files changed, 25670 insertions(+), 20701 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/convert_one_dunit_to_junit4.pl
----------------------------------------------------------------------
diff --git a/convert_one_dunit_to_junit4.pl b/convert_one_dunit_to_junit4.pl
new file mode 100755
index 0000000..c6b6dd9
--- /dev/null
+++ b/convert_one_dunit_to_junit4.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w -i -p
+# 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.
+
+use strict;
+
+my $filename = $ARGV;
+$filename =~ s/.*\/(.*).java/$1/;
+
+#Change constructor to a no arg constructor
+s/(public.*$filename)\(String name\)/$1()/;
+s/super\(name\)/super()/;
+
+#Add @Test annotation
+s/^[^\/]*public void test/  \@Test\n  public void test/;
+
+#Extend the correct junit 4 class
+s/extends CacheTestCase/extends JUnit4CacheTestCase/;
+s/extends DistributedTestCase/extends JUnit4DistributedTestCase/;
+
+#Add the DistributedTest category
+s/(^public class $filename)/\@Category(DistributedTest.class)\n$1/;
+
+#Change calls to new MyTest("string") to use the no arg constructor
+s/new $filename\(\".*?\"\)/new $filename\(\)/;
+
+#Add imports
+s/^(package com.gemstone.*)/$1\n\nimport org.junit.experimental.categories.Category;\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\nimport com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;\nimport com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;\nimport com.gemstone.gemfire.test.junit.categories.DistributedTest;/
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/etc/intellijIdeaCodeStyle.xml
----------------------------------------------------------------------
diff --git a/etc/intellijIdeaCodeStyle.xml b/etc/intellijIdeaCodeStyle.xml
index eb88ace..a6d1f25 100755
--- a/etc/intellijIdeaCodeStyle.xml
+++ b/etc/intellijIdeaCodeStyle.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<code_scheme name="gemstoneCodeStyleScheme">
+<code_scheme name="geodeCodeStyleScheme">
   <option name="OTHER_INDENT_OPTIONS">
     <value>
       <option name="INDENT_SIZE" value="2" />
@@ -12,7 +11,7 @@
       <option name="USE_RELATIVE_INDENTS" value="false" />
     </value>
   </option>
-  <option name="LINE_SEPARATOR" value="&#10;" />
+  <option name="LINE_SEPARATOR" value="&#xA;" />
   <option name="GENERATE_FINAL_LOCALS" value="true" />
   <option name="GENERATE_FINAL_PARAMETERS" value="true" />
   <option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
@@ -28,29 +27,33 @@
       <package name="java" withSubpackages="true" static="false" />
       <package name="javax" withSubpackages="true" static="false" />
       <emptyLine />
-      <package name="junit" withSubpackages="true" static="false" />
-      <package name="jmock" withSubpackages="true" static="false" />
-      <emptyLine />
-      <package name="com" withSubpackages="true" static="false" />
-      <emptyLine />
-      <package name="edu" withSubpackages="true" static="false" />
-      <emptyLine />
-      <package name="net" withSubpackages="true" static="false" />
+      <package name="" withSubpackages="true" static="false" />
       <emptyLine />
-      <package name="org" withSubpackages="true" static="false" />
+      <package name="batterytest" withSubpackages="true" static="false" />
+      <package name="cacheRunner" withSubpackages="true" static="false" />
+      <package name="hydra" withSubpackages="true" static="false" />
+      <package name="parReg" withSubpackages="true" static="false" />
+      <package name="perffmwk" withSubpackages="true" static="false" />
       <emptyLine />
-      <package name="" withSubpackages="true" static="false" />
+      <package name="com.gemstone" withSubpackages="true" static="false" />
+      <package name="com.vmware.gemfire" withSubpackages="true" static="false" />
+      <package name="io.pivotal.geode" withSubpackages="true" static="false" />
     </value>
   </option>
   <option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
   <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
-  <option name="JD_ADD_BLANK_AFTER_DESCRIPTION" value="false" />
+  <option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" />
+  <option name="JD_ADD_BLANK_AFTER_RETURN" value="true" />
   <option name="JD_KEEP_INVALID_TAGS" value="false" />
   <option name="JD_PRESERVE_LINE_FEEDS" value="true" />
   <option name="HTML_ATTRIBUTE_WRAP" value="0" />
   <option name="HTML_ALIGN_TEXT" value="true" />
   <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
   <option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
+  <option name="WRAP_COMMENTS" value="true" />
+  <JavaCodeStyleSettings>
+    <option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
+  </JavaCodeStyleSettings>
   <XML>
     <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
   </XML>
@@ -62,25 +65,20 @@
     </indentOptions>
   </codeStyleSettings>
   <codeStyleSettings language="JAVA">
+    <option name="KEEP_LINE_BREAKS" value="false" />
     <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
     <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
-    <option name="BLANK_LINES_BEFORE_PACKAGE" value="1" />
     <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
-    <option name="CLASS_BRACE_STYLE" value="5" />
-    <option name="METHOD_BRACE_STYLE" value="5" />
-    <option name="ELSE_ON_NEW_LINE" value="true" />
-    <option name="WHILE_ON_NEW_LINE" value="true" />
-    <option name="CATCH_ON_NEW_LINE" value="true" />
-    <option name="FINALLY_ON_NEW_LINE" value="true" />
+    <option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
+    <option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
+    <option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
     <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" />
     <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
-    <option name="CALL_PARAMETERS_WRAP" value="1" />
     <option name="PREFER_PARAMETERS_WRAP" value="true" />
     <option name="METHOD_PARAMETERS_WRAP" value="5" />
     <option name="EXTENDS_KEYWORD_WRAP" value="1" />
     <option name="THROWS_KEYWORD_WRAP" value="1" />
-    <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
-    <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
+    <option name="METHOD_CALL_CHAIN_WRAP" value="5" />
     <option name="ARRAY_INITIALIZER_WRAP" value="5" />
     <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
     <option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
@@ -88,15 +86,389 @@
     <option name="DOWHILE_BRACE_FORCE" value="3" />
     <option name="WHILE_BRACE_FORCE" value="3" />
     <option name="FOR_BRACE_FORCE" value="3" />
-    <option name="METHOD_ANNOTATION_WRAP" value="5" />
-    <option name="CLASS_ANNOTATION_WRAP" value="5" />
-    <option name="FIELD_ANNOTATION_WRAP" value="5" />
-    <option name="VARIABLE_ANNOTATION_WRAP" value="5" />
+    <option name="VARIABLE_ANNOTATION_WRAP" value="2" />
     <indentOptions>
       <option name="INDENT_SIZE" value="2" />
       <option name="CONTINUATION_INDENT_SIZE" value="2" />
       <option name="TAB_SIZE" value="2" />
     </indentOptions>
+    <arrangement>
+      <tokens>
+        <token id="visibility" name="visibility">
+          <rules>
+            <rule>
+              <match>
+                <PUBLIC>true</PUBLIC>
+              </match>
+            </rule>
+            <rule>
+              <match>
+                <PROTECTED>true</PROTECTED>
+              </match>
+            </rule>
+            <rule>
+              <match>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+              </match>
+            </rule>
+            <rule>
+              <match>
+                <PRIVATE>true</PRIVATE>
+              </match>
+            </rule>
+          </rules>
+        </token>
+      </tokens>
+      <rules>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PUBLIC>true</PUBLIC>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PROTECTED>true</PROTECTED>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PRIVATE>true</PRIVATE>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PUBLIC>true</PUBLIC>
+                <STATIC>true</STATIC>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PROTECTED>true</PROTECTED>
+                <STATIC>true</STATIC>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+                <STATIC>true</STATIC>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PRIVATE>true</PRIVATE>
+                <STATIC>true</STATIC>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PUBLIC>true</PUBLIC>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PROTECTED>true</PROTECTED>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PRIVATE>true</PRIVATE>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <INITIALIZER_BLOCK>true</INITIALIZER_BLOCK>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PUBLIC>true</PUBLIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PROTECTED>true</PROTECTED>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <FINAL>true</FINAL>
+                <PRIVATE>true</PRIVATE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PUBLIC>true</PUBLIC>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PROTECTED>true</PROTECTED>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PRIVATE>true</PRIVATE>
+                <VOLATILE>true</VOLATILE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PUBLIC>true</PUBLIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PROTECTED>true</PROTECTED>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PACKAGE_PRIVATE>true</PACKAGE_PRIVATE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <FIELD>true</FIELD>
+                <PRIVATE>true</PRIVATE>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <FIELD>true</FIELD>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <INITIALIZER_BLOCK>true</INITIALIZER_BLOCK>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <CONSTRUCTOR>true</CONSTRUCTOR>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <METHOD>true</METHOD>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <METHOD>true</METHOD>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <ENUM>true</ENUM>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <INTERFACE>true</INTERFACE>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <AND>
+                <CLASS>true</CLASS>
+                <STATIC>true</STATIC>
+              </AND>
+            </match>
+          </rule>
+        </section>
+        <section>
+          <rule>
+            <match>
+              <CLASS>true</CLASS>
+            </match>
+          </rule>
+        </section>
+      </rules>
+    </arrangement>
   </codeStyleSettings>
   <codeStyleSettings language="XML">
     <indentOptions>
@@ -105,5 +477,4 @@
       <option name="TAB_SIZE" value="2" />
     </indentOptions>
   </codeStyleSettings>
-</code_scheme>
-
+</code_scheme>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/extensions/geode-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java b/extensions/geode-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
index f2fb584..d4df02c 100644
--- a/extensions/geode-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
+++ b/extensions/geode-modules-hibernate/src/test/java/com/gemstone/gemfire/modules/SecondVMTest.java
@@ -16,6 +16,20 @@
 */
 package com.gemstone.gemfire.modules;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.logging.Level;
+
+import org.hibernate.Session;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.GemFireCache;
@@ -23,30 +37,16 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.TestCase;
-import org.hibernate.Session;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.logging.Level;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
-@Ignore("Can this test be deleted?")
 @Category(IntegrationTest.class)
-public class SecondVMTest extends TestCase {
+@Ignore("Can this test be deleted?")
+public class SecondVMTest {
 
   private Logger log = LoggerFactory.getLogger(getClass());
-  
-  public void testNoop() {
-    
-  }
-  public void _testStartEmptyVM() throws IOException {
+
+  @Ignore
+  @Test
+  public void testStartEmptyVM() throws IOException {
     Properties gemfireProperties = new Properties();
     gemfireProperties.setProperty(MCAST_PORT, "5555");
     gemfireProperties.setProperty(LOG_LEVEL, "fine");
@@ -63,8 +63,10 @@ public class SecondVMTest extends TestCase {
       }
     }
   }
-  
-  public void _testStartVM() throws Exception {
+
+  @Ignore
+  @Test
+  public void testStartVM() throws Exception {
     java.util.logging.Logger.getLogger("org.hibernate").setLevel(Level.ALL);
     Session session = HibernateJUnitTest.getSessionFactory(null).openSession();
     log.info("SWAP:new session open");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java b/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
index 4a37d36..c341c6f 100644
--- a/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
+++ b/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
@@ -14,15 +14,9 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-
 package com.gemstone.gemfire.modules.session.internal.filter;
 
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import com.mockrunner.servlet.BasicServletTestCaseAdapter;
-import org.junit.Ignore;
-import org.junit.Test;
+import static org.junit.Assert.*;
 
 import java.util.concurrent.TimeUnit;
 import javax.servlet.http.Cookie;
@@ -31,8 +25,12 @@ import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionAttributeListener;
 
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.*;
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import com.mockrunner.servlet.BasicServletTestCaseAdapter;
+import org.junit.Ignore;
+import org.junit.Test;
 
 /**
  * This servlet tests the effects of the downstream SessionCachingFilter filter.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java b/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
index 292f5ca..f2ef993 100644
--- a/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
+++ b/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
@@ -16,10 +16,16 @@
 */
 package com.gemstone.gemfire.modules.session;
 
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.modules.session.catalina.DeltaSessionManager;
-import com.gemstone.gemfire.modules.session.catalina.PeerToPeerCacheLifecycleListener;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.beans.PropertyChangeEvent;
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
 import com.meterware.httpunit.GetMethodWebRequest;
 import com.meterware.httpunit.WebConversation;
 import com.meterware.httpunit.WebRequest;
@@ -29,15 +35,10 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.beans.PropertyChangeEvent;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static junit.framework.Assert.*;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.modules.session.catalina.DeltaSessionManager;
+import com.gemstone.gemfire.modules.session.catalina.PeerToPeerCacheLifecycleListener;
 
 public abstract class TestSessionsBase {
 
@@ -185,36 +186,6 @@ public abstract class TestSessionsBase {
   }
 
   /**
-   * Check that our session persists beyond the container restarting.
-   */
-//    public void testSessionPersists2() throws Exception {
-//        String key = "value_testSessionPersists2";
-//        String value = "Foo";
-//
-//        WebConversation wc = new WebConversation();
-//        WebRequest req = new GetMethodWebRequest("http://localhost:7890/test");
-//        req.setParameter("cmd", QueryCommand.SET.name());
-//        req.setParameter("param", key);
-//        req.setParameter("value", value);
-//        WebResponse response = wc.getResponse(req);
-//        String sessionId = response.getNewCookieValue("JSESSIONID");
-//
-//        assertNotNull("No apparent session cookie", sessionId);
-//
-//        // Restart the container
-//        AllTests.teardownClass();
-//        AllTests.setupClass();
-//
-//        // The request retains the cookie from the prior response...
-//        req.setParameter("cmd", QueryCommand.GET.name());
-//        req.setParameter("param", key);
-//        req.removeParameter("value");
-//        response = wc.getResponse(req);
-//
-//        assertIndexDetailsEquals(value, response.getText());
-//    }
-
-  /**
    * Test that invalidating a session makes it's attributes inaccessible.
    */
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
index 5c10342..d384fef 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
+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.LogWriter;
 import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.execute.FunctionContext;
@@ -40,14 +49,15 @@ import java.util.*;
  * @since GemFire 8.0
  */
 
+@Category(DistributedTest.class)
 public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
 
   private final String REPLICATE_REGION_NAME = "sampleRRegion";
 
   private final String PR_REGION_NAME = "samplePRRegion";
 
-  public RestAPIOnRegionFunctionExecutionDUnitTest(String name) {
-    super(name);
+  public RestAPIOnRegionFunctionExecutionDUnitTest() {
+    super();
   }
 
   private class SampleFunction extends RestFunctionTemplate {
@@ -243,6 +253,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
     vm3.invoke("registerFunction(new SampleFunction())", () -> FunctionService.registerFunction(new SampleFunction()));
   }
 
+  @Test
   public void testOnRegionExecutionWithReplicateRegion() {
     createCacheAndRegisterFunction();
 
@@ -263,6 +274,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
     restURLs.clear();
   }
 
+  @Test
   public void testOnRegionExecutionWithPartitionRegion() throws Exception {
     createCacheAndRegisterFunction();
 
@@ -279,6 +291,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
     restURLs.clear();
   }
 
+  @Test
   public void testOnRegionWithFilterExecutionWithPartitionRegion() throws Exception {
     createCacheAndRegisterFunction();
 
@@ -301,6 +314,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
     }
   }
 
+  @Test
   public void testOnRegionWithFilterExecutionWithPartitionRegionJsonArgs() throws Exception {
     createCacheAndRegisterFunction();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
index eca5656..d5bc12f 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
@@ -17,16 +17,18 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.GemFireVersion;
-import com.gemstone.gemfire.internal.lang.StringUtils;
-import com.gemstone.gemfire.management.internal.AgentUtil;
-import com.gemstone.gemfire.rest.internal.web.RestFunctionTemplate;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Random;
+
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -36,19 +38,26 @@ import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.json.JSONArray;
+import org.junit.experimental.categories.Category;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Random;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.internal.GemFireVersion;
+import com.gemstone.gemfire.internal.lang.StringUtils;
+import com.gemstone.gemfire.management.internal.AgentUtil;
+import com.gemstone.gemfire.rest.internal.web.RestFunctionTemplate;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+@Category(DistributedTest.class)
+public class RestAPITestBase extends JUnit4DistributedTestCase {
 
-public class RestAPITestBase extends DistributedTestCase {
   protected Cache cache = null;
   protected List<String> restURLs = new ArrayList();
   protected VM vm0 = null;
@@ -56,10 +65,6 @@ public class RestAPITestBase extends DistributedTestCase {
   protected VM vm2 = null;
   protected VM vm3 = null;
 
-  public RestAPITestBase(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -103,7 +108,7 @@ public class RestAPITestBase extends DistributedTestCase {
   }
 
   public String createCacheWithGroups(final String hostName, final String groups) {
-    RestAPITestBase test = new RestAPITestBase(getTestMethodName());
+    RestAPITestBase test = new RestAPITestBase();
 
     final int servicePort = AvailablePortHelper.getRandomAvailableTCPPort();
 
@@ -132,6 +137,7 @@ public class RestAPITestBase extends DistributedTestCase {
   protected CloseableHttpResponse executeFunctionThroughRestCall(String function, String regionName, String filter, String jsonBody, String groups,
                                                                  String members) {
     System.out.println("Entering executeFunctionThroughRestCall");
+    CloseableHttpResponse value = null;
     try {
       CloseableHttpClient httpclient = HttpClients.createDefault();
       Random randomGenerator = new Random();
@@ -140,10 +146,11 @@ public class RestAPITestBase extends DistributedTestCase {
       HttpPost post = createHTTPPost(function, regionName, filter, restURLIndex, groups, members, jsonBody);
 
       System.out.println("Request: POST " + post.toString());
-      return httpclient.execute(post);
+      value = httpclient.execute(post);
     } catch (Exception e) {
-      throw new RuntimeException("unexpected exception", e);
+      fail("unexpected exception", e);
     }
+    return value;
   }
 
   private HttpPost createHTTPPost(String function, String regionName, String filter, int restUrlIndex, String groups, String members, String jsonBody) {
@@ -189,7 +196,7 @@ public class RestAPITestBase extends DistributedTestCase {
       JSONArray resultArray = new JSONArray(httpResponseString);
       assertEquals(resultArray.length(), expectedServerResponses);
     } catch (Exception e) {
-      e.printStackTrace();
+      //fail("exception", e);
     }
   }
 
@@ -206,7 +213,7 @@ public class RestAPITestBase extends DistributedTestCase {
       }
       return sb.toString();
     } catch (IOException e) {
-      LogWriterUtils.getLogWriter().error("Error in processing Http Response", e);
+      fail("exception", e);
     }
     return "";
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
index c0b5c79..b601b3a 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
+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.*;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
@@ -57,6 +66,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * @since GemFire 8.0
  */
 
+@Category(DistributedTest.class)
 public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
 
   private static final long serialVersionUID = -254776154266339226L;
@@ -147,9 +157,9 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
       + " \"middleName\": \"kiran12\"," + " \"lastName\": \"Patel\","
       + " \"birthDate\": \"23/08/2012\"," + "\"gender\": \"MALE\"" + "}" + "]";
 
-  public RestAPIsAndInterOpsDUnitTest(String name) {
-    super(name);
-    this.helper = new ManagementTestBase(name);
+  public RestAPIsAndInterOpsDUnitTest() {
+    super();
+    this.helper = new ManagementTestBase() {{}};
 
   }
 
@@ -759,6 +769,7 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
    * @throws Exception
    */
 
+  @Test
   public void testInterOpsWithReplicatedRegion() throws Exception {
 
     final Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
index a567700..33faf9a 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
@@ -16,23 +16,25 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.execute.FunctionContext;
 import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.rest.internal.web.RestFunctionTemplate;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.VM;
-import org.apache.http.client.methods.CloseableHttpResponse;
-
-import java.util.ArrayList;
-import java.util.Collections;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase {
 
-  public RestAPIsOnGroupsFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   protected String getFunctionID() {
     return OnGroupsFunction.Id;
@@ -48,6 +50,7 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
     vm2.invoke("registerFunction(new OnGroupsFunction())", () -> FunctionService.registerFunction(new OnGroupsFunction()));
   }
 
+  @Test
   public void testonGroupsExecutionOnAllMembers() {
     setupCacheWithGroupsAndFunction();
 
@@ -61,6 +64,7 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
     restURLs.clear();
   }
 
+  @Test
   public void testonGroupsExecutionOnAllMembersWithFilter() {
     setupCacheWithGroupsAndFunction();
 
@@ -74,6 +78,7 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
     restURLs.clear();
   }
 
+  @Test
   public void testBasicP2PFunctionSelectedGroup() {
     setupCacheWithGroupsAndFunction();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
index 901f15f..80d30e6 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
@@ -16,6 +16,14 @@
  */
 package com.gemstone.gemfire.rest.internal.web.controllers;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheClosedException;
 import com.gemstone.gemfire.cache.CacheFactory;
@@ -23,19 +31,11 @@ import com.gemstone.gemfire.cache.execute.FunctionContext;
 import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.rest.internal.web.RestFunctionTemplate;
-import org.apache.http.client.methods.CloseableHttpResponse;
-
-import java.util.Properties;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
 public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase {
 
-  private static final long serialVersionUID = 1L;
-
-  public RestAPIsOnMembersFunctionExecutionDUnitTest(String name) {
-    super(name);
-  }
-
   private class OnMembersFunction extends RestFunctionTemplate {
     public static final String Id = "OnMembersFunction";
 
@@ -80,12 +80,12 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
 
     Cache c = null;
     try {
-      c = CacheFactory.getInstance(new RestAPIsOnMembersFunctionExecutionDUnitTest("temp").getSystem(props));
+      c = CacheFactory.getInstance(new RestAPIsOnMembersFunctionExecutionDUnitTest().getSystem(props));
       c.close();
     } catch (CacheClosedException cce) {
     }
 
-    c = CacheFactory.create(new RestAPIsOnMembersFunctionExecutionDUnitTest("temp").getSystem(props));
+    c = CacheFactory.create(new RestAPIsOnMembersFunctionExecutionDUnitTest().getSystem(props));
     FunctionService.registerFunction(new OnMembersFunction());
 
     String restEndPoint = "http://" + hostName + ":" + servicePort + "/gemfire-api/v1";
@@ -98,6 +98,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
     return OnMembersFunction.Id;
   }
 
+  @Test
   public void testFunctionExecutionOnAllMembers() {
     createCacheForVMs();
 
@@ -118,6 +119,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
     restURLs.add(vm3.invoke("createCacheAndRegisterFunction",() -> createCacheAndRegisterFunction(vm3.getHost().getHostName(), "m4")));
   }
 
+  @Test
   public void testFunctionExecutionEOnSelectedMembers() {
     createCacheForVMs();
 
@@ -131,6 +133,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
     restURLs.clear();
   }
 
+  @Test
   public void testFunctionExecutionOnMembersWithFilter() {
     createCacheForVMs();
 



[08/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
index 05c9119..c0978b7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
@@ -16,6 +16,20 @@
  */
 package com.gemstone.gemfire.management;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.InternalGemFireException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -33,22 +47,30 @@ import com.gemstone.gemfire.internal.cache.tier.InternalClientMembership;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
 import com.gemstone.gemfire.internal.logging.InternalLogWriter;
 import com.gemstone.gemfire.internal.logging.LocalLogWriter;
-import com.gemstone.gemfire.management.membership.*;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.management.membership.ClientMembership;
+import com.gemstone.gemfire.management.membership.ClientMembershipEvent;
+import com.gemstone.gemfire.management.membership.ClientMembershipListener;
+import com.gemstone.gemfire.management.membership.MembershipEvent;
+import com.gemstone.gemfire.management.membership.MembershipListener;
+import com.gemstone.gemfire.management.membership.UniversalMembershipListenerAdapter;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 
 /**
  * Tests the UniversalMembershipListenerAdapter.
  *
  * @since GemFire 4.2.1
  */
+@Category(DistributedTest.class)
 public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTestCase {
+
   protected static final boolean CLIENT = true;
   protected static final boolean SERVER = false;
   
@@ -70,10 +92,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /** Millis to wait for all three event listeners to be notified */
   private static final int ASYNC_EVENT_WAIT_MILLIS = 120000; // use Integer.MAX_VALUE for debugging
     
-  public UniversalMembershipListenerAdapterDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     InternalClientMembership.unregisterAllListeners();
@@ -82,6 +100,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /**
    * Tests wrapping of BridgeMembershipEvent fired as MembershipEvent.
    */
+  @Test
   public void testAdaptedBridgeEvents() throws Exception {
     getSystem();
     
@@ -124,6 +143,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /**
    * Tests use of history to prevent duplicate events.
    */
+  @Test
   public void testNoDuplicates() throws Exception {
     getSystem();
     
@@ -224,14 +244,16 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /**
    * Tests notification of events for loner bridge clients in server process.
    */
+  @Test
   public void testLonerClientEventsInServer() throws Exception {
-     try {
-       doTestLonerClientEventsInServer();
-     }
-     finally {
-       disconnectAllFromDS();
-     }
+    try {
+      doTestLonerClientEventsInServer();
+    }
+    finally {
+      disconnectAllFromDS();
+    }
   }
+
   private void doTestLonerClientEventsInServer() throws Exception {
     final boolean[] firedSystem = new boolean[3];
     final DistributedMember[] memberSystem = new DistributedMember[3];
@@ -249,6 +271,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final boolean[] isClientBridge = new boolean[3];
 
     MembershipListener systemListener = new MembershipListener() {
+      @Override
       public synchronized void memberJoined(MembershipEvent event) {
         assertFalse(firedSystem[JOINED]);
         assertNull(memberSystem[JOINED]);
@@ -258,6 +281,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         memberIdSystem[JOINED] = event.getMemberId();
         notify();
       }
+      @Override
       public synchronized void memberLeft(MembershipEvent event) {
         assertFalse(firedSystem[LEFT]);
         assertNull(memberSystem[LEFT]);
@@ -267,6 +291,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         memberIdSystem[LEFT] = event.getMemberId();
         notify();
       }
+      @Override
       public synchronized void memberCrashed(MembershipEvent event) {
         assertFalse(firedSystem[CRASHED]);
         assertNull(memberSystem[CRASHED]);
@@ -322,6 +347,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     };
 
     ClientMembershipListener bridgeListener = new ClientMembershipListener() {
+      @Override
       public synchronized void memberJoined(ClientMembershipEvent event) {
         assertFalse(firedBridge[JOINED]);
         assertNull(memberBridge[JOINED]);
@@ -333,6 +359,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         isClientBridge[JOINED] = event.isClient();
         notify();
       }
+      @Override
       public synchronized void memberLeft(ClientMembershipEvent event) {
         assertFalse(firedBridge[LEFT]);
         assertNull(memberBridge[LEFT]);
@@ -344,6 +371,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         isClientBridge[LEFT] = event.isClient();
         notify();
       }
+      @Override
       public synchronized void memberCrashed(ClientMembershipEvent event) {
         assertFalse(firedBridge[CRASHED]);
         assertNull(memberBridge[CRASHED]);
@@ -363,7 +391,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final int[] ports = new int[1];
 
     // create BridgeServer in controller vm...
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] Create BridgeServer");
+    getLogWriter().info("[testLonerClientEventsInServer] Create BridgeServer");
     getSystem();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -377,9 +405,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final String serverMemberId = serverMember.toString();
     final Properties serverProperties = getSystem().getProperties();
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] ports[0]=" + ports[0]);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] serverMemberId=" + serverMemberId);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] serverMember=" + serverMember);
+    getLogWriter().info("[testLonerClientEventsInServer] ports[0]=" + ports[0]);
+    getLogWriter().info("[testLonerClientEventsInServer] serverMemberId=" + serverMemberId);
+    getLogWriter().info("[testLonerClientEventsInServer] serverMember=" + serverMember);
 
     // register the bridge listener
     ClientMembership.registerClientMembershipListener(bridgeListener);
@@ -398,7 +426,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     new SerializableCallable("Create bridge client") {
       @Override
       public Object call() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] create bridge client");
+        getLogWriter().info("[testLonerClientEventsInServer] create bridge client");
         Properties config = new Properties();
         config.setProperty(MCAST_PORT, "0");
         config.setProperty(LOCATORS, "");
@@ -429,7 +457,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] assert server detected client join");
+    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client join");
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
     //as of 6.1 the id can change when a bridge is created or a connection pool is created
@@ -475,7 +503,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect");
+        getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect");
         final String pl =
           getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl)PoolManager.find(pl);
@@ -485,7 +513,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     vm0.invoke(new SerializableRunnable("Close bridge client region") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] close bridge client region");
+        getLogWriter().info("[testLonerClientEventsInServer] close bridge client region");
         getRootRegion().getSubregion(name).close();
         PoolManager.close();
       }
@@ -502,7 +530,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] assert server detected client left");
+    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client left");
 
     assertFalse(firedBridge[JOINED]);
     assertNull(memberIdBridge[JOINED]);
@@ -561,7 +589,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] assert server detected client re-join");
+    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client re-join");
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
     assertEquals(clientMemberId, memberIdBridge[JOINED]);
@@ -606,7 +634,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect");
+        getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect");
         final String pl =
           getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl)PoolManager.find(pl);
@@ -618,7 +646,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Stop bridge client") {
         public void run() {
-          com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] Stop bridge client");
+          getLogWriter().info("[testLonerClientEventsInServer] Stop bridge client");
           getRootRegion().getSubregion(name).close();
           PoolManager.close();
         }
@@ -635,7 +663,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         }
       }
       
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer] assert server detected client crashed");
+    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client crashed");
     assertFalse(firedBridge[JOINED]);
     assertNull(memberIdBridge[JOINED]);
     assertNull(memberBridge[JOINED]);
@@ -687,14 +715,16 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
    * Tests notification of events for loner bridge clients in server process.
    */
   @Category(FlakyTest.class) // GEODE-1174: random port, async behavior, condition await loops
+  @Test
   public void testSystemClientEventsInServer() throws Exception {
-     try {
-       doTestSystemClientEventsInServer();
-     }
-     finally {
-       disconnectAllFromDS();
-     }
+    try {
+      doTestSystemClientEventsInServer();
+    }
+    finally {
+      disconnectAllFromDS();
+    }
   }
+
   private void doTestSystemClientEventsInServer() throws Exception {
     final boolean[] firedSystem = new boolean[3];
     final DistributedMember[] memberSystem = new DistributedMember[3];
@@ -743,7 +773,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       new UniversalMembershipListenerAdapter() {
       @Override
       public synchronized void memberJoined(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] memberJoined >" + event.getMemberId() + "<");
+        getLogWriter().info("[doTestSystemClientEventsInServer] memberJoined >" + event.getMemberId() + "<");
         firedAdapterDuplicate[JOINED] = firedAdapter[JOINED];
         firedAdapter[JOINED] = true;
         memberAdapter[JOINED] = event.getDistributedMember();
@@ -756,7 +786,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       @Override
       public synchronized void memberLeft(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] memberLeft >" + event.getMemberId() + "<");
+        getLogWriter().info("[doTestSystemClientEventsInServer] memberLeft >" + event.getMemberId() + "<");
         firedAdapterDuplicate[LEFT] = firedAdapter[LEFT];
         firedAdapter[LEFT] = true;
         memberAdapter[LEFT] = event.getDistributedMember();
@@ -769,7 +799,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       @Override
       public synchronized void memberCrashed(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] memberCrashed >" + event.getMemberId() + "<");
+        getLogWriter().info("[doTestSystemClientEventsInServer] memberCrashed >" + event.getMemberId() + "<");
         firedAdapterDuplicate[CRASHED] = firedAdapter[CRASHED];
         firedAdapter[CRASHED] = true;
         memberAdapter[CRASHED] = event.getDistributedMember();
@@ -815,7 +845,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final int[] ports = new int[1];
 
     // create BridgeServer in controller vm...
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] Create BridgeServer");
+    getLogWriter().info("[doTestSystemClientEventsInServer] Create BridgeServer");
     getSystem();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -835,9 +865,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     serverProperties.remove(SSL_PROTOCOLS);
     serverProperties.remove(SSL_REQUIRE_AUTHENTICATION);
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] ports[0]=" + ports[0]);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] serverMemberId=" + serverMemberId);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] serverMember=" + serverMember);
+    getLogWriter().info("[doTestSystemClientEventsInServer] ports[0]=" + ports[0]);
+    getLogWriter().info("[doTestSystemClientEventsInServer] serverMemberId=" + serverMemberId);
+    getLogWriter().info("[doTestSystemClientEventsInServer] serverMember=" + serverMember);
 
     // register the bridge listener
     ClientMembership.registerClientMembershipListener(bridgeListener);
@@ -856,7 +886,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     new SerializableCallable("Create bridge client") {
       @Override
       public Object call() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] create system bridge client");
+        getLogWriter().info("[doTestSystemClientEventsInServer] create system bridge client");
         assertTrue(getSystem(serverProperties).isConnected());
         assertFalse(getCache().isClosed());
         AttributesFactory factory = new AttributesFactory();
@@ -889,10 +919,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client join");
-    assertFalse(firedSystemDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client join");
+    assertArrayFalse(firedSystemDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
@@ -938,7 +968,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
+        getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
         final String pl =
           getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl)PoolManager.find(pl);
@@ -949,7 +979,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     // close bridge client region
     vm0.invoke(new SerializableRunnable("Close bridge client region") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] close bridge client region");
+        getLogWriter().info("[doTestSystemClientEventsInServer] close bridge client region");
         getRootRegion().getSubregion(name).close();
         PoolManager.close();
       }
@@ -966,10 +996,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client left");
-    assertFalse(firedSystemDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client left");
+    assertArrayFalse(firedSystemDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
     
     assertFalse(firedBridge[JOINED]);
     assertNull(memberIdBridge[JOINED]);
@@ -1028,10 +1058,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client re-join");
-    assertFalse(firedSystemDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client re-join");
+    assertArrayFalse(firedSystemDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
@@ -1077,7 +1107,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
+        getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
         final String pl =
           getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl)PoolManager.find(pl);
@@ -1088,7 +1118,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     // have bridge client disconnect from system
     vm0.invoke(new SerializableRunnable("Disconnect bridge client") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] disconnect bridge client");
+        getLogWriter().info("[doTestSystemClientEventsInServer] disconnect bridge client");
         closeCache();
         disconnectFromDS();
       }
@@ -1110,10 +1140,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client left");
-    assertFalse(firedSystemDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client left");
+    assertArrayFalse(firedSystemDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertFalse(firedBridge[JOINED]);
     assertNull(memberBridge[JOINED]);
@@ -1177,10 +1207,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client re-join");
-    assertFalse(firedSystemDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client re-join");
+    assertArrayFalse(firedSystemDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
@@ -1226,7 +1256,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
+        getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
         final String pl =
           getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl)PoolManager.find(pl);
@@ -1239,7 +1269,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Close bridge client region") {
         public void run() {
-          com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] close bridge client region");
+          getLogWriter().info("[doTestSystemClientEventsInServer] close bridge client region");
           getRootRegion().getSubregion(name).close();
           PoolManager.close();
         }
@@ -1256,10 +1286,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         }
       }
       
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client crashed");
-    assertFalse(firedSystemDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client crashed");
+      assertArrayFalse(firedSystemDuplicate);
+      assertArrayFalse(firedAdapterDuplicate);
+      assertArrayFalse(firedBridgeDuplicate);
 
     assertFalse(firedBridge[JOINED]);
     assertNull(memberBridge[JOINED]);
@@ -1310,7 +1340,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
    * Note: This probably won't work if the pool has more than one Endpoint.
    */
   protected void waitForClientToFullyConnect(final PoolImpl pool) {
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[waitForClientToFullyConnect]");
+    getLogWriter().info("[waitForClientToFullyConnect]");
     final long failMillis = System.currentTimeMillis() + JOIN_FAIL_MILLIS;
     boolean fullyConnected = false;
     while (!fullyConnected) {
@@ -1323,7 +1353,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
                  + " connections were created.",
                  System.currentTimeMillis() < failMillis);
     }
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[waitForClientToFullyConnect] fullyConnected=" + fullyConnected);
+    getLogWriter().info("[waitForClientToFullyConnect] fullyConnected=" + fullyConnected);
   }
   
   /**
@@ -1345,10 +1375,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /**
    * Asserts all elements in the array are false.
    */
-  private void assertFalse(boolean[] array) {
-    assertFalse(null, array);
+  private void assertArrayFalse(boolean[] array) {
+    assertArrayFalse(null, array);
   }
-  private void assertFalse(String msg, boolean[] array) {
+  private void assertArrayFalse(String msg, boolean[] array) {
     for (int i = 0; i < array.length; i++) {
       if (msg == null) {
         assertFalse(array[i]);
@@ -1357,10 +1387,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }    
   }
-  private void assertTrue(boolean[] array) {
-    assertTrue(null, array);
+  private void assertArrayTrue(boolean[] array) {
+    assertArrayTrue(null, array);
   }
-  private void assertTrue(String msg, boolean[] array) {
+  private void assertArrayTrue(String msg, boolean[] array) {
     for (int i = 0; i < array.length; i++) {
       if (msg == null) {
         assertTrue(array[i]);
@@ -1374,17 +1404,21 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
    * Tests notification of events for bridge server in system bridge client
    * process.
    */
+  @Test
   public void testServerEventsInPeerSystem() throws Exception {
-       try {
-         doTestServerEventsInPeerSystem();       
-       }finally {
-         disconnectAllFromDS();
-       }
+    try {
+      doTestServerEventsInPeerSystem();
+    }finally {
+     disconnectAllFromDS();
+    }
   }
+
   protected static int testServerEventsInSystemClient_port;
+
   private static int getTestServerEventsInSystemClient_port() {
     return testServerEventsInSystemClient_port;
   }
+
   private void doTestServerEventsInPeerSystem() throws Exception {
     // KIRK: this test fails intermittently with bug 37482
     final boolean[] firedSystem = new boolean[3];
@@ -1434,7 +1468,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       new UniversalMembershipListenerAdapter() {
       @Override
       public synchronized void memberJoined(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInSystemClient] memberJoined >" + event.getMemberId() + "<");
+        getLogWriter().info("[testServerEventsInSystemClient] memberJoined >" + event.getMemberId() + "<");
         firedAdapterDuplicate[JOINED] = firedAdapter[JOINED];
         firedAdapter[JOINED] = true;
         memberAdapter[JOINED] = event.getDistributedMember();
@@ -1447,7 +1481,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       @Override
       public synchronized void memberLeft(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInSystemClient] memberLeft >" + event.getMemberId() + "<");
+        getLogWriter().info("[testServerEventsInSystemClient] memberLeft >" + event.getMemberId() + "<");
         firedAdapterDuplicate[LEFT] = firedAdapter[LEFT];
         firedAdapter[LEFT] = true;
         memberAdapter[LEFT] = event.getDistributedMember();
@@ -1460,7 +1494,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       @Override
       public synchronized void memberCrashed(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInSystemClient] memberCrashed >" + event.getMemberId() + "<");
+        getLogWriter().info("[testServerEventsInSystemClient] memberCrashed >" + event.getMemberId() + "<");
         firedAdapterDuplicate[CRASHED] = firedAdapter[CRASHED];
         firedAdapter[CRASHED] = true;
         memberAdapter[CRASHED] = event.getDistributedMember();
@@ -1508,7 +1542,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertTrue(ports[0] != 0);
         
  // create BridgeServer in controller vm...
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer] Create BridgeServer");
+    getLogWriter().info("[doTestSystemClientEventsInServer] Create BridgeServer");
     getSystem();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -1527,9 +1561,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     serverProperties.remove(SSL_PROTOCOLS);
     serverProperties.remove(SSL_REQUIRE_AUTHENTICATION);
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] ports[0]=" + ports[0]);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] serverMemberId=" + serverMemberId);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] serverMember=" + serverMember);
+    getLogWriter().info("[testServerEventsInPeerSystem] ports[0]=" + ports[0]);
+    getLogWriter().info("[testServerEventsInPeerSystem] serverMemberId=" + serverMemberId);
+    getLogWriter().info("[testServerEventsInPeerSystem] serverMember=" + serverMember);
     
     GemFireCacheImpl cache = GemFireCacheImpl.getExisting();
     assertNotNull(cache);
@@ -1545,7 +1579,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     new SerializableCallable("Create Peer Cache") {
       @Override
       public Object call() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] Create Peer cache");
+        getLogWriter().info("[testServerEventsInPeerSystem] Create Peer cache");
         getSystem(serverProperties);
         AttributesFactory factory = new AttributesFactory();
         factory.setScope(Scope.LOCAL);
@@ -1559,8 +1593,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     DistributedMember peerMember = (DistributedMember)vm0.invoke(createPeerCache);
     String peerMemberId = peerMember.toString();
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] peerMemberId=" + peerMemberId);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] peerMember=" + peerMember);
+    getLogWriter().info("[testServerEventsInPeerSystem] peerMemberId=" + peerMemberId);
+    getLogWriter().info("[testServerEventsInPeerSystem] peerMember=" + peerMember);
 
     
 
@@ -1575,8 +1609,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] assert server detected peer join");
-    assertFalse(firedSystemDuplicate);
+    getLogWriter().info("[testServerEventsInPeerSystem] assert server detected peer join");
+    assertArrayFalse(firedSystemDuplicate);
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
@@ -1623,7 +1657,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Disconnect Peer server") {
         public void run() {
-          com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] disconnect peer server");
+          getLogWriter().info("[testServerEventsInPeerSystem] disconnect peer server");
           closeCache();
           disconnectFromDS();
         }
@@ -1646,14 +1680,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       ex.remove();
     }
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem] assert server detected peer crashed");
-    assertFalse(firedSystemDuplicate);
+    getLogWriter().info("[testServerEventsInPeerSystem] assert server detected peer crashed");
+    assertArrayFalse(firedSystemDuplicate);
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
     //assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer memberId.",
     //           firedAdapterDuplicate);
-    assertFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
       
     assertFalse(firedSystem[JOINED]);
     assertNull(memberSystem[JOINED]);
@@ -1697,18 +1731,22 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
    * Tests notification of events for bridge server in system bridge client
    * process.
    */
+  @Test
   public void testServerEventsInLonerClient() throws Exception {
-     try {
-       doTestServerEventsInLonerClient();
-     }
-     finally {
-       disconnectAllFromDS();
-     }
+    try {
+      doTestServerEventsInLonerClient();
+    }
+    finally {
+      disconnectAllFromDS();
+    }
   }
+
   protected static int testServerEventsInLonerClient_port;
+
   private static int getTestServerEventsInLonerClient_port() {
     return testServerEventsInLonerClient_port;
   }
+
   private void doTestServerEventsInLonerClient() throws Exception {
     final boolean[] firedAdapter = new boolean[3];
     final DistributedMember[] memberAdapter = new DistributedMember[3];
@@ -1727,7 +1765,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       new UniversalMembershipListenerAdapter() {
       @Override
       public synchronized void memberJoined(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] memberJoined >" + event.getMemberId() + "<");
+        getLogWriter().info("[testServerEventsInLonerClient] memberJoined >" + event.getMemberId() + "<");
         firedAdapterDuplicate[JOINED] = firedAdapter[JOINED];
         firedAdapter[JOINED] = true;
         memberAdapter[JOINED] = event.getDistributedMember();
@@ -1740,7 +1778,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       @Override
       public synchronized void memberLeft(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] memberLeft >" + event.getMemberId() + "<");
+        getLogWriter().info("[testServerEventsInLonerClient] memberLeft >" + event.getMemberId() + "<");
         firedAdapterDuplicate[LEFT] = firedAdapter[LEFT];
         firedAdapter[LEFT] = true;
         memberAdapter[LEFT] = event.getDistributedMember();
@@ -1753,7 +1791,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       @Override
       public synchronized void memberCrashed(MembershipEvent event) {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] memberCrashed >" + event.getMemberId() + "<");
+        getLogWriter().info("[testServerEventsInLonerClient] memberCrashed >" + event.getMemberId() + "<");
         firedAdapterDuplicate[CRASHED] = firedAdapter[CRASHED];
         firedAdapter[CRASHED] = true;
         memberAdapter[CRASHED] = event.getDistributedMember();
@@ -1800,13 +1838,13 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       { AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET) };
     assertTrue(ports[0] != 0);
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] create loner bridge client");
+    getLogWriter().info("[testServerEventsInLonerClient] create loner bridge client");
     Properties config = new Properties();
     config.setProperty(MCAST_PORT, "0");
     config.setProperty(LOCATORS, "");
     getSystem(config);
         
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] create system bridge client");
+    getLogWriter().info("[testServerEventsInLonerClient] create system bridge client");
     getSystem();
 
     // register the bridge listener
@@ -1822,7 +1860,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     new SerializableCallable("Create BridgeServer") {
       @Override
       public Object call() {
-        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] Create BridgeServer");
+        getLogWriter().info("[testServerEventsInLonerClient] Create BridgeServer");
         getSystem();
         AttributesFactory factory = new AttributesFactory();
         factory.setScope(Scope.LOCAL);
@@ -1833,7 +1871,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
           testServerEventsInLonerClient_port = startBridgeServer(ports[0]);
         }
         catch (IOException e) {
-          com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().error(e);
+          getLogWriter().error(e);
           fail(e.getMessage());
         }
         return basicGetSystem().getDistributedMember();
@@ -1847,9 +1885,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertEquals(ports[0],
                  (int) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] serverMember=" + serverMember);
+    getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
+    getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
+    getLogWriter().info("[testServerEventsInLonerClient] serverMember=" + serverMember);
 
     // create region which connects to bridge server
     AttributesFactory factory = new AttributesFactory();
@@ -1869,14 +1907,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] assert client detected server join");
+    getLogWriter().info("[testServerEventsInLonerClient] assert client detected server join");
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
     //assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer memberId.",
     //           firedAdapterDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertTrue(firedBridge[JOINED]);
     assertEquals(serverMember, memberBridge[JOINED]);
@@ -1909,7 +1947,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertFalse(isClientAdapter[CRASHED]);
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] wait for client to fully connect");
+    getLogWriter().info("[testServerEventsInLonerClient] wait for client to fully connect");
     final String pl =
       getRootRegion().getSubregion(name).getAttributes().getPoolName();
     PoolImpl pi = (PoolImpl)PoolManager.find(pl);
@@ -1938,7 +1976,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Disconnect bridge server") {
         public void run() {
-          com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] disconnect bridge server");
+          getLogWriter().info("[testServerEventsInLonerClient] disconnect bridge server");
           closeCache();
         }
       });
@@ -1962,14 +2000,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       lw.info(removeExpected2);
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] assert client detected server crashed");
+    getLogWriter().info("[testServerEventsInLonerClient] assert client detected server crashed");
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
     //assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer memberId.",
     //           firedAdapterDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertFalse(firedBridge[JOINED]);
     assertNull(memberIdBridge[JOINED]);
@@ -2015,9 +2053,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         (int) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
     serverMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
 
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] serverMember=" + serverMember);
+    getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
+    getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
+    getLogWriter().info("[testServerEventsInLonerClient] serverMember=" + serverMember);
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -2030,14 +2068,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
     
-    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient] assert client detected server re-join");
+    getLogWriter().info("[testServerEventsInLonerClient] assert client detected server re-join");
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
     //assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer memberId.",
     //           firedAdapterDuplicate);
-    assertFalse(firedAdapterDuplicate);
-    assertFalse(firedBridgeDuplicate);
+    assertArrayFalse(firedAdapterDuplicate);
+    assertArrayFalse(firedBridgeDuplicate);
 
     assertTrue(firedBridge[JOINED]);
     assertNotNull(memberBridge[JOINED]);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
index 7558295..33c760d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management.bean.stats;
 
+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.Set;
 
 import javax.management.ObjectName;
@@ -35,14 +44,16 @@ import com.gemstone.gemfire.test.dunit.VM;
 
 /**
  */
+@Category(DistributedTest.class)
 public class DistributedSystemStatsDUnitTest extends ManagementTestBase{
   
   private static final long serialVersionUID = 1L;
 
-  public DistributedSystemStatsDUnitTest(String name) {
-    super(name);
+  public DistributedSystemStatsDUnitTest() {
+    super();
   }
 
+  @Test
   public void testDistributedSystemStats() throws Exception {
     initManagement(true);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
index 01acabf..a7c2ce4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
@@ -16,30 +16,47 @@
  */
 package com.gemstone.gemfire.management.internal.cli;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.execute.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+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.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.management.DistributedRegionMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.RegionMXBean;
 import com.gemstone.gemfire.management.internal.cli.result.CommandResultException;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-/**
- * 
- *
- */
-public class CliUtilDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CliUtilDUnitTest extends JUnit4CacheTestCase {
 
-  public CliUtilDUnitTest(String name) {
-    super(name);    
+  public CliUtilDUnitTest() {
+    super();    
   }
 
   public static final String COMMON_REGION="region1";
@@ -216,6 +233,7 @@ public class CliUtilDUnitTest extends CacheTestCase {
     assertNotNull(service.getMemberMXBean());
   }
   
+  @Test
   public void testFileToBytes(){
     
     //CliUtil.filesToBytes(fileNames)
@@ -223,6 +241,7 @@ public class CliUtilDUnitTest extends CacheTestCase {
   }
   
   @SuppressWarnings("serial")
+  @Test
   public void testCliUtilMethods() {
     setupMembersWithIdsAndGroups();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
index 1ad2efd..5cbf715 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
@@ -16,7 +16,21 @@
  */
 package com.gemstone.gemfire.management.internal.pulse;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -28,19 +42,23 @@ import com.gemstone.gemfire.management.CacheServerMXBean;
 import com.gemstone.gemfire.management.MBeanUtil;
 import com.gemstone.gemfire.management.ManagementTestBase;
 import com.gemstone.gemfire.management.internal.cli.CliUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is for testing client IDs
- * 
  */
-
-public class TestClientIdsDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class TestClientIdsDUnitTest extends JUnit4DistributedTestCase {
 
   private static final String k1 = "k1";
   private static final String k2 = "k2";
@@ -62,9 +80,9 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
 
   private ManagementTestBase helper;
 
-  public TestClientIdsDUnitTest(String name) {
-    super(name);
-    this.helper = new ManagementTestBase(name);
+  @Override
+  public final void preSetUp() throws Exception {
+    this.helper = new ManagementTestBase(){};
   }
 
   @Override
@@ -86,8 +104,7 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
     disconnectFromDS();
   }
 
-  private static final long serialVersionUID = 1L;
-
+  @Test
   public void testClientIds() throws Exception {
     helper.createManagementCache(managingNode);
     helper.startManagingNode(managingNode);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
index 5420542..1ce8ed1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management.internal.pulse;
 
+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.Cache;
 import com.gemstone.gemfire.cache.execute.Execution;
 import com.gemstone.gemfire.cache.execute.Function;
@@ -35,12 +44,13 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  * 
  */
+@Category(DistributedTest.class)
 public class TestFunctionsDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
 
-  public TestFunctionsDUnitTest(String name) {
-    super(name);
+  public TestFunctionsDUnitTest() {
+    super();
   }
 
   public static Integer getNumOfRunningFunction() {
@@ -74,6 +84,7 @@ public class TestFunctionsDUnitTest extends ManagementTestBase {
     return Integer.valueOf(bean.getNumRunningFunctions());
   }
 
+  @Test
   public void testNumOfRunningFunctions() throws Exception {
     initManagement(false);
     VM client = managedNodeList.get(2);    

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
index 5cba6dd..d9fcea9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management.internal.pulse;
 
+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.management.DistributedSystemMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
@@ -29,12 +38,13 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  */
 
+@Category(DistributedTest.class)
 public class TestHeapDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
 
-  public TestHeapDUnitTest(String name) {
-    super(name);
+  public TestHeapDUnitTest() {
+    super();
   }
 
   public static long getHeapSizeOfClient() {
@@ -68,6 +78,7 @@ public class TestHeapDUnitTest extends ManagementTestBase {
     return bean.getTotalHeapSize() * 1000;
   }
 
+  @Test
   public void testTotalHeapSize() throws Exception {
     initManagement(false);
     long totalHeapSizeOnAll = 0;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
index 3d6a6b8..38f73cb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.management.internal.pulse;
 
+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.management.DistributedSystemMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
@@ -28,12 +37,13 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
  * 
  */
 
+@Category(DistributedTest.class)
 public class TestLocatorsDUnitTest extends ManagementTestBase {
 
   private static final long serialVersionUID = 1L;
 
-  public TestLocatorsDUnitTest(String name) {
-    super(name);
+  public TestLocatorsDUnitTest() {
+    super();
   }
 
   public static int getNumOfLocatorFromMBean() {
@@ -62,6 +72,7 @@ public class TestLocatorsDUnitTest extends ManagementTestBase {
     return bean.getLocatorCount();
   }
 
+  @Test
   public void testLocatorsDUnitTest() throws Exception {
     initManagement(false);
     int locatorCount = ((Number) managingNode.invoke(() -> TestLocatorsDUnitTest.getNumOfLocatorFromMBean())).intValue();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
index 9b79b67..f483cef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
@@ -16,7 +16,21 @@
  */
 package com.gemstone.gemfire.management.internal.pulse;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -27,36 +41,39 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.management.DistributedSystemMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This is for testing subscriptions
- * 
- * 
  */
+@Category(DistributedTest.class)
+public class TestSubscriptionsDUnitTest extends JUnit4DistributedTestCase {
 
-public class TestSubscriptionsDUnitTest extends DistributedTestCase {
   private static final String k1 = "k1";
   private static final String k2 = "k2";
   private static final String client_k1 = "client-k1";
 
   private static final String client_k2 = "client-k2";
-  /** name of the test region */
-  private static final String REGION_NAME = "TestSubscriptionsDUnitTest_Region";
+  private static final String REGION_NAME = TestSubscriptionsDUnitTest.class.getSimpleName() + "_Region";
   private static VM server = null;
   private static VM client = null;
   private static VM client2 = null;
   private static VM managingNode = null;
   private ManagementTestBase helper;
 
-  public TestSubscriptionsDUnitTest(String name) {
-    super(name);
-    this.helper = new ManagementTestBase(name);
+  @Override
+  public final void preSetUp() throws Exception {
+    this.helper = new ManagementTestBase(){};
   }
 
   @Override
@@ -77,8 +94,7 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
     disconnectFromDS();
   }
 
-  private static final long serialVersionUID = 1L;
-
+  @Test
   public void testNoOfSubscription() throws Exception {
 
     helper.createManagementCache(managingNode);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/memcached/DomainObjectsAsValuesJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/memcached/DomainObjectsAsValuesJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/memcached/DomainObjectsAsValuesJUnitTest.java
index 98aa90d..b55a5a7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/memcached/DomainObjectsAsValuesJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/memcached/DomainObjectsAsValuesJUnitTest.java
@@ -16,28 +16,27 @@
  */
 package com.gemstone.gemfire.memcached;
 
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import net.spy.memcached.MemcachedClient;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.concurrent.Future;
 import java.util.logging.Logger;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.*;
+import net.spy.memcached.MemcachedClient;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
 public class DomainObjectsAsValuesJUnitTest {
 
-  private static final Logger logger = Logger.getLogger(DomainObjectsAsValuesJUnitTest.class.getCanonicalName());
-  
   private int PORT;
   
   private GemFireMemcachedServer server;
@@ -56,7 +55,7 @@ public class DomainObjectsAsValuesJUnitTest {
     System.getProperties().remove(DistributionConfig.GEMFIRE_PREFIX + MCAST_PORT);
   }
 
-  public static class Customer implements java.io.Serializable {
+  private static class Customer implements java.io.Serializable {
     private static final long serialVersionUID = 4238572216598708877L;
     private String name;
     private String address;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/memcached/IntegrationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/memcached/IntegrationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/memcached/IntegrationJUnitTest.java
index 63e7b3f..b6931d6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/memcached/IntegrationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/memcached/IntegrationJUnitTest.java
@@ -16,25 +16,23 @@
  */
 package com.gemstone.gemfire.memcached;
 
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import net.spy.memcached.MemcachedClient;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.Properties;
 import java.util.concurrent.Future;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-import static org.junit.Assert.*;
+import net.spy.memcached.MemcachedClient;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**
- * 
- */
 @Category(IntegrationTest.class)
 public class IntegrationJUnitTest {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/AutoSerializableJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/AutoSerializableJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/AutoSerializableJUnitTest.java
index fccfbcf..b4527e4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/AutoSerializableJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/AutoSerializableJUnitTest.java
@@ -48,15 +48,6 @@ import static org.junit.Assert.*;
 
 /**
  * TODO: fails (on Windows 7?)
- * 
-com.gemstone.gemfire.pdx.AutoSerializableJUnitTest > testMultipleClassLoaders FAILED
-    junit.framework.AssertionFailedError
-        at junit.framework.Fail(Assert.java:55)
-        at junit.framework.Assert.assertTrue(Assert.java:22)
-        at junit.framework.Assert.assertFalse(Assert.java:39)
-        at junit.framework.Assert.assertFalse(Assert.java:47)
-        at junit.framework.TestCase.assertFalse(TestCase.java:219)
-        at com.gemstone.gemfire.pdx.AutoSerializableJUnitTest.testMultipleClassLoaders(AutoSerializableJUnitTest.java:1218)
  */
 @Category(IntegrationTest.class)
 public class AutoSerializableJUnitTest {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
index 90f51d9..e536ca6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
@@ -16,41 +16,68 @@
  */
 package com.gemstone.gemfire.pdx;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+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.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Operation;
+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.Scope;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.DistributedPutAllOperation;
+import com.gemstone.gemfire.internal.cache.DistributedRegion;
+import com.gemstone.gemfire.internal.cache.EntryEventImpl;
+import com.gemstone.gemfire.internal.cache.EventID;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
 import com.gemstone.gemfire.internal.cache.tier.sockets.BaseCommand;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.cache.tier.sockets.command.Put70;
 import com.gemstone.gemfire.internal.cache.versions.VMVersionTag;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+@Category(DistributedTest.class)
+public class ClientsWithVersioningRetryDUnitTest extends JUnit4CacheTestCase {
 
-/**
- *
- */
-public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
   // list of expected exceptions to remove in tearDown2()
   static List<IgnoredException> expectedExceptions = new LinkedList<IgnoredException>();
 
-  public ClientsWithVersioningRetryDUnitTest(String name) {
-    super(name);
-  }
-  
   @Override
   public final void postSetUp() throws Exception {
     Invoke.invokeInEveryVM(new SerializableRunnable() {
@@ -82,6 +109,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
    * the version information.
    * second failure in bug 44951
    */
+  @Test
   public void testRetryPut() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -159,6 +187,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
    * the version information.
    * bug #45059
    */
+  @Test
   public void testRetryPutAll() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -247,6 +276,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
    * and get the version information.
    * bug #48205
    */
+  @Test
   public void testRetryPutAllInAccessor() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
index f1adbce..85e12cf 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
@@ -16,26 +16,33 @@
  */
 package com.gemstone.gemfire.pdx;
 
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-public class DistributedSystemIdDUnitTest extends DistributedTestCase {
-  
-  public DistributedSystemIdDUnitTest(String name) {
-    super(name);
-  }
+import com.gemstone.gemfire.distributed.internal.DistributionManager;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
+public class DistributedSystemIdDUnitTest extends JUnit4DistributedTestCase {
+  
   @Override
   public void preSetUp() {
     disconnectAllFromDS(); // GEODE-558 test fails due to infection from another test
   }
 
+  @Test
   public void testMatchingIds() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -49,9 +56,9 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
     checkId(vm0, 1);
     checkId(vm1, 1);
     checkId(vm2, 1);
-    
   }
   
+  @Test
   public void testInfectiousId() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -63,6 +70,7 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
     checkId(vm1, 1);
   }
   
+  @Test
   public void testMismatch() {
     IgnoredException.addIgnoredException("Rejected new system node");
     Host host = Host.getHost(0);
@@ -81,6 +89,7 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
     checkId(vm0, 1);
   }
   
+  @Test
   public void testInvalid() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -90,19 +99,17 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
       createLocator(vm0, "256");
       fail("Should have gotten an exception");
     } catch(Exception expected) {
-
     }
+
     try {
       createLocator(vm0, "aardvark");
       fail("Should have gotten an exception");
     } catch(Exception expected) {
-      
     }
   }
 
   private void createSystem(VM vm, final String dsId, final int locatorPort) {
-    
-    
+
     SerializableCallable createSystem = new SerializableCallable() {
       public Object call() throws Exception {
         Properties props = new Properties();
@@ -125,8 +132,6 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
         props.setProperty(LOCATORS, "localhost[" + port + "]");
         props.setProperty(START_LOCATOR, "localhost[" + port + "]");
         getSystem(props);
-//        Locator locator = Locator.startLocatorAndDS(port, File.createTempFile("locator", ""), props);
-//        system = (InternalDistributedSystem) locator.getDistributedSystem();
         return port;
       }
     };
@@ -135,7 +140,6 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
   
   private void checkId(VM vm, final int dsId) {
     
-    
     SerializableCallable createSystem = new SerializableCallable() {
       public Object call() throws Exception {
         DistributionManager dm = (DistributionManager) InternalDistributedSystem.getAnyInstance().getDistributionManager();
@@ -145,7 +149,4 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
     };
     vm.invoke(createSystem);
   }
-  
-  
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONFormatterJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONFormatterJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONFormatterJUnitTest.java
index 40a1071..6fbc9de 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONFormatterJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONFormatterJUnitTest.java
@@ -16,14 +16,14 @@
  */
 package com.gemstone.gemfire.pdx;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.text.SimpleDateFormat;
+
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.internal.Assert;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.junit.After;
@@ -31,10 +31,16 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.text.SimpleDateFormat;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.fail;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.internal.Assert;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
 public class JSONFormatterJUnitTest {
@@ -42,10 +48,6 @@ public class JSONFormatterJUnitTest {
   private GemFireCacheImpl c;
   private final String PRIMITIVE_KV_STORE_REGION = "primitiveKVStore";
     
-  public JSONFormatterJUnitTest() {
-    super();
-  }
-
   @Before
   public void setUp() throws Exception {
     this.c = (GemFireCacheImpl) new CacheFactory().set(MCAST_PORT, "0").setPdxReadSerialized(true).create();
@@ -148,48 +150,48 @@ public class JSONFormatterJUnitTest {
 
       //Testcase-1: Validate json string against the pdxInstance.
       //validation for primitive types
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Int type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Int type values are not matched",
           testObject.getP_int(), jsonObject.getInt(testObject.getP_intFN()));
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: long type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: long type values are not matched",
           testObject.getP_long(), jsonObject.getLong(testObject.getP_longFN()));
 
       //validation for wrapper types
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Boolean type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Boolean type values are not matched",
           testObject.getW_bool().booleanValue(), jsonObject.getBoolean(testObject.getW_boolFN()));
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Float type values are not matched",
-          testObject.getW_double().doubleValue(), jsonObject.getDouble(testObject.getW_doubleFN()));
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: bigDec type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Float type values are not matched",
+          testObject.getW_double().doubleValue(), jsonObject.getDouble(testObject.getW_doubleFN()), 0);
+      assertEquals("VerifyPdxInstanceToJson: bigDec type values are not matched",
           testObject.getW_bigDec().longValue(), jsonObject.getLong(testObject.getW_bigDecFN()));
 
       //vlidation for array types
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Byte[] type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Byte[] type values are not matched",
           (int)testObject.getW_byteArray()[1], jsonObject.getJSONArray(testObject.getW_byteArrayFN()).getInt(1));
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Double[] type values are not matched",
-          testObject.getW_doubleArray()[0], jsonObject.getJSONArray(testObject.getW_doubleArrayFN()).getDouble(0));
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: String[] type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Double[] type values are not matched",
+          testObject.getW_doubleArray()[0], jsonObject.getJSONArray(testObject.getW_doubleArrayFN()).getDouble(0), 0);
+      assertEquals("VerifyPdxInstanceToJson: String[] type values are not matched",
           testObject.getW_strArray()[2], jsonObject.getJSONArray(testObject.getW_strArrayFN()).getString(2));
 
       //validation for collection types
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: list type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: list type values are not matched",
           testObject.getC_list().get(0),
           jsonObject.getJSONArray(testObject.getC_listFN()).getString(0));
 
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: stack type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: stack type values are not matched",
           testObject.getC_stack().get(2),
           jsonObject.getJSONArray(testObject.getC_stackFN()).getString(2));
 
       //validation for Map
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Map type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Map type values are not matched",
           testObject.getM_empByCity().get("Ahmedabad").get(0).getFname(),
           jsonObject.getJSONObject(testObject.getM_empByCityFN()).getJSONArray("Ahmedabad").getJSONObject(0).getString("fname"));
 
       //validation Enum
-      junit.framework.Assert.assertEquals("VerifyPdxInstanceToJson: Enum type values are not matched",
+      assertEquals("VerifyPdxInstanceToJson: Enum type values are not matched",
           testObject.getDay().toString(),
           jsonObject.getString(testObject.getDayFN()));
 
     } catch (JSONException e) {
-      fail("Error in VerifyPdxInstanceToJson, Malformed json, can not create JSONArray from it");
+      throw new AssertionError("Error in VerifyPdxInstanceToJson, Malformed json, can not create JSONArray from it", e);
     }
   }
 



[19/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
index 1be5f8e..d939fd4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -16,24 +16,45 @@
  */
 package com.gemstone.gemfire.internal.cache.locks;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CommitConflictException;
 import com.gemstone.gemfire.distributed.DistributedLockService;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.*;
+import com.gemstone.gemfire.distributed.internal.DM;
+import com.gemstone.gemfire.distributed.internal.DistributionMessage;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.distributed.internal.ReplyProcessor21;
 import com.gemstone.gemfire.distributed.internal.locks.DLockRecoverGrantorProcessor;
 import com.gemstone.gemfire.distributed.internal.locks.DLockService;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.cache.TXRegionLockRequestImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests distributed ownership via the DistributedLockService api.
  */
-public class TXLockServiceDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
   
   private static DistributedSystem system;
   
@@ -42,8 +63,8 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
   
   private InternalDistributedMember lockGrantor;
 
-  public TXLockServiceDUnitTest(String name) {
-    super(name);
+  public TXLockServiceDUnitTest() {
+    super();
   }
   
   // -------------------------------------------------------------------------
@@ -99,18 +120,23 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
   //   Test methods
   // -------------------------------------------------------------------------
   
+  @Test
   public void testGetAndDestroy() {
     forEachVMInvoke("checkGetAndDestroy", new Object[] {});
     /*invokeInEveryVM(TXLockServiceDUnitTest.class,
                     "destroyServices"); 
     forEachVMInvoke("checkGetAndDestroy", new Object[] {});*/
   }
-  
-  public void _ttestGetAndDestroyAgain() {
+
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testGetAndDestroyAgain() {
     testGetAndDestroy();
   }
-  
-  public void disable_testTXRecoverGrantorMessageProcessor() throws Exception {
+
+  @Ignore("TODO: test is disabled")
+  @Test
+  public void testTXRecoverGrantorMessageProcessor() throws Exception {
     LogWriterUtils.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
     TXLockService.createDTLS();
     checkDLockRecoverGrantorMessageProcessor();
@@ -169,6 +195,8 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
   }
   
   protected static volatile TXLockId testTXLock_TXLockId;
+
+  @Test
   public void testTXLock() {
     LogWriterUtils.getLogWriter().info("[testTXLock]");
     final int grantorVM = 0;
@@ -280,6 +308,8 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
   }
   
   protected static volatile TXLockId testTXOriginatorRecoveryProcessor_TXLockId;
+
+  @Test
   public void testTXOriginatorRecoveryProcessor() {
     LogWriterUtils.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
     final int originatorVM = 0;
@@ -374,7 +404,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
         TXLockService.destroyServices();
       }
     });
-    Host.getHost(0).getVM(originatorVM).invoke(() -> DistributedTestCase.disconnectFromDS());
+    Host.getHost(0).getVM(originatorVM).invoke(() -> disconnectFromDS());
     
     
     // grantor sends TXOriginatorRecoveryMessage...
@@ -402,6 +432,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
     });
   }
   
+  @Test
   public void testDTLSIsDistributed() {
     LogWriterUtils.getLogWriter().info("[testDTLSIsDistributed]");
     
@@ -475,7 +506,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
    * Connects a DistributedSystem, saves it in static variable "system"
    */
   private static void connectDistributedSystem() {
-    system = (new TXLockServiceDUnitTest("dummy")).getSystem();
+    system = (new TXLockServiceDUnitTest()).getSystem();
   }
   
   private static InternalDistributedMember identifyLockGrantor(String serviceName) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
index 24685e4..2e596e9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
@@ -16,76 +16,54 @@
  */
 package com.gemstone.gemfire.internal.cache.lru;
 
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+
+import com.gemstone.gemfire.StatisticDescriptor;
+import com.gemstone.gemfire.StatisticsFactory;
+import com.gemstone.gemfire.StatisticsType;
+import com.gemstone.gemfire.StatisticsTypeFactory;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAlgorithm;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
 import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
 import com.gemstone.gemfire.internal.cache.PlaceHolderDiskRegion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-/**  This class tests the LRUCapacityController's core clock algorithm.  */
+/**
+ * This class tests the LRUCapacityController's core clock algorithm.
+ */
 @Category(IntegrationTest.class)
-public class LRUClockJUnitTest extends junit.framework.TestCase {
+public class LRUClockJUnitTest {
   
   private String myTestName;
 
-  //static int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-
   static Properties sysProps = new Properties();
-  static {
-    //sysProps.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, String.valueOf(unusedPort));
-    // a loner is all this test needs
-    sysProps.setProperty(MCAST_PORT, "0");
-    sysProps.setProperty(LOCATORS, "");
-  }
 
-  public LRUClockJUnitTest( String name ) {
-    super( name );
-    this.myTestName = name;
-  }
+  @Rule
+  public TestName testName = new TestName();
 
-  protected LRUClockJUnitTest( String prefix, String methodName ) {
-    super( methodName );
-    this.myTestName = prefix + methodName;
-  }
-  
-  /**
-   *  The JUnit setup method
-   *
-   * @exception  Exception  Description of the Exception
-   */
   @Before
   public void setUp() throws Exception {
-    super.setUp();
-    System.out.println( "\n\n### beginning " + this.myTestName + "###" );
-  }
-
-  /**
-   *  The teardown method for JUnit
-   *
-   * @exception  Exception  Description of the Exception
-   */
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
-    System.out.println( "###  finished " + this.myTestName + "###" );
+    sysProps = new Properties();
+    sysProps.setProperty(MCAST_PORT, "0");
+    sysProps.setProperty(LOCATORS, "");
   }
 
-  /**
-   *  A unit test for JUnit
-   *
-   * @exception  Exception  Description of the Exception
-   */
   @Test
   public void testAddToClockFace() throws Exception {
     NewLRUClockHand clock = getAClockHand( getARegion(), new TestEnableLRU() );
@@ -110,8 +88,7 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
   }
 
   @Test
-  public void testFIFO() {
-    try {
+  public void testFIFO() throws Exception {
     NewLRUClockHand clock = getAClockHand( getARegion(), new TestEnableLRU() );
 
     for( int i = 0; i < 100; i++ ) {
@@ -139,15 +116,6 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
       le = (LRUTestEntry) clock.getLRUEntry();
     }
     assertTrue( "expected 100, found " + counter, counter == 100);
-    } 
-    catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    }
-    catch ( Throwable t ) {
-      t.printStackTrace();
-      assertTrue( "failed", false );
-    }
   }
   
   @Test
@@ -267,16 +235,16 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
   }
   
   /** manufacture a node so that a shared type can be used by SharedLRUClockTest. */
-  protected LRUTestEntry getANode( int id ) {
+  private LRUTestEntry getANode( int id ) {
     return new LocalLRUTestEntry( id );
   }
-  
-  public static interface LRUTestEntry extends LRUClockNode {
+
+  private interface LRUTestEntry extends LRUClockNode {
     public int id();
   }
   
   /** test implementation of an LRUClockNode */
-  public static class LocalLRUTestEntry implements LRUTestEntry {
+  private static class LocalLRUTestEntry implements LRUTestEntry {
     
     int id;
     LRUClockNode next;
@@ -293,7 +261,8 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
       recentlyUsed = false;
       evicted = false;
     }
-    
+
+    @Override
     public int id() {
       return id; 
     }
@@ -301,108 +270,121 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
     public boolean isTombstone() {
       return false;
     }
-    
+
+    @Override
     public void setNextLRUNode( LRUClockNode next ) {
       this.next = next; 
     }
-    
+
+    @Override
     public LRUClockNode nextLRUNode() {
       return this.next; 
     }
 
+    @Override
     public void setPrevLRUNode( LRUClockNode prev ) {
       this.prev = prev; 
     }
-    
+
+    @Override
     public LRUClockNode prevLRUNode() {
       return this.prev; 
     }
-    
-    
+
+    @Override
     public int updateEntrySize( EnableLRU cc ) {
       return this.size = 1; 
     }
 
+    @Override
     public int updateEntrySize(EnableLRU cc, Object value) {
       return this.size = 1; 
     }
-    
+
+    @Override
     public int getEntrySize() {
       return this.size; 
     }
     
     /** this should only happen with the LRUClockHand sync'ed */
+    @Override
     public void setEvicted() {
       evicted = true;
     }
 
+    @Override
     public void unsetEvicted() {
       evicted = false;
     }
-    
+
+    @Override
     public boolean testEvicted( ) {
       return evicted; 
     }
-    
+
+    @Override
     public boolean testRecentlyUsed() {
       return recentlyUsed;  
     }
-    
+
+    @Override
     public void setRecentlyUsed() {
       recentlyUsed = true;  
     }
-    
+
+    @Override
     public void unsetRecentlyUsed() {
       recentlyUsed = false; 
     }
+
     public LRUClockNode absoluteSelf( ) { return this; }
     public LRUClockNode clearClones( ) { return this; }
     public int cloneCount( ) { return 0; }
   }
 
-
-  public class TestEnableLRU implements EnableLRU {
+  private class TestEnableLRU implements EnableLRU {
 
     private final StatisticsType statType;
 
     {
-    // create the stats type for MemLRU.
-    StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
-    
-    final String bytesAllowedDesc = 
-      "Number of total bytes allowed in this region.";
-    final String byteCountDesc = 
-      "Number of bytes in region.";
-    final String lruEvictionsDesc = 
-      "Number of total entry evictions triggered by LRU.";
-    final String lruEvaluationsDesc = 
-      "Number of entries evaluated during LRU operations.";
-    final String lruGreedyReturnsDesc =
-      "Number of non-LRU entries evicted during LRU operations";
-    final String lruDestroysDesc =
-      "Number of entry destroys triggered by LRU.";
-    final String lruDestroysLimitDesc =
-      "Maximum number of entry destroys triggered by LRU before scan occurs.";
-      
-    statType = f.createType( "TestLRUStatistics",
-      "Statistics about byte based Least Recently Used region entry disposal",
-      new StatisticDescriptor[] {
-        f.createLongGauge("bytesAllowed", bytesAllowedDesc, "bytes" ),
-        f.createLongGauge("byteCount", byteCountDesc, "bytes" ),
-        f.createLongCounter("lruEvictions", lruEvictionsDesc, "entries" ),
-        f.createLongCounter("lruEvaluations", lruEvaluationsDesc, "entries" ),
-        f.createLongCounter("lruGreedyReturns", lruGreedyReturnsDesc, "entries"),
-        f.createLongCounter("lruDestroys", lruDestroysDesc, "entries" ),
-        f.createLongCounter("lruDestroysLimit", lruDestroysLimitDesc, "entries" ),
-      }
-    );
-  }
-
-  
+      // create the stats type for MemLRU.
+      StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
+
+      final String bytesAllowedDesc =
+        "Number of total bytes allowed in this region.";
+      final String byteCountDesc =
+        "Number of bytes in region.";
+      final String lruEvictionsDesc =
+        "Number of total entry evictions triggered by LRU.";
+      final String lruEvaluationsDesc =
+        "Number of entries evaluated during LRU operations.";
+      final String lruGreedyReturnsDesc =
+        "Number of non-LRU entries evicted during LRU operations";
+      final String lruDestroysDesc =
+        "Number of entry destroys triggered by LRU.";
+      final String lruDestroysLimitDesc =
+        "Maximum number of entry destroys triggered by LRU before scan occurs.";
+
+      statType = f.createType( "TestLRUStatistics",
+        "Statistics about byte based Least Recently Used region entry disposal",
+        new StatisticDescriptor[] {
+          f.createLongGauge("bytesAllowed", bytesAllowedDesc, "bytes" ),
+          f.createLongGauge("byteCount", byteCountDesc, "bytes" ),
+          f.createLongCounter("lruEvictions", lruEvictionsDesc, "entries" ),
+          f.createLongCounter("lruEvaluations", lruEvaluationsDesc, "entries" ),
+          f.createLongCounter("lruGreedyReturns", lruGreedyReturnsDesc, "entries"),
+          f.createLongCounter("lruDestroys", lruDestroysDesc, "entries" ),
+          f.createLongCounter("lruDestroysLimit", lruDestroysLimitDesc, "entries" ),
+        }
+      );
+    }
+
+    @Override
     public int entrySize( Object key, Object value ) throws IllegalArgumentException {
       return 1;  
     }
-    
+
+    @Override
     public long limit( ) {
       return 20; 
     }
@@ -410,66 +392,79 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
     public boolean usesMem( ) {
       return false; 
     }
-    
+
+    @Override
     public EvictionAlgorithm getEvictionAlgorithm() {
       return EvictionAlgorithm.LRU_ENTRY;
     }
-    
+
+    @Override
     public LRUStatistics getStats() {
       return null;
     }
 
+    @Override
     public EvictionAction getEvictionAction() {
       return EvictionAction.DEFAULT_EVICTION_ACTION;
     }
 
-      public StatisticsType getStatisticsType() {
-        return statType;
-      }
+    @Override
+    public StatisticsType getStatisticsType() {
+      return statType;
+    }
 
-      public String getStatisticsName() {
-        return "TestLRUStatistics";
-      }
+    @Override
+    public String getStatisticsName() {
+      return "TestLRUStatistics";
+    }
 
-      public int getLimitStatId() {
-        return statType.nameToId("bytesAllowed");
+    @Override
+    public int getLimitStatId() {
+      return statType.nameToId("bytesAllowed");
+    }
 
-      }
+    @Override
+    public int getCountStatId() {
+      return statType.nameToId("byteCount");
+    }
 
-      public int getCountStatId() {
-        return statType.nameToId("byteCount");
-      }
+    @Override
+    public int getEvictionsStatId() {
+      return statType.nameToId("lruEvictions");
+    }
 
-      public int getEvictionsStatId() {
-        return statType.nameToId("lruEvictions");
-      }
+    @Override
+    public int getDestroysStatId() {
+      return statType.nameToId("lruDestroys");
+    }
 
-      public int getDestroysStatId() {
-        return statType.nameToId("lruDestroys");
-      }
+    @Override
+    public int getDestroysLimitStatId() {
+      return statType.nameToId("lruDestroysLimit");
+    }
 
-      public int getDestroysLimitStatId() {
-        return statType.nameToId("lruDestroysLimit");
-      }
+    @Override
+    public int getEvaluationsStatId() {
+      return statType.nameToId("lruEvaluations");
+    }
 
-      public int getEvaluationsStatId() {
-        return statType.nameToId("lruEvaluations");
-      }
-      
-      public int getGreedyReturnsStatId() {
-        return statType.nameToId("lruGreedyReturns");
-      }
+    @Override
+    public int getGreedyReturnsStatId() {
+      return statType.nameToId("lruGreedyReturns");
+    }
 
+    @Override
     public boolean mustEvict(LRUStatistics stats, Region region, int delta) {
       throw new UnsupportedOperationException("Not implemented");
     }
 
+    @Override
     public void afterEviction() {
       throw new UnsupportedOperationException("Not implemented");
     }
 
-    public LRUStatistics initStats(Object region, StatisticsFactory sf)
-    {
+    @Override
+    public LRUStatistics initStats(Object region, StatisticsFactory sf) {
       String regionName;
       if (region instanceof Region) {
         regionName = ((Region)region).getName();
@@ -486,7 +481,7 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
   }
 
   /** overridden in SharedLRUClockTest to test SharedLRUClockHand */
-  protected NewLRUClockHand getAClockHand( Region reg, EnableLRU elru ) {
+  private NewLRUClockHand getAClockHand( Region reg, EnableLRU elru ) {
     return new NewLRUClockHand( reg, elru,new InternalRegionArguments());
   }
   
@@ -503,7 +498,7 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
     if ( root == null ) {
       root = c.createRegion("root", af.create() );
     }
-    Region sub = root.createSubregion( myTestName, af.create() );
+    Region sub = root.createSubregion( testName.getMethodName(), af.create() );
     return sub;
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
index f796945..90b8ecc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
@@ -16,11 +16,14 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+import static org.junit.Assert.*;
+
 import java.io.Serializable;
 import java.util.List;
 import java.util.Set;
 
-import junit.framework.Assert;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.CancelException;
 import com.gemstone.gemfire.LogWriter;
@@ -30,7 +33,6 @@ import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.PartitionAttributes;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
@@ -39,28 +41,24 @@ import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedM
 import com.gemstone.gemfire.internal.cache.ForceReattemptException;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore;
-import com.gemstone.gemfire.internal.cache.partitioned.ManageBucketMessage;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
+@Category(DistributedTest.class)
+public class Bug39356DUnitTest extends JUnit4CacheTestCase {
 
-/**
- *
- */
-public class Bug39356DUnitTest extends CacheTestCase {
   protected static final String REGION_NAME = "myregion";
   
-  public Bug39356DUnitTest(String name) {
-    super(name);
-  }
-  
   /**
    * This tests the case where the VM forcing other
    * VMs to create a bucket crashes while creating the bucket.
    */
+  @Test
   public void testCrashWhileCreatingABucket() {
     Host host = Host.getHost(0);
     final VM vm0 = host.getVM(0);
@@ -127,9 +125,9 @@ public class Bug39356DUnitTest extends CacheTestCase {
             log.info("skipping bucket " + i + " because it has no data");
             continue;
           }
-          Assert.assertEquals("Expecting bucket " +  i + " to have two copies", 2, owners.size());
+          assertEquals("Expecting bucket " +  i + " to have two copies", 2, owners.size());
           log.info("bucket " + i + " had two copies");
-          }
+        }
       }
     };
     vm1.invoke(verifyBuckets);
@@ -174,6 +172,7 @@ public class Bug39356DUnitTest extends CacheTestCase {
    * A test to make sure that we cannot move a bucket to a member which already
    * hosts the bucket, thereby reducing our redundancy.
    */
+  @Test
   public void testMoveBucketToHostThatHasTheBucketAlready() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
index 939e09a..2dd4dc3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
@@ -16,7 +16,21 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+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.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -27,24 +41,22 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.RegionEntry;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * TODO This doesn't really test the optimised RI behaviour but only that RI
  * works. But there must be other tests doing the same.
- * 
- * 
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class Bug43684DUnitTest extends DistributedTestCase {
+public class Bug43684DUnitTest extends JUnit4DistributedTestCase {
 
-  private static final String REGION_NAME = "Bug43684DUnitTest";
+  private static final String REGION_NAME = Bug43684DUnitTest.class.getSimpleName();
 
   private static GemFireCacheImpl cache;
 
@@ -60,10 +72,6 @@ public class Bug43684DUnitTest extends DistributedTestCase {
 
   private static int numBuckets = 11;
 
-  public Bug43684DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     host = Host.getHost(0);
@@ -87,17 +95,20 @@ public class Bug43684DUnitTest extends DistributedTestCase {
     if (cache != null && !cache.isClosed()) {
       cache.close();
     }
-    DistributedTestCase.disconnectFromDS();
+    disconnectFromDS();
   }
 
+  @Test
   public void testRIWithSingleKeyOnRR()  throws Exception {
     doRegisterInterest("KEY_1", null, numBuckets, true, false);
   }
 
+  @Test
   public void testRIWithAllKeysOnRR()  throws Exception {
     doRegisterInterest(null, null, numBuckets, true, false);
   }
 
+  @Test
   public void testRIWithKeyListOnRR()  throws Exception {
     ArrayList<String> riKeys = new ArrayList<String>();
     riKeys.add("KEY_0");
@@ -111,18 +122,22 @@ public class Bug43684DUnitTest extends DistributedTestCase {
     doRegisterInterest(riKeys, null, numBuckets, true, false);
   }
 
+  @Test
   public void testRIWithRegularExpressionOnRR()  throws Exception{
     doRegisterInterest(null, "^[X][_].*", numBuckets, true, false);
   }
 
+  @Test
   public void testRIWithSingleKeyOnPR()  throws Exception {
     doRegisterInterest("KEY_1", null);
   }
 
+  @Test
   public void testRIWithAllKeysOnPR()  throws Exception {
     doRegisterInterest(null, null);
   }
 
+  @Test
   public void testRIWithKeyListOnPR()  throws Exception {
     ArrayList<String> riKeys = new ArrayList<String>();
     riKeys.add("KEY_0");
@@ -136,22 +151,27 @@ public class Bug43684DUnitTest extends DistributedTestCase {
     doRegisterInterest(riKeys, null);
   }
 
+  @Test
   public void testRIWithRegularExpressionOnPR()  throws Exception{
     doRegisterInterest(null, "^[X][_].*");
   }
 
+  @Test
   public void testRIWithMoreEntriesOnPR()  throws Exception{
     doRegisterInterest(null, null, 5147, false, false);
   }
 
+  @Test
   public void testRIWithSingleKeyOnEmptyPrimaryOnPR()  throws Exception {
     doRegisterInterest("KEY_1", null, numBuckets, false, true);
   }
 
+  @Test
   public void testRIWithAllKeysOnEmptyPrimaryOnPR()  throws Exception {
     doRegisterInterest(null, null, numBuckets, false, true);
   }
 
+  @Test
   public void testRIWithKeyListOnEmptyPrimaryOnPR()  throws Exception {
     ArrayList<String> riKeys = new ArrayList<String>();
     riKeys.add("KEY_0");
@@ -165,10 +185,12 @@ public class Bug43684DUnitTest extends DistributedTestCase {
     doRegisterInterest(riKeys, null, numBuckets, false, true);
   }
 
+  @Test
   public void testRIWithRegularExpressionOnEmptyPrimaryOnPR()  throws Exception{
     doRegisterInterest(null, "^[X][_].*", numBuckets, false, true);
   }
 
+  @Test
   public void testNativeClientIssueOnPR()  throws Exception{
     ArrayList<String> riKeys = new ArrayList<String>();
     riKeys.add("OPKEY_0");
@@ -229,7 +251,7 @@ public class Bug43684DUnitTest extends DistributedTestCase {
 
   @SuppressWarnings("rawtypes")
   public static Integer createServerCache(Boolean isReplicated, Boolean isPrimaryEmpty) throws Exception {
-    DistributedTestCase.disconnectFromDS();
+    disconnectFromDS();
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
     props.setProperty(STATISTIC_ARCHIVE_FILE, "server_" + OSProcess.getId()
@@ -256,7 +278,7 @@ public class Bug43684DUnitTest extends DistributedTestCase {
 
   @SuppressWarnings({ "unchecked", "rawtypes" })
   public static void createClientCache(Host host, Integer port) {
-    DistributedTestCase.disconnectFromDS();
+    disconnectFromDS();
     Properties props = new Properties();
     props.setProperty(STATISTIC_ARCHIVE_FILE, "client_" + OSProcess.getId()
         + ".gfs");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
index ba24fe1..d46b0f5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
@@ -19,7 +19,22 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+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.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@ -31,11 +46,12 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueueStats;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * The test creates two datastores with a partitioned region, and also running a
@@ -45,11 +61,10 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * ensures that the EXPIRE_DESTROY events are propagated to the subscriber
  * client and the secondary server does process the QRMs for the EXPIRE_DESTROY
  * events.
- * 
- * 
  */
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class Bug47388DUnitTest extends DistributedTestCase {
+public class Bug47388DUnitTest extends JUnit4DistributedTestCase {
 
   private static VM vm0 = null;
   private static VM vm1 = null;
@@ -60,14 +75,7 @@ public class Bug47388DUnitTest extends DistributedTestCase {
 
   private static volatile boolean lastKeyDestroyed = false;
 
-  public static final String REGION_NAME = "Bug47388DUnitTest_region";
-
-  /**
-   * @param name
-   */
-  public Bug47388DUnitTest(String name) {
-    super(name);
-  }
+  public static final String REGION_NAME = Bug47388DUnitTest.class.getSimpleName() + "_region";
 
   @Override
   public final void postSetUp() throws Exception {
@@ -109,10 +117,9 @@ public class Bug47388DUnitTest extends DistributedTestCase {
   }
 
   @SuppressWarnings("deprecation")
-  public static Integer createCacheServerWithPRDatastore()//Integer mcastPort)
-      throws Exception {
+  public static Integer createCacheServerWithPRDatastore() throws Exception {
     Properties props = new Properties();
-    Bug47388DUnitTest test = new Bug47388DUnitTest("Bug47388DUnitTest");
+    Bug47388DUnitTest test = new Bug47388DUnitTest();
     DistributedSystem ds = test.getSystem(props);
     ds.disconnect();
     cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
@@ -135,15 +142,13 @@ public class Bug47388DUnitTest extends DistributedTestCase {
   }
 
   @SuppressWarnings("deprecation")
-  public static void createClientCache(Host host, Integer[] ports, Boolean doRI)
-      throws Exception {
-
+  public static void createClientCache(Host host, Integer[] ports, Boolean doRI) throws Exception {
     Properties props = new Properties();
     props.setProperty(DURABLE_CLIENT_ID,
         "my-durable-client-" + ports.length);
     props.setProperty(DURABLE_CLIENT_TIMEOUT, "300000");
 
-    DistributedSystem ds = new Bug47388DUnitTest("Bug47388DUnitTest").getSystem(props);
+    DistributedSystem ds = new Bug47388DUnitTest().getSystem(props);
     ds.disconnect();
     ClientCacheFactory ccf = new ClientCacheFactory(props);
     ccf.setPoolSubscriptionEnabled(doRI);
@@ -174,12 +179,10 @@ public class Bug47388DUnitTest extends DistributedTestCase {
       region.registerInterest("ALL_KEYS", true);
       cache.readyForEvents();
     }
-
   }
 
   @SuppressWarnings("unchecked")
-  public static void doPuts(Integer numOfSets, Integer numOfPuts)
-      throws Exception {
+  public static void doPuts(Integer numOfSets, Integer numOfPuts) throws Exception {
     Region<String, String> region = cache.getRegion(REGION_NAME);
 
     for (int i = 0; i < numOfSets; i++) {
@@ -195,8 +198,7 @@ public class Bug47388DUnitTest extends DistributedTestCase {
         .getClientProxies().toArray()[0]).isPrimary();
   }
 
-  public static void verifyClientSubscriptionStats(final Boolean isPrimary,
-      final Integer events) throws Exception {
+  public static void verifyClientSubscriptionStats(final Boolean isPrimary, final Integer events) throws Exception {
 
     WaitCriterion wc = new WaitCriterion() {
       private long dispatched;
@@ -254,7 +256,9 @@ public class Bug47388DUnitTest extends DistributedTestCase {
     Wait.waitForCriterion(wc, 60 * 1000, 500, true);
   }
 
-  public void bug51931_testQRMOfExpiredEventsProcessedSuccessfully() throws Exception {
+  @Ignore("TODO: test is disabled due to bug51931")
+  @Test
+  public void testQRMOfExpiredEventsProcessedSuccessfully() throws Exception {
     int numOfSets = 2, numOfPuts = 5;
     int totalEvents = 23; // = (numOfSets * numOfPuts) * 2 [eviction-destroys] +
                           // 2 [last key's put and eviction-destroy] + 1 [marker
@@ -269,8 +273,4 @@ public class Bug47388DUnitTest extends DistributedTestCase {
     vm0.invoke(() -> Bug47388DUnitTest.verifyClientSubscriptionStats( isvm0Primary, totalEvents ));
     vm1.invoke(() -> Bug47388DUnitTest.verifyClientSubscriptionStats( !isvm0Primary, totalEvents ));
   }
-  public void testNothingBecauseOfBug51931() {
-    // remove this when bug #51931 is fixed
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
index 9193719..d7366eb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
@@ -19,6 +19,14 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionFactory;
@@ -33,17 +41,16 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxyStats;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-
-/**
- * 
- * 
- */
-public class Bug51400DUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class Bug51400DUnitTest extends JUnit4DistributedTestCase {
 
   private static VM server0 = null;
   private static VM server1 = null;
@@ -54,13 +61,6 @@ public class Bug51400DUnitTest extends DistributedTestCase {
 
   public static final String REGION_NAME = "Bug51400DUnitTest_region";
 
-  /**
-   * @param name
-   */
-  public Bug51400DUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     Host host = Host.getHost(0);
@@ -92,7 +92,7 @@ public class Bug51400DUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
 
-    Bug51400DUnitTest test = new Bug51400DUnitTest("Bug51400DUnitTest");
+    Bug51400DUnitTest test = new Bug51400DUnitTest();
     DistributedSystem ds = test.getSystem(props);
     ds.disconnect();
     cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
@@ -116,7 +116,7 @@ public class Bug51400DUnitTest extends DistributedTestCase {
       Integer interval) throws Exception {
     Properties props = new Properties();
 
-    DistributedSystem ds = new Bug51400DUnitTest("Bug51400DUnitTest").getSystem(props);
+    DistributedSystem ds = new Bug51400DUnitTest().getSystem(props);
     ds.disconnect();
     ClientCacheFactory ccf = new ClientCacheFactory(props);
     ccf.setPoolSubscriptionEnabled(true);
@@ -148,6 +148,7 @@ public class Bug51400DUnitTest extends DistributedTestCase {
         + (isPrimary ? "primary." : "secondary."), numOfEvents.intValue(), qSize);
   }
 
+  @Test
   public void testNothing() {
     // remove when ticket #51932 is fixed
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ElidedPutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ElidedPutAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ElidedPutAllDUnitTest.java
index aa03833..56f6f99 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ElidedPutAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ElidedPutAllDUnitTest.java
@@ -15,6 +15,15 @@
  * limitations under the License.
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
+
+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.HashMap;
 import java.util.Map;
@@ -44,17 +53,19 @@ import com.gemstone.gemfire.test.dunit.VM;
 /**
  *
  */
-public class ElidedPutAllDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ElidedPutAllDUnitTest extends JUnit4CacheTestCase {
   
   private static final long serialVersionUID = -184003583877999750L;
 
-  public ElidedPutAllDUnitTest(String name) {
-    super(name);
+  public ElidedPutAllDUnitTest() {
+    super();
   }
   
   /**
    * bug #47425 - elided putAll event causes PutAllPartialResultException
    */
+  @Test
   public void testElidedPutAllOnPR() throws Exception {
     final String regionName = getUniqueName() + "Region";
     final String key = "key-1";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
index 8d05dea..2330cb9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
@@ -19,6 +19,16 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+import org.junit.Ignore;
+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.CacheTransactionManager;
 import com.gemstone.gemfire.cache.EntryOperation;
@@ -54,7 +64,8 @@ import java.util.concurrent.atomic.AtomicInteger;
  * and not called while local iteration.
  *
  */
-public class PartitionResolverDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionResolverDUnitTest extends JUnit4CacheTestCase {
 
   final private static String CUSTOMER = "custRegion";
   final private static String ORDER = "orderRegion";
@@ -65,8 +76,8 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public PartitionResolverDUnitTest(String name) {
-    super(name);
+  public PartitionResolverDUnitTest() {
+    super();
   }
 
   @Override
@@ -178,36 +189,42 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
       }
     });
   }
+  @Test
   public void testKeysInIterationOnAccessor() {
     resolverInIteration(IteratorType.KEYS, accessor);
     verifyResolverCountInVM(accessor, 0);
     verifyResolverCountInVM(datastore1, 0);
     verifyResolverCountInVM(datastore2, 0);
   }
+  @Test
   public void testValuesInIterationOnAccessor() {
     resolverInIteration(IteratorType.VALUES, accessor);
     verifyResolverCountInVM(accessor, 0);
     verifyResolverCountInVM(datastore1, getNumberOfKeysOwnedByVM(datastore1));
     verifyResolverCountInVM(datastore2, getNumberOfKeysOwnedByVM(datastore2));
   }
+  @Test
   public void testEntriesInIterationOnAccessor() {
     resolverInIteration(IteratorType.ENTRIES, accessor);
     verifyResolverCountInVM(accessor, 0);
     verifyResolverCountInVM(datastore1, getNumberOfKeysOwnedByVM(datastore1));
     verifyResolverCountInVM(datastore2, getNumberOfKeysOwnedByVM(datastore2));
   }
+  @Test
   public void testKeysInIterationOnDataStore() {
     resolverInIteration(IteratorType.KEYS, datastore1);
     verifyResolverCountInVM(accessor, 0);
     verifyResolverCountInVM(datastore1, 0);
     verifyResolverCountInVM(datastore2, 0);
   }
+  @Test
   public void testValuesInIterationOnDataStore() {
     resolverInIteration(IteratorType.VALUES, datastore1);
     verifyResolverCountInVM(accessor, 0);
     verifyResolverCountInVM(datastore1, 0);
     verifyResolverCountInVM(datastore2, getNumberOfKeysOwnedByVM(datastore2));
   }
+  @Test
   public void testEntriesInIterationOnDataStore() {
     resolverInIteration(IteratorType.ENTRIES, datastore1);
     verifyResolverCountInVM(accessor, 0);
@@ -250,6 +267,7 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
     vm.invoke(doIteration);
   }
   
+  @Test
   public void testKeysIterationInFunctionExection() {
     doIterationInFunction(IteratorType.KEYS);
     verifyResolverCountInVM(accessor, 0);
@@ -257,6 +275,7 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
     verifyResolverCountInVM(datastore2, 0);
   }
   
+  @Test
   public void testValuesIterationInFunctionExection() {
     doIterationInFunction(IteratorType.VALUES);
     verifyResolverCountInVM(accessor, 0);
@@ -264,6 +283,7 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
     verifyResolverCountInVM(datastore2, 0);
   }
   
+  @Test
   public void testEntriesIterationInFunctionExection() {
     doIterationInFunction(IteratorType.ENTRIES);
     verifyResolverCountInVM(accessor, 0);
@@ -337,6 +357,7 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testOps() {
     initAccessorAndDataStore(0);
     doOps(false);
@@ -345,7 +366,9 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
     verifyResolverCountInVM(datastore2, getResolverCountForVM(datastore2));
   }
 
-  public void _testTxOps() {
+  @Ignore("TODO")
+  @Test
+  public void testTxOps() {
     initAccessorAndDataStore(0);
     doOps(true);
     verifyResolverCountInVM(accessor, 7);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
index 61b5c69..4cef3c8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.util.Properties;
 
@@ -36,7 +45,8 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
 
-public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionLoaderWriterDUnitTest extends JUnit4CacheTestCase {
 
   private static final String PartitionedRegionName = "PartitionedRegionTest";
 
@@ -53,10 +63,11 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public PartitionedRegionLoaderWriterDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionLoaderWriterDUnitTest() {
+    super();
   }
 
+  @Test
   public void testLoader_OnAccessor_NotOnDataStore(){
     host = Host.getHost(0);
     accessor = host.getVM(0);
@@ -65,6 +76,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
     datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 10));
   }
   
+  @Test
   public void testWriter_NotOnAccessor_OnDataStore(){
     host = Host.getHost(0);
     accessor = host.getVM(1);
@@ -73,6 +85,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
     datastore1.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, new CacheWriter2(), 10));
   }
   
+  @Test
   public void testWriter_OnDataStore_NotOnAccessor(){
     host = Host.getHost(0);
     accessor = host.getVM(1);
@@ -81,6 +94,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
     accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(null, null, 0));
   }
   
+  @Test
   public void testLoader_OnAccessor_NotOnFirstDataStore_OnSecondDataStore(){
     host = Host.getHost(0);
     accessor = host.getVM(1);
@@ -91,6 +105,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
     datastore2.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegionWithPossibleFail(new CacheLoader2(),null, 10));
   }
   
+  @Test
   public void testLoader_NotOnFirstDataStore_OnAccessor_OnSecondDataStore(){
     host = Host.getHost(0);
     accessor = host.getVM(1);
@@ -101,6 +116,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
     datastore2.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegionWithPossibleFail(new CacheLoader2(),null, 10));
   }
   
+  @Test
   public void testLoader_OnFirstDataStore_OnSecondDataStore_OnAccessor(){
     host = Host.getHost(0);
     accessor = host.getVM(1);
@@ -111,6 +127,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
     accessor.invoke(() -> PartitionedRegionLoaderWriterDUnitTest.createRegion(new CacheLoader2(), null, 0));
   }
   
+  @Test
   public void testLoader_OnFirstDataStore_OnSecondDataStore_NotOnAccessor(){
     host = Host.getHost(0);
     accessor = host.getVM(1);
@@ -124,7 +141,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
   
   public static void createRegion(CacheLoader cacheLoader, CacheWriter cacheWriter, Integer localMaxMemory) {
     try {
-      new PartitionedRegionLoaderWriterDUnitTest("DUnitTests")
+      new PartitionedRegionLoaderWriterDUnitTest()
           .createCache(new Properties());
       AttributesFactory factory = new AttributesFactory();
       factory.setCacheLoader(cacheLoader);
@@ -144,7 +161,7 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
   public static void createRegionWithPossibleFail(CacheLoader cacheLoader,
       CacheWriter cacheWriter, Integer localMaxMemory) {
     final PartitionedRegionLoaderWriterDUnitTest test =
-      new PartitionedRegionLoaderWriterDUnitTest("DUnitTests");
+      new PartitionedRegionLoaderWriterDUnitTest();
     test.createCache(new Properties());
     // add expected exception
     test.cache.getLogger().info("<ExpectedException action=add>"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
index 31b6c48..a6716b2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.ExpirationAttributes;
 import com.gemstone.gemfire.cache.RegionFactory;
 import com.gemstone.gemfire.cache.RegionShortcut;
@@ -32,12 +41,14 @@ import com.gemstone.gemfire.test.dunit.Wait;
 /**
  *
  */
-public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class PartitionedRegionMetaDataCleanupDUnitTest extends JUnit4CacheTestCase {
 
-  public PartitionedRegionMetaDataCleanupDUnitTest(String name) {
-    super(name);
+  public PartitionedRegionMetaDataCleanupDUnitTest() {
+    super();
   }
   
+  @Test
   public void testCleanupOnCloseCache() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -58,6 +69,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
     waitForCreate(vm0, "region1", 15);
   }
   
+  @Test
   public void testCleanupOnCloseRegion() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -78,6 +90,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
     waitForCreate(vm0, "region1", 15);
   }
   
+  @Test
   public void testCrash() throws InterruptedException {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
index 641982f..3da750f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.Properties;
 
 import com.gemstone.gemfire.cache.CacheClosedException;
@@ -38,21 +47,19 @@ import com.gemstone.gemfire.test.dunit.Wait;
  * Tests the basic use cases for PR persistence.
  *
  */
+@Category(DistributedTest.class)
 public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
   private static final int NUM_BUCKETS = 15;
   private static final int MAX_WAIT = 30 * 1000;
   static Object lockObject = new Object();
   
-  public PersistPRKRFDUnitTest(String name) {
-    super(name);
-  }
-  
   /**
    * do a put/modify/destroy while closing disk store
    * 
    * to turn on debug, add following parameter in local.conf:
    * hydra.VmPrms-extraVMArgs += "-Ddisk.KRF_DEBUG=true";
    */
+  @Test
   public void testCloseDiskStoreWhenPut() {
     final String title = "testCloseDiskStoreWhenPut:";
     Host host = Host.getHost(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
index 6df3dec..d8b3514 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.IOException;
 import java.util.Collections;
 import java.util.Set;
@@ -56,13 +65,14 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
+@Category(DistributedTest.class)
 public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPartitionedRegionTestBase {
 
   private static final int NUM_BUCKETS = 15;
   private static final int MAX_WAIT = 30 * 1000;
 
-  public PersistentColocatedPartitionedRegionDUnitTest(String name) {
-    super(name);
+  public PersistentColocatedPartitionedRegionDUnitTest() {
+    super();
   }
   
   @Override
@@ -70,6 +80,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
     FileUtil.delete(getBackupDir());
   }
   
+  @Test
   public void testColocatedPRAttributes() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(1);
@@ -133,6 +144,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
   /**
    * Testing that we can colocate persistent PRs
    */
+  @Test
   public void testColocatedPRs() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -224,6 +236,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
    * Testing what happens we we recreate colocated persistent PRs by creating
    * one PR everywhere and then the other PR everywhere.
    */
+  @Test
   public void testColocatedPRsRecoveryOnePRAtATime() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -355,6 +368,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
     };
   }
   
+  @Test
   public void testColocatedPRsRecoveryOneMemberLater() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -458,6 +472,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
     assertEquals(vm2PrimaryBuckets, getPrimaryBucketList(vm2, "region2"));
   }
   
+  @Test
   public void testReplaceOfflineMemberAndRestart() throws Throwable {
     SerializableRunnable createPRs = new SerializableRunnable("region1") {
       public void run() {
@@ -509,6 +524,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
    * in different disk stores, we still keep our metadata consistent.
    * @throws Throwable
    */
+  @Test
   public void testReplaceOfflineMemberAndRestartTwoDiskStores() throws Throwable {
     SerializableRunnable createPRs = new SerializableRunnable("region1") {
       public void run() {
@@ -661,6 +677,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
     }
   }
   
+  @Test
   public void testReplaceOfflineMemberAndRestartCreateColocatedPRLate() throws Throwable {
     SerializableRunnable createParentPR = new SerializableRunnable() {
       public void run() {
@@ -720,6 +737,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
     replaceOfflineMemberAndRestartCreateColocatedPRLate(createParentPR, createChildPR);
   }
   
+  @Test
   public void testReplaceOfflineMemberAndRestartCreateColocatedPRLateTwoDiskStores() throws Throwable {
     SerializableRunnable createParentPR = new SerializableRunnable() {
       public void run() {
@@ -907,6 +925,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
   //This test method is disabled because it is failing
   //periodically and causing cruise control failures
   //See bug #46748
+  @Test
   public void testCrashDuringRedundancySatisfaction() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1042,6 +1061,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
    * Test what happens when we restart persistent members while
    * there is an accessor concurrently performing puts. This is for bug 43899
    */
+  @Test
   public void testRecoverySystemWithConcurrentPutter() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1181,6 +1201,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
   }
 
   @Category(FlakyTest.class) // GEODE-506: time sensitive, async actions with 30 sec max
+  @Test
   public void testRebalanceWithOfflineChildRegion() throws Throwable {
     SerializableRunnable createParentPR = new SerializableRunnable() {
       public void run() {
@@ -1230,6 +1251,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
    * because in this case all of the regions have been created, but
    * they are in the middle of actually recovering buckets from disk.
    */
+  @Test
   public void testRebalanceDuringRecovery() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1356,6 +1378,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
   }
 
   @Category(FlakyTest.class) // GEODE-1380: time sensitive, async actions with 30 sec max
+  @Test
   public void testRebalanceWithOfflineChildRegionTwoDiskStores() throws Throwable {
     SerializableRunnable createParentPR = new SerializableRunnable() {
       public void run() {
@@ -1408,6 +1431,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends PersistentPar
    * @throws Throwable
    */
   @Category(FlakyTest.class) // GEODE-900: disk dependency, filesystem sensitive
+  @Test
   public void testModifyColocation() throws Throwable {
     //Create PRs where region3 is colocated with region1.
     createColocatedPRs("region1");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
index e6a765b..ef63848 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
@@ -16,9 +16,49 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static java.util.concurrent.TimeUnit.*;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.*;
+import static org.junit.Assert.fail;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.ConcurrentModificationException;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.CustomExpiry;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskAccessException;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionedRegionStorageException;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerOperationException;
@@ -41,39 +81,42 @@ import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMes
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
 import com.gemstone.gemfire.internal.cache.partitioned.ManageBucketMessage.ManageBucketReplyMessage;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
-
-import java.io.*;
-import java.util.*;
-import java.util.concurrent.CountDownLatch;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static com.jayway.awaitility.Awaitility.await;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * Tests the basic use cases for PR persistence.
  */
+@Category(DistributedTest.class)
 public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedRegionTestBase {
+
   private static final int NUM_BUCKETS = 15;
   //This must be bigger than the dunit ack-wait-threshold for the revoke
   //tests. The command line is setting the ack-wait-threshold to be 
   //60 seconds.
   private static final int MAX_WAIT = 65 * 1000;
   
-  public PersistentPartitionedRegionDUnitTest(String name) {
-    super(name);
+  public PersistentPartitionedRegionDUnitTest() {
+    super();
   }
   
   /**
    * A simple test case that we are actually
    * persisting with a PR.
    */
+  @Test
   public void testSinglePR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -108,6 +151,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * Test total-buckets-num getting bigger, which cause exception.
    * but changed to smaller should be ok.
    */
+  @Test
   public void testChangedToalBucketNumberSinglePR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -142,6 +186,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
   /**
    * Test for bug 44184
    */
+  @Test
   public void testSinglePRWithCustomExpiry() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(1);
@@ -189,6 +234,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * 0
    * @throws Throwable 
    */
+  @Test
   public void testTotalRecoverRedundancy0() throws Throwable {
     totalRecoverTest(0);
   }
@@ -199,6 +245,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * 1
    * @throws Throwable 
    */
+  @Test
   public void testTotalRecoverRedundancy1() throws Throwable {
     totalRecoverTest(1);
   }
@@ -354,6 +401,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     checkData(vm0, 0, numBuckets, null);
   }
   
+  @Test
   public void testRevokeAfterStartup() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -409,6 +457,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
   }
 
   @Category(FlakyTest.class) // GEODE-974: async actions, time sensitive, 65 second timeouts
+  @Test
   public void testRevokeBeforeStartup() throws Throwable {
     IgnoredException.addIgnoredException("RevokeFailedException");
     Host host = Host.getHost(0);
@@ -492,6 +541,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * Test that we wait for missing data to come back
    * if the redundancy was 0.
    */
+  @Test
   public void testMissingMemberRedundancy0() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -681,6 +731,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
   /**Test to make sure that we recreate
   * a bucket if a member is destroyed
   */
+  @Test
   public void testDestroyedMemberRedundancy0() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -721,7 +772,8 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
   /**Test to make sure that we recreate
    * a bucket if a member is destroyed
    */
-   public void testDestroyedMemberRedundancy1() {
+  @Test
+  public void testDestroyedMemberRedundancy1() {
      Host host = Host.getHost(0);
      VM vm0 = host.getVM(0);
      VM vm1 = host.getVM(1);
@@ -755,7 +807,8 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    /**Test to make sure that we recreate
     * a bucket if a member is revoked
     */
-    public void testRevokedMemberRedundancy0() {
+  @Test
+  public void testRevokedMemberRedundancy0() {
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
       VM vm1 = host.getVM(1);
@@ -827,7 +880,8 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
      * a bucket if a member is revoked
      * @throws Throwable 
      */
-    public void testRevokedMemberRedundancy1() throws Throwable {
+  @Test
+  public void testRevokedMemberRedundancy1() throws Throwable {
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
       VM vm1 = host.getVM(1);
@@ -903,7 +957,8 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
      * is set to 0.
      * @throws Throwable 
      */
-    public void testRevokedMemberRedundancy1ImmediateRecovery() throws Throwable {
+  @Test
+  public void testRevokedMemberRedundancy1ImmediateRecovery() throws Throwable {
       disconnectAllFromDS(); // I see this test failing because it finds the ds disconnected. Trying this as a fix.
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
@@ -977,7 +1032,8 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
      *   we replace buckets where are offline on A by creating them on C
      *   We then shutdown C and restart A, which recovers those buckets
      */
-    public void testBug41340() throws Throwable {
+  @Test
+  public void testBug41340() throws Throwable {
       Host host = Host.getHost(0);
       VM vm0 = host.getVM(0);
       VM vm1 = host.getVM(1);
@@ -1043,6 +1099,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * missing member comes back online.
    */
   @Category(FlakyTest.class) // GEODE-1047: thread unsafe test hook, CountDownLatch, async behavior
+  @Test
   public void testMissingMemberRedundancy1() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1092,6 +1149,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * member ID as offline, preventing redundancy
    * recovery in the future.
    */
+  @Test
   public void testBug41341() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1216,6 +1274,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     checkData(vm0, 0, NUM_BUCKETS, "a");
   }
   
+  @Test
   public void testMoveBucket() throws Throwable {
     int redundancy = 0;
     Host host = Host.getHost(0);
@@ -1266,6 +1325,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     checkData(vm0, 226, 227, "a");
   }
   
+  @Test
   public void testCleanStop() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1309,6 +1369,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
   
   
   
+  @Test
   public void testRegisterInterestNoDataStores() {
     //Closing the client may log a warning on the server
     IgnoredException.addIgnoredException("Connection reset");
@@ -1383,6 +1444,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * sure that we don't get a suspect string
    * with an exception during cache closure.
    */
+  @Test
   public void testOverflowCacheClose() {
     Cache cache = getCache();
     RegionFactory rf = new RegionFactory();
@@ -1401,6 +1463,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
   /**
    * Test for bug 41336
    */
+  @Test
   public void testCrashDuringBucketCreation() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1416,7 +1479,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
               DistributionMessage msg) {
             if(msg instanceof ManageBucketReplyMessage) {
               Cache cache = getCache();
-              DistributedTestCase.disconnectFromDS();
+              disconnectFromDS();
               
               await().atMost(30, SECONDS).until(() -> {return (cache == null || cache.isClosed());});
               LogWriterUtils.getLogWriter().info("Cache is confirmed closed");
@@ -1462,6 +1525,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     assertEquals(Collections.emptySet(), getBucketList(vm0));
   }
   
+  @Test
   public void testNestedPRRegions() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1519,6 +1583,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     checkData(vm2, numBuckets, 113, "d", "parent2/"+PR_REGION_NAME);
   }
   
+  @Test
   public void testCloseDuringRegionOperation() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1598,6 +1663,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * @throws Throwable 
    */
   @Category(FlakyTest.class) // GEODE-1208: time sensitive, multiple non-thread-safe test hooks, async actions
+  @Test
   public void testBug42226() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1680,6 +1746,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * 
    * @throws Throwable
    */
+  @Test
   public void testAllowRegionUseBeforeRedundancyRecovery() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1796,6 +1863,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * crashes before the GII is complete, we need
    * to make sure that later we can recover redundancy.
    */
+  @Test
   public void testCrashDuringBucketGII() {
     IgnoredException.addIgnoredException("PartitionOfflineException");
     Host host = Host.getHost(0);
@@ -1850,6 +1918,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * discovers that the GII target is no longer hosting the bucket.
    * @throws InterruptedException 
    */
+  @Test
   public void testCrashDuringBucketGII2() throws InterruptedException {
     IgnoredException.addIgnoredException("PartitionOfflineException");
     Host host = Host.getHost(0);
@@ -1913,6 +1982,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     assertEquals(Collections.singleton(0), getBucketList(vm1));
   }
   
+  @Test
   public void testCleanupAfterConflict() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1975,6 +2045,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
    * Test to make sure that primaries are rebalanced after recovering from
    * disk.
    */
+  @Test
   public void testPrimaryBalanceAfterRecovery() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2031,6 +2102,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     assertThat(vm0Primaries.size()).isBetween(9, 11);
   }
 
+  @Test
   public void testConcurrencyChecksEnabled() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2074,6 +2146,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     vm3.invoke(verifyConcurrenyChecks);
   }
 
+  @Test
   public void testNonPersistentProxy() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);
@@ -2111,6 +2184,7 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR
     vm3.invoke(verifyConcurrencyChecks);
   }
   
+  @Test
   public void testReplicateAfterPersistent() {
     Host host = Host.getHost(0);
     VM vm1 = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionOldConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionOldConfigDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionOldConfigDUnitTest.java
index c37ac69..9731097 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionOldConfigDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionOldConfigDUnitTest.java
@@ -16,16 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.Cache;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 
+@Category(DistributedTest.class)
 public class PersistentPartitionedRegionOldConfigDUnitTest extends PersistentPartitionedRegionDUnitTest {
 
-  public PersistentPartitionedRegionOldConfigDUnitTest(String name) {
-    super(name);
+  public PersistentPartitionedRegionOldConfigDUnitTest() {
+    super();
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
index 59700d9..692378c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -44,8 +46,6 @@ import com.gemstone.gemfire.cache.control.RebalanceFactory;
 import com.gemstone.gemfire.cache.partition.PartitionRegionHelper;
 import com.gemstone.gemfire.cache.partition.PartitionRegionInfo;
 import com.gemstone.gemfire.cache.persistence.PersistentID;
-import com.gemstone.gemfire.cache.persistence.RevokeFailedException;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.FileUtil;
 import com.gemstone.gemfire.internal.cache.DiskRegion;
@@ -65,19 +65,16 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+
+public abstract class PersistentPartitionedRegionTestBase extends JUnit4CacheTestCase {
 
-/**
- *
- */
-public abstract class PersistentPartitionedRegionTestBase extends CacheTestCase {
   public static String PR_REGION_NAME = "region";
 //This must be bigger than the dunit ack-wait-threshold for the revoke
   //tests. The command line is setting the ack-wait-threshold to be 
   //60 seconds.
   private static final int MAX_WAIT = 70 * 1000;
   
-  
-
   /* (non-Javadoc)
    * Set the region name for this test so that multiple subclasses of this
    * test base do not conflict with one another during parallel dunit runs
@@ -99,13 +96,6 @@ public abstract class PersistentPartitionedRegionTestBase extends CacheTestCase
     PR_REGION_NAME = testName + "Region";
   }
 
-  /**
-   * @param name
-   */
-  public PersistentPartitionedRegionTestBase(String name) {
-    super(name);
-  }
-
   protected void checkRecoveredFromDisk(VM vm, final int bucketId, final boolean recoveredLocally) {
     vm.invoke(new SerializableRunnable("check recovered from disk") {
       public void run() { 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
index 94ca51c..0eacca3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.partitioned;
 
+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.Cache;
 import com.gemstone.gemfire.cache.CacheTransactionManager;
 import com.gemstone.gemfire.cache.Region;
@@ -32,12 +41,13 @@ import com.gemstone.gemfire.test.dunit.VM;
  * Tests the basic use cases for PR persistence.
  *
  */
+@Category(DistributedTest.class)
 public class PersistentPartitionedRegionWithTransactionDUnitTest extends PersistentPartitionedRegionTestBase {
 
   private static final long MAX_WAIT = 0;
 
-  public PersistentPartitionedRegionWithTransactionDUnitTest(String name) {
-    super(name);
+  public PersistentPartitionedRegionWithTransactionDUnitTest() {
+    super();
   }
   
   @Override
@@ -61,6 +71,7 @@ public class PersistentPartitionedRegionWithTransactionDUnitTest extends Persist
     });
   }
 
+  @Test
   public void testRollback() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);