geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [27/61] [abbrv] [partial] incubator-geode git commit: GEODE-773: Extract static methods from DistributedTestCase
Date Thu, 11 Feb 2016 00:39:01 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
index 2528b2b..58e54ed 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
@@ -39,6 +39,8 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 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.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.cache.Region;
 
@@ -106,15 +108,13 @@ public class HAClearDUnitTest extends DistributedTestCase
 
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(HAClearDUnitTest.class, "closeCache");
     client2.invoke(HAClearDUnitTest.class, "closeCache");
     server1.invoke(HAClearDUnitTest.class, "closeCache");
     server2.invoke(HAClearDUnitTest.class, "closeCache");
     closeCache();
-
   }
 
   /* The test perorms following operations
@@ -527,7 +527,7 @@ public class HAClearDUnitTest extends DistributedTestCase
       {
         Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
         assertNotNull(region);
-        getLogWriter().info("Size of the region " + region.size());
+        LogWriterUtils.getLogWriter().info("Size of the region " + region.size());
         assertEquals(size, region.size());
       }
     };
@@ -542,7 +542,7 @@ public class HAClearDUnitTest extends DistributedTestCase
       public void run2() throws CacheException
       {
         Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
-        getLogWriter().warning("Found region " + region);
+        LogWriterUtils.getLogWriter().warning("Found region " + region);
         assertNull(region);
       }
     };
@@ -559,14 +559,14 @@ public class HAClearDUnitTest extends DistributedTestCase
     PORT2 = ((Integer)server2.invoke(HAClearDUnitTest.class,
         "createServerCache")).intValue();
     client1.invoke(HAClearDUnitTest.class, "createClientCache", new Object[] {
-        getServerHostName(Host.getHost(0)),
+        NetworkUtils.getServerHostName(Host.getHost(0)),
         new Integer(PORT1), new Integer(PORT2), new Boolean(true),
         new Boolean(true) });
     client2.invoke(HAClearDUnitTest.class, "createClientCache", new Object[] {
-        getServerHostName(Host.getHost(0)),
+        NetworkUtils.getServerHostName(Host.getHost(0)),
         new Integer(PORT1), new Integer(PORT2), new Boolean(true),
         new Boolean(true) });
-    createClientCache(getServerHostName(Host.getHost(0)),
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)),
         new Integer(PORT1), new Integer(PORT2),
         new Boolean(true), new Boolean(true));
   }
@@ -616,7 +616,7 @@ public class HAClearDUnitTest extends DistributedTestCase
       factory.setCacheListener(new CacheListenerAdapter() {
         public void afterRegionClear(RegionEvent event)
         {
-          getLogWriter().info("-------> afterRegionClear received");
+          LogWriterUtils.getLogWriter().info("-------> afterRegionClear received");
           synchronized (HAClearDUnitTest.class) {
             gotClearCallback = true;
             HAClearDUnitTest.class.notifyAll();
@@ -626,7 +626,7 @@ public class HAClearDUnitTest extends DistributedTestCase
         public void afterRegionDestroy(RegionEvent event)
         {
           synchronized (HAClearDUnitTest.class) {
-            getLogWriter().info("-------> afterRegionDestroy received");
+            LogWriterUtils.getLogWriter().info("-------> afterRegionDestroy received");
             gotDestroyRegionCallback = true;
             HAClearDUnitTest.class.notifyAll();
           }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
index a86b50a..241ac39 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
@@ -39,8 +39,10 @@ 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.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * This is Targetted conflation Dunit test.
@@ -112,17 +114,15 @@ public class HAConflationDUnitTest extends CacheTestCase
     server1.invoke(ConflationDUnitTest.class, "setIsSlowStart");
     server1.invoke(HAConflationDUnitTest.class, "makeDispatcherSlow");
     client1.invoke(HAConflationDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(host), new Integer(PORT1), new Boolean(true) });
+        new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT1), new Boolean(true) });
 
   }
 
-  public void tearDown2() throws Exception
-  {
-	super.tearDown2();
+  @Override
+  protected final void postTearDownCacheTestCase() throws Exception {
     client1.invoke(HAConflationDUnitTest.class, "closeCache");
     // close server
     server1.invoke(HAConflationDUnitTest.class, "closeCache");
-
   }
   
   public static void closeCache()
@@ -287,7 +287,7 @@ public class HAConflationDUnitTest extends CacheTestCase
             }
           };
           
-          waitForCriterion(w, 3 * 60 * 1000, interval, true);
+          Wait.waitForCriterion(w, 3 * 60 * 1000, interval, true);
       }
     };
     return checkEvents;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
index b4fd1ac..732e22a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
@@ -40,6 +40,8 @@ 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.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
 /**
@@ -105,15 +107,13 @@ public class HADuplicateDUnitTest extends DistributedTestCase
     client2 = host.getVM(3);
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(HADuplicateDUnitTest.class, "closeCache");
     // close server
     server1.invoke(HADuplicateDUnitTest.class, "reSetQRMslow");
     server1.invoke(HADuplicateDUnitTest.class, "closeCache");
     server2.invoke(HADuplicateDUnitTest.class, "closeCache");
-
   }
 
   public void _testDuplicate() throws Exception
@@ -160,8 +160,8 @@ public class HADuplicateDUnitTest extends DistributedTestCase
   public void testSample() throws Exception
   {
 
-    addExpectedException("IOException");
-    addExpectedException("Connection reset");
+    IgnoredException.addIgnoredException("IOException");
+    IgnoredException.addIgnoredException("Connection reset");
     createClientServerConfiguration();
     server1.invoke(new CacheSerializableRunnable("putKey") {
 
@@ -225,7 +225,7 @@ public class HADuplicateDUnitTest extends DistributedTestCase
     PORT2 = ((Integer)server2.invoke(HADuplicateDUnitTest.class,
         "createServerCache")).intValue();
     client1.invoke(HADuplicateDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
+        new Object[] { NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
index ae3a4dc..af1eb8b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
@@ -46,9 +46,14 @@ 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.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.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  *
@@ -92,9 +97,8 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
   }
 
   /** close the caches* */
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(HAEventIdPropagationDUnitTest.class, "closeCache");
     // close server
     server1.invoke(HAEventIdPropagationDUnitTest.class, "closeCache");
