geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [05/62] [abbrv] [partial] incubator-geode git commit: GEODE-773: Extract static methods from DistributedTestCase
Date Thu, 11 Feb 2016 15:26:29 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
index 42d367c..4bca2c4 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
@@ -70,8 +70,12 @@ 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.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;
 
 /**
  * @author sbawaska
@@ -93,7 +97,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
       //TXManagerImpl mgr = getGemfireCache().getTxManager();
       //assertEquals(0, mgr.hostedTransactionsInProgressForTest());
       final TXManagerImpl mgr = getGemfireCache().getTxManager();
-      waitForCriterion(new WaitCriterion() {
+      Wait.waitForCriterion(new WaitCriterion() {
         @Override
         public boolean done() {
           return mgr.hostedTransactionsInProgressForTest() == 0;
@@ -119,13 +123,12 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
   }
   
   @Override
-  public void tearDown2() throws Exception {
+  protected final void preTearDownCacheTestCase() throws Exception {
 //    try { Thread.sleep(5000); } catch (InterruptedException e) { } // FOR MANUAL TESTING OF STATS - DON"T KEEP THIS
     try {
-      invokeInEveryVM(verifyNoTxState);
+      Invoke.invokeInEveryVM(verifyNoTxState);
     } finally {
       closeAllCache();
-      super.tearDown2();
     }
   }
   
@@ -737,7 +740,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
         ClientCacheFactory ccf = new ClientCacheFactory();
         ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port);
         ccf.setPoolSubscriptionEnabled(true);
-        ccf.set("log-level", getDUnitLogLevel());
+        ccf.set("log-level", LogWriterUtils.getDUnitLogLevel());
         ClientCache cCache = getClientCache(ccf);
         ClientRegionFactory<Integer, String> crf = cCache
             .createClientRegionFactory(isEmpty ? ClientRegionShortcut.PROXY

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
index f5f1fc1..9b8f28f 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
@@ -57,9 +57,10 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessageImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
 import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
-
+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;
 
 /**
@@ -174,8 +175,8 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
   /**
    * Tears down the test.
    */
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     serverVM0.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
     serverVM1.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
     closeCache();
@@ -332,7 +333,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
   public static void createClientCache(Integer port1, Integer port2,
       Integer port3, String rLevel, Boolean addListener) throws Exception {
     CacheServerTestUtil.disableShufflingOfEndpoints();
-    String host = DistributedTestCase.getIPLiteral();
+    String host = NetworkUtils.getIPLiteral();
 
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -362,7 +363,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
       cache.getQueryService();
     }
     catch (Exception cqe) {
-      fail("Failed to getCQService.", cqe);
+      Assert.fail("Failed to getCQService.", cqe);
     }
 
     AttributesFactory factory = new AttributesFactory();
