geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [21/51] [partial] incubator-geode git commit: GEODE-773: Extract static methods from DistributedTestCase
Date Tue, 09 Feb 2016 18:44:31 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/InterestResultPolicyDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
index 5e74812..597da3d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
@@ -33,9 +33,13 @@ import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.cache.client.*;
 
 /**
@@ -59,7 +63,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
 
   private static final String REGION_NAME = "InterestResultPolicyDUnitTest_region" ;
 
-  private ExpectedException expectedEx;
+  private IgnoredException expectedEx;
 
   /**
    * Creates a test instance with the given name
@@ -78,7 +82,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
   public void setUp() throws Exception {
     super.setUp();
     disconnectAllFromDS();
-    pause(5000);
+    Wait.pause(5000);
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
@@ -90,10 +94,9 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * Closes the cache on server and client
    */
   @Override
-  public void tearDown2() throws Exception
-  {
+  protected final void preTearDown() throws Exception {
     // might get ServerConnectivityExceptions during shutdown
-    this.expectedEx = addExpectedException(ServerConnectivityException.class
+    this.expectedEx = IgnoredException.addIgnoredException(ServerConnectivityException.class
         .getName());
     // close server
     vm0.invoke(InterestResultPolicyDUnitTest.class, "closeCache");
@@ -102,8 +105,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
   }
 
   @Override
-  protected void realTearDown() throws Exception {
-    super.realTearDown();
+  protected void postTearDown() throws Exception {
     if (this.expectedEx != null) {
       this.expectedEx.remove();
     }
@@ -125,7 +127,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
     objArr[0] = InterestResultPolicy.NONE;
     objArr[1] = new Integer(PREPOPULATED_ENTRIES);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "createClientCache", new Object[] {
-      getServerHostName(Host.getHost(0)), new Integer(PORT)});
+      NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT)});
     vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
     logger.fine("testPolicyNone END");
@@ -147,7 +149,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
     objArr[0] = InterestResultPolicy.KEYS;
     objArr[1] = new Integer(PREPOPULATED_ENTRIES);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "createClientCache", new Object[] {
-      getServerHostName(Host.getHost(0)), new Integer(PORT)});;
+      NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT)});;
     vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
     logger.fine("testPolicyKeys END");
@@ -169,7 +171,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
     objArr[0] = InterestResultPolicy.KEYS_VALUES;
     objArr[1] = new Integer(PREPOPULATED_ENTRIES);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "createClientCache", new Object[] {
-      getServerHostName(Host.getHost(0)), new Integer(PORT)});
+      NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT)});
     vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
     logger.fine("testPolicyKeyValues END");