@@ -123,7 +127,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
     int PORT1 = ((Integer)server1.invoke(HAEventIdPropagationDUnitTest.class,
         "createServerCache")).intValue();
     client1.invoke(HAEventIdPropagationDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server1.getHost()), new Integer(PORT1) });
+        new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
   }
 
   /** create the server * */
@@ -212,9 +216,9 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 10 * 1000, 200, true);
     synchronized(map) {
-      getLogWriter().info("assertThreadIdToSequenceIdMapisNotNullButEmpty: map size is " + map.size());
+      LogWriterUtils.getLogWriter().info("assertThreadIdToSequenceIdMapisNotNullButEmpty: map size is " + map.size());
       assertTrue(map.size() == 1);
     }
 
@@ -415,7 +419,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
     }
     catch (Exception e) {
       e.printStackTrace();
-      fail("test failed due to " + e, e);
+      Assert.fail("test failed due to " + e, e);
     }
   }
 
@@ -683,7 +687,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
 
     public void afterCreate(EntryEvent event)
     {
-      getLogWriter().fine(" entered after created with " + event.getKey());
+      LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
       boolean shouldNotify = false;
       Object key = event.getKey();
       if (key.equals(PUTALL_KEY1)) {
@@ -776,7 +780,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
 
     public void afterCreate(EntryEvent event)
     {
-      getLogWriter().fine(" entered after created with " + event.getKey());
+      LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
       boolean shouldNotify = false;
       Object key = event.getKey();
       if (key.equals(PUTALL_KEY1)) {
@@ -852,14 +856,14 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
 
     public void afterRegionDestroy(RegionEvent event)
     {
-      getLogWriter().info("Before Regionestroy in Server");
+      LogWriterUtils.getLogWriter().info("Before Regionestroy in Server");
       eventId = ((RegionEventImpl)event).getEventId();
       assertNotNull(eventId);
       synchronized (lockObject) {
         receivedOperation = true;
         lockObject.notify();
       }
-      getLogWriter().info("After RegionDestroy in Server");
+      LogWriterUtils.getLogWriter().info("After RegionDestroy in Server");
     }
 
     public void afterRegionClear(RegionEvent event)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
index 3d3eb0a..92ee889 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
@@ -36,8 +36,11 @@ 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;
 
 /**
  * This test checks Expiration of events in the regionqueue.
@@ -93,16 +96,14 @@ public class HAExpiryDUnitTest extends DistributedTestCase
 
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     vm0.invoke(HAExpiryDUnitTest.class, "closeCache");
     vm1.invoke(HAExpiryDUnitTest.class, "closeCache");
     vm2.invoke(HAExpiryDUnitTest.class, "closeCache");
     vm3.invoke(HAExpiryDUnitTest.class, "closeCache");
     cache = null;
-    invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
-
+    Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
   }
 
   public void testExpiryPeriod() throws Exception
@@ -155,7 +156,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
     vm2.invoke(HAExpiryDUnitTest.class, "checkSizeBeforeExpiration");
     vm3.invoke(HAExpiryDUnitTest.class, "checkSizeBeforeExpiration");
 
-   pause(5000); // wait for some time to make sure that we give sufficient time
+   Wait.pause(5000); // wait for some time to make sure that we give sufficient time
                 // to expiry
    // in spite of giving time the events should not expire, and queue should be
    // same as before expiration
@@ -187,7 +188,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 60 * 1000, 200, true);
     /*
      * if (regionqueue.size() < 1) fail("RegionQueue size canot be less than 1
      * before expiration");
@@ -216,7 +217,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 60 * 1000, 200, true);
     
     /*
      * if (regionqueue.size() > regionQueueSize) fail("RegionQueue size should

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
index 1c151e7..df754d0 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
@@ -37,10 +37,14 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 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;
 
 /**
@@ -112,15 +116,14 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
 
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     vm0.invoke(HAGIIBugDUnitTest.class, "closeCache");
     vm1.invoke(HAGIIBugDUnitTest.class, "closeCache");
     vm2.invoke(HAGIIBugDUnitTest.class, "closeCache");
     vm3.invoke(HAGIIBugDUnitTest.class, "closeCache");
     cache = null;
-    invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+    Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
   }
 
   protected void createCache(Properties props) throws Exception
@@ -136,7 +139,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
   
   public void testDummy() throws Exception
   {
-    getLogWriter().info("This is Dummy test for the GII");  
+    LogWriterUtils.getLogWriter().info("This is Dummy test for the GII");  
   }
   
   
@@ -158,7 +161,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
           factory.setCacheListener(regionListener);
           RegionAttributes attrs = factory.create();
           Region region = cache.createRegion(REGION_NAME, attrs);
-          getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "Name of the region is : " + region.getFullPath());
 
           HARegionQueueAttributes hattr = new HARegionQueueAttributes();
@@ -183,14 +186,14 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
     AsyncInvocation[] async = new AsyncInvocation[4];
     async[0] = vm0.invokeAsync(putFrmVm("vm0_2"));
     t1.start();
-    DistributedTestCase.join(t1, 30 * 1000, getLogWriter());
+    ThreadUtils.join(t1, 30 * 1000);
     if (isTestFailed)
       fail("HARegionQueue can not be created");
 
     for (int count = 0; count < 1; count++) {
-      DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+      ThreadUtils.join(async[count], 30 * 1000);
       if (async[count].exceptionOccurred()) {
-        fail("Got exception on " + count, async[count].getException());
+        Assert.fail("Got exception on " + count, async[count].getException());
       }
     }
 
@@ -204,7 +207,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
 
     validationFlag = true;
     validateResults(validationFlag);
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "No. of keys that are missed by HARegion Queue during GII "
             + keys_set_after_gii.size());
 
@@ -218,7 +221,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
 //    int k = 0;
     for (int i = 0; i < 1; i++) {
       long totalPuts = ((Long)total_no_puts[i]).longValue() - 3 * NO_OF_PUTS;
-      getLogWriter().info("Total no of puts expectesd " + totalPuts);
+      LogWriterUtils.getLogWriter().info("Total no of puts expectesd " + totalPuts);
       for (int j = 0; j < totalPuts; j++) {
         keys_set_after_gii.add("vm" + i + "_2" + j);
 
@@ -239,7 +242,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
   {
     HARegion regionForQueue = (HARegion)cache.getRegion(Region.SEPARATOR
         + HARegionQueue.createRegionName(HAExpiryDUnitTest.regionQueueName));
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Region Queue size : " + regionForQueue.keys().size());
     Iterator itr = regionForQueue.entries(false).iterator();
     while (itr.hasNext()) {
@@ -315,7 +318,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
           }
           TOTAL_NO_OF_PUTS = TOTAL_NO_OF_PUTS + NO_OF_PUTS;
         }
-        getLogWriter().info("Total no of puts : " + TOTAL_NO_OF_PUTS);
+        LogWriterUtils.getLogWriter().info("Total no of puts : " + TOTAL_NO_OF_PUTS);
       }
     };
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
index 93cd77e..40d44b4 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
@@ -47,10 +47,15 @@ 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.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.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;
 
 /**
  * Client is connected to S1 which has a slow dispatcher. Puts are made on S1.  Then S2 is started
@@ -146,7 +151,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
     PORT2 =  AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     //Start the client
     client0.invoke(HAGIIDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(host), new Integer(PORT1),new Integer(PORT2)});
+        new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2)});
   }
   
   public void testGIIRegionQueue()
@@ -159,7 +164,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
 
     client0.invoke(HAGIIDUnitTest.class, "verifyEntries");
     server1.invoke(HAGIIDUnitTest.class, "createServer2Cache" ,new Object[] {new Integer(PORT2)});
-    pause(6000);
+    Wait.pause(6000);
     server0.invoke(HAGIIDUnitTest.class, "stopServer");
     //pause(10000);
     client0.invoke(HAGIIDUnitTest.class, "verifyEntriesAfterGiiViaListener");
@@ -231,7 +236,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
       r.registerInterest("key-3",InterestResultPolicy.KEYS_VALUES);
     }
     catch (Exception ex) {
-      fail("failed while registering keys ", ex);
+      Assert.fail("failed while registering keys ", ex);
     }
   }
   public static void createEntries()
@@ -245,7 +250,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -275,7 +280,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while r.put()", ex);
+      Assert.fail("failed while r.put()", ex);
     }
   }
   
@@ -326,7 +331,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 60 * 1000, 200, true);
       // assertEquals( "key-2",r.getEntry("key-2").getValue());
       
       // wait until we
@@ -340,11 +345,11 @@ public class HAGIIDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 60 * 1000, 200, true);
       // assertEquals( "key-3",r.getEntry("key-3").getValue());
     }
     catch (Exception ex) {
-      fail("failed while verifyEntries()", ex);
+      Assert.fail("failed while verifyEntries()", ex);
     }
   }
 
@@ -359,7 +364,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 90 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 90 * 1000, 200, true);
 
     ev = new WaitCriterion() {
       public boolean done() {
@@ -369,7 +374,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 60 * 1000, 200, true);
 
     ev = new WaitCriterion() {
       public boolean done() {
@@ -379,7 +384,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 60 * 1000, 200, true);
     
     assertEquals(3, HAGIIDUnitTest.checker.getUpdates());
   }
@@ -400,7 +405,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 60 * 1000, 200, true);
 
       // wait until
       // we have a
@@ -413,7 +418,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 60 * 1000, 200, true);
       // assertEquals( "key-2",r.getEntry("key-2").getValue());
 
 
@@ -428,7 +433,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 60 * 1000, 200, true);
       
       /*
        * assertEquals( "value-1",r.getEntry("key-1").getValue()); assertEquals(
@@ -438,7 +443,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while verifyEntriesAfterGII()", ex);
+      Assert.fail("failed while verifyEntriesAfterGII()", ex);
     }
   }
 
@@ -446,11 +451,11 @@ public class HAGIIDUnitTest extends DistributedTestCase
   {
       System.setProperty("slowStartTimeForTesting", "120000");
   }
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+
+  @Override
+  protected final void preTearDown() throws Exception {
     ConflationDUnitTest.unsetIsSlowStart();
-    invokeInEveryVM(ConflationDUnitTest.class, "unsetIsSlowStart");
+    Invoke.invokeInEveryVM(ConflationDUnitTest.class, "unsetIsSlowStart");
     // close the clients first
     client0.invoke(HAGIIDUnitTest.class, "closeCache");
     // then close the servers

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
index 205ba4a..ad649d3 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
@@ -47,7 +47,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 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.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
@@ -470,8 +470,8 @@ public class HARQAddOperationJUnitTest
     t1.start();
     t2.start();
 
-    DistributedTestCase.join(t1, 180 * 1000, null);
-    DistributedTestCase.join(t2, 180 * 1000, null);
+    ThreadUtils.join(t1, 180 * 1000);
+    ThreadUtils.join(t2, 180 * 1000);
 
     if (testFailed)
       fail("Test failed due to " + message);
@@ -528,8 +528,8 @@ public class HARQAddOperationJUnitTest
     t2.start();
     t1.start();
 
-    DistributedTestCase.join(t1, 180 * 1000, null);
-    DistributedTestCase.join(t2, 180 * 1000, null);
+    ThreadUtils.join(t1, 180 * 1000);
+    ThreadUtils.join(t2, 180 * 1000);
 
     if (testFailed)
       fail("Test failed due to " + message);
@@ -628,7 +628,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfThreads; k++) {
-      DistributedTestCase.join(threads[k], 180 * 1000, null);
+      ThreadUtils.join(threads[k], 180 * 1000);
     }
 
     this.logWriter
@@ -711,7 +711,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfThreads; k++) {
-      DistributedTestCase.join(threads[k], 180 * 1000, null);
+      ThreadUtils.join(threads[k], 180 * 1000);
     }
 
     if (testFailed)
@@ -779,7 +779,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfThreads; k++) {
-      DistributedTestCase.join(threads[k], 180 * 1000, null);
+      ThreadUtils.join(threads[k], 180 * 1000);
     }
 
     if (testFailed)
@@ -853,7 +853,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfThreads; k++) {
-      DistributedTestCase.join(threads[k], 180 * 1000, null);
+      ThreadUtils.join(threads[k], 180 * 1000);
     }
 
     if (testFailed)
@@ -902,7 +902,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfPuts; k++) {
-      DistributedTestCase.join(threads_peek_remove[k], 180 * 1000, null);
+      ThreadUtils.join(threads_peek_remove[k], 180 * 1000);
     }
 
     if (testFailed)
@@ -965,7 +965,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfThreads; k++) {
-      DistributedTestCase.join(threads[k], 180 * 1000, null);
+      ThreadUtils.join(threads[k], 180 * 1000);
     }
 
     if (testFailed)
@@ -1013,7 +1013,7 @@ public class HARQAddOperationJUnitTest
     }
 
     for (int k = 0; k < numOfPuts - 1; k++) {
-      DistributedTestCase.join(threads_peek_remove[k], 180 * 1000, null);
+      ThreadUtils.join(threads_peek_remove[k], 180 * 1000);
     }
 
     if (testFailed)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
index 84c2f05..3691ba1 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
@@ -52,9 +52,13 @@ 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.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 util.TestException;
 
@@ -129,8 +133,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
   /**
    * Tears down the test.
    */
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     closeCache();
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "closeCache");
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "closeCache");
@@ -258,7 +262,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.registerInterest("ALL_KEYS");
     }
     catch (Exception ex) {
-      fail("failed in registerInterestListAll", ex);
+      Assert.fail("failed in registerInterestListAll", ex);
     }
   }
 
