geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [28/51] [partial] incubator-geode git commit: GEODE-773: Extract static methods from DistributedTestCase
Date Tue, 09 Feb 2016 18:44:38 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
index 63b2334..5ce60f3 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
@@ -60,11 +60,16 @@ import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.execute.data.Shipment;
 import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 /**
  * This is the test for the custom and colocated partitioning of
  * PartitionedRegion
@@ -712,14 +717,14 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertNotNull(basicGetCache());
         Region pr = basicGetCache().createRegion(partitionedRegionName, attr.create());
         assertNotNull(pr);
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Partitioned Region " + partitionedRegionName
                 + " created Successfully :" + pr.toString());
       }
     });
 
     // add expected exception string
-    final ExpectedException ex = addExpectedException(
+    final IgnoredException ex = IgnoredException.addIgnoredException(
         "Colocated regions should have accessors at the same node", dataStore1);
     dataStore1.invoke(new CacheSerializableRunnable(
         "Colocated PR with Accessor on different nodes") {
@@ -749,7 +754,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
         }
         catch (Exception Expected) {
           Expected.printStackTrace();
-          getLogWriter().info("Expected Message : " + Expected.getMessage());
+          LogWriterUtils.getLogWriter().info("Expected Message : " + Expected.getMessage());
           assertTrue(Expected.getMessage().startsWith(
               "Colocated regions should have accessors at the same node"));
         }
@@ -784,14 +789,14 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertNotNull(basicGetCache());
         Region pr = basicGetCache().createRegion(partitionedRegionName, attr.create());
         assertNotNull(pr);
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Partitioned Region " + partitionedRegionName
                 + " created Successfully :" + pr.toString());
       }
     });
 
     // add expected exception string
-    final ExpectedException ex = addExpectedException(
+    final IgnoredException ex = IgnoredException.addIgnoredException(
         "Colocated regions should have accessors at the same node", dataStore1);
     dataStore1.invoke(new CacheSerializableRunnable(
         "Colocated PR with accessor on different nodes") {
@@ -820,7 +825,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
               + "should have accessors at the same node");
         }
         catch (Exception Expected) {
-          getLogWriter().info("Expected Message : " + Expected.getMessage());
+          LogWriterUtils.getLogWriter().info("Expected Message : " + Expected.getMessage());
           assertTrue(Expected.getMessage().startsWith(
               "Colocated regions should have accessors at the same node"));
         }
@@ -855,7 +860,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertNotNull(basicGetCache());
         Region pr = basicGetCache().createRegion(partitionedRegionName, attr.create());
         assertNotNull(pr);
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Partitioned Region " + partitionedRegionName
                 + " created Successfully :" + pr.toString());
       }
@@ -883,14 +888,14 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertNotNull(basicGetCache());
         Region pr = basicGetCache().createRegion(partitionedRegionName, attr.create());
         assertNotNull(pr);
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Partitioned Region " + partitionedRegionName
                 + " created Successfully :" + pr.toString());
       }
     });
 
     // add expected exception string
-    final ExpectedException ex = addExpectedException("Cannot create buckets",
+    final IgnoredException ex = IgnoredException.addIgnoredException("Cannot create buckets",
         dataStore2);
     dataStore2.invoke(new CacheSerializableRunnable(
         "Colocated PR with PR on different node") {
@@ -922,7 +927,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
               + "as colocated regions are not configured to be at the same nodes.");
         }
         catch (Exception Expected) {
-          getLogWriter().info("Expected Message : " + Expected.getMessage());
+          LogWriterUtils.getLogWriter().info("Expected Message : " + Expected.getMessage());
           assertTrue(Expected.getMessage().contains("Cannot create buckets, as "
               + "colocated regions are not configured to be at the same nodes."));
         }
@@ -958,9 +963,9 @@ public class PRColocationDUnitTest extends CacheTestCase {
         }
         catch (Exception NotExpected) {
           NotExpected.printStackTrace();
-          getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "Unexpected Exception Message : " + NotExpected.getMessage());
-          fail("Unpexpected Exception" , NotExpected);
+          Assert.fail("Unpexpected Exception" , NotExpected);
         }
       }
     });
@@ -999,7 +1004,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     // add expected exception string
     final String expectedExMessage =
       "Any Region in colocation chain cannot be destroyed locally.";
-    final ExpectedException ex = addExpectedException(expectedExMessage,
+    final IgnoredException ex = IgnoredException.addIgnoredException(expectedExMessage,
         dataStore1);
     dataStore1.invoke(new CacheSerializableRunnable(
         "PR with Local destroy") {
@@ -1013,7 +1018,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
               + expectedExMessage);
         }
         catch (Exception Expected) {
-          getLogWriter().info("Expected Messageee : " + Expected.getMessage());
+          LogWriterUtils.getLogWriter().info("Expected Messageee : " + Expected.getMessage());
           assertTrue(Expected.getMessage().contains(expectedExMessage));
         }
       }
@@ -1031,7 +1036,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
               + expectedExMessage);
         }
         catch (Exception Expected) {
-          getLogWriter().info("Expected Messageee : " + Expected.getMessage());
+          LogWriterUtils.getLogWriter().info("Expected Messageee : " + Expected.getMessage());
           assertTrue(Expected.getMessage().contains(expectedExMessage));
         }
       }
@@ -1077,7 +1082,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     // add expected exception string
     final String expectedExMessage = "colocation chain cannot be destroyed, "
         + "unless all its children";
-    final ExpectedException ex = addExpectedException(expectedExMessage,
+    final IgnoredException ex = IgnoredException.addIgnoredException(expectedExMessage,
         dataStore1);
     dataStore1.invoke(new CacheSerializableRunnable(
         "PR with destroy") {
@@ -1091,7 +1096,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
               + expectedExMessage);
         }
         catch (IllegalStateException expected) {
-          getLogWriter().info("Got message: " + expected.getMessage());
+          LogWriterUtils.getLogWriter().info("Got message: " + expected.getMessage());
           assertTrue(expected.getMessage().contains(expectedExMessage));
         }
       }
@@ -1109,7 +1114,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
         }
         catch (Exception unexpected) {
           unexpected.printStackTrace();
-          getLogWriter().info("Unexpected Message: " + unexpected.getMessage());
+          LogWriterUtils.getLogWriter().info("Unexpected Message: " + unexpected.getMessage());
           fail("Could not destroy the child region.");
         }
       }
@@ -1126,7 +1131,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
         }
         catch (Exception unexpected) {
           unexpected.printStackTrace();
-          getLogWriter().info("Unexpected Message: " + unexpected.getMessage());
+          LogWriterUtils.getLogWriter().info("Unexpected Message: " + unexpected.getMessage());
           fail("Could not destroy the parent region.");
         }
       }
@@ -1221,7 +1226,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
               DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(1);
               prForCustomer.put(dummy, new Integer(100));
               assertEquals(prForCustomer.get(dummy), new Integer(100));
-              getLogWriter().info(
+              LogWriterUtils.getLogWriter().info(
                   "Key :" + dummy.dummyID + " Value :"
                       + prForCustomer.get(dummy));
 
@@ -1230,14 +1235,14 @@ public class PRColocationDUnitTest extends CacheTestCase {
               assertNotNull(prForOrder);
               prForOrder.put(dummy, new Integer(200));
               assertEquals(prForOrder.get(dummy), new Integer(200));
-              getLogWriter().info(
+              LogWriterUtils.getLogWriter().info(
                   "Key :" + dummy.dummyID + " Value :" + prForOrder.get(dummy));
               return null;
             }
           });
     } catch (Exception unexpected) {
       unexpected.printStackTrace();
-      getLogWriter().info("Unexpected Message: " + unexpected.getMessage());
+      LogWriterUtils.getLogWriter().info("Unexpected Message: " + unexpected.getMessage());
       fail("Test failed");
     }
   }
@@ -1513,7 +1518,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
       @Override
       public void run2() throws CacheException {
         getCache();
-        addExpectedException("redundancy should be same as the redundancy");
+        IgnoredException.addIgnoredException("redundancy should be same as the redundancy");
         createPR(rName, red1, Integer.valueOf(100), Integer.valueOf(3), null, Boolean.FALSE, Boolean.FALSE);
         try {
           createPR(rName+"colo", red0, Integer.valueOf(100), Integer.valueOf(3), rName, Boolean.FALSE, Boolean.FALSE);
@@ -1753,7 +1758,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertEquals(2, region.getDataStore().getAllLocalPrimaryBucketIds().size());
       }
     };
-    pause(5000);
+    Wait.pause(5000);
     dataStore1.invoke(checkForBuckets_ForOrder);
     
     dataStore2.invoke(PRColocationDUnitTest.class, "createPR", attributeObjects1);
@@ -1883,7 +1888,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
       throw async2.getException();
     }
     
-    pause(5000);
+    Wait.pause(5000);
     SerializableRunnable checkForBuckets_ForOrder = new SerializableRunnable("check for buckets") {
       public void run() {
         PartitionedRegion region = (PartitionedRegion) basicGetCache().getRegion(OrderPartitionedRegionName);
@@ -2067,13 +2072,13 @@ public class PRColocationDUnitTest extends CacheTestCase {
       }
       Iterator primaryBucketIterator = primaryBucketListForCustomer.iterator();
       while (primaryBucketIterator.hasNext()) {
-        getLogWriter().info("Primary Bucket : " + primaryBucketIterator.next());
+        LogWriterUtils.getLogWriter().info("Primary Bucket : " + primaryBucketIterator.next());
 
       }
       Iterator SecondaryBucketIterator = secondaryBucketListForCustomer
           .iterator();
       while (SecondaryBucketIterator.hasNext()) {
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Secondary Bucket : " + SecondaryBucketIterator.next());
       }
     }
@@ -2114,12 +2119,12 @@ public class PRColocationDUnitTest extends CacheTestCase {
       }
       Iterator primaryBucketIterator = primaryBucketListForOrder.iterator();
       while (primaryBucketIterator.hasNext()) {
-        getLogWriter().info("Primary Bucket : " + primaryBucketIterator.next());
+        LogWriterUtils.getLogWriter().info("Primary Bucket : " + primaryBucketIterator.next());
 
       }
       Iterator SecondaryBucketIterator = secondaryBucketListForOrder.iterator();
       while (SecondaryBucketIterator.hasNext()) {
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Secondary Bucket : " + SecondaryBucketIterator.next());
       }
     }
@@ -2160,13 +2165,13 @@ public class PRColocationDUnitTest extends CacheTestCase {
       }
       Iterator primaryBucketIterator = primaryBucketListForShipment.iterator();
       while (primaryBucketIterator.hasNext()) {
-        getLogWriter().info("Primary Bucket : " + primaryBucketIterator.next());
+        LogWriterUtils.getLogWriter().info("Primary Bucket : " + primaryBucketIterator.next());
 
       }
       Iterator SecondaryBucketIterator = secondaryBucketListForShipment
           .iterator();
       while (SecondaryBucketIterator.hasNext()) {
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "Secondary Bucket : " + SecondaryBucketIterator.next());
       }
     }
@@ -2206,10 +2211,10 @@ public class PRColocationDUnitTest extends CacheTestCase {
     HashMap localBucket2RegionMap = (HashMap)customerPartitionedregion
         .getDataStore().getSizeLocally();
     int customerBucketSize = localBucket2RegionMap.size();
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Size of the " + customerPartitionedRegionName + " in this VM :- "
             + localBucket2RegionMap.size());
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Size of primary buckets the " + customerPartitionedRegionName + " in this VM :- "
             + customerPartitionedregion.getDataStore().getNumberOfPrimaryBucketsManaged());
     Set customerEntrySet = localBucket2RegionMap.entrySet();
@@ -2219,7 +2224,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
       Map.Entry me = (Map.Entry)customerIterator.next();
       Integer size = (Integer)me.getValue();
       assertEquals(1, size.intValue());
-      getLogWriter().info(
+      LogWriterUtils.getLogWriter().info(
           "Size of the Bucket " + me.getKey() + ": - " + size.toString());
     }
     
@@ -2227,10 +2232,10 @@ public class PRColocationDUnitTest extends CacheTestCase {
     localBucket2RegionMap = (HashMap)orderPartitionedregion.getDataStore()
         .getSizeLocally();
     int orderBucketSize = localBucket2RegionMap.size();
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Size of the " + orderPartitionedRegionName + " in this VM :- "
             + localBucket2RegionMap.size());
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Size of primary buckets the " + orderPartitionedRegionName + " in this VM :- "
             + orderPartitionedregion.getDataStore().getNumberOfPrimaryBucketsManaged());
     
@@ -2241,16 +2246,16 @@ public class PRColocationDUnitTest extends CacheTestCase {
       Map.Entry me = (Map.Entry)orderIterator.next();
       Integer size = (Integer)me.getValue();
       assertEquals(10, size.intValue());
-      getLogWriter().info(
+      LogWriterUtils.getLogWriter().info(
           "Size of the Bucket " + me.getKey() + ": - " + size.toString());
     }
     localBucket2RegionMap = (HashMap)shipmentPartitionedregion.getDataStore()
         .getSizeLocally();
     int shipmentBucketSize = localBucket2RegionMap.size();
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Size of the " + shipmentPartitionedRegionName + " in this VM :- "
             + localBucket2RegionMap.size());
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Size of primary buckets the " + shipmentPartitionedRegionName + " in this VM :- "
             + shipmentPartitionedregion.getDataStore().getNumberOfPrimaryBucketsManaged());
     Set shipmentEntrySet = localBucket2RegionMap.entrySet();
@@ -2260,7 +2265,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
       Map.Entry me = (Map.Entry)shipmentIterator.next();
       Integer size = (Integer)me.getValue();
       assertEquals(100, size.intValue());
-      getLogWriter().info(
+      LogWriterUtils.getLogWriter().info(
           "Size of the Bucket " + me.getKey() + ": - " + size.toString());
     }
     
@@ -2302,7 +2307,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
           + partitionedRegionName);
     }
     catch (Exception e) {
-      fail(
+      Assert.fail(
           "validateBeforePutCustomerPartitionedRegion : Failed while getting the region from cache",
           e);
     }
@@ -2328,7 +2333,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
           .getRegion(Region.SEPARATOR + shipmentPartitionedRegionName);
     }
     catch (Exception e) {
-      fail(
+      Assert.fail(
           "validateAfterPutPartitionedRegion : failed while getting the region",
           e);
     }
@@ -2358,7 +2363,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
           // assertNotNull(orderPartitionedregion.get(orderId));
 
           if (custId.equals(orderId.getCustId())) {
-            getLogWriter().info(
+            LogWriterUtils.getLogWriter().info(
                 orderId + "belongs to node " + idmForCustomer + " "
                     + idmForOrder);
             assertEquals(idmForCustomer, idmForOrder);
@@ -2370,7 +2375,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
             ShipmentId shipmentId = (ShipmentId)shipmentIterator.next();
             // assertNotNull(shipmentPartitionedregion.get(shipmentId));
             if (orderId.equals(shipmentId.getOrderId())) {
-              getLogWriter().info(
+              LogWriterUtils.getLogWriter().info(
                   shipmentId + "belongs to node " + idmForOrder + " "
                       + idmForShipment);
             }
@@ -2401,7 +2406,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertEquals(customer, pr.get(custid));
       }
       catch (Exception e) {
-        fail("putInPartitionedRegion : failed while doing put operation in "
+        Assert.fail("putInPartitionedRegion : failed while doing put operation in "
             + pr.getFullPath(), e);
       }
     }
@@ -2415,7 +2420,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     try {
       partitionedregion.close();
     } catch (Exception e) {
-      fail(
+      Assert.fail(
           "closeRegion : failed to close region : " + partitionedregion,
           e);
     }
@@ -2451,11 +2456,11 @@ public class PRColocationDUnitTest extends CacheTestCase {
         assertEquals(customer,partitionedregion.get(custid));
       }
       catch (Exception e) {
-        fail(
+        Assert.fail(
             "putCustomerPartitionedRegion : failed while doing put operation in CustomerPartitionedRegion ",
             e);
       }
-      getLogWriter().info("Customer :- { " + custid + " : " + customer + " }");
+      LogWriterUtils.getLogWriter().info("Customer :- { " + custid + " : " + customer + " }");
     }
   }
 
@@ -2477,11 +2482,11 @@ public class PRColocationDUnitTest extends CacheTestCase {
 
         }
         catch (Exception e) {
-          fail(
+          Assert.fail(
               "putOrderPartitionedRegion : failed while doing put operation in OrderPartitionedRegion ",
               e);
         }
-        getLogWriter().info("Order :- { " + orderId + " : " + order + " }");
+        LogWriterUtils.getLogWriter().info("Order :- { " + orderId + " : " + order + " }");
       }
     }
   }
@@ -2504,11 +2509,11 @@ public class PRColocationDUnitTest extends CacheTestCase {
 
         }
         catch (Exception e) {
-          fail(
+          Assert.fail(
               "putOrderPartitionedRegion : failed while doing put operation in OrderPartitionedRegion ",
               e);
         }
-        getLogWriter().info("Order :- { " + orderId + " : " + order + " }");
+        LogWriterUtils.getLogWriter().info("Order :- { " + orderId + " : " + order + " }");
       }
     }
   }
@@ -2533,11 +2538,11 @@ public class PRColocationDUnitTest extends CacheTestCase {
             assertEquals(shipment,partitionedregion.get(shipmentId));
           }
           catch (Exception e) {
-            fail(
+            Assert.fail(
                 "putShipmentPartitionedRegion : failed while doing put operation in ShipmentPartitionedRegion ",
                 e);
           }
-          getLogWriter().info(
+          LogWriterUtils.getLogWriter().info(
               "Shipment :- { " + shipmentId + " : " + shipment + " }");
         }
       }
@@ -2571,12 +2576,12 @@ public class PRColocationDUnitTest extends CacheTestCase {
     Region pr = basicGetCache().getRegion(partitionedRegionName);
     assertNotNull(pr);
     try {
-      getLogWriter().info("Destroying Partitioned Region " + partitionedRegionName);
+      LogWriterUtils.getLogWriter().info("Destroying Partitioned Region " + partitionedRegionName);
       pr.destroyRegion();
       fail("Did not get the expected ISE");
     } catch (Exception e) {
       if (!(e instanceof IllegalStateException)) {
-        fail("Expected IllegalStateException, but it's not.", e);
+        Assert.fail("Expected IllegalStateException, but it's not.", e);
       }
     }
   }
@@ -2602,7 +2607,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     assertNotNull(basicGetCache());
     Region pr = basicGetCache().createRegion(partitionedRegionName, attr.create());
     assertNotNull(pr);
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Partitioned Region " + partitionedRegionName
             + " created Successfully :" + pr.toString());
   }
@@ -2623,7 +2628,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
     attr.setPartitionAttributes(prAttr);
     Region pr = root.createSubregion(partitionedRegionName, attr.create());
     assertNotNull(pr);
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Partitioned sub region " + pr.getName()
             + " created Successfully :" + pr.toString());
     if(localMaxMemory == 0){
@@ -2636,9 +2641,8 @@ public class PRColocationDUnitTest extends CacheTestCase {
   }
 
   @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
-    invokeInEveryVM(new SerializableRunnable() {
+  protected final void postTearDownCacheTestCase() throws Exception {
+    Invoke.invokeInEveryVM(new SerializableRunnable() {
       public void run() {
         InternalResourceManager.setResourceObserver(null);
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
index 302edd7..981db10 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRCustomPartitioningDUnitTest.java
@@ -51,7 +51,9 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDUnitTestCase;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor;
 import com.gemstone.gemfire.internal.cache.xmlcache.Declarable2;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -153,12 +155,12 @@ public class PRCustomPartitioningDUnitTest extends
     for (int b = 0; b < numBucks; b++) {
       if (par.getBucketKeys(b).contains(key)) {
         foundIt = true;
-        getLogWriter().info("Key " + key + " found in bucket " + b);
+        LogWriterUtils.getLogWriter().info("Key " + key + " found in bucket " + b);
         break;
       }
     }
     if (!foundIt) {
-      getLogWriter().severe("Key " + key + " not found in any bucket");      
+      LogWriterUtils.getLogWriter().severe("Key " + key + " not found in any bucket");      
     }
     return foundIt;
   }
@@ -204,7 +206,7 @@ public class PRCustomPartitioningDUnitTest extends
               ppr.dumpAllBuckets(false);
             }
             catch (ReplyException re) {
-              fail("dumpAllBuckets", re);
+              Assert.fail("dumpAllBuckets", re);
             }
           }
         });
@@ -240,7 +242,7 @@ public class PRCustomPartitioningDUnitTest extends
               ppr.dumpAllBuckets(false);
             }
             catch (ReplyException re) {
-              fail("dumpAllBuckets", re);
+              Assert.fail("dumpAllBuckets", re);
             }
           }
         });
@@ -275,7 +277,7 @@ public class PRCustomPartitioningDUnitTest extends
               ppr.dumpAllBuckets(false);
             }
             catch (ReplyException re) {
-              fail("dumpAllBuckets", re);
+              Assert.fail("dumpAllBuckets", re);
             }
           }
         });
@@ -310,7 +312,7 @@ public class PRCustomPartitioningDUnitTest extends
               ppr.dumpAllBuckets(false);
             }
             catch (ReplyException re) {
-              fail("dumpAllBuckets", re);
+              Assert.fail("dumpAllBuckets", re);
             }
           }
         });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
index 359143f..0c4b7a9 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionDUnitTest.java
@@ -66,12 +66,17 @@ import com.gemstone.gemfire.internal.cache.execute.data.Order;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 public class PRFunctionExecutionDUnitTest extends
     PartitionedRegionDUnitTestCase {
@@ -316,7 +321,7 @@ public class PRFunctionExecutionDUnitTest extends
             }
             catch (Throwable e) {
               e.printStackTrace();
-              fail("This is not expected Exception", e);
+              Assert.fail("This is not expected Exception", e);
             }
             return Boolean.TRUE;
           }
@@ -390,7 +395,7 @@ public class PRFunctionExecutionDUnitTest extends
         }
         catch (Throwable e) {
           e.printStackTrace();
-          fail("This is not expected Exception", e);
+          Assert.fail("This is not expected Exception", e);
         }
         return Boolean.TRUE;
       }
@@ -750,7 +755,7 @@ public class PRFunctionExecutionDUnitTest extends
   }
   
   public void testLocalMultiKeyExecution_BucketMoved() throws Exception {
-    addExpectedException("BucketMovedException");
+    IgnoredException.addIgnoredException("BucketMovedException");
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     final VM datastore0 = host.getVM(0);
@@ -893,7 +898,7 @@ public class PRFunctionExecutionDUnitTest extends
         }
         catch (Throwable e) {
           e.printStackTrace();
-          fail("This is not expected Exception", e);
+          Assert.fail("This is not expected Exception", e);
         }
         return Boolean.TRUE;
       }
@@ -980,7 +985,7 @@ public class PRFunctionExecutionDUnitTest extends
             return excuse;
           }
         };
-        DistributedTestCase.waitForCriterion(wc, 3000, 200, false);
+        Wait.waitForCriterion(wc, 3000, 200, false);
         long endTime = System.currentTimeMillis();
         getCache().getLogger().fine(
             "Time wait for Cache Close = " + (endTime - startTime));
@@ -990,10 +995,10 @@ public class PRFunctionExecutionDUnitTest extends
     });
     assertEquals(Boolean.TRUE, o);
 
-    DistributedTestCase.join(async[0], 60 * 1000, getLogWriter());
+    ThreadUtils.join(async[0], 60 * 1000);
 
     if (async[0].getException() != null) {
-      fail("UnExpected Exception Occured : ", async[0].getException());
+      Assert.fail("UnExpected Exception Occured : ", async[0].getException());
     }
     List l = (List)async[0].getReturnValue();
     assertEquals(2, l.size());
@@ -1078,7 +1083,7 @@ public class PRFunctionExecutionDUnitTest extends
             return excuse;
           }
         };
-        DistributedTestCase.waitForCriterion(wc, 3000, 200, false);
+        Wait.waitForCriterion(wc, 3000, 200, false);
         long endTime = System.currentTimeMillis();
         getCache().getLogger().fine(
             "Time wait for Cache Close = " + (endTime - startTime));
@@ -1088,10 +1093,10 @@ public class PRFunctionExecutionDUnitTest extends
     });
     assertEquals(Boolean.TRUE, o);
 
-    DistributedTestCase.join(async[0], 60 * 1000, getLogWriter());
+    ThreadUtils.join(async[0], 60 * 1000);
 
     if (async[0].getException() != null) {
-      fail("UnExpected Exception Occured : ", async[0].getException());
+      Assert.fail("UnExpected Exception Occured : ", async[0].getException());
     }
     List l = (List)async[0].getReturnValue();
     assertEquals(2, l.size());
@@ -1585,7 +1590,7 @@ public class PRFunctionExecutionDUnitTest extends
         }
         catch (Exception expected) {
           // No data should cause exec to throw
-          getLogWriter().warning("Exception Occured : "+ expected.getMessage());
+          LogWriterUtils.getLogWriter().warning("Exception Occured : "+ expected.getMessage());
           // boolean expectedStr = expected.getMessage().startsWith("No target
           // node was found for routingKey");
           // assertTrue("Unexpected exception: " + expected, expectedStr);
@@ -2242,7 +2247,7 @@ public class PRFunctionExecutionDUnitTest extends
         ResultCollector rc1 = dataSet.withArgs(Boolean.TRUE)
             .execute(function.getId());
         List l = ((List)rc1.getResult());
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PRFunctionExecutionDUnitTest#testExecutionOnAllNodes_byName : Result size :"
                 + l.size() + " Result : " + l);
         assertEquals(4, l.size());
@@ -2427,7 +2432,7 @@ public class PRFunctionExecutionDUnitTest extends
               }
             });
         List l = ((List)rc1.getResult());
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PRFunctionExecutionDUnitTest#testExecutionOnAllNodes_byName : Result size :"
                 + l.size() + " Result : " + l);
         assertEquals(4, l.size());
@@ -2532,7 +2537,7 @@ public class PRFunctionExecutionDUnitTest extends
               }
             });
         List l = ((List)rc1.getResult());
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PRFunctionExecutionDUnitTest#testExecutionOnAllNodes_byName : Result size :"
                 + l.size() + " Result : " + l);
         assertEquals(4, l.size());
@@ -2603,11 +2608,11 @@ public class PRFunctionExecutionDUnitTest extends
             testKeys.add(custid);
           }
           catch (Exception e) {
-            fail(
+            Assert.fail(
                 "putCustomerPartitionedRegion : failed while doing put operation in CustomerPartitionedRegion ",
                 e);
           }
-          getLogWriter().fine("Customer :- { " + custid + " : " + customer + " }");
+          LogWriterUtils.getLogWriter().fine("Customer :- { " + custid + " : " + customer + " }");
         }
         
         Function function = new TestFunction(true,TestFunction.TEST_FUNCTION3);
@@ -2714,11 +2719,11 @@ public class PRFunctionExecutionDUnitTest extends
               testKeys.add(custid);
           }
           catch (Exception e) {
-            fail(
+            Assert.fail(
                 "putCustomerPartitionedRegion : failed while doing put operation in CustomerPartitionedRegion ",
                 e);
           }
-          getLogWriter().fine("Customer :- { " + custid + " : " + customer + " }");
+          LogWriterUtils.getLogWriter().fine("Customer :- { " + custid + " : " + customer + " }");
         }
 
         PartitionedRegion partitionedregion = (PartitionedRegion)getCache().getRegion(rName2);
@@ -2736,11 +2741,11 @@ public class PRFunctionExecutionDUnitTest extends
               
             }
             catch (Exception e) {
-              fail(
+              Assert.fail(
                   "putOrderPartitionedRegion : failed while doing put operation in OrderPartitionedRegion ",
                   e);
             }
-            getLogWriter().fine("Order :- { " + orderId + " : " + order + " }");
+            LogWriterUtils.getLogWriter().fine("Order :- { " + orderId + " : " + order + " }");
           }
         }
                 
@@ -3049,9 +3054,9 @@ public class PRFunctionExecutionDUnitTest extends
       ds.disconnect();
     }
     catch (Exception e) {
-      getLogWriter().info("Exception Occured : " + e.getMessage());
+      LogWriterUtils.getLogWriter().info("Exception Occured : " + e.getMessage());
       e.printStackTrace();
-      fail("Test failed", e);
+      Assert.fail("Test failed", e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
index 6ded986..169ad3a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
@@ -41,6 +41,7 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegionTestHelper;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -666,7 +667,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends
    * @throws Exception
    */
   public void testLocalMultiKeyExecution_byName() throws Exception {
-    addExpectedException("BucketMovedException");
+    IgnoredException.addIgnoredException("BucketMovedException");
     final String rName = getUniqueName();
     Host host = Host.getHost(0);
     VM localOnly = host.getVM(3);
@@ -797,7 +798,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends
     final VM datastore1 = host.getVM(1);
     final VM datastore2 = host.getVM(2);
     final VM datastore3 = host.getVM(3);
-    addExpectedException("BucketMovedException");
+    IgnoredException.addIgnoredException("BucketMovedException");
     getCache();
     SerializableCallable dataStoreCreate = new SerializableCallable(
         "Create PR with Function Factory") {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
index df36f8f..458ac5d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java
@@ -48,6 +48,7 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegionDUnitTestCase;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionTestHelper;
 import com.gemstone.gemfire.internal.cache.functions.TestFunction;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -584,7 +585,7 @@ public class PRFunctionExecutionWithResultSenderDUnitTest extends
         ResultCollector rc1 = dataSet.withArgs(Boolean.TRUE).execute(
             function.getId());
         List l = ((List)rc1.getResult());
-        getLogWriter().info(
+        LogWriterUtils.getLogWriter().info(
             "PRFunctionExecutionDUnitTest#testExecutionOnAllNodes_byName : Result size :"
                 + l.size() + " Result : " + l);
         assertEquals(4, l.size());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
index 8f99059..cd35f50 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRPerformanceTestDUnitTest.java
@@ -52,7 +52,9 @@ import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionDUnitTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -157,7 +159,7 @@ public class PRPerformanceTestDUnitTest extends
       }
     }
     if (!foundIt) {
-      getLogWriter().severe("Key " + key + " not found in any bucket");      
+      LogWriterUtils.getLogWriter().severe("Key " + key + " not found in any bucket");      
     }
     return foundIt;
   }