@@ -194,7 +196,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
     /* registering for 5 extra keys */
     objArr[1] = new Integer(PREPOPULATED_ENTRIES + 5);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "createClientCache", new Object[] {
-      getServerHostName(Host.getHost(0)), new Integer(PORT)});
+      NetworkUtils.getServerHostName(Host.getHost(0)), new Integer(PORT)});
     vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
     vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
     Integer cnt = (Integer)vm0.invoke(InterestResultPolicyDUnitTest.class,
@@ -334,7 +336,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
       region1.registerInterest(keylist, policy);
     }
     catch (CacheWriterException e) {
-      fail("failed to register interestlist for the client", e);
+      Assert.fail("failed to register interestlist for the client", 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/NewRegionAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
index 74fde05..97bef89 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
@@ -32,6 +32,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * This tests that basic entry operations work properly when regions are
@@ -73,7 +74,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
   public void setUp() throws Exception {
     super.setUp();
     disconnectAllFromDS();
-    pause(5000);
+    Wait.pause(5000);
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
@@ -98,8 +99,8 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
    * @throws Exception
    *           thrown if any problem occurs while closing the cache
    */
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     vm0.invoke(NewRegionAttributesDUnitTest.class, "closeCache");
     vm1.invoke(NewRegionAttributesDUnitTest.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/RedundancyLevelPart1DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
index 879d878..704a82a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart1DUnitTest.java
@@ -16,8 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * Tests Redundancy Level Functionality
@@ -46,7 +50,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
         + ") never became " + expected;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
   }
   
   /*
@@ -56,7 +60,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancyNotSpecifiedNonPrimaryServerFail()
   {    
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0);
       verifyOrderOfEndpoints();
       server2.invoke(RedundancyLevelTestBase.class, "stopServer");
       //pause(5000);      
@@ -74,10 +78,10 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
           return "pool still contains " + SERVER3;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 30 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 30 * 1000, 1000, true);
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test RedundancyNotSpecifiedNonPrimaryServerFail ",
           ex);
     }
@@ -104,7 +108,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //Asif: Increased the socket read timeout to 3000 sec becoz the registering 
       // of keys was timing out sometimes causing fail over to EP4 cozing 
       // below assertion to fail
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0, 3000, 100);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0, 3000, 100);
       assertTrue(pool.getPrimaryName().equals(SERVER1));
       verifyOrderOfEndpoints();
       server0.invoke(RedundancyLevelTestBase.class, "stopServer");
@@ -123,12 +127,12 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
           return "pool still contains " + SERVER1;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 30 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 30 * 1000, 1000, true);
       assertFalse(pool.getPrimaryName().equals(SERVER1));
       assertEquals(SERVER2, pool.getPrimaryName());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test RedundancyNotSpecifiedPrimaryServerFails ",
           ex);
     }/*finally {
@@ -145,7 +149,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedNonFailoverEPFails()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       //assertTrue(pool.getRedundantNames().contains(SERVER1));      
@@ -166,7 +170,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFails ",
           ex);
     }
@@ -184,7 +188,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     try {
       
       FailOverDetectionByCCU = true;
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1, 250, 500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1, 250, 500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       // assertTrue(pool.getRedundantNames()
@@ -206,7 +210,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByCCU ",
           ex);
     }
@@ -221,7 +225,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void _testRedundancySpecifiedNonFailoverEPFailsDetectionByRegisterInterest()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       // assertTrue(pool.getRedundantNames()
@@ -245,7 +249,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByRegisterInterest ",
           ex);
     }
@@ -261,7 +265,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void _testRedundancySpecifiedNonFailoverEPFailsDetectionByUnregisterInterest()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       // assertTrue(pool.getRedundantNames()
@@ -284,7 +288,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByUnregisterInterest ",
           ex);
     }    
@@ -299,7 +303,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedNonFailoverEPFailsDetectionByPut()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,500,1000);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,500,1000);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       // assertTrue(pool.getRedundantNames()
@@ -322,7 +326,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
      // assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFailsDetectionByPut ",
           ex);
     }
@@ -339,7 +343,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedNonPrimaryEPFails()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -361,7 +365,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonFailoverEPFails ",
           ex);
     }
@@ -380,7 +384,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
     try {
       
       FailOverDetectionByCCU = true;
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1, 250, 500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1, 250, 500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -402,7 +406,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonPrimaryEPFailsDetectionByCCU ",
           ex);
     }
@@ -419,7 +423,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByRegisterInterest()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250, 500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -443,7 +447,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonPrimaryEPFailsDetectionByRegisterInterest ",
           ex);
     }
@@ -460,7 +464,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByUnregisterInterest()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -483,7 +487,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonPrimaryEPFailsDetectionByUnregisterInterest ",
           ex);
     }
@@ -500,7 +504,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedNonPrimaryEPFailsDetectionByPut()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,250,500);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -527,7 +531,7 @@ public class RedundancyLevelPart1DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedNonPrimaryEPFailsDetectionByPut ",
           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/RedundancyLevelPart2DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
index 1c83206..6f31d3b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart2DUnitTest.java
@@ -16,8 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
 {
@@ -42,7 +46,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
         + ") never became " + expected;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 2 * 60 * 1000, 1000, true);
+    Wait.waitForCriterion(wc, 2 * 60 * 1000, 1000, true);
   }
   
   /*
@@ -58,7 +62,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedPrimaryEPFails()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
       assertTrue(pool.getPrimaryName().equals(SERVER1));
       assertTrue(pool.getRedundantNames().contains(SERVER2));
@@ -79,7 +83,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedPrimaryEPFails ",
           ex);
     }
@@ -100,7 +104,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     try {
       
       FailOverDetectionByCCU = true;
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000,100);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000,100);
       waitConnectedServers(4);
       assertTrue(pool.getPrimaryName().equals(SERVER1));
       assertTrue(pool.getRedundantNames().contains(SERVER2));
@@ -120,7 +124,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedPrimaryEPFailsDetectionByCCU ",
           ex);
     }
@@ -139,7 +143,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedPrimaryEPFailsDetectionByRegisterInterest()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000, 100);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000, 100);
       waitConnectedServers(4);
       assertTrue(pool.getPrimaryName().equals(SERVER1));
       assertTrue(pool.getRedundantNames().contains(SERVER2));
@@ -161,7 +165,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedPrimaryEPFailsDetectionByRegisterInterest ",
           ex);
     }
@@ -180,7 +184,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedPrimaryEPFailsDetectionByUnregisterInterest()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000,100);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000,100);
       waitConnectedServers(4);
       assertTrue(pool.getPrimaryName().equals(SERVER1));
       assertTrue(pool.getRedundantNames().contains(SERVER2));
@@ -201,7 +205,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedPrimaryEPFailsDetectionByUnregisterInterest ",
           ex);
     }
@@ -220,7 +224,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedPrimaryEPFailsDetectionByPut()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000, 100);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1,3000, 100);
       waitConnectedServers(4);
       assertTrue(pool.getPrimaryName().equals(SERVER1));
       assertTrue(pool.getRedundantNames().contains(SERVER2));
@@ -241,7 +245,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       //assertEquals(1, proxy.getDeadServers().size());
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedPrimaryEPFailsDetectionByPut ",
           ex);
     }
@@ -256,7 +260,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedPrimarySecondaryEPFails()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       waitConnectedServers(4);
       assertEquals(1, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -279,7 +283,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
           "verifyInterestRegistration");
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedPrimarySecondaryEPFails ",
           ex);
     }
@@ -297,7 +301,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedEPFails()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
       waitConnectedServers(4);
       assertEquals(2, pool.getRedundantNames().size());
       assertTrue(pool.getPrimaryName().equals(SERVER1));
@@ -331,14 +335,14 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       // not to the active server as redundancy level is satisfied.
       server2.invoke(RedundancyLevelTestBase.class, "startServer");
       //pause(10000);
-      pause(1000);
+      Wait.pause(1000);
       verifyOrderOfEndpoints();
       //assertEquals(3, pool.getRedundantNames().size());
       //assertEquals(4, pool.getConnectedServerCount());
       server2.invoke(RedundancyLevelTestBase.class, "verifyNoCCP");
     }
     catch (Exception ex) {
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedEPFails ",
           ex);
     }
@@ -358,7 +362,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       // make sure that the client connects to only two servers and
       // redundancyLevel
       // unsatisfied with one
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
       // let the client connect to servers
       //pause(10000);      
       verifyLiveAndRedundantServers(2, 1);
@@ -385,7 +389,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       // verify that redundancy level is satisfied
       server1.invoke(RedundancyLevelTestBase.class, "startServer");
       //pause(10000);
-      pause(1000);
+      Wait.pause(1000);
       verifyOrderOfEndpoints();
       //assertEquals(3, pool.getRedundantNames().size());
       //assertEquals(4, pool.getConnectedServerCount());      
@@ -397,7 +401,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
 
     }
     catch (Exception ex) {
-      fail("test failed due to exception in test noRedundancyLevelServerFail ",
+      Assert.fail("test failed due to exception in test noRedundancyLevelServerFail ",
           ex);
     }
 
@@ -413,7 +417,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     try {
       // TODO: Yogesh
       server1.invoke(RedundancyLevelTestBase.class, "stopServer");
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 2);
       // let the client connect to servers
       //pause(10000);      
       verifyLiveAndRedundantServers(3, 2);
@@ -426,7 +430,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
       assertFalse(pool.getRedundantNames().contains(SERVER2));
       // start server
       server1.invoke(RedundancyLevelTestBase.class, "startServer");
-      pause(1000);
+      Wait.pause(1000);
       verifyOrderOfEndpoints();
       //assertEquals(3, pool.getRedundantNames().size());
       //assertEquals(4, pool.getConnectedServerCount());      
@@ -438,7 +442,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
 
     }
     catch (Exception ex) {
-      fail("test failed due to exception in test noRedundancyLevelServerFail ",
+      Assert.fail("test failed due to exception in test noRedundancyLevelServerFail ",
           ex);
     }
   }
@@ -453,7 +457,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     try {
       // TODO: Yogesh
       server2.invoke(RedundancyLevelTestBase.class, "stopServer");
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, -1/* not specified */);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, -1/* not specified */);
       // let the client connect to servers
       //pause(10000);
       verifyLiveAndRedundantServers(3, 2);
@@ -482,7 +486,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
           "verifyInterestRegistration");
     }
     catch (Exception ex) {
-      fail("test failed due to exception in test noRedundancyLevelServerFail ",
+      Assert.fail("test failed due to exception in test noRedundancyLevelServerFail ",
           ex);
     }
   }