@@ -271,7 +275,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.registerInterest("k5");
     }
     catch (Exception ex) {
-      fail("failed while registering keys", ex);
+      Assert.fail("failed while registering keys", ex);
     }
   }
 
@@ -288,7 +292,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.put("k5", "pv5");
     }
     catch (Exception ex) {
-      fail("failed in putEntries()", ex);
+      Assert.fail("failed in putEntries()", ex);
     }
   }
 
@@ -304,7 +308,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       r.create("k5", "v5");
     }
     catch (Exception ex) {
-      fail("failed in createEntries()", ex);
+      Assert.fail("failed in createEntries()", ex);
     }
   }
 
@@ -317,7 +321,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      fail("failed in createEntries(Long)", ex);
+      Assert.fail("failed in createEntries(Long)", ex);
     }
   }
 
@@ -332,7 +336,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      fail("failed in putHeavyEntries(Long)", ex);
+      Assert.fail("failed in putHeavyEntries(Long)", ex);
     }
   }
 
@@ -350,11 +354,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -388,11 +392,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -427,11 +431,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -464,11 +468,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -506,11 +510,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -561,11 +565,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "40000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -617,11 +621,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     Integer port3 = (Integer)serverVM0.invoke(HARQueueNewImplDUnitTest.class,
         "createOneMoreBridgeServer", new Object[] { Boolean.TRUE });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), port3, "0");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), port3, "0");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -648,8 +652,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     Integer port3 = (Integer)serverVM0.invoke(HARQueueNewImplDUnitTest.class,
         "createOneMoreBridgeServer", new Object[] { Boolean.FALSE });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1", Boolean.TRUE);
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1", Boolean.TRUE);
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, port3, new Integer(PORT2), "1", Boolean.TRUE });
 