@@ -377,18 +378,18 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
 
   /* Register CQs */
   public static void createCQ(String cqName, String queryStr) {
-    getLogWriter().info("### Create CQ. ###" + cqName);
+    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("### Create CQ. ###" + cqName);
     // Get CQ Service.
     QueryService cqService = null;
     try {
       cqService = cache.getQueryService();
     }
     catch (Exception cqe) {
-      fail("Failed to getCQService.", cqe);
+      Assert.fail("Failed to getCQService.", cqe);
     }
     // Create CQ Attributes.
     CqAttributesFactory cqf = new CqAttributesFactory();
-    CqListener[] cqListeners = { new CqQueryTestListener(getLogWriter()) };
+    CqListener[] cqListeners = { new CqQueryTestListener(com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter()) };
     ((CqQueryTestListener)cqListeners[0]).cqName = cqName;
 
     cqf.initCqListeners(cqListeners);
@@ -400,7 +401,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
       assertTrue("newCq() state mismatch", cq1.getState().isStopped());
     }
     catch (Exception ex) {
-      getLogWriter().info("CqService is :" + cqService);
+      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
       ex.printStackTrace();
       AssertionError err = new AssertionError("Failed to create CQ " + cqName
           + " . ");
@@ -410,7 +411,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
   }
 
   public static void executeCQ(String cqName, Boolean initialResults) {
-    getLogWriter().info("### DEBUG EXECUTE CQ START ####");
+    com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("### DEBUG EXECUTE CQ START ####");
     // Get CQ Service.
     QueryService cqService = null;
     CqQuery cq1 = null;
@@ -420,19 +421,19 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
     try {
       cq1 = cqService.getCq(cqName);
       if (cq1 == null) {
-        getLogWriter().info(
+        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info(
             "Failed to get CqQuery object for CQ name: " + cqName);
-        fail("Failed to get CQ " + cqName, new Exception("Failed to get CQ "
+        Assert.fail("Failed to get CQ " + cqName, new Exception("Failed to get CQ "
             + cqName));
       }
       else {
-        getLogWriter().info("Obtained CQ, CQ name: " + cq1.getName());
+        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("Obtained CQ, CQ name: " + cq1.getName());
         assertTrue("newCq() state mismatch", cq1.getState().isStopped());
       }
     }
     catch (Exception ex) {
-      getLogWriter().info("CqService is :" + cqService);
-      getLogWriter().error(ex);
+      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
+      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().error(ex);
       AssertionError err = new AssertionError("Failed to execute  CQ " + cqName);
       err.initCause(ex);
       throw err;
@@ -445,14 +446,14 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
         cqResults = cq1.executeWithInitialResults();
       }
       catch (Exception ex) {
-        getLogWriter().info("CqService is :" + cqService);
+        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
         ex.printStackTrace();
         AssertionError err = new AssertionError("Failed to execute  CQ "
             + cqName);
         err.initCause(ex);
         throw err;
       }
-      getLogWriter().info("initial result size = " + cqResults.size());
+      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("initial result size = " + cqResults.size());
       assertTrue("executeWithInitialResults() state mismatch", cq1.getState()
           .isRunning());
       // if (expectedResultsSize >= 0) {
@@ -466,7 +467,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
         cq1.execute();
       }
       catch (Exception ex) {
-        getLogWriter().info("CqService is :" + cqService);
+        com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
         ex.printStackTrace();
         AssertionError err = new AssertionError("Failed to execute  CQ "
             + cqName);
@@ -483,7 +484,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
     try {
       region = cache.getRegion("root").getSubregion(regionName);
       region.getAttributesMutator().setCacheListener(
-          new CertifiableTestCacheListener(getLogWriter()));
+          new CertifiableTestCacheListener(com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter()));
     }
     catch (Exception cqe) {
       AssertionError err = new AssertionError("Failed to get Region.");
@@ -517,12 +518,12 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
     }
     catch (Exception cqe) {
       cqe.printStackTrace();
-      fail("Failed to getCQService.", cqe);
+      Assert.fail("Failed to getCQService.", cqe);
     }
 
     CqQuery cQuery = cqService.getCq(cqName);
     if (cQuery == null) {
-      fail("Failed to get CqQuery for CQ : " + cqName, new Exception(
+      Assert.fail("Failed to get CqQuery for CQ : " + cqName, new Exception(
           "Failed to get CqQuery for CQ : " + cqName));
     }
 
@@ -569,7 +570,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
       r.registerInterest("ALL_KEYS");
     }
     catch (Exception ex) {
-      fail("failed in registerInterestListAll", ex);
+      Assert.fail("failed in registerInterestListAll", ex);
     }
   }
 
@@ -582,7 +583,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
       r.registerInterest("k5");
     }
     catch (Exception ex) {
-      fail("failed while registering keys", ex);
+      Assert.fail("failed while registering keys", ex);
     }
   }
 
@@ -593,11 +594,11 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
       for (int i = 0; i < num.longValue(); i++) {
         r.put(KEY + i, new Portfolio(i + 1));
       }
-      getLogWriter().info(
+      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info(
           "### Number of Entries in Region " + rName + ": " + r.keys().size());
     }
     catch (Exception ex) {
-      fail("failed in putEntries()", ex);
+      Assert.fail("failed in putEntries()", ex);
     }
   }
 