@@ -518,7 +522,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
   public void testRedundancySpecifiedMoreThanEPs()
   {
     try {
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 5);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 5);
       assertEquals(3, pool.getRedundantNames().size());
       server0.invoke(RedundancyLevelTestBase.class, "verifyCCP");
       server1.invoke(RedundancyLevelTestBase.class, "verifyCCP");
@@ -527,7 +531,7 @@ public class RedundancyLevelPart2DUnitTest extends RedundancyLevelTestBase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedMoreThanEPs ",
           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/RedundancyLevelPart3DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
index c1266e7..ac5d8b7 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelPart3DUnitTest.java
@@ -18,8 +18,10 @@ package com.gemstone.gemfire.internal.cache.tier.sockets;
 
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 
 /**
@@ -50,7 +52,7 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
   {
     try {
       CacheServerTestUtil.disableShufflingOfEndpoints();
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 3);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 3);
       createEntriesK1andK2();
       registerK1AndK2();
       assertEquals(3, pool.getRedundantNames().size());
@@ -136,7 +138,7 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
     }
      catch (Exception ex) {
         ex.printStackTrace();
-        fail(
+        Assert.fail(
             "test failed due to exception in test testRedundancySpecifiedMoreThanEPs ",
             ex);
      }
@@ -154,7 +156,7 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
   {
     try {
       CacheServerTestUtil.disableShufflingOfEndpoints();
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 0);
       createEntriesK1andK2();
       registerK1AndK2();
       assertEquals(0, pool.getRedundantNames().size());
@@ -188,7 +190,7 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
     }
      catch (Exception ex) {
         ex.printStackTrace();
-        fail(
+        Assert.fail(
             "test failed due to exception in test testRedundancySpecifiedMoreThanEPs ",
             ex);
      }
@@ -206,7 +208,7 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
     try {
 //      long maxWaitTime = 60000;
       CacheServerTestUtil.disableShufflingOfEndpoints();
-      createClientCache(getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
+      createClientCache(NetworkUtils.getServerHostName(Host.getHost(0)), PORT1, PORT2, PORT3, PORT4, 1);
       createEntriesK1andK2();
       registerK1AndK2();
       assertEquals(1, pool.getRedundantNames().size());
@@ -237,7 +239,7 @@ public class RedundancyLevelPart3DUnitTest extends RedundancyLevelTestBase
      }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail(
+      Assert.fail(
           "test failed due to exception in test testRedundancySpecifiedMoreThanEPs ",
           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/RedundancyLevelTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index 7f95f8b..03ed215 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -40,9 +40,14 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.ClientServerObserver;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
+import com.gemstone.gemfire.test.dunit.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.cache.CacheServerImpl;
 
 /**
@@ -107,7 +112,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
     server2 = host.getVM(2);
     server3 = host.getVM(3);
 
-    addExpectedException("java.net.SocketException||java.net.ConnectException");
+    IgnoredException.addIgnoredException("java.net.SocketException||java.net.ConnectException");
 
     // start servers first
     PORT1 = ((Integer)server0.invoke(RedundancyLevelTestBase.class,
@@ -119,7 +124,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
     PORT4 = ((Integer)server3.invoke(RedundancyLevelTestBase.class,
         "createServerCache")).intValue();
 
-    String hostName = getServerHostName(Host.getHost(0));
+    String hostName = NetworkUtils.getServerHostName(Host.getHost(0));
     SERVER1 = hostName + PORT1;
     SERVER2 = hostName + PORT2;
     SERVER3 = hostName + PORT3;
@@ -169,7 +174,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
 
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
           .iterator().next();
@@ -186,7 +191,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
 
 
       Iterator iter_prox = ccn.getClientProxies().iterator();
@@ -204,13 +209,13 @@ public class RedundancyLevelTestBase extends DistributedTestCase
             return excuse;
           }
         };
-        DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+        Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
         // assertTrue("Dispatcher on primary should be alive",   proxy._messageDispatcher.isAlive());
       }
 
     }
     catch (Exception ex) {
-      fail("while setting verifyDispatcherIsAlive  ", ex);
+      Assert.fail("while setting verifyDispatcherIsAlive  ", ex);
     }
   }
 
@@ -228,7 +233,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
 
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
           .iterator().next();
@@ -245,7 +250,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
 
       Iterator iter_prox = ccn.getClientProxies().iterator();
       if (iter_prox.hasNext()) {
@@ -256,7 +261,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("while setting verifyDispatcherIsNotAlive  ", ex);
+      Assert.fail("while setting verifyDispatcherIsNotAlive  ", ex);
     }
   }
   
@@ -271,7 +276,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
         + pool.getRedundantNames() + ") does not contain " + server;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 60 * 1000, 2000, true);
+    Wait.waitForCriterion(wc, 60 * 1000, 2000, true);
   }
 
   public static void verifyLiveAndRedundantServers(final int liveServers,
@@ -289,7 +294,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
             + ") to become " + redundantServers;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 120 * 1000, 2 * 1000, true);
+    Wait.waitForCriterion(wc, 120 * 1000, 2 * 1000, true);
   }
   
   public static void verifyDeadServers(int deadServers )
@@ -326,7 +331,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       assertEquals(r1.getEntry(k2).getValue(), k2);
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -342,7 +347,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
     }
     catch (Exception ex) {
       ex.printStackTrace();
-      fail("failed while region.registerK1AndK2()", ex);
+      Assert.fail("failed while region.registerK1AndK2()", ex);
     }
   }
   public static void unregisterInterest()
@@ -352,7 +357,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       r.unregisterInterest("k1");      
     }
     catch (Exception e) {
-      fail("test failed due to ", e);
+      Assert.fail("test failed due to ", e);
     }
   }
   
@@ -382,7 +387,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
       
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
           .iterator().next();
@@ -401,10 +406,10 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+      Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
     }
     catch (Exception ex) {
-      fail("exception in verifyCCP()", ex);
+      Assert.fail("exception in verifyCCP()", ex);
     }
   }  
 
@@ -420,7 +425,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
               + cache.getCacheServers().size() + ") never became 1";
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 180 * 1000, 2000, true);
+      Wait.waitForCriterion(wc, 180 * 1000, 2000, true);
 
       CacheServerImpl bs = (CacheServerImpl)cache.getCacheServers()
           .iterator().next();
@@ -436,7 +441,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
           return "Notifier's proxies is empty";
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 180 * 1000, 2000, true);
+      Wait.waitForCriterion(wc, 180 * 1000, 2000, true);
 
       Iterator iter_prox = ccn.getClientProxies().iterator();
 
@@ -462,7 +467,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
             return excuse;
           }
         };
-        DistributedTestCase.waitForCriterion(wc, 180 * 1000, 2 * 1000, true);
+        Wait.waitForCriterion(wc, 180 * 1000, 2 * 1000, true);
         
         Set keysMap = ccp.cils[RegisterInterestTracker.interestListIndex]
           .getProfile(Region.SEPARATOR + REGION_NAME)
@@ -489,7 +494,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       }
     }
     catch (Exception e) {
-      fail("failed while stopServer()", e);
+      Assert.fail("failed while stopServer()", e);
     }
   }
 
@@ -503,7 +508,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
       bs.start();
     }
     catch (Exception ex) {
-      fail("while startServer()  ", ex);
+      Assert.fail("while startServer()  ", ex);
     }
   }
 
@@ -619,11 +624,9 @@ public class RedundancyLevelTestBase extends DistributedTestCase
 //     }
   }
 
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     try {
-      super.tearDown2();
-    
       if(!FailOverDetectionByCCU)
         ClientServerObserverHolder.setInstance(oldBo);   
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
index 88b684c..a6ee5ba 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
@@ -32,9 +32,13 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.cache.client.*;
 
 /**
@@ -75,7 +79,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
 
     PORT1 =  ((Integer)server1.invoke(RegionCloseDUnitTest.class, "createServerCache" )).intValue();
     client1.invoke(RegionCloseDUnitTest.class, "createClientCache", new Object[] {
-      getServerHostName(host), new Integer(PORT1)});
+      NetworkUtils.getServerHostName(host), new Integer(PORT1)});
 
   }
 
@@ -157,7 +161,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 15 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 15 * 1000, 200, true);
     assertEquals(1, bs.getAcceptor().getCacheClientNotifier().getClientProxies().size());
 
     Iterator iter = bs.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();
@@ -181,7 +185,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
       pool.destroy();
     }
     catch (Exception ex) {
-      fail("failed while region close", ex);
+      Assert.fail("failed while region close", ex);
     }
   }
 
@@ -196,7 +200,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 40 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 40 * 1000, 200, true);
 
     final CacheServerImpl bs = (CacheServerImpl)c.getCacheServers().iterator()
         .next();
@@ -208,7 +212,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 40 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 40 * 1000, 200, true);
     
     ev = new WaitCriterion() {
       public boolean done() {
@@ -218,7 +222,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 40 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 40 * 1000, 200, true);
     // assertNull(c.getRegion("/"+clientMembershipId));
     assertEquals(0, bs.getAcceptor().getCacheClientNotifier()
         .getClientProxies().size());
@@ -232,13 +236,11 @@ public class RegionCloseDUnitTest extends DistributedTestCase
     }
   }
 
-  public void tearDown2() throws Exception
-  {
-	super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     //close client
     client1.invoke(RegionCloseDUnitTest.class, "closeCache");
     //close server
     server1.invoke(RegionCloseDUnitTest.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/RegisterInterestBeforeRegionCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
index 6d71b43..fd50d6e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
@@ -33,7 +33,10 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
 import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
 import com.gemstone.gemfire.cache.client.*;
@@ -102,9 +105,8 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
    * close the cache on all the vms
    * @throws Exception
    */
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(RegisterInterestBeforeRegionCreationDUnitTest.class, "closeCache");
     client2.invoke(RegisterInterestBeforeRegionCreationDUnitTest.class, "closeCache");
     server1.invoke(RegisterInterestBeforeRegionCreationDUnitTest.class, "closeCache");