@@ -686,11 +690,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -736,11 +740,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -780,11 +784,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "30000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM1.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -818,11 +822,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
    */
   public void testCMRNotReturnedByRootRegionsMethod() throws Exception {
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -867,11 +871,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
     serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
         new Object[] { "60000" });
 
-    createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
-    final String client1Host = getServerHostName(clientVM1.getHost());
+    createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+    final String client1Host = NetworkUtils.getServerHostName(clientVM1.getHost());
     clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
-    final String client2Host = getServerHostName(clientVM2.getHost());
+    final String client2Host = NetworkUtils.getServerHostName(clientVM2.getHost());
     clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
         new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
 
@@ -1073,7 +1077,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
 
     Set entries = msgsRegion.entrySet();
     Iterator iter = entries.iterator();
@@ -1206,7 +1210,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 120 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 120 * 1000, 1000, true);
   }
 
   public static void verifyRegionSize(final Integer regionSize, 
@@ -1244,7 +1248,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 120 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 120 * 1000, 1000, true);
   }
 
   public static void verifyHaContainerType(Boolean isRegion, Integer port) {
@@ -1308,7 +1312,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+        Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
       }
       else {
         WaitCriterion ev = new WaitCriterion() {
@@ -1319,7 +1323,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+        Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
       }
     }
     catch (Exception e) {
@@ -1351,7 +1355,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+      Wait.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/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
index 59780ef..d553d1c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
@@ -71,9 +71,8 @@ public class HARegionDUnitTest extends DistributedTestCase
   /**
    * close the cache in tearDown
    */
-  public void tearDown2() throws Exception
-  {
-	super.tearDown2();  
+  @Override
+  protected final void preTearDown() throws Exception {
     vm0.invoke(HARegionDUnitTest.class, "closeCache");
     vm1.invoke(HARegionDUnitTest.class, "closeCache");
   }
@@ -311,7 +310,7 @@ public class HARegionDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.put()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
     }
   }
 