@@ -724,7 +725,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
       }
     }
     catch (Exception e) {
-      fail("failed in VerifyCUMCQList()" + e, e);
+      Assert.fail("failed in VerifyCUMCQList()" + e, e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
index ddc907c..8920afb 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
@@ -56,7 +56,11 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
 import com.gemstone.gemfire.internal.cache.tier.sockets.HAEventWrapper;
 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;
 
 /**
  * This Dunit test is to verify that when the dispatcher of CS dispatches the
@@ -143,12 +147,12 @@ public class HADispatcherDUnitTest extends DistributedTestCase
     client2.invoke( CacheServerTestUtil.class, "disableShufflingOfEndpoints");
     client1.invoke(HADispatcherDUnitTest.class, "createClientCache",
         new Object[] {
-            getServerHostName(Host.getHost(0)),
+            NetworkUtils.getServerHostName(Host.getHost(0)),
             new Integer(PORT1), new Integer(PORT2),
             new Boolean(false) });
     client2.invoke(HADispatcherDUnitTest.class, "createClientCache",
         new Object[] {
-            getServerHostName(Host.getHost(0)),
+            NetworkUtils.getServerHostName(Host.getHost(0)),
             new Integer(PORT1), new Integer(PORT2),
             new Boolean(true) });
     //createClientCache(new Integer(PORT1), new Integer(PORT2), new Boolean(true) );
@@ -156,16 +160,13 @@ public class HADispatcherDUnitTest extends DistributedTestCase
   }
 
   @Override
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  protected final void preTearDown() throws Exception {
     client1.invoke(HADispatcherDUnitTest.class, "closeCache");
     client2.invoke(HADispatcherDUnitTest.class, "closeCache");
     // close server
     server1.invoke(HADispatcherDUnitTest.class, "resetQRMslow");
     server1.invoke(HADispatcherDUnitTest.class, "closeCache");
     server2.invoke(HADispatcherDUnitTest.class, "closeCache");
-
   }
 
   public static void closeCache()
@@ -290,7 +291,7 @@ public class HADispatcherDUnitTest extends DistributedTestCase
                     + " for proxy " + proxy;
               }
             };
-            DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+            Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
             cache.getLogger().fine("processed a proxy");
         }
       }
@@ -412,7 +413,7 @@ public class HADispatcherDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 30 * 1000, 200, true);
       ev = new WaitCriterion() {
         public boolean done() {
           return pool.getRedundants().size() >= 1;
@@ -421,7 +422,7 @@ public class HADispatcherDUnitTest extends DistributedTestCase
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 30 * 1000, 200, true);
       
       assertNotNull(pool.getPrimary());
       assertTrue("backups="+pool.getRedundants() + " expected=" + 1,
@@ -446,7 +447,7 @@ public class HADispatcherDUnitTest extends DistributedTestCase
     
     // Create CQ Attributes.
     CqAttributesFactory cqf = new CqAttributesFactory();
-    CqListener[] cqListeners = {new CqQueryTestListener(getLogWriter())};    
+    CqListener[] cqListeners = {new CqQueryTestListener(LogWriterUtils.getLogWriter())};    
     cqf.initCqListeners(cqListeners);
     CqAttributes cqa = cqf.create();
     
@@ -458,7 +459,7 @@ public class HADispatcherDUnitTest extends DistributedTestCase
       CqQuery cq1 = cqService.newCq(cqName, queryStr, cqa);
       cq1.execute();
     } catch (Exception ex){
-      getLogWriter().info("CQService is :" + cqService);
+      LogWriterUtils.getLogWriter().info("CQService is :" + cqService);
       ex.printStackTrace();
       AssertionError err = new AssertionError("Failed to create/execute CQ " + cqName + " . ");
       err.initCause(ex);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
index d04d249..0449a78 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
@@ -52,7 +52,10 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionLocalMaxMemoryDUnitTest.TestObject1;
 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;
 
 /**
  * Test client to server flow for delta propogation
@@ -130,8 +133,8 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
     client2 = host.getVM(3);
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     // reset all flags
     DeltaTestImpl.resetDeltaInvokationCounters();
     server.invoke(DeltaTestImpl.class, "resetDeltaInvokationCounters");
@@ -161,11 +164,11 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
             Boolean.TRUE, Boolean.FALSE, clone, enableDelta })).intValue();
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
 
     client2.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server2.getHost()),
+        new Object[] { NetworkUtils.getServerHostName(server2.getHost()),
             new Integer(PORT2), Boolean.TRUE, Boolean.FALSE, cq, queries, RI });
   }
 
@@ -180,11 +183,11 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
             Boolean.FALSE, Boolean.FALSE, clone, enableDelta })).intValue();
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.FALSE, Boolean.FALSE, Boolean.FALSE });
 
     client2.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server2.getHost()),
+        new Object[] { NetworkUtils.getServerHostName(server2.getHost()),
             new Integer(PORT2), Boolean.TRUE, Boolean.FALSE, cq, queries, RI });
   }
 
@@ -713,7 +716,7 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         new Object[] { Boolean.FALSE, Boolean.FALSE });
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.FALSE, Boolean.TRUE, Boolean.FALSE });
 
 /*    server2.invoke(ClientToServerDeltaDUnitTest.class, "setFirstSecondUpdate",
@@ -746,7 +749,7 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         new Object[] { Boolean.FALSE, Boolean.FALSE });
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.FALSE, Boolean.TRUE, Boolean.FALSE });
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
@@ -778,11 +781,11 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         new Object[] { Boolean.FALSE, Boolean.FALSE });
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.TRUE, Boolean.TRUE, Boolean.FALSE });
 
     client2.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.TRUE, Boolean.FALSE, Boolean.FALSE });
     
     int deltaSent =  (Integer)server2.invoke(
@@ -809,7 +812,7 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         new Object[] { Boolean.FALSE, Boolean.FALSE });
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(server.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()), new Integer(PORT1),
             Boolean.FALSE, Boolean.FALSE, Boolean.FALSE});
 
     client.invoke(ClientToServerDeltaDUnitTest.class, "putDelta",
@@ -1000,7 +1003,7 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
         return "Last key NOT received.";
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 10*1000, 100, true);
+    Wait.waitForCriterion(wc, 10*1000, 100, true);
   }
   
   static class CSDeltaTestImpl extends DeltaTestImpl {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
index 2e7efe7..8095079 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
@@ -54,7 +54,10 @@ import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 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.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * @author ashetkar
@@ -101,8 +104,8 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
     client2 = host.getVM(3);
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     server1.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
     server2.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
     client1.invoke(DeltaPropagationWithCQDUnitTest.class, "close");
@@ -126,10 +129,10 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
     // 2. setup a client
     client1
         .invoke(DeltaPropagationWithCQDUnitTest.class, "createClientCache",
-            new Object[] {getServerHostName(server1.getHost()), port,
+            new Object[] {NetworkUtils.getServerHostName(server1.getHost()), port,
                 Boolean.TRUE});
     // 3. setup another client with cqs and interest in all keys.
-    createClientCache(getServerHostName(server1.getHost()), port, true);
+    createClientCache(NetworkUtils.getServerHostName(server1.getHost()), port, true);
     registerCQs(1, "CQWithInterestDUnitTest_cq");
     // 4. put a key on client1
     client1.invoke(DeltaPropagationWithCQDUnitTest.class, "doPut", new Object[] {
@@ -147,7 +150,7 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
             + " cqEvents and " + cqErrors + " cqErrors";
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 30 * 1000, 100, true);
+    Wait.waitForCriterion(wc, 30 * 1000, 100, true);
 
     // 7. validate that client2 has the new value
     assertEquals("Latest value: ", "NEW_VALUE", cache.getRegion(regionName)
@@ -164,10 +167,10 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
     // 2. setup a client with register interest
     client1
         .invoke(DeltaPropagationWithCQDUnitTest.class, "createClientCache",
-            new Object[] {getServerHostName(server1.getHost()), port,
+            new Object[] {NetworkUtils.getServerHostName(server1.getHost()), port,
                 Boolean.TRUE});
     // 3. setup another client with cqs but without interest.
-    createClientCache(getServerHostName(server1.getHost()), port, false/*RI*/);
+    createClientCache(NetworkUtils.getServerHostName(server1.getHost()), port, false/*RI*/);
     for (int i = 0; i < numOfCQs; i++) {
       registerCQs(numOfListeners, "Query_"+i);
     }
@@ -200,7 +203,7 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
         return (cqEvents + cqErrors) == events;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 10000, 100, true);