@@ -168,7 +170,7 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, 5 * 1000, 200, true);
+        Wait.waitForCriterion(ev, 5 * 1000, 200, true);
       }
     };
     return putFromServer;
@@ -204,11 +206,11 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
     
     //client1 connected to server1
     client1.invoke(RegisterInterestBeforeRegionCreationDUnitTest.class, "createClient",
-        new Object[] { getServerHostName(server1.getHost()), new Integer(PORT1) });
+        new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1) });
     
     //client2 connected to server2
     client2.invoke(RegisterInterestBeforeRegionCreationDUnitTest.class, "createClient",
-        new Object[] { getServerHostName(server1.getHost()), new Integer(PORT2) });
+        new Object[] { NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2) });
   }
 
   public static Integer createServer(Boolean createRegion) throws Exception

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
index 691f98d..203a742 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
@@ -23,9 +23,13 @@ import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.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.cache.client.*;
 
 /**
@@ -65,7 +69,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
   public void setUp() throws Exception {
     super.setUp();
     disconnectAllFromDS();
-    pause(5000);
+    Wait.pause(5000);
 
     final Host host = Host.getHost(0);
     //Server1 VM
@@ -85,15 +89,15 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
       host.getVM(i).invoke(getClass(), "createImpl", null);
     }
 
-    getLogWriter().info("implementation class is " + impl.getClass());
+    LogWriterUtils.getLogWriter().info("implementation class is " + impl.getClass());
 
     PORT1 =  ((Integer)server1.invoke(impl.getClass(), "createServerCache" )).intValue();
     PORT2 =  ((Integer)server2.invoke(impl.getClass(), "createServerCache" )).intValue();
     
     client1.invoke(impl.getClass(), "createClientCache", new Object[] { 
-      getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
+      NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
     client2.invoke(impl.getClass(), "createClientCache", new Object[] {
-      getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
+      NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
 
   }
 
@@ -136,7 +140,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
       assertEquals(r1.getEntry("key1").getValue(), "key-1");
     }
     catch (Exception ex) {
-      fail("failed while createEntriesK1()", ex);
+      Assert.fail("failed while createEntriesK1()", ex);
     }
   }
 
@@ -220,7 +224,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while registering interest", ex);
+      Assert.fail("failed while registering interest", ex);
     }
   }
 
@@ -232,15 +236,13 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
     }
   }
 
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     //close client
     client1.invoke(impl.getClass(), "closeCache");
     client2.invoke(impl.getClass(), "closeCache");
     //close server
     server1.invoke(impl.getClass(), "closeCache");
     server2.invoke(impl.getClass(), "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/ReliableMessagingDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
index ffab9b9..ece92d7 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
@@ -40,9 +40,15 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.ha.HAHelper;
 import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
 import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier;
+import com.gemstone.gemfire.test.dunit.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.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;
 
 /**
  * 
@@ -107,15 +113,15 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
    * QRM to other redundant servers.    
    */
   public void testPeriodicAckSendByClientPrimaryFailover() throws Exception {    
-    addExpectedException("java.net.ConnectException");
+    IgnoredException.addIgnoredException("java.net.ConnectException");
     createEntries();
     setClientServerObserverForBeforeSendingClientAck();    
     server1.invoke(ReliableMessagingDUnitTest.class, "putOnServer");
-    getLogWriter().info("Entering waitForServerUpdate");
+    LogWriterUtils.getLogWriter().info("Entering waitForServerUpdate");
     waitForServerUpdate();    
-    getLogWriter().info("Entering waitForCallback");
+    LogWriterUtils.getLogWriter().info("Entering waitForCallback");
     waitForCallback();
-    getLogWriter().info("Entering waitForClientAck");
+    LogWriterUtils.getLogWriter().info("Entering waitForClientAck");
     waitForClientAck();
     server2.invoke(ReliableMessagingDUnitTest.class, "checkTidAndSeq");
   }
