geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [23/51] [partial] incubator-geode git commit: GEODE-773: Extract static methods from DistributedTestCase
Date Tue, 09 Feb 2016 18:44:33 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
index ba8ee2e..5ba03bd 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
@@ -38,9 +38,14 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
 import com.gemstone.gemfire.cache.client.*;
@@ -100,9 +105,9 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
     PORT2 =  ((Integer)vm1.invoke(DestroyEntryPropagationDUnitTest.class, "createServerCache" )).intValue();
 
     vm2.invoke(DestroyEntryPropagationDUnitTest.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)});
     vm3.invoke(DestroyEntryPropagationDUnitTest.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)});
 
   }
 
@@ -221,7 +226,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -245,7 +250,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -296,10 +301,10 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
   {
     try {
       Iterator iter = cache.getCacheServers().iterator();
-      getLogWriter().fine ("Asif: servers running = "+cache.getCacheServers().size());
+      LogWriterUtils.getLogWriter().fine ("Asif: servers running = "+cache.getCacheServers().size());
       if (iter.hasNext()) {
         CacheServer server = (CacheServer)iter.next();
-        getLogWriter().fine("asif : server running on port="+server.getPort()+ " asked to kill serevre onport="+port);
+        LogWriterUtils.getLogWriter().fine("asif : server running on port="+server.getPort()+ " asked to kill serevre onport="+port);
          if(port.intValue() == server.getPort()){
          server.stop();
         }
@@ -342,7 +347,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
       assertEquals(r1.getEntry("key2").getValue(), "key-2");
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -359,7 +364,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
       r.destroy("key2");
     }
     catch (Exception ex) {
-      fail("failed while destroyEntry()", ex);
+      Assert.fail("failed while destroyEntry()", ex);
     }
   }
 
@@ -372,7 +377,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
       assertNotNull(r.getEntry("key2"));
     }
     catch (Exception ex) {
-      fail("failed while verifyDestroyEntry in C1", ex);
+      Assert.fail("failed while verifyDestroyEntry in C1", ex);
     }
   }
 
@@ -386,7 +391,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
       assertNull(r.getEntry("key2"));
     }
     catch (Exception ex) {
-      fail("failed while verifyDestroyEntry in C1", ex);
+      Assert.fail("failed while verifyDestroyEntry in C1", ex);
     }
   }
 
@@ -400,7 +405,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
       assertNotNull(r.getEntry("key2"));
     }
     catch (Exception ex) {
-      fail("failed while verifyDestroyEntry for key1", ex);
+      Assert.fail("failed while verifyDestroyEntry for key1", ex);
     }
   }
 
@@ -414,7 +419,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
         return "waiting for destroy event for " + key;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 10 * 1000, 200, true);
     ccl.destroys.remove(key);
   }
 
@@ -447,7 +452,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setPoolName(p.getName());
-    factory.setCacheListener(new CertifiableTestCacheListener(getLogWriter()));
+    factory.setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
     RegionAttributes attrs = factory.create();
     cache.createRegion(REGION_NAME, attrs);
 
@@ -459,7 +464,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
-    factory.setCacheListener(new CertifiableTestCacheListener(getLogWriter()));
+    factory.setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
     RegionAttributes attrs = factory.create();
     cache.createRegion(REGION_NAME, attrs);
 
@@ -482,7 +487,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while registering interest", ex);
+      Assert.fail("failed while registering interest", ex);
     }
   }
 