@@ -251,8 +253,8 @@ public class PRPerformanceTestDUnitTest extends
             list = (ArrayList)rc.getResult();
           }
           catch (Exception ex) {
-            getLogWriter().info("Exception Occured :" + ex.getMessage());
-            fail("Test failed",ex);
+            LogWriterUtils.getLogWriter().info("Exception Occured :" + ex.getMessage());
+            Assert.fail("Test failed",ex);
           }
           Object val = list.get(0);
           assertNotNull(val);
@@ -277,7 +279,7 @@ public class PRPerformanceTestDUnitTest extends
         }
         
         t.stop();        
-        getLogWriter().info("Time taken to iterate over " + vals.size()+ " no. of keys: " + t.getTimeInMs() + " ms");
+        LogWriterUtils.getLogWriter().info("Time taken to iterate over " + vals.size()+ " no. of keys: " + t.getTimeInMs() + " ms");
                 
         // Call the execute method for each key and see if this takes more time
 
@@ -304,7 +306,7 @@ public class PRPerformanceTestDUnitTest extends
         }
         t.stop();
         assertEquals(vals.size(),listOfKeys.size());            
-        getLogWriter().info("Time taken to iterate over " + vals.size()+ " no. of keys using FunctionExecution: " + t.getTimeInMs() + " ms");
+        LogWriterUtils.getLogWriter().info("Time taken to iterate over " + vals.size()+ " no. of keys using FunctionExecution: " + t.getTimeInMs() + " ms");
         
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
index 75a9f20..b253dc0 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
@@ -43,6 +43,9 @@ import com.gemstone.gemfire.internal.cache.execute.data.Order;
 import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
 import com.gemstone.gemfire.internal.cache.execute.data.Shipment;
 import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 
 /**
@@ -152,7 +155,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         filter.clear();
         args.clear();
         args.add(new Integer(VERIFY_NON_COLOCATION));
-        getLogWriter().info("VERIFY_NON_COLOCATION");
+        LogWriterUtils.getLogWriter().info("VERIFY_NON_COLOCATION");
         args.add(custId);
         args.add(newCus);
         args.add(orderId);
@@ -164,7 +167,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
           fail("Expected exception was not thrown");
         }
         catch (FunctionException fe) {
-          getLogWriter().info("Caught Expected exception");
+          LogWriterUtils.getLogWriter().info("Caught Expected exception");
           if(fe.getCause() instanceof TransactionDataNotColocatedException) {
           }
           else {
@@ -175,7 +178,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         }
         // verify that the transaction modifications are applied        
         args.set(0, new Integer(VERIFY_TX));
-        getLogWriter().info("VERIFY_TX");        
+        LogWriterUtils.getLogWriter().info("VERIFY_TX");        
         orderpr.put(orderId, order);
         assertNotNull(orderpr.get(orderId));
         e.withFilter(filter).withArgs(args).execute(txFunction.getId())
@@ -191,17 +194,17 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
             .getResult();
         // verify that the transaction is rolled back        
         args.set(0, new Integer(VERIFY_ROLLBACK));
-        getLogWriter().info("VERIFY_ROLLBACK");        
+        LogWriterUtils.getLogWriter().info("VERIFY_ROLLBACK");        
         e.withFilter(filter).withArgs(args).execute(txFunction.getId())
             .getResult();
         // verify destroy
         args.set(0, new Integer(VERIFY_DESTROY));
-        getLogWriter().info("VERIFY_DESTROY");
+        LogWriterUtils.getLogWriter().info("VERIFY_DESTROY");
         e.withFilter(filter).withArgs(args).execute(txFunction.getId())
             .getResult();
         // verify invalidate
         args.set(0, new Integer(VERIFY_INVALIDATE));
-        getLogWriter().info("VERIFY_INVALIDATE");
+        LogWriterUtils.getLogWriter().info("VERIFY_INVALIDATE");
         e.withFilter(filter).withArgs(args).execute(txFunction.getId())
             .getResult();
         return Boolean.TRUE;
@@ -389,7 +392,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
           .getRegion(Region.SEPARATOR + OrderPartitionedRegionName);
     }
     catch (Exception e) {
-      fail(
+      Assert.fail(
           "validateAfterPutPartitionedRegion : failed while getting the region",
           e);
     }
@@ -400,7 +403,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
     orderPartitionedregion.getDataStore().dumpEntries(false);
     Iterator custIterator = customerPartitionedregion.getDataStore()
         .getEntries().iterator();
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         "Found " + customerPartitionedregion.getDataStore().getEntries().size()
             + " Customer entries in the partition");
     Region.Entry custEntry = null;
@@ -410,7 +413,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
       Customer cust = (Customer)custEntry.getValue();
       Iterator orderIterator = orderPartitionedregion.getDataStore()
           .getEntries().iterator();
-      getLogWriter().info(
+      LogWriterUtils.getLogWriter().info(
           "Found " + orderPartitionedregion.getDataStore().getEntries().size()
               + " Order entries in the partition");
       int orderPerCustomer = 0;
@@ -465,7 +468,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         filter.clear();
         args.clear();
         args.add(new Integer(VERIFY_LISTENER_CALLBACK));
-        getLogWriter().info("VERIFY_LISTENER_CALLBACK");
+        LogWriterUtils.getLogWriter().info("VERIFY_LISTENER_CALLBACK");
         args.add(custId);
         args.add(newCus);
         args.add(orderId);
@@ -513,7 +516,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         filter.clear();
         args.clear();
         args.add(new Integer(VERIFY_REP_READ));
-        getLogWriter().info("VERIFY_REP_READ");
+        LogWriterUtils.getLogWriter().info("VERIFY_REP_READ");
         args.add(custId);
         args.add(newCus);
         args.add(orderId);
@@ -558,7 +561,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         Execution e = FunctionService.onRegion(customerPR);
         // for each customer, update order and shipment
         for (int iterations = 1; iterations <= totalIterations; iterations++) {
-          getLogWriter().info("running perfFunction");
+          LogWriterUtils.getLogWriter().info("running perfFunction");
           long startTime = 0;
           ArrayList args = new ArrayList();
           CustId custId = new CustId(iterations % 10);
@@ -599,7 +602,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         Execution e = FunctionService.onRegion(customerPR);
         // for each customer, update order and shipment
         for (int iterations = 1; iterations <= totalIterations; iterations++) {
-          getLogWriter().info("Running perfFunction");
+          LogWriterUtils.getLogWriter().info("Running perfFunction");
           long startTime = 0;
           ArrayList args = new ArrayList();
           CustId custId = new CustId(iterations % 10);
@@ -635,7 +638,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
     double diff = (perfTime.longValue() - perfTxTime.longValue()) * 1.0;
     double percentDiff = (diff / perfTime.longValue()) * 100;
 
-    getLogWriter().info(
+    LogWriterUtils.getLogWriter().info(
         (totalIterations - warmupIterations) + " iterations of function took:"
             + +perfTime.longValue() + " Nanos, and transaction function took:"
             + perfTxTime.longValue() + " Nanos, difference :" + diff
@@ -677,12 +680,9 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
   public void testColocatedPRWithPROnDifferentNode1() throws Throwable {
   }
   
-  public void tearDown2() throws Exception {
-    try {
-      invokeInEveryVM(verifyNoTxState);
-    } finally {
-      super.tearDown2();
-    }
+  @Override
+  protected final void preTearDownCacheTestCase() throws Exception {
+    Invoke.invokeInEveryVM(verifyNoTxState);
   }
 
   SerializableCallable verifyNoTxState = new SerializableCallable() {
@@ -715,11 +715,11 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
         }
         catch (Exception e) {
           // mgr.rollback();
-          fail(" failed while doing put operation in CacheListener ", e);
+          Assert.fail(" failed while doing put operation in CacheListener ", e);
         }
       }
       mgr.commit();
-      getLogWriter().info("COMMIT completed");
+      LogWriterUtils.getLogWriter().info("COMMIT completed");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
index 5ed07ab..33e22f4 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
@@ -31,7 +31,9 @@ import com.gemstone.gemfire.cache.client.internal.ClientPartitionAdvisor;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
 
@@ -91,12 +93,12 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
       // check if the function was routed to pruned nodes
       Map resultMap = region.getAll(testKeyList);
       assertTrue(resultMap.equals(origVals));
-      pause(2000);
+      Wait.pause(2000);
       Map secondResultMap = region.getAll(testKeyList);
       assertTrue(secondResultMap.equals(origVals));
     }
     catch (Exception e) {
-      fail("Test failed after the getAll operation", e);
+      Assert.fail("Test failed after the getAll operation", e);
     }
   }
   
@@ -119,7 +121,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
             + regionMetaData.size();
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 5000, 200, true);
+    Wait.waitForCriterion(wc, 5000, 200, true);
     assertTrue(regionMetaData.containsKey(region.getFullPath()));
     final ClientPartitionAdvisor prMetaData = regionMetaData.get(region.getFullPath());
     wc = new WaitCriterion() {
@@ -133,7 +135,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
             + prMetaData.getBucketServerLocationsMap_TEST_ONLY().size();
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 5000, 200, true);
+    Wait.waitForCriterion(wc, 5000, 200, true);
     for (Entry entry : prMetaData.getBucketServerLocationsMap_TEST_ONLY()
         .entrySet()) {
       assertEquals(2, ((List)entry.getValue()).size());
@@ -167,7 +169,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
       region.putAll(keysValuesMap);
       // check the listener
       // check how the function was executed
-      pause(2000);
+      Wait.pause(2000);
       region.putAll(keysValuesMap);
       
       // check if the client meta-data is in synch
@@ -176,7 +178,7 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
       // check if the function was routed to pruned nodes
       Map<String, String> resultMap = region.getAll(testKeysList);
       assertTrue(resultMap.equals(keysValuesMap));
-      pause(2000);
+      Wait.pause(2000);
       Map<String, String> secondResultMap = region.getAll(testKeysList);
       assertTrue(secondResultMap.equals(keysValuesMap));
 
@@ -187,17 +189,12 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
         noValueMap.put(key, null);
       }
       assertEquals(noValueMap, region.getAll(testKeysList));
-      pause(2000); // Why does this test keep pausing for 2 seconds and then do the exact same thing?
+      Wait.pause(2000); // Why does this test keep pausing for 2 seconds and then do the exact same thing?
       region.removeAll(testKeysList);
       assertEquals(noValueMap, region.getAll(testKeysList));
     }
     catch (Exception e) {
-      fail("Test failed after the putAll operation", e);
+      Assert.fail("Test failed after the putAll operation", e);
     }
   }
-  
-  @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/DistributedRegionFunction.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/DistributedRegionFunction.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/DistributedRegionFunction.java
index 030980d..b8343ee 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/DistributedRegionFunction.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/DistributedRegionFunction.java
@@ -24,8 +24,8 @@ import com.gemstone.gemfire.cache.execute.FunctionContext;
 import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 @SuppressWarnings("serial")
 public class DistributedRegionFunction extends FunctionAdapter {
@@ -65,7 +65,7 @@ public class DistributedRegionFunction extends FunctionAdapter {
           return excuse;
         }
       };
-      DistributedTestCase.waitForCriterion(wc, 12000, 500, false);
+      Wait.waitForCriterion(wc, 12000, 500, false);
     }
     long endTime = System.currentTimeMillis();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/TestFunction.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/TestFunction.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/TestFunction.java
index 95a9da9..e789973 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/TestFunction.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/functions/TestFunction.java
@@ -41,8 +41,8 @@ import com.gemstone.gemfire.internal.cache.execute.InternalFunctionInvocationTar
 import com.gemstone.gemfire.internal.cache.execute.MyFunctionExecutionException;
 import com.gemstone.gemfire.internal.cache.execute.RegionFunctionContextImpl;
 import com.gemstone.gemfire.internal.cache.xmlcache.Declarable2;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -797,7 +797,7 @@ public class TestFunction extends FunctionAdapter implements Declarable2 {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 15000, 1000, false);
+    Wait.waitForCriterion(wc, 15000, 1000, false);
     if (context.getArguments() instanceof Boolean) {
       context.getResultSender().lastResult((Serializable) context.getArguments());
     }
@@ -911,7 +911,7 @@ public class TestFunction extends FunctionAdapter implements Declarable2 {
         return excuse;
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 10000, 500, false);
+    Wait.waitForCriterion(wc, 10000, 500, false);
     rcontext.getResultSender().lastResult((Serializable) rcontext.getArguments());
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARQAddOperationJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARQAddOperationJUnitTest.java
index 04f7f60..f299391 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARQAddOperationJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARQAddOperationJUnitTest.java
@@ -31,7 +31,8 @@ import org.junit.experimental.categories.Category;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.internal.cache.Conflatable;
 import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
@@ -152,7 +153,7 @@ public class BlockingHARQAddOperationJUnitTest extends
     };
 
     takeThread.start();
-    DistributedTestCase.staticPause(20 * 1000);
+    Wait.pause(20 * 1000);
     if (!takeThread.isAlive()) {
       fail("take() thread died ");
     }
@@ -160,7 +161,7 @@ public class BlockingHARQAddOperationJUnitTest extends
     ConflatableObject c1 = new ConflatableObject(KEY1, VALUE1, id1,
         conflationEnabled, "region1");
     rq.put(c1);
-    DistributedTestCase.join(takeThread, 20 * 1000, null);
+    ThreadUtils.join(takeThread, 20 * 1000);
     assertEquals(1, takenObjects.size());
     Conflatable obj = (Conflatable)takenObjects.get(0);
     assertNotNull(obj);
@@ -220,7 +221,7 @@ public class BlockingHARQAddOperationJUnitTest extends
       rq.put(c);
     }
     for (int i = 0; i < totalTakeThreads; i++) {
-      DistributedTestCase.join(takeThreads[i], 20 * 1000, null);
+      ThreadUtils.join(takeThreads[i], 20 * 1000);
     }
 
     assertEquals(totalTakeThreads, takenObjects.size());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
index e7b5314..9e79239 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/BlockingHARegionJUnitTest.java
@@ -32,8 +32,9 @@ import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
@@ -76,8 +77,8 @@ public class BlockingHARegionJUnitTest
       thread1.start();
       thread2.start();
 
-      DistributedTestCase.join(thread1, 30 * 1000, null);
-      DistributedTestCase.join(thread2, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000);
+      ThreadUtils.join(thread2, 30 * 1000);
 
       if (exceptionOccured) {
         fail(" Test failed due to " + exceptionString);
@@ -124,7 +125,7 @@ public class BlockingHARegionJUnitTest
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 1000, 200, true);
+      Wait.waitForCriterion(ev, 1000, 200, true);
       assertTrue(thread1.isAlive()); //thread should still be alive (in wait state)
       
       Thread thread2 = new DoTake(hrq,1);
@@ -138,7 +139,7 @@ public class BlockingHARegionJUnitTest
         }
       };
       //sleep. take will proceed and so will sleeping put
-      DistributedTestCase.waitForCriterion(ev, 3 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 3 * 1000, 200, true);
 
       // thread should have died since put should have proceeded
       ev = new WaitCriterion() {
@@ -149,10 +150,10 @@ public class BlockingHARegionJUnitTest
           return "thread1 still alive";
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 30 * 1000, 1000, true);
+      Wait.waitForCriterion(ev, 30 * 1000, 1000, true);
       
-      DistributedTestCase.join(thread1, 30 * 1000, null); // for completeness
-      DistributedTestCase.join(thread2, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000); // for completeness
+      ThreadUtils.join(thread2, 30 * 1000);
       if (exceptionOccured) {
         fail(" Test failed due to " + exceptionString);
       }
@@ -204,7 +205,7 @@ public class BlockingHARegionJUnitTest
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 30 * 1000, 200, true);
       
       assertTrue(thread1.isAlive());
       assertTrue(thread2.isAlive());
@@ -225,11 +226,11 @@ public class BlockingHARegionJUnitTest
       
       Thread.sleep(2000);
       
-      DistributedTestCase.join(thread1, 5 * 60 * 1000, null);
-      DistributedTestCase.join(thread2, 5 * 60 * 1000, null);
-      DistributedTestCase.join(thread3, 5 * 60 * 1000, null);
-      DistributedTestCase.join(thread4, 5 * 60 * 1000, null);
-      DistributedTestCase.join(thread5, 5 * 60 * 1000, null);
+      ThreadUtils.join(thread1, 5 * 60 * 1000);
+      ThreadUtils.join(thread2, 5 * 60 * 1000);
+      ThreadUtils.join(thread3, 5 * 60 * 1000);
+      ThreadUtils.join(thread4, 5 * 60 * 1000);
+      ThreadUtils.join(thread5, 5 * 60 * 1000);
       
       cache.close();
     }
@@ -282,11 +283,11 @@ public class BlockingHARegionJUnitTest
       thread9.start();
       thread10.start();
       
-      DistributedTestCase.join(thread6, 30 * 1000, null);
-      DistributedTestCase.join(thread7, 30 * 1000, null);
-      DistributedTestCase.join(thread8, 30 * 1000, null);
-      DistributedTestCase.join(thread9, 30 * 1000, null);
-      DistributedTestCase.join(thread10, 30 * 1000, null);
+      ThreadUtils.join(thread6, 30 * 1000);
+      ThreadUtils.join(thread7, 30 * 1000);
+      ThreadUtils.join(thread8, 30 * 1000);
+      ThreadUtils.join(thread9, 30 * 1000);
+      ThreadUtils.join(thread10, 30 * 1000);
       
       WaitCriterion ev = new WaitCriterion() {
         public boolean done() {
@@ -296,7 +297,7 @@ public class BlockingHARegionJUnitTest
           return null;
         }
       };
-      DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+      Wait.waitForCriterion(ev, 30 * 1000, 200, true);
       
       assertTrue(thread1.isAlive());
       assertTrue(thread2.isAlive());
@@ -319,11 +320,11 @@ public class BlockingHARegionJUnitTest
       Thread.sleep(2000);
       
       
-      DistributedTestCase.join(thread1, 30 * 1000, null);
-      DistributedTestCase.join(thread2, 30 * 1000, null);
-      DistributedTestCase.join(thread3, 30 * 1000, null);
-      DistributedTestCase.join(thread4, 30 * 1000, null);
-      DistributedTestCase.join(thread5, 30 * 1000, null);
+      ThreadUtils.join(thread1, 30 * 1000);
+      ThreadUtils.join(thread2, 30 * 1000);
+      ThreadUtils.join(thread3, 30 * 1000);
+      ThreadUtils.join(thread4, 30 * 1000);
+      ThreadUtils.join(thread5, 30 * 1000);
       
       cache.close();
     }
@@ -377,7 +378,7 @@ public class BlockingHARegionJUnitTest
         }
       };
       t1.start();
-      DistributedTestCase.join(t1, 20 * 1000, null);
+      ThreadUtils.join(t1, 20 * 1000);
       if (exceptionOccured) {
         fail(" Test failed due to " + exceptionString);
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
index 2c319cd..09e0fbf 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
@@ -36,6 +36,9 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
 import com.gemstone.gemfire.test.dunit.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;
 
 /**
@@ -111,7 +114,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
         "createServerCache")).intValue();
 
     client.invoke(Bug36853EventsExpiryDUnitTest.class, "createClientCache",
-        new Object[] { getServerHostName(host), new Integer(PORT2) });
+        new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT2) });
 
   }
 
@@ -177,11 +180,11 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
       public void afterCreate(EntryEvent event)
       {
         String key = (String)event.getKey();
-        getLogWriter().info("client2 : afterCreate : key =" + key);
+        LogWriterUtils.getLogWriter().info("client2 : afterCreate : key =" + key);
         if (key.equals(LAST_KEY)) {
 
           synchronized (Bug36853EventsExpiryDUnitTest.class) {
-            getLogWriter().info(
+            LogWriterUtils.getLogWriter().info(
                 "Notifying client2 to proceed for validation");
             proceedForValidation = true;
             Bug36853EventsExpiryDUnitTest.class.notify();
@@ -239,8 +242,8 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    */
   public void testEventsExpiryBug() throws Exception
   {
-    addExpectedException("Unexpected IOException");
-    addExpectedException("Connection reset");
+    IgnoredException.addIgnoredException("Unexpected IOException");
+    IgnoredException.addIgnoredException("Connection reset");
     server.invoke(Bug36853EventsExpiryDUnitTest.class, "generateEvents");
     client.invoke(Bug36853EventsExpiryDUnitTest.class,
         "validateEventCountAtClient");
@@ -256,7 +259,7 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
       synchronized (Bug36853EventsExpiryDUnitTest.class) {
         if (!proceedForValidation)
           try {
-            getLogWriter().info(
+            LogWriterUtils.getLogWriter().info(
                 "Client2 going in wait before starting validation");
             Bug36853EventsExpiryDUnitTest.class.wait(5000);
           }
@@ -265,13 +268,13 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
           }
       }
     }