+    Wait.waitForCriterion(wc, 10000, 100, true);
   }
 
   public static void verifyFullValueRequestsFromClients(Long expected)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
index ed7232f..886e671 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
@@ -44,8 +44,11 @@ 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.LogWriterUtils;
+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 tests the flag setting for region ( DataPolicy as Empty ) for
  * Delta propogation for a client while registering CQ
@@ -115,7 +118,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
   public void setUp() throws Exception
   {
     disconnectAllFromDS();
-    pause(5000);
+    Wait.pause(5000);
     final Host host = Host.getHost(0);
     server = host.getVM(0);
     client = host.getVM(1);
@@ -331,7 +334,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
       else  
         cq1.execute();
     } catch (Exception ex){
-      getLogWriter().info("CqService is :" + cqService);
+      LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
       ex.printStackTrace();
       AssertionError err = new AssertionError("Failed to create CQ " + cqName1 + " . ");
       err.initCause(ex);
@@ -372,7 +375,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
       else  
         cq1.execute();
     } catch (Exception ex){
-      getLogWriter().info("CqService is :" + cqService);
+      LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
       ex.printStackTrace();
       AssertionError err = new AssertionError("Failed to create CQ " + cqName1 + " . ");
       err.initCause(ex);
@@ -401,7 +404,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
         return "Wait Expired";
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 5 * 1000, 100, true);
+    Wait.waitForCriterion(wc, 5 * 1000, 100, true);
     
     assertTrue(REGION_NAME1
         + " not present in cache client proxy : Delta is enable", proxy
@@ -442,7 +445,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
         return "Wait Expired";
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 5 * 1000, 100, true);
+    Wait.waitForCriterion(wc, 5 * 1000, 100, true);
     
     assertTrue("Multiple entries for a region", proxy
         .getRegionsWithEmptyDataPolicy().size() == 2);
@@ -587,11 +590,6 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
     return new Integer(p.getPrimaryPort());
   }
   
-  public void tearDown2() throws Exception
-  {
-    // donot do any thing as we handling closing cache in test case
-  }
-
   /*
    * close cache
    */
@@ -667,7 +665,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
         "createServerCache")).intValue();
     client
         .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCache",
-            new Object[] { getServerHostName(server.getHost()),
+            new Object[] { NetworkUtils.getServerHostName(server.getHost()),
                 new Integer(PORT1) });
   }
   