@@ -327,7 +326,7 @@ public class HARegionDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.put()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
     }
   }
 
@@ -346,7 +345,7 @@ public class HARegionDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.get()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
     }
   }
 
@@ -365,7 +364,7 @@ public class HARegionDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.get()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
     }
   }
 
@@ -384,7 +383,7 @@ public class HARegionDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.get()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
index f4c50cd..da57b86 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
@@ -45,7 +45,10 @@ 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;
 
 /**
  *
@@ -98,9 +101,8 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
   /**
    * close the cache in tearDown
    */
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     vm0.invoke(HARegionQueueDUnitTest.class, "closeCache");
     vm1.invoke(HARegionQueueDUnitTest.class, "closeCache");
     vm2.invoke(HARegionQueueDUnitTest.class, "closeCache");
@@ -294,7 +296,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+        Wait.waitForCriterion(ev, 60 * 1000, 200, true);
       }
     });
 
@@ -403,7 +405,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 60 * 1000, 200, true);
 
       /*
        * if (region.get(new Long(0)) != null) { fail("Expected message to have
@@ -444,7 +446,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.put()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
     }
   }
 
@@ -460,7 +462,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.put()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
     }
   }
 
@@ -554,7 +556,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.put()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
     }
   }
 
@@ -570,7 +572,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.put()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.put()", ex);
     }
   }
 
@@ -589,7 +591,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.get()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
     }
   }
 
@@ -608,7 +610,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.get()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
     }
   }
 
@@ -627,7 +629,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.get()", ex);
+      com.gemstone.gemfire.test.dunit.Assert.fail("failed while region.get()", ex);
     }
   }
 
@@ -851,7 +853,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
           if (opThreads[i].isInterrupted()) {
             fail("Test failed because  thread encountered exception");
           }
-          DistributedTestCase.join(opThreads[i], 30 * 1000, getLogWriter());
+          ThreadUtils.join(opThreads[i], 30 * 1000);
         }
       }
     };
@@ -965,8 +967,8 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
-        DistributedTestCase.join(createQueuesThread, 300 * 1000, getLogWriter());
+        Wait.waitForCriterion(ev, 30 * 1000, 200, true);
+        ThreadUtils.join(createQueuesThread, 300 * 1000);
       }
     };
 
@@ -980,7 +982,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
         if (opThreads[0].isInterrupted()) {
           fail("The test has failed as it encountered interrupts in puts & takes");
         }
-        DistributedTestCase.join(opThreads[0], 30 * 1000, getLogWriter());
+        ThreadUtils.join(opThreads[0], 30 * 1000);
       }
     };
     vm0.invoke(joinWithThread);
@@ -1106,7 +1108,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 60 * 1000, 200, true);
     // assertEquals(0, hrq.getAvalaibleIds().size());
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
index f73a5a6..48da630 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
@@ -54,7 +54,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.Conflatable;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.RegionQueue;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
@@ -292,7 +292,7 @@ public class HARegionQueueJUnitTest
     // call join on the put-threads so that this thread waits till they complete
     // before doing verfication
     for (i = 0; i < TOTAL_PUT_THREADS; i++) {
-      DistributedTestCase.join(putThreads[i], 30 * 1000, null);
+      ThreadUtils.join(putThreads[i], 30 * 1000);
     }
     assertFalse(encounteredException);
 
@@ -384,7 +384,7 @@ public class HARegionQueueJUnitTest
 
       long startTime = System.currentTimeMillis();
       for (int k = 0; k < threads.length; k++) {
-        DistributedTestCase.join(threads[k], 60 * 1000, null);
+        ThreadUtils.join(threads[k], 60 * 1000);
       }
 
       long totalTime = System.currentTimeMillis() - startTime;
@@ -1252,8 +1252,8 @@ public class HARegionQueueJUnitTest
       };
       thread1.start();
       thread2.start();
-      DistributedTestCase.join(thread1, 30 * 1000, null);
-      DistributedTestCase.join(thread2, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000);
+      ThreadUtils.join(thread2, 30 * 1000);
       List list2 = HARegionQueue.createMessageListForTesting();
       Iterator iterator = list1.iterator();
       boolean doOnce = false;
@@ -1363,8 +1363,8 @@ public class HARegionQueueJUnitTest
       };
       thread1.start();
       thread2.start();
-      DistributedTestCase.join(thread1, 30 * 1000, null);
-      DistributedTestCase.join(thread2, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000);
+      ThreadUtils.join(thread2, 30 * 1000);
       List list2 = HARegionQueue.createMessageListForTesting();
       Iterator iterator = list1.iterator();
       boolean doOnce = false;
@@ -1483,8 +1483,8 @@ public class HARegionQueueJUnitTest
       };
       thread1.start();
       thread2.start();
-      DistributedTestCase.join(thread1, 30 * 1000, null);
-      DistributedTestCase.join(thread2, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000);
+      ThreadUtils.join(thread2, 30 * 1000);
       List list2 = HARegionQueue.createMessageListForTesting();
       Iterator iterator = list1.iterator();
       boolean doOnce = true;
@@ -1649,8 +1649,8 @@ public class HARegionQueueJUnitTest
       };
       thread1.start();
       thread2.start();
-      DistributedTestCase.join(thread1, 30 * 1000, null);
-      DistributedTestCase.join(thread2, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000);
+      ThreadUtils.join(thread2, 30 * 1000);
       List list2 = HARegionQueue.createMessageListForTesting();
       Iterator iterator = list1.iterator();
       boolean doOnce = true;
@@ -1769,7 +1769,7 @@ public class HARegionQueueJUnitTest
 
       long startTime = System.currentTimeMillis();
       for (int k = 0; k < 3; k++) {
-        DistributedTestCase.join(threads[k], 180 * 1000, null);
+        ThreadUtils.join(threads[k], 180 * 1000);
       }
 
       long totalTime = System.currentTimeMillis() - startTime;
@@ -1848,7 +1848,7 @@ public class HARegionQueueJUnitTest
 
       long startTime = System.currentTimeMillis();
       for (int k = 0; k < 3; k++) {
-        DistributedTestCase.join(threads[k], 60 * 1000, null);
+        ThreadUtils.join(threads[k], 60 * 1000);
       }
 
       long totalTime = System.currentTimeMillis() - startTime;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
index 90fc817..6b805ad 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
@@ -37,9 +37,14 @@ 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.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 public class HASlowReceiverDUnitTest extends DistributedTestCase {
   protected static Cache cache = null;
@@ -86,8 +91,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
   }
 
   @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  protected final void preTearDown() throws Exception {
     clientVM.invoke(HASlowReceiverDUnitTest.class, "closeCache");
 
     // then close the servers
@@ -196,7 +200,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
       r.registerInterest("ALL_KEYS");
     }
     catch (Exception ex) {
-      fail("failed in registerInterestListAll", ex);
+      Assert.fail("failed in registerInterestListAll", ex);
     }
   }
 
@@ -211,7 +215,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      fail("failed in putEntries()", ex);
+      Assert.fail("failed in putEntries()", ex);
     }
   }
 
@@ -224,7 +228,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception ex) {
-      fail("failed in createEntries(Long)", ex);
+      Assert.fail("failed in createEntries(Long)", ex);
     }
   }
 
@@ -239,20 +243,20 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
             + ") to become " + redundantServers.intValue();
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 200 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 200 * 1000, 1000, true);
   }
 
   // Test slow client
   public void testSlowClient() throws Exception {
     setBridgeObeserverForAfterQueueDestroyMessage();
     clientVM.invoke(HASlowReceiverDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(Host.getHost(0)), new Integer(PORT0),
+        new Object[] { NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT0),
             new Integer(PORT1), new Integer(PORT2), new Integer(2) });
     clientVM.invoke(HASlowReceiverDUnitTest.class, "registerInterest");
     // add expected socket exception string
-    final ExpectedException ex1 = addExpectedException(SocketException.class
+    final IgnoredException ex1 = IgnoredException.addIgnoredException(SocketException.class
         .getName());
-    final ExpectedException ex2 = addExpectedException(InterruptedException.class
+    final IgnoredException ex2 = IgnoredException.addIgnoredException(InterruptedException.class
         .getName());
     putEntries();
     Thread.sleep(20000);// wait for put to block and allow server to remove

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
index de0979e..154f9cc 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
@@ -33,9 +33,13 @@ 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.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;
 
 /**
  *
@@ -114,20 +118,18 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
     PORT2 = ((Integer)server2.invoke(OperationsPropagationDUnitTest.class,
         "createServerCache")).intValue();
     client1.invoke(OperationsPropagationDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(host), new Integer(PORT2) });
+        new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT2) });
 
   }
 
   /**
    * close the caches of the client and the servers
    */
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(OperationsPropagationDUnitTest.class, "closeCache");
     server1.invoke(OperationsPropagationDUnitTest.class, "closeCache");
     server2.invoke(OperationsPropagationDUnitTest.class, "closeCache");