@@ -494,15 +499,13 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
     }
   }
 
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     //close client
     vm2.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
     vm3.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
     //close server
     vm0.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
     vm1.invoke(DestroyEntryPropagationDUnitTest.class, "closeCache");
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
index d40563b..fb8fb3e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
@@ -30,9 +30,13 @@ import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 public class DurableClientBug39997DUnitTest extends CacheTestCase {
 
@@ -47,7 +51,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
 
-    final String hostName = getServerHostName(host);
+    final String hostName = NetworkUtils.getServerHostName(host);
     final int port = AvailablePortHelper.getRandomAvailableTCPPort();
     vm0.invoke(new SerializableRunnable("create cache") {
       public void run() {
@@ -84,7 +88,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
         try {
           server.start();
         } catch (IOException e) {
-          fail("couldn't start server", e);
+          Assert.fail("couldn't start server", e);
         }
       }
     });
@@ -93,7 +97,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
       public void run() {
         Cache cache = getCache();
         final Region region = cache.getRegion("region");
-        waitForCriterion(new WaitCriterion() {
+        Wait.waitForCriterion(new WaitCriterion() {
 
           public String description() {
             return "Wait for register interest to succeed";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
index 3e23ab5..dbe2355 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
@@ -35,7 +35,9 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.VM;
 
 /**
@@ -85,11 +87,12 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
         "createCacheServer", new Object[] { });
     port1 = (Integer) vm1.invoke(DurableClientQueueSizeDUnitTest.class,
         "createCacheServer", new Object[] { });
-    addExpectedException("java.net.SocketException");
-    addExpectedException("Unexpected IOException");
+    IgnoredException.addIgnoredException("java.net.SocketException");
+    IgnoredException.addIgnoredException("Unexpected IOException");
   }
 
-  public void tearDown2() throws Exception {
+  @Override
+  protected final void preTearDown() throws Exception {
     closeCache();
 
     vm2.invoke(DurableClientQueueSizeDUnitTest.class, "closeCache");
@@ -275,7 +278,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
   public static Integer createCacheServer(Integer serverPort)
       throws Exception {
     Properties props = new Properties();
-    props.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+    props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
 //    props.setProperty("log-level", "fine");
 //    props.setProperty("log-file", "server_" + OSProcess.getId() + ".log");
 //    props.setProperty("statistic-archive-file", "server_" + OSProcess.getId()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
index 5e015ea..f9e7d87 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java
@@ -19,7 +19,9 @@ package com.gemstone.gemfire.internal.cache.tier.sockets;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 
 /**
  * @author dsmith
@@ -50,7 +52,7 @@ public class DurableClientReconnectAutoDUnitTest extends
   protected PoolFactory getPoolFactory() {
     Host host = Host.getHost(0);
     PoolFactory factory = PoolManager.createFactory()
-    .addLocator(getServerHostName(host), getDUnitLocatorPort());
+    .addLocator(NetworkUtils.getServerHostName(host), DistributedTestUtils.getDUnitLocatorPort());
     return factory;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
index 309f44a..6ade4bd 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
@@ -43,9 +43,15 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+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.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 
 /**      
@@ -104,10 +110,10 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     PORT2 =  ((Integer) server2.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
     PORT3 =  ((Integer) server3.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
     PORT4 =  ((Integer) server4.invoke(DurableClientReconnectDUnitTest.class, "createServerCache"));
-    SERVER1 = getServerHostName(host)+PORT1;
-    SERVER2 = getServerHostName(host)+PORT2;
-    SERVER3 = getServerHostName(host)+PORT3;
-    SERVER4 = getServerHostName(host)+PORT4;
+    SERVER1 = NetworkUtils.getServerHostName(host)+PORT1;
+    SERVER2 = NetworkUtils.getServerHostName(host)+PORT2;
+    SERVER3 = NetworkUtils.getServerHostName(host)+PORT3;
+    SERVER4 = NetworkUtils.getServerHostName(host)+PORT4;
     
     //CacheServerTestUtil.disableShufflingOfEndpoints();
     System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false");
@@ -115,7 +121,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   }
   public void testDurableReconnectSingleServer() throws Exception
   {
-    createCacheClientAndConnectToSingleServer(getServerHostName(Host.getHost(0)), 0);
+    createCacheClientAndConnectToSingleServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
     List redundantServers = pool.getRedundantNames();    
     String primaryName = pool.getPrimaryName();
     assertTrue(redundantServers.isEmpty());
@@ -123,9 +129,9 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     //Wait for server to cleanup client resources
     //temporary fix for bug 38345.
-    pause(2000);
+    Wait.pause(2000);
     
-    createCacheClientAndConnectToSingleServer(getServerHostName(Host.getHost(0)), 0);
+    createCacheClientAndConnectToSingleServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
     List redundantServers2 = pool.getRedundantNames();
     String primaryName2 = pool.getPrimaryName();
     assertTrue(redundantServers2.isEmpty());
@@ -133,13 +139,13 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   }
   public void testDurableReconnectSingleServerWithZeroConnPerServer() throws Exception
   {
-    createCacheClientAndConnectToSingleServerWithZeroConnPerServer(getServerHostName(Host.getHost(0)), 0);
+    createCacheClientAndConnectToSingleServerWithZeroConnPerServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
     List redundantServers = pool.getRedundantNames();
     String primaryName = pool.getPrimaryName();
     assertTrue(redundantServers.isEmpty());
     closeCache(true);
     
-    createCacheClientAndConnectToSingleServerWithZeroConnPerServer(getServerHostName(Host.getHost(0)), 0);
+    createCacheClientAndConnectToSingleServerWithZeroConnPerServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
     List redundantServers2 = pool.getRedundantNames();
     String primaryName2 = pool.getPrimaryName();
     assertTrue(redundantServers2.isEmpty());
@@ -155,7 +161,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     //Wait for server to cleanup client resources
     //temporary fix for bug 38345.
-    pause(2000);
+    Wait.pause(2000);
     
     createCacheClient(0);
     List redundantServers2 = pool.getRedundantNames();
@@ -182,7 +188,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     //Wait for server to cleanup client resources
     //temporary fix for bug 38345.
-    pause(2000);
+    Wait.pause(2000);
     
     createCacheClient();
     
@@ -211,7 +217,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     
     //Wait for server to cleanup client resources
     //temporary fix for bug 38345.
-    pause(2000);
+    Wait.pause(2000);
     
     createCacheClient();
     
@@ -333,7 +339,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     String rServer2 = (String)serverArray[1];
 
     // can see sporadic socket closed exceptions
-    final ExpectedException expectedEx = addExpectedException(
+    final IgnoredException expectedEx = IgnoredException.addIgnoredException(
         SocketException.class.getName());
 
     instance.closeServer(rServer1);    
@@ -376,51 +382,51 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     instance.determineAndVerfiyRedundantServers(redundantServers);
     instance.determineAndVerfiyNonRedundantServers(redundantServers);
     
-    getLogWriter().info("TEST - Durable client initialially has servers " + redundantServers);
+    LogWriterUtils.getLogWriter().info("TEST - Durable client initialially has servers " + redundantServers);
      
-    getLogWriter().info("TEST - Closing durable client for the first time");
+    LogWriterUtils.getLogWriter().info("TEST - Closing durable client for the first time");
     // Stop the durable client
     closeCache(true);
     
-    getLogWriter().info("TEST - Durable client closed for the first time");
+    LogWriterUtils.getLogWriter().info("TEST - Durable client closed for the first time");
     
     //Wait for server to cleanup client resources
     //temporary fix for bug 38345.
-    pause(2000);
+    Wait.pause(2000);
     
-    getLogWriter().info("TEST - Creating the durable client with one fewer servers");
+    LogWriterUtils.getLogWriter().info("TEST - Creating the durable client with one fewer servers");
     //We recreate the durable client, but this
     //Time we won't have it create any queues
     createCacheClient(2, 20, false);
     
     HashSet redundantServers2 = new HashSet(pool.getRedundantNames());
     redundantServers2.add(pool.getPrimaryName());
-    getLogWriter().info("TEST - Durable client created again, now with servers " + redundantServers2);
+    LogWriterUtils.getLogWriter().info("TEST - Durable client created again, now with servers " + redundantServers2);
     Host host = Host.getHost(0);
     //Make sure we create client to server connections to all of the servers 
-    pool.acquireConnection(new ServerLocation(getServerHostName(host), PORT1.intValue()));
-    pool.acquireConnection(new ServerLocation(getServerHostName(host), PORT2.intValue()));
-    pool.acquireConnection(new ServerLocation(getServerHostName(host), PORT3.intValue()));
-    pool.acquireConnection(new ServerLocation(getServerHostName(host), PORT4.intValue()));
+    pool.acquireConnection(new ServerLocation(NetworkUtils.getServerHostName(host), PORT1.intValue()));
+    pool.acquireConnection(new ServerLocation(NetworkUtils.getServerHostName(host), PORT2.intValue()));
+    pool.acquireConnection(new ServerLocation(NetworkUtils.getServerHostName(host), PORT3.intValue()));
+    pool.acquireConnection(new ServerLocation(NetworkUtils.getServerHostName(host), PORT4.intValue()));
     
-    getLogWriter().info("TEST - All pool connections are now aquired");
+    LogWriterUtils.getLogWriter().info("TEST - All pool connections are now aquired");
     
     closeCache(true);
     
-    getLogWriter().info("TEST - closed durable client for the second time");
+    LogWriterUtils.getLogWriter().info("TEST - closed durable client for the second time");
     
   //Wait for server to cleanup client resources
     //temporary fix for bug 38345.
-    pause(2000);
+    Wait.pause(2000);
     
-    getLogWriter().info("TEST - creating durable client for the third time");
+    LogWriterUtils.getLogWriter().info("TEST - creating durable client for the third time");
     //Now we should connect to all of the servers we were originally connected to
     createCacheClient(2, 20);
     
     HashSet redundantServersAfterReconnect = new HashSet(pool.getRedundantNames());
     redundantServersAfterReconnect.add(pool.getPrimaryName());
     
-    getLogWriter().info("TEST - durable client created for the third time, now with servers " + redundantServersAfterReconnect);
+    LogWriterUtils.getLogWriter().info("TEST - durable client created for the third time, now with servers " + redundantServersAfterReconnect);
     
     instance.determineAndVerfiyRedundantServers(redundantServersAfterReconnect);
     instance.determineAndVerfiyNonRedundantServers(redundantServersAfterReconnect);
@@ -428,9 +434,9 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertEquals(redundantServers, redundantServersAfterReconnect);
     
     //Now we wait to make sure the durable client expiration task isn't fired.
-    pause(25000);
+    Wait.pause(25000);
     
-    getLogWriter().info("TEST - Finished waiting for durable client expiration task");
+    LogWriterUtils.getLogWriter().info("TEST - Finished waiting for durable client expiration task");
     
     redundantServersAfterReconnect = new HashSet(pool.getRedundantNames());
     redundantServersAfterReconnect.add(pool.getPrimaryName());
@@ -450,7 +456,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
         assertTrue(redundantServersAfterReconnect.contains(endpointName));
       }      
     }catch (Exception e){
-      fail("test failed due to" , e);
+      Assert.fail("test failed due to" , e);
     }    
   }
   
@@ -458,7 +464,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     try{
       checkNumberOfClientProxies(0);
     }catch (Exception e){
-      fail("test failed due to" , e);
+      Assert.fail("test failed due to" , e);
     }    
   }
   
@@ -536,7 +542,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     assertEquals("DurableClientReconnectDUnitTest_client", proxy.getDurableId());
 //    assertEquals(60, proxy.getDurableTimeout());
     }catch (Exception e){
-      fail("test failed due to" , e);
+      Assert.fail("test failed due to" , e);
     }    
   }
   
@@ -563,7 +569,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 15 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 15 * 1000, 200, true);
   }
   
   protected static int getNumberOfClientProxies() {
@@ -585,7 +591,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     cache = CacheFactory.create(ds);
     assertNotNull(cache);    
   } catch(Exception e){
-    fail("test failed due to " , e ); 
+    Assert.fail("test failed due to " , e ); 
   }
   }
 
@@ -597,10 +603,10 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   protected PoolFactory getPoolFactory() {
     Host host = Host.getHost(0);
     PoolFactory factory = PoolManager.createFactory()
-    .addServer(getServerHostName(host), PORT1.intValue())
-    .addServer(getServerHostName(host), PORT2.intValue())
-    .addServer(getServerHostName(host), PORT3.intValue())
-    .addServer(getServerHostName(host), PORT4.intValue());
+    .addServer(NetworkUtils.getServerHostName(host), PORT1.intValue())
+    .addServer(NetworkUtils.getServerHostName(host), PORT2.intValue())
+    .addServer(NetworkUtils.getServerHostName(host), PORT3.intValue())
+    .addServer(NetworkUtils.getServerHostName(host), PORT4.intValue());
     return factory;
   }
   
@@ -641,7 +647,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     cache.readyForEvents();
     
     }catch(Exception e){
-      fail("test failed due to " , e );
+      Assert.fail("test failed due to " , e );
     }
     
   }
@@ -676,7 +682,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
     cache.readyForEvents();
     
     }catch(Exception e){
-      fail("test failed due to " , e );
+      Assert.fail("test failed due to " , e );
     }    
   }
 
@@ -711,7 +717,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
       cache.readyForEvents();
       
       }catch(Exception e){
-        fail("test failed due to " , e );
+        Assert.fail("test failed due to " , e );
       }    
   }
 
@@ -726,8 +732,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
   }
 
   @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  protected final void preTearDown() throws Exception {
     // close the clients first
     closeCache();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
index 08eaa9d..97cb31c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
@@ -30,9 +30,12 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.cache.client.*;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * 
@@ -77,7 +80,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
   }
 
   @Override
-  public void tearDown2() throws Exception {
+  protected final void preTearDown() throws Exception {
     // Stop server 1
     this.server1VM.invoke(CacheServerTestUtil.class, "closeCache");
     CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
@@ -99,23 +102,23 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     startAndCloseNonDurableClientCache(durableClientTimeout);
     startAndCloseNonDurableClientCache(1);      //////// -> Reconnection1
-    pause(1400);        //////// -> Queue Dropped1
+    Wait.pause(1400);        //////// -> Queue Dropped1
     startAndCloseNonDurableClientCache(1);
-    pause(1400);        //////// -> Queue Dropped2
+    Wait.pause(1400);        //////// -> Queue Dropped2
     
     startRegisterAndCloseNonDurableClientCache( durableClientTimeout);
-    pause(500);
+    Wait.pause(500);
 
     this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
         new Object[] { K1, "Value1" });         //////// -> Enqueue Message1
 
-    pause(500);
+    Wait.pause(500);
     startAndCloseNonDurableClientCache(1);      //////// -> Reconnection2
-    pause(1400);        //////// -> Queue Dropped3
+    Wait.pause(1400);        //////// -> Queue Dropped3
     startAndCloseNonDurableClientCache(1);
-    pause(1400);        //////// -> Queue Dropped4
+    Wait.pause(1400);        //////// -> Queue Dropped4
     startRegisterAndCloseNonDurableClientCache( durableClientTimeout);
-    pause(500);
+    Wait.pause(500);
 
     this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
         new Object[] { K1, "NewValue1" });      //////// -> Enqueue Message2
@@ -143,23 +146,23 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     startAndCloseDurableClientCache(durableClientTimeout);
     startAndCloseDurableClientCache(1);      //////// -> Reconnection1
-    pause(1400);        //////// -> Queue Dropped1
+    Wait.pause(1400);        //////// -> Queue Dropped1
     startAndCloseDurableClientCache(1);
-    pause(1400);        //////// -> Queue Dropped2
+    Wait.pause(1400);        //////// -> Queue Dropped2
     
     startRegisterAndCloseDurableClientCache( durableClientTimeout);
-    pause(500);
+    Wait.pause(500);
 
     this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
         new Object[] { K1, "Value1" });         //////// -> Enqueue Message1
 
-    pause(500);
+    Wait.pause(500);
     startAndCloseDurableClientCache(1);      //////// -> Reconnection2
-    pause(1400);        //////// -> Queue Dropped3
+    Wait.pause(1400);        //////// -> Queue Dropped3
     startAndCloseDurableClientCache(1);
-    pause(1400);        //////// -> Queue Dropped4
+    Wait.pause(1400);        //////// -> Queue Dropped4
     startRegisterAndCloseDurableClientCache( durableClientTimeout);
-    pause(500);
+    Wait.pause(500);
 
     this.server1VM.invoke(DurableClientStatsDUnitTest.class, "putValue",
         new Object[] { K1, "NewValue1" });      //////// -> Enqueue Message2
@@ -178,7 +181,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getDurableClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout), Boolean.TRUE });
@@ -203,7 +206,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getNonDurableClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout), Boolean.TRUE });
@@ -228,7 +231,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getDurableClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout), Boolean.TRUE });
@@ -252,7 +255,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
 
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, true, 0),
             regionName,
             getNonDurableClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout), Boolean.TRUE });
@@ -336,7 +339,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
       region.registerInterest(key, InterestResultPolicy.NONE, isDurable);
     }
     catch (Exception ex) {
-      fail("failed while registering interest in registerKey function", ex);
+      Assert.fail("failed while registering interest in registerKey function", ex);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
index f2ef6d1..141bb0b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
@@ -39,9 +39,14 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.cache.client.*;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.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;
 
 /**
  * 
@@ -124,7 +129,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     // seconds
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
             regionName,
             getClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout), Boolean.TRUE });
@@ -162,7 +167,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.server2VM.invoke(DurableRegistrationDUnitTest.class, "putValue",
         new Object[] { K4, "Value4" });
 
-    pause(1000);
+    Wait.pause(1000);
     // Step 5: Verify Updates on the Client
 
     assertEquals("Value1", this.server2VM.invoke(
@@ -197,7 +202,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     // Step 8: Re-start the Client
     this.durableClientVM
         .invoke(CacheServerTestUtil.class, "createCacheClient",
-            new Object[] { getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
+            new Object[] { getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
                 regionName,
                 getClientDistributedSystemProperties(durableClientId),
                 Boolean.TRUE });
@@ -210,7 +215,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
       }
     });
 
-    pause(5000);
+    Wait.pause(5000);
 
     assertNull(this.durableClientVM.invoke(DurableRegistrationDUnitTest.class,
         "getValue", new Object[] { K1 }));
@@ -220,7 +225,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.durableClientVM.invoke(DurableRegistrationDUnitTest.class,
         "registerKey", new Object[] { K1, new Boolean(false) });
 
-    pause(5000);
+    Wait.pause(5000);
     assertNull(this.durableClientVM.invoke(DurableRegistrationDUnitTest.class,
         "getValue", new Object[] { K1 }));
     assertNull(this.durableClientVM.invoke(DurableRegistrationDUnitTest.class,
@@ -235,7 +240,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.server2VM.invoke(DurableRegistrationDUnitTest.class, "putValue",
         new Object[] { K4, "PingPong_updated_4" });
 
-    pause(5000);
+    Wait.pause(5000);
 
     // Step 9: Verify Updates on the Client
     assertEquals("PingPong_updated_1", this.durableClientVM.invoke(
@@ -276,7 +281,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     final int durableClientTimeout = 600;
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
             regionName,
             getClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout) });
@@ -314,7 +319,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.server2VM.invoke(DurableRegistrationDUnitTest.class, "putValue",
         new Object[] { K4, "Value4" });
 
-    pause(1000);
+    Wait.pause(1000);
     // Step 5: Verify Updates on the Client
 
     assertEquals("Value1", this.server2VM.invoke(
@@ -349,7 +354,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     // Step 8: Re-start the Client
     this.durableClientVM
         .invoke(CacheServerTestUtil.class, "createCacheClient",
-            new Object[] { getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
+            new Object[] { getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 0),
                 regionName,
                 getClientDistributedSystemProperties(durableClientId),
                 Boolean.TRUE });
@@ -381,7 +386,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.durableClientVM.invoke(DurableRegistrationDUnitTest.class,
         "unregisterKey", new Object[] { K3 });
 
-    pause(5000);
+    Wait.pause(5000);
 
     // Step 12: Modify values on the server for all the Keys
     this.server2VM.invoke(DurableRegistrationDUnitTest.class, "putValue",
@@ -393,7 +398,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.server2VM.invoke(DurableRegistrationDUnitTest.class, "putValue",
         new Object[] { K4, "PingPong_updated_4" });
 
-    pause(5000);
+    Wait.pause(5000);
 
     // Step 13: Check the values for the ones not unregistered and the
     // Unregistered Keys' Values should be null
@@ -467,7 +472,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     final int durableClientTimeout = 600;
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 1),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 1),
             regionName,
             getClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout) });
@@ -496,13 +501,13 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
         "createCacheServer", new Object[] { regionName, new Boolean(true),
              PORT2 });
 
-    pause(3000);
+    Wait.pause(3000);
 
     // Check server2 got all the interests registered by the durable client.    
     server2VM.invoke(new CacheSerializableRunnable("Verify Interests.") {
       public void run2() throws CacheException
       {
-        getLogWriter().info("### Verifying interests registered by DurableClient. ###");
+        LogWriterUtils.getLogWriter().info("### Verifying interests registered by DurableClient. ###");
         CacheClientNotifier ccn = CacheClientNotifier.getInstance();
         CacheClientProxy p = null;
         
@@ -510,7 +515,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
         for (int i=0; i < 60; i++) {
           Iterator ps = ccn.getClientProxies().iterator();
           if (!ps.hasNext()) {
-            pause(1000);
+            Wait.pause(1000);
             continue;
           } else {
             p = (CacheClientProxy)ps.next();
@@ -567,7 +572,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     final int durableClientTimeout = 600;
     this.durableClientVM.invoke(CacheServerTestUtil.class, "createCacheClient",
         new Object[] {
-            getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 1),
+            getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 1),
             regionName,
             getClientDistributedSystemProperties(durableClientId,
                 durableClientTimeout) });
@@ -594,12 +599,12 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.durableClientVM.invoke(DurableRegistrationDUnitTest.class,
         "closeCache");
 
-    pause(2000);
+    Wait.pause(2000);
 
     //Re-start the Client
     this.durableClientVM
         .invoke(CacheServerTestUtil.class, "createCacheClient",
-            new Object[] { getClientPool(getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 1),
+            new Object[] { getClientPool(NetworkUtils.getServerHostName(durableClientVM.getHost()), PORT1, PORT2, true, 1),
                 regionName,
                 getClientDistributedSystemProperties(durableClientId),
                 Boolean.TRUE });
@@ -617,13 +622,13 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
         "createCacheServer", new Object[] { regionName, new Boolean(true),
              PORT2 });
 
-    pause(3000);
+    Wait.pause(3000);
 
     // Check server2 got all the interests registered by the durable client.    
     server2VM.invoke(new CacheSerializableRunnable("Verify Interests.") {
       public void run2() throws CacheException
       {
-        getLogWriter().info("### Verifying interests registered by DurableClient. ###");
+        LogWriterUtils.getLogWriter().info("### Verifying interests registered by DurableClient. ###");
         CacheClientNotifier ccn = CacheClientNotifier.getInstance();
         CacheClientProxy p = null;
         
@@ -631,7 +636,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
         for (int i=0; i < 60; i++) {
           Iterator ps = ccn.getClientProxies().iterator();
           if (!ps.hasNext()) {
-            pause(1000);
+            Wait.pause(1000);
             continue;
           } else {
             p = (CacheClientProxy)ps.next();
@@ -703,7 +708,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
 
     }
     catch (Exception ex) {
-      fail("failed while registering interest in registerKey function", ex);
+      Assert.fail("failed while registering interest in registerKey function", ex);
     }
   }
 
@@ -736,7 +741,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
       region.registerInterest(key, InterestResultPolicy.NONE, isDurable);
     }
     catch (Exception ex) {
-      fail("failed while registering interest in registerKey function", ex);
+      Assert.fail("failed while registering interest in registerKey function", ex);
     }
   }
 
@@ -752,7 +757,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
       region.unregisterInterest(key);
     }
     catch (Exception ex) {
-      fail("failed while registering interest in registerKey function", ex);
+      Assert.fail("failed while registering interest in registerKey function", ex);
     }
   }
 
@@ -801,7 +806,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 15 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 15 * 1000, 200, true);
   }
 
   protected static int getNumberOfClientProxies() {
@@ -858,9 +863,8 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
     this.regionName = regionName;
   }
   
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
index bbbdf80..4f1028c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
@@ -24,9 +24,14 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.cache.client.*;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
@@ -66,9 +71,9 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     // start servers first
     PORT1 = ((Integer)server1.invoke(DurableResponseMatrixDUnitTest.class,
         "createServerCache"));
-    createCacheClient(getServerHostName(server1.getHost()));
+    createCacheClient(NetworkUtils.getServerHostName(server1.getHost()));
     //Disconnecting the client can cause this
-    addExpectedException("Connection reset||Unexpected IOException");
+    IgnoredException.addIgnoredException("Connection reset||Unexpected IOException");
   }
 
   public void testRegisterInterestResponse_NonExistent_Invalid()
@@ -196,7 +201,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 120 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 120 * 1000, 200, true);
   }
   
   public void testNotification_NonExistent_Create() throws Exception
@@ -369,7 +374,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       r.put(key, value);
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
 
@@ -381,7 +386,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       r.destroy(key);
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
 
@@ -393,7 +398,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       r.invalidate(key);
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
 
@@ -406,7 +411,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       r.invalidate(key);
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
 
@@ -419,7 +424,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       r.localInvalidate(key);
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
 
@@ -434,7 +439,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
       assertNotNull(cache);
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
 
@@ -467,7 +472,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
 
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
 
   }
@@ -503,9 +508,8 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
     return properties;
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     // close the clients first
     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/tier/sockets/EventIDVerificationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
index 6cb897e..78e0f41 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
@@ -42,8 +42,10 @@ import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.RegionEventImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
 /**
@@ -97,7 +99,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
 
     //vm2.invoke(EventIDVerificationDUnitTest.class, "createClientCache", new
     // Object[] { new Integer(PORT1),new Integer(PORT2)});
-    createClientCache(getServerHostName(host), new Integer(PORT1), new Integer(PORT2));
+    createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2));
     CacheObserverHolder.setInstance(new CacheObserverAdapter());
 
   }
@@ -388,7 +390,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
       assertEquals(r.getEntry("key-1").getValue(), "key-1");
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -404,7 +406,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while r.put()", ex);
+      Assert.fail("failed while r.put()", ex);
     }
   }
 
@@ -416,7 +418,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
       r.destroy("key-1");
     }
     catch (Exception ex) {
-      fail("test failed due to exception in destroy ", ex);
+      Assert.fail("test failed due to exception in destroy ", ex);
     }
   }
 
@@ -429,7 +431,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
       r.remove("key-1");
     }
     catch (Exception ex) {
-      fail("test failed due to exception in remove ", ex);
+      Assert.fail("test failed due to exception in remove ", ex);
     }
   }
 
@@ -442,7 +444,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
       r.destroyRegion();
     }
     catch (Exception ex) {
-      fail("test failed due to exception in destroyRegion ", ex);
+      Assert.fail("test failed due to exception in destroyRegion ", ex);
     }
   }
 
@@ -454,7 +456,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
       r.clear();
     }
     catch (Exception ex) {
-      fail("test failed due to exception in clearRegion ", ex);
+      Assert.fail("test failed due to exception in clearRegion ", ex);
     }
   }
 
@@ -486,9 +488,8 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
     assertEquals(eventId, ((RegionEventImpl)event).getEventId());
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     // close the clients first
     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/tier/sockets/EventIDVerificationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
index 4e8b82d..15a709b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
@@ -31,6 +31,7 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.cache.InternalCacheEvent;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
@@ -216,7 +217,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
       assertEquals(r.getEntry("key-1").getValue(), "key-1");
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -232,7 +233,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while r.put()", ex);
+      Assert.fail("failed while r.put()", ex);
     }
   }
 
@@ -244,7 +245,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
       r.destroy("key-1");
     }
     catch (Exception ex) {
-      fail("test failed due to exception in destroy ", ex);
+      Assert.fail("test failed due to exception in destroy ", ex);
     }
   }
 
@@ -256,7 +257,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
       r.destroyRegion();
     }
     catch (Exception ex) {
-      fail("test failed due to exception in destroyRegion ", ex);
+      Assert.fail("test failed due to exception in destroyRegion ", ex);
     }
   }
   
@@ -268,7 +269,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
       r.invalidateRegion();
     }
     catch (Exception ex) {
-      fail("test failed due to exception in invalidateRegion ", ex);
+      Assert.fail("test failed due to exception in invalidateRegion ", ex);
     }
   }
 
@@ -317,9 +318,8 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
     assertTrue(pass.booleanValue());   
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     closeCache();
     vm0.invoke(EventIDVerificationInP2PDUnitTest.class, "closeCache");
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
index 3d89089..9313ddd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateEvictionDUnitTest.java
@@ -43,9 +43,13 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CachedDeserializable;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.Token;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * @author dsmith
@@ -258,7 +262,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
         Region region = cache.getRegion(name);
         final MyListener listener = (MyListener) region.getAttributes().getCacheListeners()[0];
         if(invalidated) {
-          waitForCriterion(new WaitCriterion() {
+          Wait.waitForCriterion(new WaitCriterion() {
 
             public String description() {
               return "Didn't receive invalidate after 30 seconds";
@@ -284,7 +288,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
         Cache cache = getCache();
         final LocalRegion region = (LocalRegion) cache.getRegion(name);
         
-        waitForCriterion(new WaitCriterion() {
+        Wait.waitForCriterion(new WaitCriterion() {
           
           public boolean done() {
             Object value  = null;
@@ -341,7 +345,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
         Cache cache = getCache();
         
         PoolFactory pf = PoolManager.createFactory();
-        pf.addServer(getServerHostName(host), port);
+        pf.addServer(NetworkUtils.getServerHostName(host), port);
         pf.setSubscriptionEnabled(true);
         pf.create(name);
         RegionFactory rf = new RegionFactory();
@@ -366,7 +370,7 @@ public class ForceInvalidateEvictionDUnitTest extends CacheTestCase {
         try {
           server.start();
         } catch (IOException e) {
-          fail("IO Exception", e);
+          Assert.fail("IO Exception", e);
         }
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
index 7a441c6..b9c1893 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
@@ -20,6 +20,7 @@ import java.util.Properties;
 
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
 /**
@@ -35,7 +36,7 @@ public class ForceInvalidateOffHeapEvictionDUnitTest extends
   }
 
   @Override
-  public void tearDown2() throws Exception {
+  protected final void preTearDownCacheTestCase() throws Exception {
     SerializableRunnable checkOrphans = new SerializableRunnable() {
 
       @Override
@@ -45,12 +46,8 @@ public class ForceInvalidateOffHeapEvictionDUnitTest extends
         }
       }
     };
-    invokeInEveryVM(checkOrphans);
-    try {
-      checkOrphans.run();
-    } finally {
-      super.tearDown2();
-    }
+    Invoke.invokeInEveryVM(checkOrphans);
+    checkOrphans.run();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
index 395047a..08175dd 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
@@ -39,7 +39,9 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessage;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * This is the bugtest for bug no. 36738. When Object of class
@@ -85,18 +87,16 @@ public class HABug36738DUnitTest extends DistributedTestCase
 
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     server1.invoke(HABug36738DUnitTest.class, "closeCache");
     server2.invoke(HABug36738DUnitTest.class, "closeCache");
-
   }
 
   public void testBug36768() throws Exception
   {
     createServer1();
-    pause(10000);
+    Wait.pause(10000);
     server1.invoke(HABug36738DUnitTest.class, "checkRegionQueueSize");
     createServer2();
     server1.invoke(HABug36738DUnitTest.class, "checkRegionQueueSize");
@@ -113,7 +113,7 @@ public class HABug36738DUnitTest extends DistributedTestCase
     while (itr.hasNext()) {
       Object key = itr.next();
       ClientUpdateMessage value = (ClientUpdateMessage)region.get(key);
-      getLogWriter().info("key : " + key + "Value " + value.getValue());
+      LogWriterUtils.getLogWriter().info("key : " + key + "Value " + value.getValue());
 
     }
 
@@ -161,7 +161,7 @@ public class HABug36738DUnitTest extends DistributedTestCase
             new EventID(("memberID" + i).getBytes(), i, i));
 
         haRegion.put(new Long(i), clientMessage);
-        getLogWriter().info("Putting in the message Queue");
+        LogWriterUtils.getLogWriter().info("Putting in the message Queue");
 
       }
     }
@@ -190,7 +190,7 @@ public class HABug36738DUnitTest extends DistributedTestCase
     HARegion region = (HARegion)cache.getRegion(Region.SEPARATOR
         + HAHelper.getRegionQueueName(HAREGION_NAME));
     assertNotNull(region);
-    getLogWriter().info("Size of the Queue : " + region.size());
+    LogWriterUtils.getLogWriter().info("Size of the Queue : " + region.size());
 
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
index e82faae..fc9211d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart1DUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 
 @SuppressWarnings("serial")
@@ -29,7 +31,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * Tests whether interest is registered or not on both primary and secondaries
    */
   public void testInterestRegistrationOnBothPrimaryAndSecondary() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -46,7 +48,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * verify their responses
    */
   public void testInterestRegistrationResponseOnBothPrimaryAndSecondary() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -60,7 +62,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * interest map
    */
   public void testRERegistrationWillNotCreateDuplicateKeysOnServerInterstMaps() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -79,7 +81,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * registerInterest
    */
   public void testPrimaryFailureInRegisterInterest() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -100,7 +102,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * list
    */
   public void testSecondaryFailureInRegisterInterest() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -122,7 +124,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * registration on newly selected primary
    */
   public void testBothPrimaryAndSecondaryFailureInRegisterInterest() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -146,7 +148,7 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    *
    */
   public void testProbablePrimaryFailureInRegisterInterest() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -166,10 +168,10 @@ public class HAInterestPart1DUnitTest extends HAInterestTestCase {
    * client ( create CCP) as welll as register IL
    */
   public void testInterstRegistrationOnRecoveredEPbyDSM() throws Exception {
-    addExpectedException("SocketException");
-    addExpectedException("Unexpected IOException");
+    IgnoredException.addIgnoredException("SocketException");
+    IgnoredException.addIgnoredException("Unexpected IOException");
 
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     registerK1AndK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
index 28bee9f..647069f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java
@@ -19,8 +19,11 @@ package com.gemstone.gemfire.internal.cache.tier.sockets;
 import com.gemstone.gemfire.cache.EntryDestroyedException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
-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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 @SuppressWarnings({"rawtypes", "serial"})
 public class HAInterestPart2DUnitTest extends HAInterestTestCase {
@@ -34,7 +37,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * failover should pick new primary
    */
   public void testPrimaryFailureInUNregisterInterest() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -60,7 +63,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * Ep list
    */
   public void testSecondaryFailureInUNRegisterInterest() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -82,7 +85,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * detected live server as well
    */
   public void testDSMDetectsServerLiveJustBeforeInterestRegistration() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -108,7 +111,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * detected live server as well
    */
   public void testDSMDetectsServerLiveJustAfterInterestRegistration() throws Exception {
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
 
     createEntriesK1andK2();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
@@ -140,11 +143,11 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * is primary
    */
   public void testRefreshEntriesFromPrimaryWhenDSMDetectsServerLive() throws Exception {
-    addExpectedException(ServerConnectivityException.class.getName());
+    IgnoredException.addIgnoredException(ServerConnectivityException.class.getName());
     
     PORT1 = ((Integer) server1.invoke(HAInterestTestCase.class, "createServerCache")).intValue();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
-    createClientPoolCacheConnectionToSingleServer(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCacheConnectionToSingleServer(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     registerK1AndK2();
     verifyRefreshedEntriesFromServer();
 
@@ -200,7 +203,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
+    Wait.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
   }
 
   /**
@@ -222,7 +225,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     server3.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
 
-    createClientPoolCache(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
 
     VM backup1 = getBackupVM();
     VM backup2 = getBackupVM(backup1);
@@ -247,7 +250,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
   public void testBug35945() throws Exception {
     PORT1 = ((Integer) server1.invoke(HAInterestTestCase.class, "createServerCache")).intValue();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
-    createClientPoolCacheConnectionToSingleServer(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCacheConnectionToSingleServer(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     registerK1AndK2();
     verifyRefreshedEntriesFromServer();
 
@@ -303,7 +306,7 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
+    Wait.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
   }
 
   /**
@@ -311,13 +314,13 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
    * new endpoint to register interest
    */
   public void testInterestRecoveryFailure() throws Exception {
-    addExpectedException("Server unreachable");
+    IgnoredException.addIgnoredException("Server unreachable");
     
     PORT1 = ((Integer) server1.invoke(HAInterestTestCase.class, "createServerCache")).intValue();
     server1.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
     PORT2 = ((Integer) server2.invoke(HAInterestTestCase.class, "createServerCache")).intValue();
     server2.invoke(HAInterestTestCase.class, "createEntriesK1andK2");
-    createClientPoolCacheWithSmallRetryInterval(this.getName(), getServerHostName(server1.getHost()));
+    createClientPoolCacheWithSmallRetryInterval(this.getName(), NetworkUtils.getServerHostName(server1.getHost()));
     registerK1AndK2();
     verifyRefreshedEntriesFromServer();
     VM backup = getBackupVM();
@@ -368,6 +371,6 @@ public class HAInterestPart2DUnitTest extends HAInterestTestCase {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
+    Wait.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
   }
 }


Mime
View raw message