@@ -145,7 +151,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
           (System.currentTimeMillis() - start) < maxWaitTime);
       sleep(1000);
     }
-    getLogWriter().info("seo = " + seo);
+    LogWriterUtils.getLogWriter().info("seo = " + seo);
     assertTrue("Creation time " + creationTime + " supposed to be same as seo " 
         + seo.getCreationTime(), creationTime == seo.getCreationTime());
   }
@@ -163,7 +169,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 10 * 1000, 200, true);
     Map.Entry entry;
     synchronized (map) {
       Iterator iter = map.entrySet().iterator();
@@ -174,7 +180,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
           .getValue();
       assertFalse(seo.getAckSend());
       creationTime = seo.getCreationTime();
-      getLogWriter().info("seo is " + seo.toString());
+      LogWriterUtils.getLogWriter().info("seo is " + seo.toString());
       assertTrue("Creation time not set", creationTime != 0);
       
       Object args[] =
@@ -235,7 +241,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
       Thread.sleep(ms);
     }
     catch (InterruptedException e) {
-      fail("Interrupted", e);
+      Assert.fail("Interrupted", e);
     }
   }
   
@@ -264,7 +270,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
       }
     }
     catch (Exception e) {
-      fail("failed while stopServer()", e);
+      Assert.fail("failed while stopServer()", e);
     }
   }
   