-
   }
 
   /**
@@ -282,7 +284,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       region.put(DESTROY_KEY, DESTROY_VALUE);
     }
     catch (Exception e) {
-      fail(" Test failed due to " + e, e);
+      Assert.fail(" Test failed due to " + e, e);
     }
 
   }
@@ -304,7 +306,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
       region.putAll(map);
     }
     catch (Exception e) {
-      fail(" Test failed due to " + e, e);
+      Assert.fail(" Test failed due to " + e, e);
     }
 
   }
@@ -326,7 +328,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
       /*
        * if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE1))) { fail(" Expected
@@ -343,7 +345,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
       /*
        * if (!(region.get(INVALIDATE_KEY).equals(INVALIDATE_VALUE))) { fail("
@@ -360,7 +362,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
       /*
        * if (!(region.get(DESTROY_KEY).equals(DESTROY_VALUE))) { fail(" Expected
@@ -370,7 +372,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
 
     }
     catch (Exception e) {
-      fail(" Test failed due to " + e, e);
+      Assert.fail(" Test failed due to " + e, e);
     }
 
   }
@@ -394,7 +396,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      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 "
@@ -410,7 +412,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      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 "
@@ -425,7 +427,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
 
       /*if (region.containsKey(DESTROY_KEY)) {
@@ -442,7 +444,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      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 "
@@ -458,7 +460,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       
       /*
        * if (!(region.get(PUTALL_KEY).equals(PUTALL_VALUE))) { fail("PUTALL
@@ -475,10 +477,10 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
     }
     catch (Exception e) {
-      fail(" Test failed due to " + e, e);
+      Assert.fail(" Test failed due to " + e, e);
     }
   }
   
@@ -497,6 +499,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
index ef82f7a..ef75a38 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
@@ -44,6 +44,8 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 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.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
 /**
@@ -100,9 +102,8 @@ public class PutAllDUnitTest extends DistributedTestCase
   }
 
   /** close the caches**/
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(PutAllDUnitTest.class, "closeCache");
     client2.invoke(PutAllDUnitTest.class, "closeCache");
     // close server