-    getLogWriter().info("Starting validation on client2");
+    LogWriterUtils.getLogWriter().info("Starting validation on client2");
     Assert.assertEquals(
         "Puts recieved by client not equal to the puts done at server.",
         TOTAL_PUTS, putsRecievedByClient);
-    getLogWriter()
+    LogWriterUtils.getLogWriter()
         .info("putsRecievedByClient = " + putsRecievedByClient);
-    getLogWriter().info("Validation complete on client2");
+    LogWriterUtils.getLogWriter().info("Validation complete on client2");
 
   }
 
@@ -291,7 +294,8 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
    * @throws Exception -
    *           thrown if any problem occurs in closing client and server caches.
    */
-  public void tearDown2() throws Exception
+  @Override
+  protected final void preTearDownCacheTestCase() throws Exception
   {
     // close client
     client.invoke(Bug36853EventsExpiryDUnitTest.class, "closeCache");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
index 6278d9e..66f1a11 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
@@ -39,8 +39,12 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 public class Bug48571DUnitTest extends DistributedTestCase {
 
@@ -65,7 +69,8 @@ public class Bug48571DUnitTest extends DistributedTestCase {
     client = host.getVM(1);
   }
   
-  public void tearDown2() throws Exception {
+  @Override
+  protected final void preTearDown() throws Exception {
     reset();
     server.invoke(Bug48571DUnitTest.class, "reset");
     client.invoke(Bug48571DUnitTest.class, "reset");
@@ -83,7 +88,7 @@ public class Bug48571DUnitTest extends DistributedTestCase {
   }
 
   public void testStatsMatchWithSize() throws Exception {
-    addExpectedException("Unexpected IOException||Connection reset");
+    IgnoredException.addIgnoredException("Unexpected IOException||Connection reset");
     // start a server
     int port = (Integer) server.invoke(Bug48571DUnitTest.class, "createServerCache");
     // create durable client, with durable RI
@@ -105,7 +110,7 @@ public class Bug48571DUnitTest extends DistributedTestCase {
 
   public static int createServerCache() throws Exception {
     Properties props = new Properties();
-    props.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+    props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
     props.setProperty("log-file", "server_" + OSProcess.getId() + ".log");
     props.setProperty("log-level", "info");
     props.setProperty("statistic-archive-file", "server_" + OSProcess.getId()
@@ -239,7 +244,7 @@ public class Bug48571DUnitTest extends DistributedTestCase {
         return "Did not receive last key.";
       }
     };
-    DistributedTestCase.waitForCriterion(wc, 60*1000, 500, true);
+    Wait.waitForCriterion(wc, 60*1000, 500, true);
   }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
index 0457ce1..c7ff13a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
@@ -67,7 +67,8 @@ public class Bug48879DUnitTest extends DistributedTestCase {
     createClientCache(host, new Integer[] {port0, port1}, Boolean.TRUE);
   }
 
-  public void tearDown2() throws Exception {
+  @Override
+  protected final void preTearDown() throws Exception {
     closeCache();
 
     vm0.invoke(Bug48879DUnitTest.class, "closeCache");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
index fe1edb0..086b956 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
@@ -43,6 +43,8 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl;
 import com.gemstone.gemfire.internal.cache.EventID;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.cache.client.internal.ServerRegionProxy;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -173,9 +175,9 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
         "createServerCache")).intValue();
 
     client1.invoke(EventIdOptimizationDUnitTest.class, "createClientCache1",
-        new Object[] { getServerHostName(host), new Integer(PORT1) });
+        new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT1) });
     client2.invoke(EventIdOptimizationDUnitTest.class, "createClientCache2",
-        new Object[] { getServerHostName(host), new Integer(PORT2) });
+        new Object[] { NetworkUtils.getServerHostName(host), new Integer(PORT2) });
 
   }
 
@@ -452,7 +454,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
       synchronized (EventIdOptimizationDUnitTest.class) {
         if (!proceedForValidation)
           try {
-            getLogWriter().info(
+            LogWriterUtils.getLogWriter().info(
                 "Client2 going in wait before starting validation");
             EventIdOptimizationDUnitTest.class.wait();
           }
@@ -461,12 +463,12 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
           }
       }
     }