@@ -293,13 +299,13 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
     origObserver = ClientServerObserverHolder.setInstance(new ClientServerObserverAdapter() {
       public void beforeSendingClientAck()
       {
-        getLogWriter().info("beforeSendingClientAck invoked");
+        LogWriterUtils.getLogWriter().info("beforeSendingClientAck invoked");
         setCreationTimeTidAndSeq();   
         server1.invoke(ReliableMessagingDUnitTest.class, "stopServer");
         checkServerCount(1,1);
         server2.invoke(ReliableMessagingDUnitTest.class, "checkEmptyDispatchedMsgs");        
         PoolImpl.BEFORE_SENDING_CLIENT_ACK_CALLBACK_FLAG = false;       
-        getLogWriter().info("end of beforeSendingClientAck");
+        LogWriterUtils.getLogWriter().info("end of beforeSendingClientAck");
             }
     });
   }
@@ -370,7 +376,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
     server.setPort(port);
     server.setNotifyBySubscription(true);
     server.start();
-    getLogWriter().info("Server started at PORT = " + port);
+    LogWriterUtils.getLogWriter().info("Server started at PORT = " + port);
 
     return new Integer(server.getPort());
   }
@@ -382,7 +388,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "");
     cache = test.createCache(props);
-    String host = getServerHostName(Host.getHost(0));
+    String host = NetworkUtils.getServerHostName(Host.getHost(0));
     PoolImpl p = (PoolImpl)PoolManager.createFactory()
       .addServer(host, PORT1)
       .addServer(host, PORT2)