@@ -134,11 +135,11 @@ public class PutAllDUnitTest extends DistributedTestCase
     PORT2 = ((Integer)server2.invoke(PutAllDUnitTest.class,
     "createServerCache")).intValue();
     client1.invoke(PutAllDUnitTest.class, "createClientCache1",
-        new Object[] { getServerHostName(server1.getHost()), new Integer(PORT1) });
+        new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
     client2.invoke(PutAllDUnitTest.class, "createClientCache2",
-        new Object[] { getServerHostName(server1.getHost()), new Integer(PORT2) });
+        new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2) });
     try {
-      createClientCache2(getServerHostName(server1.getHost()), new Integer(PORT2));
+      createClientCache2(NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2));
     }
     catch (Exception e) {
      fail(" test failed due to "+e);
@@ -548,7 +549,7 @@ public class PutAllDUnitTest extends DistributedTestCase
 
     public void afterCreate(EntryEvent event)
     {
-      getLogWriter().fine(" entered after created with "+event.getKey());
+      LogWriterUtils.getLogWriter().fine(" entered after created with "+event.getKey());
       boolean shouldNotify = false;
       Object key = event.getKey();
       if (key.equals(PUTALL_KEY1)) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
index 788692f..dd8cf87 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
@@ -36,7 +36,10 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 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.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
@@ -150,9 +153,8 @@ public class StatsBugDUnitTest extends DistributedTestCase
    * @throws Exception
    *           thrown if any problem occurs in closing cache
    */
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     // close client
     client1.invoke(StatsBugDUnitTest.class, "closeCache");
 
@@ -176,13 +178,13 @@ public class StatsBugDUnitTest extends DistributedTestCase
    */
   public void testBug36109() throws Exception
   {
-    getLogWriter().info("testBug36109 : BEGIN");
+    LogWriterUtils.getLogWriter().info("testBug36109 : BEGIN");
     client1.invoke(StatsBugDUnitTest.class, "createClientCacheForInvalidates", new Object[] {
-        getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
+        NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
     client1.invoke(StatsBugDUnitTest.class, "prepopulateClient");
     primary.invoke(StatsBugDUnitTest.class, "doEntryOperations",
         new Object[] { primaryPrefix });
-    pause(3000);
+    Wait.pause(3000);
     primary.invoke(StatsBugDUnitTest.class, "stopServer");
     try {
       Thread.sleep(5000);
@@ -201,7 +203,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
     }
 
     client1.invoke(StatsBugDUnitTest.class, "verifyNumInvalidates");
-    getLogWriter().info("testBug36109 : END");
+    LogWriterUtils.getLogWriter().info("testBug36109 : END");
   }
 
   /**
@@ -229,7 +231,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
     server.setNotifyBySubscription(false);
     server.setSocketBufferSize(32768);
     server.start();
-    getLogWriter().info("Server started at PORT = " + port);
+    LogWriterUtils.getLogWriter().info("Server started at PORT = " + port);
     return new Integer(port);
   }
 
@@ -254,7 +256,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
     RegionAttributes attrs = factory.create();
     Region region = cache.createRegion(REGION_NAME, attrs);
     region.registerInterest("ALL_KEYS");
-    getLogWriter().info("Client cache created");
+    LogWriterUtils.getLogWriter().info("Client cache created");
   }
 
   /**
@@ -278,7 +280,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
     RegionAttributes attrs = factory.create();
     Region region = cache.createRegion(REGION_NAME, attrs);
     region.registerInterest("ALL_KEYS", false, false);
-    getLogWriter().info("Client cache created");
+    LogWriterUtils.getLogWriter().info("Client cache created");
   }
   
   /**
@@ -289,11 +291,11 @@ public class StatsBugDUnitTest extends DistributedTestCase
   public static void verifyNumInvalidates()
   {
     long invalidatesRecordedByStats = pool.getInvalidateCount();
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "invalidatesRecordedByStats = " + invalidatesRecordedByStats);
 
     int expectedInvalidates = TOTAL_SERVERS * PUTS_PER_SERVER;
-    getLogWriter().info("expectedInvalidates = " + expectedInvalidates);
+    LogWriterUtils.getLogWriter().info("expectedInvalidates = " + expectedInvalidates);
 
     if (invalidatesRecordedByStats != expectedInvalidates) {
       fail("Invalidates received by client(" + invalidatesRecordedByStats


Mime
View raw message