@@ -679,7 +677,7 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
         "createServerCache")).intValue();
     client
         .invoke(DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCacheWithNoRegion",
-            new Object[] { getServerHostName(server.getHost()),
+            new Object[] { NetworkUtils.getServerHostName(server.getHost()),
                 new Integer(PORT1) });
   }
   /*
@@ -702,8 +700,8 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
         "createServerCache")).intValue();
     primary = (Integer)client2.invoke(
         DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCache2",
-        new Object[] { getServerHostName(server.getHost()),
-            getServerHostName(server2.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()),
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT1),
             new Integer(PORT2) });
   }
   
@@ -718,8 +716,8 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
         "createServerCache")).intValue();
     primary = (Integer)client2.invoke(
         DeltaToRegionRelationCQRegistrationDUnitTest.class, "createClientCache3",
-        new Object[] { getServerHostName(server.getHost()),
-            getServerHostName(server2.getHost()), new Integer(PORT1),
+        new Object[] { NetworkUtils.getServerHostName(server.getHost()),
+            NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT1),
             new Integer(PORT2) });
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
index 13afbf2..753fe67 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
@@ -43,9 +43,9 @@ public class DurableClientCrashDUnitTest extends DurableClientTestCase {
     this.durableClientVM.invoke(CacheServerTestUtil.class, "setClientCrash", new Object[] {new Boolean(true)});    
   }
   
-  public void tearDown2() throws Exception {
+  @Override
+  protected void preTearDownDurableClientTestCase() throws Exception {
     configureClientStop2();
-    super.tearDown2();
   }
   
   public void configureClientStop2()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientNetDownDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientNetDownDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientNetDownDUnitTest.java
index 4dd41b8..96781f9 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientNetDownDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientNetDownDUnitTest.java
@@ -32,10 +32,9 @@ public class DurableClientNetDownDUnitTest extends DurableClientCrashDUnitTest {
   }
   
   @Override
-  public void tearDown2() throws Exception {
+  protected final void preTearDownDurableClientTestCase() throws Exception {
     //ensure that the test flag is no longer set in this vm
     this.durableClientVM.invoke(CacheServerTestUtil.class, "reconnectClient");
-    super.tearDown2();
   }
 
   public void setPrimaryRecoveryCheck() {}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
index 04ce137..ed0e565 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
@@ -42,10 +42,15 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 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.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.VM;
+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;
 
 public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
 
@@ -65,7 +70,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     // normally
     final String durableClientId = getName() + "_client";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -88,7 +93,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
 
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 10;
@@ -147,7 +152,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     final String regionName1 = regionName + "1";
     final String regionName2 = regionName + "2";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClients", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName1, regionName2, getClientDistributedSystemProperties(durableClientId)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName1, regionName2, getClientDistributedSystemProperties(durableClientId)});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -213,7 +218,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     // stops normally
     final String durableClientId = getName() + "_client";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -239,7 +244,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
       public void run2() throws CacheException {
         getSystem(getClientDistributedSystemProperties(durableClientId));
         PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory();
-        pf.init(getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, true));
+        pf.init(getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, true));
         try {
           pf.create("uncreatablePool");
           fail("Should not have been able to create the pool");
@@ -247,7 +252,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
           // expected exception
           disconnectFromDS();
         } catch (Exception e) {
-          fail("Should not have gotten here", e);
+          Assert.fail("Should not have gotten here", e);
         }
       }
     });
@@ -269,7 +274,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 10;
@@ -325,7 +330,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     // stops normally
     final String durableClientId = getName() + "_client";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId)});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -339,7 +344,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     VM durableClient2VM = this.publisherClientVM;
     final String durableClientId2 = getName() + "_client2";
     durableClient2VM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClient2VM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId2)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClient2VM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId2)});
     
     // Send clientReady message
     durableClient2VM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -407,7 +412,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -445,7 +450,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
 
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 10;
@@ -514,7 +519,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     
     // Re-start the durable client
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -577,7 +582,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -603,7 +608,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     VM durableClient2VM = this.server2VM;
     final String durableClientId2 = getName() + "_client2";
     durableClient2VM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClient2VM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId2, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClient2VM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId2, durableClientTimeout), Boolean.TRUE});
     
     // Send clientReady message
     durableClient2VM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -652,7 +657,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 10;
@@ -778,7 +783,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
 
     // Re-start durable client 1
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -789,7 +794,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
 
     // Re-start durable client 2
     durableClient2VM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClient2VM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId2), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClient2VM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId2), Boolean.TRUE});
 
     // Send clientReady message
     durableClient2VM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -869,7 +874,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -907,7 +912,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     });
 
     // VJR: wait for ack to go out
-    pause(5000);
+    Wait.pause(5000);
 
     // Stop the durable client
     this.durableClientVM.invoke(CacheServerTestUtil.class, "closeCache", new Object[] {new Boolean(true)});
@@ -929,7 +934,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
         
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 10;
@@ -969,7 +974,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     // Re-start the durable client that is kept alive on the server when it stops
     // normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -1056,7 +1061,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     final String durableClientId = getName() + "_client";
     // make the client use ClientCacheFactory so it will have a default pool
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId)});
 
     // verify that readyForEvents has not yet been called on the client's default pool
     this.durableClientVM.invoke(new CacheSerializableRunnable("check readyForEvents not called") {
@@ -1187,7 +1192,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
       
       // Start normal publisher client
       this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-          new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+          new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
   
       // Publish some entries
       final int numberOfEntries = 10;
@@ -1353,7 +1358,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
         ClientServerObserver origObserver = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
           public void beforeSendingClientAck()
           {
-            getLogWriter().info("beforeSendingClientAck invoked");
+            LogWriterUtils.getLogWriter().info("beforeSendingClientAck invoked");
            
           }
         });
@@ -1430,7 +1435,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 10;
@@ -2877,8 +2882,8 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
    */
   public void testRejectClientWhenDrainingCq() throws Exception {
     try {
-      DistributedTestCase.addExpectedException(LocalizedStrings.CacheClientNotifier_COULD_NOT_CONNECT_DUE_TO_CQ_BEING_DRAINED.toLocalizedString());
-      DistributedTestCase.addExpectedException("Could not initialize a primary queue on startup. No queue servers available.");
+      IgnoredException.addIgnoredException(LocalizedStrings.CacheClientNotifier_COULD_NOT_CONNECT_DUE_TO_CQ_BEING_DRAINED.toLocalizedString());
+      IgnoredException.addIgnoredException("Could not initialize a primary queue on startup. No queue servers available.");
       
       String greaterThan5Query = "select * from /" + regionName + " p where p.ID > 5";
       String allQuery = "select * from /" + regionName + " p where p.ID > -1";
@@ -2949,7 +2954,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
               return null;
             }
           };
-          DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+          Wait.waitForCriterion(ev, 10 * 1000, 200, true);
           assertTrue(((RejectClientReconnectTestHook) CacheClientProxy.testHook).wasClientRejected());
         }
       });
@@ -3281,7 +3286,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     final String durableClientId = getName() + "_client";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -3346,7 +3351,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase {
     // Start up the client again. This time initialize it so that it is not kept
     // alive on the servers when it stops normally.
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), server1Port, server2Port, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
index c3a3482..f9d73e0 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
@@ -64,7 +64,11 @@ import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
 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;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * Class <code>DurableClientTestCase</code> tests durable client