@@ -408,10 +414,9 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
     pool = p;
   }
 
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     creationTime = 0;
-    super.tearDown2();   
     closeCache();
     server1.invoke(ReliableMessagingDUnitTest.class, "closeCache");
     server2.invoke(ReliableMessagingDUnitTest.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/UnregisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
index c4ebead..dedd915 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
@@ -37,9 +37,13 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.FilterProfile;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * @author ashetkar
@@ -78,7 +82,8 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
     client2.invoke(UnregisterInterestDUnitTest.class, "createClientCache", new Object[]{client2.getHost(), port});
   }
 
-  public void tearDown2() throws Exception {
+  @Override
+  protected final void preTearDown() throws Exception {
     closeCache();
     server0.invoke(UnregisterInterestDUnitTest.class, "closeCache");
     client1.invoke(UnregisterInterestDUnitTest.class, "closeCache");
@@ -214,7 +219,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
       checkFilters(value, valueInv);
       break;
     default:
-      fail("Invalid interest type: " + interestType, new IllegalArgumentException("Invalid interest type: " + interestType));
+      Assert.fail("Invalid interest type: " + interestType, new IllegalArgumentException("Invalid interest type: " + interestType));
     }
   }
 
@@ -258,7 +263,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
     case filter:
       break;
     default:
-      fail("Invalid interest type: " + interestType, new IllegalArgumentException("Invalid interest type: " + interestType));
+      Assert.fail("Invalid interest type: " + interestType, new IllegalArgumentException("Invalid interest type: " + interestType));
     }
   }
 