-    getLogWriter().info("Starting validation on client2");
+    LogWriterUtils.getLogWriter().info("Starting validation on client2");
     if (validationFailed) {
       fail("\n The following eventIds recieved by client2 were not present in the eventId array sent by client1 \n"
           + failureMsg);
     }
-    getLogWriter().info("Validation complete on client2, goin to unregister listeners");
+    LogWriterUtils.getLogWriter().info("Validation complete on client2, goin to unregister listeners");
     
     Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     if (region != null && !region.isDestroyed()) {
@@ -490,7 +492,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
       }
     }
     
-    getLogWriter().info("Test completed, Unregistered the listeners");
+    LogWriterUtils.getLogWriter().info("Test completed, Unregistered the listeners");
   }
 
   /**
@@ -508,15 +510,14 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
   /**
    * Closes the caches on clients and servers
    */
-  public void tearDown2() throws Exception
-  {
+  @Override
+  protected final void preTearDown() throws Exception {
     // close client
     client1.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
     client2.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
     // close server
     server1.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
     server2.invoke(EventIdOptimizationDUnitTest.class, "closeCache");
-
   }
 
   /**
@@ -570,7 +571,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
         && (eventIdAtClient2.getSequenceID() == eventIdForLastKey
             .getSequenceID())) {
       synchronized (EventIdOptimizationDUnitTest.class) {
-        getLogWriter().info("Notifying client2 to proceed for validation");
+        LogWriterUtils.getLogWriter().info("Notifying client2 to proceed for validation");
         proceedForValidation = true;
         EventIdOptimizationDUnitTest.class.notify();
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
index fa07821..1119313 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
@@ -39,9 +39,13 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
 import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
+import com.gemstone.gemfire.test.dunit.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.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 
@@ -86,7 +90,7 @@ public class FailoverDUnitTest extends DistributedTestCase
     PORT2 =  ((Integer)vm1.invoke(FailoverDUnitTest.class, "createServerCache" )).intValue();
 
     CacheServerTestUtil.disableShufflingOfEndpoints();
-    createClientCache(getServerHostName(host), new Integer(PORT1),new Integer(PORT2));
+    createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2));
     { // calculate the primary vm
       waitForPrimaryAndBackups(1);
       PoolImpl pool = (PoolImpl)PoolManager.find("FailoverPool");
@@ -188,7 +192,7 @@ public class FailoverDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 20 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 20 * 1000, 200, true);
     assertNotNull(pool.getPrimary());
     assertTrue("backups="+pool.getRedundants() + " expected=" + numBackups,
                pool.getRedundants().size() >= numBackups);
@@ -206,7 +210,7 @@ public class FailoverDUnitTest extends DistributedTestCase
       r.registerInterest("key-5");
     }
     catch (Exception ex) {
-      fail("failed while registering keys k1 to k5", ex);
+      Assert.fail("failed while registering keys k1 to k5", ex);
     }
   }
 
@@ -224,7 +228,7 @@ public class FailoverDUnitTest extends DistributedTestCase
       r.create("key-5", "key-5");
     }
     catch (Exception ex) {
-      fail("failed while createEntries()", ex);
+      Assert.fail("failed while createEntries()", ex);
     }
   }
 
@@ -255,7 +259,7 @@ public class FailoverDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while r.put()", ex);
+      Assert.fail("failed while r.put()", ex);
     }
   }
 
@@ -271,7 +275,7 @@ public class FailoverDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 20 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 20 * 1000, 200, true);
 
     assertEquals("value-1", r.getEntry("key-1").getValue());
     assertEquals("value-2", r.getEntry("key-2").getValue());
@@ -298,7 +302,7 @@ public class FailoverDUnitTest extends DistributedTestCase
 
     }
     catch (Exception ex) {
-      fail("failed while r.putDuringFailover()", ex);
+      Assert.fail("failed while r.putDuringFailover()", ex);
     }
   }
 
@@ -314,15 +318,14 @@ public class FailoverDUnitTest extends DistributedTestCase
         return null;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 20 * 1000, 200, true);
+    Wait.waitForCriterion(ev, 20 * 1000, 200, true);
     assertEquals("value-5", r.getEntry("key-5").getValue());
     assertEquals("value-4", r.getEntry("key-4").getValue());
   }
 
 
-  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/ha/HABugInPutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
index c356816..02cd880 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
@@ -36,6 +36,7 @@ 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;
 
 /**
@@ -96,22 +97,20 @@ public class HABugInPutDUnitTest extends DistributedTestCase
         .intValue();
 
     client1.invoke(HABugInPutDUnitTest.class, "createClientCache", new Object[] {
-        getServerHostName(host), new Integer(PORT1), new Integer(PORT2) });
+        NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) });
     client2.invoke(HABugInPutDUnitTest.class, "createClientCache", new Object[] {
-        getServerHostName(host), new Integer(PORT1), new Integer(PORT2) });
+        NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) });
     //Boolean.getBoolean("")
 
   }
 
-  public void tearDown2() throws Exception
-  {
-	super.tearDown2();
+  @Override
+  protected final void preTearDown() throws Exception {
     client1.invoke(HABugInPutDUnitTest.class, "closeCache");
     client2.invoke(HABugInPutDUnitTest.class, "closeCache");
     // close server
     server1.invoke(HABugInPutDUnitTest.class, "closeCache");
     server2.invoke(HABugInPutDUnitTest.class, "closeCache");
-
   }
 
   public static void closeCache()


Mime
View raw message