@@ -96,17 +100,24 @@ public class DurableClientTestCase extends DistributedTestCase {
     this.publisherClientVM = host.getVM(3);
     this.regionName = getName() + "_region";
     //Clients see this when the servers disconnect
-    addExpectedException("Could not find any server");
-    testName = getName();
-    System.out.println("\n\n[setup] START TEST " + getClass().getSimpleName()+"."+ testName+"\n\n");
+    IgnoredException.addIgnoredException("Could not find any server");
+    setTestMethodName(getName());
+    assertEquals(getName(), getTestMethodName());
+    System.out.println("\n\n[setup] START TEST " + getClass().getSimpleName()+"."+ getTestMethodName()+"\n\n");
   }
   
-  public void tearDown2() throws Exception {
+  @Override
+  protected final void preTearDown() throws Exception {
+    preTearDownDurableClientTestCase();
+    
     this.durableClientVM.invoke(CacheServerTestUtil.class, "closeCache");
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "closeCache");
     this.server1VM.invoke(CacheServerTestUtil.class, "closeCache");
     this.server2VM.invoke(CacheServerTestUtil.class, "closeCache");
   }
+  
+  protected void preTearDownDurableClientTestCase() throws Exception {
+  }
 
   /**
    * Test that starting a durable client is correctly processed by the server.
@@ -121,7 +132,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     // stops normally
     final String durableClientId = getName() + "_client";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId)});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -177,7 +188,7 @@ public class DurableClientTestCase extends DistributedTestCase {
       final String durableClientId = getName() + "_client";
 
       this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
-          new Object[] { getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), new Boolean(false), jp });
+          new Object[] { getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), new Boolean(false), jp });
 
       // Send clientReady message
       this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -241,7 +252,7 @@ public class DurableClientTestCase extends DistributedTestCase {
   {
     printClientProxyState("Before");
     this.durableClientVM.invoke(CacheServerTestUtil.class, "closeCache",new Object[] {new Boolean(keepAlive)});
-    pause(1000);
+    Wait.pause(1000);
     printClientProxyState("after");
   }
 
@@ -310,7 +321,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout)});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -349,7 +360,7 @@ public class DurableClientTestCase extends DistributedTestCase {
 
     // Re-start the durable client
     this.restartDurableClient(new Object[] {
-        getClientPool(getServerHostName(durableClientVM.getHost()),serverPort, true),
+        getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()),serverPort, true),
         regionName,
         getClientDistributedSystemProperties(durableClientId,
             durableClientTimeout) });
@@ -393,7 +404,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout)});
 
 //    // Send clientReady message
 //    this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -442,7 +453,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     // Re-start the durable client (this is necessary so the
     //netDown test will set the appropriate system properties.
     this.restartDurableClient(new Object[] {
-        getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true),
+        getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true),
         regionName,
         getClientDistributedSystemProperties(durableClientId,
             durableClientTimeout) });
@@ -482,7 +493,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 5; // keep the client alive for 5 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout)});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -538,7 +549,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     });
     
     this.restartDurableClient(new Object[] {
-        getClientPool(getServerHostName(Host.getHost(0)), serverPort, true),
+        getClientPool(NetworkUtils.getServerHostName(Host.getHost(0)), serverPort, true),
         regionName,
         getClientDistributedSystemProperties(durableClientId,
             durableClientTimeout) });
@@ -565,7 +576,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 120; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -588,7 +599,7 @@ public class DurableClientTestCase extends DistributedTestCase {
 
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 1;
@@ -632,7 +643,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         };
         //If we wait too long, the durable queue will be gone, because
         //the timeout is 120 seconds.
-        DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+        Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       }
     });
 
@@ -682,7 +693,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         };
         //If we wait too long, the durable queue will be gone, because
         //the timeout is 120 seconds.
-        DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+        Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
       }
     });
 
@@ -691,7 +702,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     
     // Re-start the durable client
     this.restartDurableClient(new Object[] {
-        getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName,
+        getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName,
         getClientDistributedSystemProperties(durableClientId), Boolean.TRUE });
 
     // Verify durable client on server
@@ -736,7 +747,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     //final boolean durableClientKeepAlive = true; // keep the client alive when it stops normally
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId, durableClientTimeout), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -759,7 +770,7 @@ public class DurableClientTestCase extends DistributedTestCase {
 
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 1;
@@ -804,7 +815,7 @@ public class DurableClientTestCase extends DistributedTestCase {
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 1000, 200, true);
+        Wait.waitForCriterion(ev, 1000, 200, true);
         assertTrue(proxy.isPaused());
       }
     });
@@ -847,7 +858,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     
     // Re-start the durable client
     this.restartDurableClient(new Object[] {
-        getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName,
+        getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName,
         getClientDistributedSystemProperties(durableClientId), Boolean.TRUE });
 
     // Verify durable client on server
@@ -951,7 +962,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     // stops normally
     final String durableClientId = getName() + "_client";
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), serverPort, true), regionName, getClientDistributedSystemProperties(durableClientId), Boolean.TRUE});
 
     // Send clientReady message
     this.durableClientVM.invoke(new CacheSerializableRunnable("Send clientReady") {
@@ -1017,7 +1028,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     
     // Start a publisher
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), serverPort, false), regionName});
 
     // Publish some messages
     // Publish some entries
@@ -1072,7 +1083,7 @@ public class DurableClientTestCase extends DistributedTestCase {
   public void DISABLED_testDurableHAFailover() throws InterruptedException
   {
     //Clients see this when the servers disconnect
-    addExpectedException("Could not find any server");
+    IgnoredException.addIgnoredException("Could not find any server");
     durableFailover(1);
     durableFailoverAfterReconnect(1);
   }
@@ -1102,10 +1113,10 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     Pool clientPool;
     if (redundancyLevel == 1) {
-      clientPool = getClientPool(getServerHostName(Host.getHost(0)), server1Port, server2Port, true); 
+      clientPool = getClientPool(NetworkUtils.getServerHostName(Host.getHost(0)), server1Port, server2Port, true); 
     }
     else {
-      clientPool = getClientPool(getServerHostName(Host.getHost(0)), server1Port, server2Port, true, 0);
+      clientPool = getClientPool(NetworkUtils.getServerHostName(Host.getHost(0)), server1Port, server2Port, true, 0);
     }
     
     this.durableClientVM.invoke(CacheServerTestUtil.class, "disableShufflingOfEndpoints");
@@ -1139,7 +1150,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 1;
@@ -1296,10 +1307,10 @@ public class DurableClientTestCase extends DistributedTestCase {
     final int durableClientTimeout = 60; // keep the client alive for 60 seconds
     Pool clientPool;
     if (redundancyLevel == 1) {
-      clientPool = getClientPool(getServerHostName(Host.getHost(0)), server1Port, server2Port, true); 
+      clientPool = getClientPool(NetworkUtils.getServerHostName(Host.getHost(0)), server1Port, server2Port, true); 
     }
     else {
-      clientPool = getClientPool(getServerHostName(Host.getHost(0)), server1Port, server2Port, true, 0);
+      clientPool = getClientPool(NetworkUtils.getServerHostName(Host.getHost(0)), server1Port, server2Port, true, 0);
     }
     
     this.durableClientVM.invoke(CacheServerTestUtil.class, "disableShufflingOfEndpoints");
@@ -1328,7 +1339,7 @@ public class DurableClientTestCase extends DistributedTestCase {
     
     // Start normal publisher client
     this.publisherClientVM.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(publisherClientVM.getHost()), server1Port, server2Port, false), regionName});
 
     // Publish some entries
     final int numberOfEntries = 1;
@@ -1667,7 +1678,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         return getAllClientProxyState();
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 50 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 50 * 1000, 200, true);
   }
   
   protected static void checkProxyIsAlive(final CacheClientProxy proxy) {
@@ -1679,7 +1690,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 15 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 15 * 1000, 200, true);
   }
   
   protected static int getNumberOfClientProxies() {
@@ -1728,7 +1739,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         return "never received marker ack";
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 3 * 60 * 1000, 200/*0*/, true);
+    Wait.waitForCriterion(ev, 3 * 60 * 1000, 200/*0*/, true);
   }
 
   /**
@@ -1783,7 +1794,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         
         // wait for primary (and interest) recovery
         // recovery satisfier task currently uses ping interval value
-        DistributedTestCase.waitForCriterion(waitForPrimaryRecovery, 30000, 1000, true);
+        Wait.waitForCriterion(waitForPrimaryRecovery, 30000, 1000, true);
       }
     });
   }
@@ -1905,7 +1916,7 @@ public class DurableClientTestCase extends DistributedTestCase {
             return "cq numHAQueuedEvents stat was expected to be " + expectedNumber + " but was instead " + cqQuery.getVsdStats().getNumHAQueuedEvents();
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+        Wait.waitForCriterion(ev, 10 * 1000, 200, true);
         
         assertEquals(expectedNumber, cqQuery.getVsdStats().getNumHAQueuedEvents());
       }
@@ -1936,7 +1947,7 @@ public class DurableClientTestCase extends DistributedTestCase {
             return "queue size stat was expected to be " + expectedNumber + " but was instead " + clientProxy.getQueueSizeStat();
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+        Wait.waitForCriterion(ev, 10 * 1000, 200, true);
         
         assertTrue(clientProxy.getQueueSizeStat() == expectedNumber || clientProxy.getQueueSizeStat() == remaining);
       }
@@ -2005,7 +2016,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         CacheServerTestUtil.class,
         "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()),
                 serverPort1, true), regionName,
             getClientDistributedSystemProperties(durableClientId, durableTimeoutInSeconds),
             Boolean.TRUE });
@@ -2016,7 +2027,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         CacheServerTestUtil.class,
         "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()),
                 serverPort1, true), regionName,
             getClientDistributedSystemProperties(durableClientId),
             Boolean.TRUE });
@@ -2027,7 +2038,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         CacheServerTestUtil.class,
         "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(vm.getHost()),
+            getClientPool(NetworkUtils.getServerHostName(vm.getHost()),
                 serverPort1, serverPort2, true), regionName,
             getClientDistributedSystemProperties(durableClientId),
             Boolean.TRUE });
@@ -2038,7 +2049,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         CacheServerTestUtil.class,
         "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(vm.getHost()),
+            getClientPool(NetworkUtils.getServerHostName(vm.getHost()),
                 serverPort1, false), regionName });
   }
   
@@ -2047,7 +2058,7 @@ public class DurableClientTestCase extends DistributedTestCase {
         CacheServerTestUtil.class,
         "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(vm.getHost()),
+            getClientPool(NetworkUtils.getServerHostName(vm.getHost()),
                 serverPort1, serverPort2, false), regionName });
   }
   
@@ -2077,7 +2088,7 @@ public class DurableClientTestCase extends DistributedTestCase {
             return "No primary updater";
           }
         };
-        DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+        Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
         assertTrue(CacheServerTestUtil.getPool().isPrimaryUpdaterAlive());
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
index 58c682b..b4e589f 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
@@ -49,10 +49,14 @@ import com.gemstone.gemfire.management.internal.JmxManagerLocatorRequest;
 import com.gemstone.gemfire.management.internal.JmxManagerLocatorResponse;
 import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
 import com.gemstone.gemfire.management.internal.SystemManagementService;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+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;
 
 /**
  * Cache Server related management test cases
@@ -89,8 +93,8 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
     super.setUp();
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  @Override
+  protected final void postTearDownLocatorTestBase() throws Exception {
     disconnectAllFromDS();
   }
 
@@ -118,7 +122,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
 
     final int port = server.invokeInt(CqQueryDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     // Create client.
     cqDUnitTest.createClient(client, port, host0);
@@ -142,7 +146,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
 
     // Close.
 
-    pause(2000);
+    Wait.pause(2000);
     checkNavigation(managingNode,member,serverPort);
     verifyIndex(server,serverPort);
     // This will test all CQs and will close the cq in its final step
@@ -174,7 +178,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
     int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     startLocatorInVM(locator, locatorPort, "");
     
-    String locators = getServerHostName(locator.getHost())+ "[" + locatorPort + "]";
+    String locators = NetworkUtils.getServerHostName(locator.getHost())+ "[" + locatorPort + "]";
     
    
     int serverPort = startBridgeServerInVM(server, null, locators);
@@ -182,7 +186,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
     addClientNotifListener(server,serverPort);
 
     // Start a client and make sure that proper notification is received
-    startBridgeClientInVM(client, null, getServerHostName(locator.getHost()), locatorPort);
+    startBridgeClientInVM(client, null, NetworkUtils.getServerHostName(locator.getHost()), locatorPort);
     
     //stop the client and make sure the bridge server notifies
     stopBridgeMemberVM(client);
@@ -211,7 +215,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
     final int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     startLocator(locator, locatorPort, "");
 
-    String locators = getServerHostName(locator.getHost())+ "[" + locatorPort + "]";
+    String locators = NetworkUtils.getServerHostName(locator.getHost())+ "[" + locatorPort + "]";
     
     //Step 2:
     int serverPort = startBridgeServerInVM(server, null, locators);
@@ -275,7 +279,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
         Properties props = new Properties();
         props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0));
         props.setProperty(DistributionConfig.LOCATORS_NAME, otherLocators);
-        props.setProperty(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel());
+        props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel());
         props.setProperty(DistributionConfig.JMX_MANAGER_HTTP_PORT_NAME, "0");
         props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
         try {
@@ -283,14 +287,14 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
               + ".log");
           InetAddress bindAddr = null;
           try {
-            bindAddr = InetAddress.getByName(getServerHostName(vm.getHost()));
+            bindAddr = InetAddress.getByName(NetworkUtils.getServerHostName(vm.getHost()));
           } catch (UnknownHostException uhe) {
-            fail("While resolving bind address ", uhe);
+            Assert.fail("While resolving bind address ", uhe);
           }
           Locator locator = Locator.startLocatorAndDS(locatorPort, logFile, bindAddr, props);
           remoteObjects.put(LOCATOR_KEY, locator);
         } catch (IOException ex) {
-          fail("While starting locator on port " + locatorPort, ex);
+          Assert.fail("While starting locator on port " + locatorPort, ex);
         }
       }
     });
@@ -352,7 +356,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+        Wait.waitForCriterion(ev, 10 * 1000, 200, true);
         assertTrue(bean.isRunning());
         TestCacheServerNotif nt = new TestCacheServerNotif();
         try {
@@ -396,7 +400,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
         CacheServerMXBean bean = service
             .getLocalCacheServerMXBean(serverPort);
         assertEquals(bean.getIndexCount(), 1);
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "<ExpectedString> Index is   " + bean.getIndexList()[0]
                 + "</ExpectedString> ");
         try {
@@ -461,7 +465,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+        Wait.waitForCriterion(ev, 10 * 1000, 200, true);
         assertTrue(bean.isRunning());
         assertCacheServerConfig(bean);
 
@@ -487,7 +491,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
         .getMessageTimeToLive());
     assertEquals(CacheServer.DEFAULT_LOAD_POLL_INTERVAL, bean
         .getLoadPollInterval());
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "<ExpectedString> LoadProbe of the Server is  "
             + bean.fetchLoadProbe().toString() + "</ExpectedString> ");
   }
@@ -514,14 +518,14 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
 
           String clientId = bean.getClientIds()[0];
           assertNotNull(clientId);
-          getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "<ExpectedString> ClientId of the Server is  " + clientId
                   + "</ExpectedString> ");
-          getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "<ExpectedString> Active Query Count  "
                   + bean.getActiveCQCount() + "</ExpectedString> ");
           
-          getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "<ExpectedString> Registered Query Count  "
                   + bean.getRegisteredCQCount() + "</ExpectedString> ");
 
@@ -563,7 +567,7 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
     @Override
     public void handleNotification(Notification notification, Object handback) {
       assertNotNull(notification);
-      getLogWriter().info("Expected String :" + notification.toString());
+      LogWriterUtils.getLogWriter().info("Expected String :" + notification.toString());
     }
 
   }


Mime
View raw message