@@ -302,14 +307,14 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
         return "Expected to receive " + inv + " invalidates but received " + pool.getInvalidateCount();
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 10000, 100, true);
+    Wait.waitForCriterion(wc, 10000, 100, true);
   }
 
   public static Integer createCacheAndStartServer() throws Exception {
     DistributedSystem ds = new UnregisterInterestDUnitTest("UnregisterInterestDUnitTest").getSystem();
     ds.disconnect();
     Properties props = new Properties();
-    props.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+    props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
     CacheFactory cf = new CacheFactory(props);
     cache = cf.create();
     RegionFactory rf = ((GemFireCacheImpl)cache).createRegionFactory(RegionShortcut.REPLICATE);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
index c4dca37..0c60c46 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
@@ -44,9 +44,14 @@ 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.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.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;
 
 /**
  *
@@ -123,12 +128,12 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
     PORT2 =  ((Integer)server2.invoke(getClass(), "createServerCache" )).intValue();
 
     client1.invoke(getClass(), "createClientCache", new Object[] {
-      getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
+      NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
     client2.invoke(getClass(), "createClientCache", new Object[] {
-      getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
+      NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)});
     
-    addExpectedException("java.net.SocketException");
-    addExpectedException("Unexpected IOException");
+    IgnoredException.addIgnoredException("java.net.SocketException");
+    IgnoredException.addIgnoredException("Unexpected IOException");
 
   }
   
@@ -191,7 +196,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -216,7 +221,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -244,7 +249,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -252,7 +257,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
     // Client1 should not receive updated value while client2 should receive
     client1.invoke(impl.getClass(),
         "acquireConnectionsAndPutonK1andK2",
-        new Object[] { getServerHostName(client1.getHost())});
+        new Object[] { NetworkUtils.getServerHostName(client1.getHost())});
     //pause(5000);
     //Check if both the puts ( on key1 & key2 ) have reached the servers
     server1.invoke(impl.getClass(), "verifyUpdates");
@@ -301,7 +306,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
     client2.invoke(new CacheSerializableRunnable("Wait for server on port1 to be dead") {
@@ -325,7 +330,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -348,7 +353,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
 
@@ -368,18 +373,18 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
             return null;
           }
         };
-        DistributedTestCase.waitForCriterion(ev, maxWaitTime, 200, true);
+        Wait.waitForCriterion(ev, maxWaitTime, 200, true);
       }
     });
     
-    pause(5000);
+    Wait.pause(5000);
 
     //Do a put on Server1 via Connection object from client1.
     // Client1 should not receive updated value while client2 should receive
     client1.invoke(impl.getClass(),
         "acquireConnectionsAndPutonK1andK2",
-        new Object[] { getServerHostName(client1.getHost())});
-    pause(5000);
+        new Object[] { NetworkUtils.getServerHostName(client1.getHost())});
+    Wait.pause(5000);
     //Check if both the puts ( on key1 & key2 ) have reached the servers
     server1.invoke(impl.getClass(), "verifyUpdates");
     server2.invoke(impl.getClass(), "verifyUpdates");
@@ -465,7 +470,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
       }
     }
     catch (Exception ex) {
-      fail("failed while createEntriesK1andK2()", ex);
+      Assert.fail("failed while createEntriesK1andK2()", ex);
     }
   }
 
@@ -537,7 +542,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while registering interest", ex);
+      Assert.fail("failed while registering interest", ex);
     }
   }
 
@@ -551,7 +556,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
       assertEquals("key-2", r.getEntry("key2").getValue());
     }
     catch (Exception ex) {
-      fail("failed while verifyNoUpdates()", ex);
+      Assert.fail("failed while verifyNoUpdates()", ex);
     }
   }
 
@@ -571,7 +576,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
       }
     }
     catch (Exception ex) {
-      fail("failed while region", ex);
+      Assert.fail("failed while region", ex);
     }
   }
 
@@ -583,17 +588,15 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
     }
   }
 
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     //close client
     client1.invoke(getClass(), "closeCache");
     client2.invoke(getClass(), "closeCache");
     //close server
     server1.invoke(getClass(), "closeCache");
     server2.invoke(getClass(), "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/VerifyEventIDGenerationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
index 16fb199..83df124 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
@@ -30,6 +30,7 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
@@ -148,7 +149,7 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
       assertEquals(r.getEntry("key-1").getValue(), "key-1");
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -160,7 +161,7 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
       r.get("key-1");
     }
     catch (Exception ex) {
-      fail("failed while r.put()", ex);
+      Assert.fail("failed while r.put()", ex);
     }
   }
 
@@ -171,9 +172,8 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
     return new Boolean(temp);
   }
 
-  public void tearDown2() throws Exception
-  {
-    super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     closeCache();
     vm0.invoke(VerifyEventIDGenerationInP2PDUnitTest.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/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
index d1c3da7..c2a0016 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
@@ -33,9 +33,12 @@ import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 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;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.cache.client.*;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -73,7 +76,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
   public void setUp() throws Exception {
     super.setUp();
     disconnectAllFromDS();
-    pause(5000);
+    Wait.pause(5000);
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
@@ -84,7 +87,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     PORT2 =  ((Integer)vm1.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createServerCache" )).intValue();
 
     vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(vm0.getHost()), new Integer(PORT1),new Integer(PORT2)});
+        new Object[] { NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1),new Integer(PORT2)});
 
 
   }
@@ -110,7 +113,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "registerKey");
 
     vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "acquireConnectionsAndPut", new Object[] { new Integer(PORT2)});
-    pause(30000);
+    Wait.pause(30000);
     vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "verifyPut");
   }
 
@@ -155,7 +158,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
       assertEquals(r1.getEntry("key-2").getValue(), "key-2");
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -217,7 +220,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
 
     }
     catch (Exception ex) {
-      fail("failed while registerKey()", ex);
+      Assert.fail("failed while registerKey()", ex);
     }
   }
 
@@ -231,7 +234,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
       assertEquals("key-2", r.getEntry("key-2").getValue());
     }
     catch (Exception ex) {
-      fail("failed while verifyPut()", ex);
+      Assert.fail("failed while verifyPut()", ex);
     }
   }
 
@@ -243,14 +246,12 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
     }
   }
 
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     //close client
     vm2.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "closeCache");
     //close server
     vm0.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "closeCache");
     vm1.invoke(VerifyUpdatesFromNonInterestEndPointDUnitTest.class, "closeCache");
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/versions/RegionVersionVectorJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/versions/RegionVersionVectorJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/versions/RegionVersionVectorJUnitTest.java
index 0efea5a..df85998 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/versions/RegionVersionVectorJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/versions/RegionVersionVectorJUnitTest.java
@@ -35,7 +35,7 @@ import com.gemstone.gemfire.internal.HeapDataOutputStream;
 import com.gemstone.gemfire.internal.InternalDataSerializer;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.cache.persistence.DiskStoreID;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
@@ -56,7 +56,7 @@ public class RegionVersionVectorJUnitTest extends TestCase {
   public void testRegionVersionVectors() throws Exception {
     // this is just a quick set of unit tests for basic RVV functionality
     
-    final String local = DistributedTestCase.getIPLiteral();
+    final String local = NetworkUtils.getIPLiteral();
     InternalDistributedMember server1 = new InternalDistributedMember(local, 101);
     InternalDistributedMember server2 = new InternalDistributedMember(local, 102);
     InternalDistributedMember server3 = new InternalDistributedMember(local, 103);


Mime
View raw message