geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [08/44] incubator-geode git commit: Refactor dunit
Date Tue, 02 Feb 2016 20:21:15 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
index 8f3c260..dcb5d25 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
@@ -35,8 +35,12 @@ import com.gemstone.gemfire.cache.query.internal.cq.InternalCqQuery;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * This class tests the ContiunousQuery mechanism in GemFire.
@@ -58,7 +62,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     // avoid IllegalStateException from HandShake by connecting all vms to
     // system before creating pool
     getSystem();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         getSystem();
       }
@@ -74,7 +78,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
       final int cqListenerInvocations) {
     vm.invoke(new CacheSerializableRunnable("Validate CQs") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ Stats. ### " + cqName);
+        LogWriterSupport.getLogWriter().info("### Validating CQ Stats. ### " + cqName);
 //      Get CQ Service.
         QueryService qService = null;
         try {          
@@ -157,7 +161,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
       final int clientsWithCqs) {
     vm.invoke(new CacheSerializableRunnable("Validate CQ Service Stats") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ Service Stats. ### ");
+        LogWriterSupport.getLogWriter().info("### Validating CQ Service Stats. ### ");
 //      Get CQ Service.
         QueryService qService = null;
         try {          
@@ -245,7 +249,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client, port, host0);
     
     /* Create CQs. */
@@ -272,7 +276,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     cqDUnitTest.createValues(server, cqDUnitTest.regions[0], 200);
     // Wait for client to Synch.
     cqDUnitTest.waitForCreated(client, "testCQStatistics_0", CqQueryDUnitTest.KEY+200);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     size = 200;
     
     // validate CQs.
@@ -296,7 +300,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     // Wait for client to Synch.
     cqDUnitTest.waitForDestroyed(client, "testCQStatistics_0", CqQueryDUnitTest.KEY+100);
     size = 10;
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     cqDUnitTest.validateCQ(client, "testCQStatistics_0",
         /* resultSize: */ CqQueryDUnitTest.noTest,
@@ -315,7 +319,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     // Test  CQ Close
     cqDUnitTest.closeCQ(client, "testCQStatistics_0");
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Close.
     cqDUnitTest.closeClient(client);
@@ -336,7 +340,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client1, port, host0);
     cqDUnitTest.createClient(client2, port, host0);
     
@@ -345,7 +349,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     String cqName10 = new String("testCQServiceStatistics_10");   
     cqDUnitTest.createCQ(client1, cqName, cqDUnitTest.cqs[0]);
     cqDUnitTest.createCQ(client2, cqName10, cqDUnitTest.cqs[2]); 
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on clients: #1");
     validateCQServiceStats(client1, 1, 0, 1, 0, 1, 1, CqQueryDUnitTest.noTest);
@@ -353,7 +357,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     cqDUnitTest.executeCQ(client1, cqName, false, null);
     cqDUnitTest.executeCQ(client2, cqName10, false, null);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     getCache().getLogger().info("Validating CQ Service stats on clients: #2");
     validateCQServiceStats(client1, 1, 1, 0, 0, 1, 1, CqQueryDUnitTest.noTest);
@@ -378,7 +382,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on clients: #3");
@@ -391,7 +395,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     //Create CQs with no name, execute, and close. 
     cqDUnitTest.createAndExecCQNoName(client1, cqDUnitTest.cqs[0]); 
-    pause(PAUSE);      
+    Wait.pause(PAUSE);      
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #4");
@@ -402,7 +406,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     // Test  CQ Close
     cqDUnitTest.closeCQ(client1, cqName);
-    pause(PAUSE);      
+    Wait.pause(PAUSE);      
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #5");
@@ -413,7 +417,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     //Test stop CQ
     cqDUnitTest.stopCQ(client2, cqName10);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #6");
@@ -423,7 +427,7 @@ public class CqStatsDUnitTest extends CacheTestCase {
     
     // Test  CQ Close
     cqDUnitTest.closeCQ(client2, cqName10);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #7");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
index 987a70a..e02e3b4 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
@@ -18,6 +18,7 @@ package com.gemstone.gemfire.cache.query.cq.dunit;
 
 import com.gemstone.gemfire.cache.query.internal.cq.CqService;
 import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
 /**
@@ -31,7 +32,7 @@ public class CqStatsOptimizedExecuteDUnitTest extends CqStatsDUnitTest{
 
   public void setUp() throws Exception {
     super.setUp();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
       }
@@ -40,7 +41,7 @@ public class CqStatsOptimizedExecuteDUnitTest extends CqStatsDUnitTest{
   
   @Override
   public void tearDown2() throws Exception {
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
index 1210426..305b8e6 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
@@ -35,8 +35,12 @@ import com.gemstone.gemfire.cache.query.internal.cq.InternalCqQuery;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * This class tests the ContiunousQuery mechanism in GemFire.
@@ -58,7 +62,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     // avoid IllegalStateException from HandShake by connecting all vms to
     // system before creating pool
     getSystem();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         getSystem();
       }
@@ -74,7 +78,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
       final int cqListenerInvocations) {
     vm.invoke(new CacheSerializableRunnable("Validate CQs") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ Stats. ### " + cqName);
+        LogWriterSupport.getLogWriter().info("### Validating CQ Stats. ### " + cqName);
 //      Get CQ Service.
         QueryService qService = null;
         try {          
@@ -157,7 +161,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
       final int clientsWithCqs) {
     vm.invoke(new CacheSerializableRunnable("Validate CQ Service Stats") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ Service Stats. ### ");
+        LogWriterSupport.getLogWriter().info("### Validating CQ Service Stats. ### ");
 //      Get CQ Service.
         QueryService qService = null;
         try {          
@@ -245,7 +249,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
     
     String poolName = "testCQStatistics";
     cqDUnitTest.createPool(client, poolName, host0, port);
@@ -276,7 +280,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createValues(server, cqDUnitTest.regions[0], 200);
     // Wait for client to Synch.
     cqDUnitTest.waitForCreated(client, "testCQStatistics_0", CqQueryUsingPoolDUnitTest.KEY+200);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     size = 200;
     
     // validate CQs.
@@ -300,7 +304,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     // Wait for client to Synch.
     cqDUnitTest.waitForDestroyed(client, "testCQStatistics_0", CqQueryUsingPoolDUnitTest.KEY+100);
     size = 10;
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     cqDUnitTest.validateCQ(client, "testCQStatistics_0",
         /* resultSize: */ CqQueryUsingPoolDUnitTest.noTest,
@@ -319,7 +323,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     // Test  CQ Close
     cqDUnitTest.closeCQ(client, "testCQStatistics_0");
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Close.
     cqDUnitTest.closeClient(client);
@@ -340,7 +344,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     /* Init Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
     
     String poolName1 = "testCQServiceStatistics1";
     String poolName2 = "testCQServiceStatistics2";
@@ -356,7 +360,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     String cqName10 = new String("testCQServiceStatistics_10");   
     cqDUnitTest.createCQ(client1, poolName1, cqName, cqDUnitTest.cqs[0]);
     cqDUnitTest.createCQ(client2, poolName2, cqName10, cqDUnitTest.cqs[2]); 
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on clients: #1");
     validateCQServiceStats(client1, 1, 0, 1, 0, 1, 1, CqQueryUsingPoolDUnitTest.noTest);
@@ -364,7 +368,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.executeCQ(client1, cqName, false, null);
     cqDUnitTest.executeCQ(client2, cqName10, false, null);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     getCache().getLogger().info("Validating CQ Service stats on clients: #2");
     validateCQServiceStats(client1, 1, 1, 0, 0, 1, 1, CqQueryUsingPoolDUnitTest.noTest);
@@ -389,7 +393,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
         /* queryUpdates: */ 0,
         /* queryDeletes: */ 0,
         /* totalEvents: */ size);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on clients: #3");
@@ -402,7 +406,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     //Create CQs with no name, execute, and close. 
     cqDUnitTest.createAndExecCQNoName(client1, poolName1, cqDUnitTest.cqs[0]); 
-    pause(PAUSE);      
+    Wait.pause(PAUSE);      
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #4");
@@ -413,7 +417,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     // Test  CQ Close
     cqDUnitTest.closeCQ(client1, cqName);
-    pause(PAUSE);      
+    Wait.pause(PAUSE);      
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #5");
@@ -424,7 +428,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     //Test stop CQ
     cqDUnitTest.stopCQ(client2, cqName10);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #6");
@@ -434,7 +438,7 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
     
     // Test  CQ Close
     cqDUnitTest.closeCQ(client2, cqName10);
-    pause(PAUSE);
+    Wait.pause(PAUSE);
     
     // Test CQ Service stats
     getCache().getLogger().info("Validating CQ Service stats on client: #7");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
index 95eb789..fc1fc04 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
@@ -18,6 +18,7 @@ package com.gemstone.gemfire.cache.query.cq.dunit;
 
 import com.gemstone.gemfire.cache.query.internal.cq.CqService;
 import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
 /**
@@ -31,7 +32,7 @@ public class CqStatsUsingPoolOptimizedExecuteDUnitTest extends CqStatsUsingPoolD
 
   public void setUp() throws Exception {
     super.setUp();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
       }
@@ -40,7 +41,7 @@ public class CqStatsUsingPoolOptimizedExecuteDUnitTest extends CqStatsUsingPoolD
   
   @Override
   public void tearDown2() throws Exception {
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqTimeTestListener.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqTimeTestListener.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqTimeTestListener.java
index 23d0728..4edc4a8 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqTimeTestListener.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqTimeTestListener.java
@@ -25,8 +25,8 @@ import com.gemstone.gemfire.cache.Operation;
 import com.gemstone.gemfire.cache.query.CqEvent;
 import com.gemstone.gemfire.cache.query.CqListener;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
-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;
 
 /**
  * @author anil.
@@ -198,7 +198,7 @@ public class CqTimeTestListener implements CqListener {
         return "never got create event for CQ " + CqTimeTestListener.this.cqName;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
     return true;
   }
   
@@ -211,7 +211,7 @@ public class CqTimeTestListener implements CqListener {
         return "never got destroy event for CQ " + CqTimeTestListener.this.cqName;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
     return true;
   }
   
@@ -224,7 +224,7 @@ public class CqTimeTestListener implements CqListener {
         return "never got invalidate event for CQ " + CqTimeTestListener.this.cqName;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
     return true;
   }
   
@@ -237,7 +237,7 @@ public class CqTimeTestListener implements CqListener {
         return "never got update event for CQ " + CqTimeTestListener.this.cqName;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
     return true;
   }
 
@@ -250,7 +250,7 @@ public class CqTimeTestListener implements CqListener {
         return "never got close event for CQ " + CqTimeTestListener.this.cqName;
       }
     };
-    DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
     return true;
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
index 360c0d9..3585de2 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
@@ -46,9 +46,13 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 /**
  * Test class for Partitioned Region and CQs
  * 
@@ -125,14 +129,14 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     
     // register cq.
     createCQ(client, "testCQEvents_0", cqs[0]);
     cqHelper.executeCQ(client, "testCQEvents_0", false, null);
-    pause(2 * 1000);
+    Wait.pause(2 * 1000);
     
     // create values
     int size = 40;
@@ -162,7 +166,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     server1.bounce();
     
     cqHelper.closeClient(client);
-    pause(10 * 1000);
+    Wait.pause(10 * 1000);
     //cc1 = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCqCountFromRegionProfile");
     cc2 = server2.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCqCountFromRegionProfile");
     
@@ -187,14 +191,14 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     
     // register cq.
     createCQ(client, "testCQEvents_0", cqs[0]);
     cqHelper.executeCQ(client, "testCQEvents_0", false, null);
-    pause(2 * 1000);
+    Wait.pause(2 * 1000);
     
     // create values
     int size = 40;
@@ -300,7 +304,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     
@@ -391,7 +395,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // creating an accessor vm with Bridge Server installed.
     createServer(server1);
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     
@@ -489,7 +493,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server2.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server2.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server2.getHost());
     
     createClient(client, port, host0);
     
@@ -584,7 +588,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     
@@ -680,7 +684,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     
@@ -776,7 +780,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     createClient(client2, port, host0);
@@ -875,10 +879,10 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server2, false , 1);
     
     // Wait for server to initialize.
-    pause(2000);
+    Wait.pause(2000);
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     createClient(client2, port, host0);
@@ -1019,7 +1023,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     createClient(client, port, host0);
     createClient(client2, port, host0);
@@ -1237,7 +1241,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServer(server2);
     
     final int port = server1.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     // Initialize Client.
     createClient(client, port, host0);
@@ -1370,7 +1374,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     createServerWithoutRootRegion(server, 0, false, 0);
     
     final int port = server.invokeInt(PartitionedRegionCqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
     
     // Initialize Client.
     createCacheClient(client1, port, host0);
@@ -1435,7 +1439,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           // REGION NULL
           Log.getLogWriter().info("Local region is NOT null in client 1");
           
-          pause(5*1000);
+          Wait.pause(5*1000);
           CqQuery[] cqs = getCache().getQueryService().getCqs();
           if (cqs != null && cqs.length > 0) {
             assertTrue(cqs[0].isClosed());
@@ -1495,7 +1499,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         "Create Cache Server") {
       public void run2() throws CacheException
       {
-          getLogWriter().info("### Create Cache Server. ###");
+          LogWriterSupport.getLogWriter().info("### Create Cache Server. ###");
           //AttributesFactory factory = new AttributesFactory();
           //factory.setScope(Scope.DISTRIBUTED_ACK);
           //factory.setMirrorType(MirrorType.KEYS_VALUES);
@@ -1514,14 +1518,14 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
           for (int i = 0; i < regions.length; i++) {
             Region r = createRegion(regions[i], attr.create());
-            getLogWriter().info("Server created the region: "+r);
+            LogWriterSupport.getLogWriter().info("Server created the region: "+r);
           }
 //          pause(2000);
           try {
             startBridgeServer(port, true);
           }
           catch (Exception ex) {
-            fail("While starting CacheServer", ex);
+            Assert.fail("While starting CacheServer", ex);
           }
 //          pause(2000);
        
@@ -1544,7 +1548,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         "Create Cache Server") {
       public void run2() throws CacheException
       {
-          getLogWriter().info("### Create Cache Server. ###");
+          LogWriterSupport.getLogWriter().info("### Create Cache Server. ###");
           //AttributesFactory factory = new AttributesFactory();
           //factory.setScope(Scope.DISTRIBUTED_ACK);
           //factory.setMirrorType(MirrorType.KEYS_VALUES);
@@ -1563,14 +1567,14 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
           //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
           for (int i = 0; i < regions.length; i++) {
             Region r = createRegionWithoutRoot(regions[i], attr.create());
-            getLogWriter().info("Server created the region: "+r);
+            LogWriterSupport.getLogWriter().info("Server created the region: "+r);
           }
 //          pause(2000);
           try {
             startBridgeServer(port, true);
           }
           catch (Exception ex) {
-            fail("While starting CacheServer", ex);
+            Assert.fail("While starting CacheServer", ex);
           }
 //          pause(2000);
       }
@@ -1614,8 +1618,8 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
     SerializableRunnable createQService =
       new CacheSerializableRunnable("Create Client") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create Client. ###");
-        getLogWriter().info(
+        LogWriterSupport.getLogWriter().info("### Create Client. ###");
+        LogWriterSupport.getLogWriter().info(
             "Will connect to server at por: " + serverPorts[0] + " and at host : "
              + serverHost);
         //Region region1 = null;
@@ -1638,7 +1642,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         
         for (int i=0; i < regions.length; i++) {        
           Region clientRegion = createRegion(regions[i], regionFactory.createRegionAttributes());
-          getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
+          LogWriterSupport.getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
           //region1.getAttributesMutator().setCacheListener(new CqListener());
         }
       }
@@ -1654,7 +1658,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         //getLogWriter().info("### DEBUG CREATE CQ START ####");
         //pause(20 * 1000);
         
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterSupport.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {
@@ -1665,7 +1669,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         }
         // Create CQ Attributes.
         CqAttributesFactory cqf = new CqAttributesFactory();
-        CqListener[] cqListeners = {new CqQueryTestListener(getLogWriter())};
+        CqListener[] cqListeners = {new CqQueryTestListener(LogWriterSupport.getLogWriter())};
         ((CqQueryTestListener)cqListeners[0]).cqName = cqName;
         
         cqf.initCqListeners(cqListeners);
@@ -1675,11 +1679,11 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         try {
           CqQuery cq1 = cqService.newCq(cqName, queryStr, cqa);
           assertTrue("newCq() state mismatch", cq1.getState().isStopped());
-          getLogWriter().info("Created a new CqQuery : "+cq1);
+          LogWriterSupport.getLogWriter().info("Created a new CqQuery : "+cq1);
         } catch (Exception ex){
           AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
           err.initCause(ex);
-          getLogWriter().info("CqService is :" + cqService, err);
+          LogWriterSupport.getLogWriter().info("CqService is :" + cqService, err);
           throw err;
         }
       }
@@ -1718,7 +1722,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         for (int i = 1; i <= size; i++) {
           region1.put(KEY+i, new Portfolio(i));
         }
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
   }
@@ -1745,13 +1749,13 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
   public void createCacheClient(VM vm, final String[] serverHosts, final int[] serverPorts, final String redundancyLevel) {
     vm.invoke(new CacheSerializableRunnable("createCacheClient") {
       public void run2() throws CacheException {
-        getLogWriter().info(
+        LogWriterSupport.getLogWriter().info(
             "Will connect to server at por: " + serverPorts[0] + " and at host : "
              + serverHosts[0]);
         ClientCacheFactory ccf = new ClientCacheFactory();
         ccf.addPoolServer(serverHosts[0]/*getServerHostName(Host.getHost(0))*/, serverPorts[0]);
         ccf.setPoolSubscriptionEnabled(true);
-        ccf.set("log-level", getDUnitLogLevel());
+        ccf.set("log-level", LogWriterSupport.getDUnitLogLevel());
         
         // Create Client Cache.
         getClientCache(ccf);
@@ -1777,7 +1781,7 @@ public class PartitionedRegionCqQueryDUnitTest extends CacheTestCase {
         for (int i=0; i < regions.length; i++) {        
           Region clientRegion = ((ClientCache)getCache()).createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
           .create(regions[i]);
-          getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
+          LogWriterSupport.getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
           //region1.getAttributesMutator().setCacheListener(new CqListener());
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
index e5544b7..2990503 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
@@ -24,6 +24,9 @@ import com.gemstone.gemfire.cache.query.internal.cq.CqServiceProvider;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -35,7 +38,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
 
   public void setUp() throws Exception {
     super.setUp();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
       }
@@ -44,7 +47,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
   
   @Override
   public void tearDown2() throws Exception {
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
         CqServiceProvider.MAINTAIN_KEYS = true;
@@ -66,7 +69,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
 
     final int thePort = server.invokeInt(PartitionedRegionCqQueryOptimizedExecuteDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     // Create client.
     createClient(client, thePort, host0);
@@ -93,7 +96,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
         for (int i = numOfEntries+1; i <= numOfEntries*2; i++) {
           region1.put(KEY+i, new Portfolio(i));
         }
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
     
@@ -164,7 +167,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
 
     final int thePort = server.invokeInt(PartitionedRegionCqQueryDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     // Create client.
     createClient(client, thePort, host0);
@@ -192,7 +195,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
         for (int i = numOfEntries+1; i <= numOfEntries*2; i++) {
           region1.put(KEY+i, new Portfolio(i));
         }
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
index 80cd738..95dc532 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java
@@ -40,9 +40,13 @@ import com.gemstone.gemfire.cache.query.Struct;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 /**
@@ -117,7 +121,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     //createClient(client, port, host0);
     String poolName = "testCQAndPartitionedRegion";
@@ -232,7 +236,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     String poolName = "testPartitionedCqOnAccessorBridgeServer";
     createPool(client, poolName, host0, port);
@@ -326,7 +330,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // creating an accessor vm with Bridge Server installed.
     createServer(server1);
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     String poolName = "testPartitionedCqOnSingleBridgeServer";
     createPool(client, poolName, host0, port);
@@ -426,7 +430,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     // create client 
     
     final int port = server2.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server2.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server2.getHost());
     
     String poolName = "testPRCqOnSingleBridgeServerUpdatesOriginatingAtAccessor";
     createPool(client, poolName, host0, port);
@@ -524,7 +528,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
 
     String poolName = "testPRCqWithInvalidatesOnBridgeServer";
     createPool(client, poolName, host0, port);
@@ -624,7 +628,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     String poolName = "testPRCqWithInvalidatesOnAccessorBridgeServer";
     createPool(client, poolName, host0, port);
@@ -725,7 +729,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     String poolName1 = "testPRCqWithUpdatesFromClients1";
     createPool(client, poolName1, host0, port);
@@ -831,10 +835,10 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server2, false , 1);
 
     // Wait for server to initialize.
-    pause(2000);
+    Wait.pause(2000);
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
 
     String poolName1 = "testPRCqWithMultipleRegionsOnServer1";
     createPool(client, poolName1, host0, port);
@@ -977,10 +981,10 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server2, false , 1);
 
     // Wait for server to initialize.
-    pause(2000);
+    Wait.pause(2000);
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     String poolName1 = "testPRWithCQsAndProfileUpdates1";
     createPool(client, poolName1, host0, port);
@@ -1199,7 +1203,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     createServer(server2);
     
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
     
     String poolName1 = "testEventsDuringQueryExecution";
     createPool(client, poolName1, host0, port);
@@ -1333,7 +1337,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     final int size = 100;
 
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutalls";
     createPool(client, poolName, new String[]{host0}, new int[]{port});
@@ -1427,7 +1431,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     final int size = 100;
 
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutalls";
     createPool(client, poolName, new String[]{host0}, new int[]{port});
@@ -1529,7 +1533,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     final int size = 100;
 
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutallsTx";
     createPool(client, poolName, new String[]{host0}, new int[]{port});
@@ -1651,7 +1655,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     final int size = 100;
 
     final int port = server1.invokeInt(PrCqUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server1.getHost());
 
     String poolName = "testCQsWithPutallsTx";
     createPool(client, poolName, new String[]{host0}, new int[]{port});
@@ -1804,7 +1808,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         "Create Cache Server") {
       public void run2() throws CacheException
       {
-          getLogWriter().info("### Create Cache Server. ###");
+          LogWriterSupport.getLogWriter().info("### Create Cache Server. ###");
           //AttributesFactory factory = new AttributesFactory();
           //factory.setScope(Scope.DISTRIBUTED_ACK);
           //factory.setMirrorType(MirrorType.KEYS_VALUES);
@@ -1823,14 +1827,14 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
           //assertTrue(getSystem().getDistributionManager().getOtherDistributionManagerIds().size() > 0);
           for (int i = 0; i < regions.length; i++) {
             Region r = createRegion(regions[i], attr.create());
-            getLogWriter().info("Server created the region: "+r);
+            LogWriterSupport.getLogWriter().info("Server created the region: "+r);
           }
 //          pause(2000);
           try {
             startBridgeServer(port, true);
           }
           catch (Exception ex) {
-            fail("While starting CacheServer", ex);
+            Assert.fail("While starting CacheServer", ex);
           }
 //          pause(2000);
        
@@ -1881,7 +1885,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         } 
         
         for (int i=0; i < servers.length; i++){
-          getLogWriter().info("### Adding to Pool. ### Server : " + servers[i] + " Port : " + ports[i]);
+          LogWriterSupport.getLogWriter().info("### Adding to Pool. ### Server : " + servers[i] + " Port : " + ports[i]);
           cpf.addServer(servers[i], ports[i]);
         }
         
@@ -1902,8 +1906,8 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
     SerializableRunnable createQService =
       new CacheSerializableRunnable("Create Client") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create Client. ###");
-        getLogWriter().info(
+        LogWriterSupport.getLogWriter().info("### Create Client. ###");
+        LogWriterSupport.getLogWriter().info(
             "Will connect to server at por: " + serverPorts[0] + " and at host : "
              + serverHost);
         //Region region1 = null;
@@ -1926,7 +1930,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         
         for (int i=0; i < regions.length; i++) {        
           Region clientRegion = createRegion(regions[i], regionFactory.createRegionAttributes());
-          getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
+          LogWriterSupport.getLogWriter().info("### Successfully Created Region on Client :" + clientRegion);
           //region1.getAttributesMutator().setCacheListener(new CqListener());
         }
       }
@@ -1942,7 +1946,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         //getLogWriter().info("### DEBUG CREATE CQ START ####");
         //pause(20 * 1000);
         
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterSupport.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {
@@ -1953,7 +1957,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         }
         // Create CQ Attributes.
         CqAttributesFactory cqf = new CqAttributesFactory();
-        CqListener[] cqListeners = {new CqQueryTestListener(getLogWriter())};
+        CqListener[] cqListeners = {new CqQueryTestListener(LogWriterSupport.getLogWriter())};
         ((CqQueryTestListener)cqListeners[0]).cqName = cqName;
         
         cqf.initCqListeners(cqListeners);
@@ -1963,11 +1967,11 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         try {
           CqQuery cq1 = cqService.newCq(cqName, queryStr, cqa);
           assertTrue("newCq() state mismatch", cq1.getState().isStopped());
-          getLogWriter().info("Created a new CqQuery : "+cq1);
+          LogWriterSupport.getLogWriter().info("Created a new CqQuery : "+cq1);
         } catch (Exception ex){
           AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
           err.initCause(ex);
-          getLogWriter().info("CqService is :" + cqService, err);
+          LogWriterSupport.getLogWriter().info("CqService is :" + cqService, err);
           throw err;
         }
       }
@@ -1987,7 +1991,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
         for (int i = 1; i <= size; i++) {
           region1.put(KEY+i, new Portfolio(i));
         }
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
   }
@@ -2001,7 +2005,7 @@ public class PrCqUsingPoolDUnitTest extends CacheTestCase {
           m.put(KEY+i, new Portfolio(i));
         }
         region1.putAll(m);
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
index 5db4b22..9ebc396 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
@@ -17,6 +17,7 @@
 package com.gemstone.gemfire.cache.query.cq.dunit;
 
 import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
 /**
@@ -31,7 +32,7 @@ public class PrCqUsingPoolOptimizedExecuteDUnitTest extends PrCqUsingPoolDUnitTe
 
   public void setUp() throws Exception {
     super.setUp();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
       }
@@ -40,7 +41,7 @@ public class PrCqUsingPoolOptimizedExecuteDUnitTest extends PrCqUsingPoolDUnitTe
   
   @Override
   public void tearDown2() throws Exception {
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
index 8abed40..eb81ce2 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQDUnitTest.java
@@ -36,9 +36,13 @@ import com.gemstone.gemfire.cache.query.cq.dunit.CqQueryTestListener;
 import com.gemstone.gemfire.cache.query.dunit.PdxQueryCQTestBase.TestObject;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 
 
@@ -84,7 +88,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     final int port0 = vm0.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
     final int port1 = vm1.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
 
-    final String host0 = getServerHostName(vm0.getHost());
+    final String host0 = NetworkSupport.getServerHostName(vm0.getHost());
 
     // Create client pool.
     final String poolName = "testCqPool"; 
@@ -95,17 +99,17 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     // Execute CQ
     SerializableRunnable executeCq = new CacheSerializableRunnable("Execute queries") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterSupport.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService qService = null;
         try {
           qService = (PoolManager.find(poolName)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         // Create CQ Attributes.
         CqAttributesFactory cqf = new CqAttributesFactory();
-        CqListener[] cqListeners = {new CqQueryTestListener(getLogWriter())};
+        CqListener[] cqListeners = {new CqQueryTestListener(LogWriterSupport.getLogWriter())};
         ((CqQueryTestListener)cqListeners[0]).cqName = cqName;
 
         cqf.initCqListeners(cqListeners);
@@ -125,7 +129,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
         } catch (Exception ex){
           AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
           err.initCause(ex);
-          getLogWriter().info("QueryService is :" + qService, err);
+          LogWriterSupport.getLogWriter().info("QueryService is :" + qService, err);
           throw err;
         }
       }
@@ -164,13 +168,13 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
 
     SerializableRunnable validateCq = new CacheSerializableRunnable("Validate CQs") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ. ### " + cqName);
+        LogWriterSupport.getLogWriter().info("### Validating CQ. ### " + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {          
           cqService = getCache().getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         
         CqQuery cQuery = cqService.getCq(cqName);
@@ -183,7 +187,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
         final CqQueryTestListener listener = (CqQueryTestListener) cqListeners[0];
         
         //Wait for the events to show up on the client.
-        waitForCriterion(new WaitCriterion() {
+        Wait.waitForCriterion(new WaitCriterion() {
           
           public boolean done() {
             return listener.getTotalEventCount() >= (numberOfEntries * 2 - queryLimit);
@@ -265,7 +269,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     final int port0 = vm0.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
     final int port1 = vm1.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
 
-    final String host0 = getServerHostName(vm0.getHost());
+    final String host0 = NetworkSupport.getServerHostName(vm0.getHost());
 
     // Create client pool.
     final String poolName = "testCqPool"; 
@@ -314,18 +318,18 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
         }
         region.registerInterest(list);
         
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterSupport.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService qService = null;
         try {
           qService = (PoolManager.find(poolName)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         // Create CQ Attributes.
         for (int i=0; i < queries.length; i++) {
           CqAttributesFactory cqf = new CqAttributesFactory();
-          CqListener[] cqListeners = {new CqQueryTestListener(getLogWriter())};
+          CqListener[] cqListeners = {new CqQueryTestListener(LogWriterSupport.getLogWriter())};
           ((CqQueryTestListener)cqListeners[0]).cqName = (cqName + i);
 
           cqf.initCqListeners(cqListeners);
@@ -345,7 +349,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
           } catch (Exception ex){
             AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
             err.initCause(ex);
-            getLogWriter().info("QueryService is :" + qService, err);
+            LogWriterSupport.getLogWriter().info("QueryService is :" + qService, err);
             throw err;
           }
         }
@@ -469,7 +473,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
     final int port1 = vm1.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
     final int port2 = vm2.invokeInt(PdxQueryCQTestBase.class, "getCacheServerPort");
     
-    final String host0 = getServerHostName(vm0.getHost());
+    final String host0 = NetworkSupport.getServerHostName(vm0.getHost());
 
     // Create client pool.
     final String poolName = "testCqPool";     
@@ -505,18 +509,18 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
         }
         region.registerInterest(list);
         
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterSupport.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService qService = null;
         try {
           qService = (PoolManager.find(poolName)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         // Create CQ Attributes.
         for (int i=0; i < queries.length; i++) {
           CqAttributesFactory cqf = new CqAttributesFactory();
-          CqListener[] cqListeners = {new CqQueryTestListener(getLogWriter())};
+          CqListener[] cqListeners = {new CqQueryTestListener(LogWriterSupport.getLogWriter())};
           ((CqQueryTestListener)cqListeners[0]).cqName = (cqName + i);
 
           cqf.initCqListeners(cqListeners);
@@ -536,7 +540,7 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
           } catch (Exception ex){
             AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
             err.initCause(ex);
-            getLogWriter().info("QueryService is :" + qService, err);
+            LogWriterSupport.getLogWriter().info("QueryService is :" + qService, err);
             throw err;
           }
         }
@@ -654,13 +658,13 @@ public class PdxQueryCQDUnitTest extends PdxQueryCQTestBase {
       final int updateEvents) {
         vm.invoke(new CacheSerializableRunnable("Validate CQs") {
           public void run2() throws CacheException {
-            getLogWriter().info("### Validating CQ. ### " + cqName);
+            LogWriterSupport.getLogWriter().info("### Validating CQ. ### " + cqName);
             // Get CQ Service.
             QueryService cqService = null;
               try {          
                 cqService = getCache().getQueryService();
               } catch (Exception cqe) {
-                fail("Failed to getCQService.", cqe);
+                Assert.fail("Failed to getCQService.", cqe);
               }
       
               CqQuery cQuery = cqService.getCq(cqName);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
index 3637dce..71fd4bc 100755
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
@@ -51,6 +51,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.pdx.PdxReader;
 import com.gemstone.gemfire.pdx.PdxSerializable;
 import com.gemstone.gemfire.pdx.PdxWriter;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
@@ -129,7 +130,7 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
             cpf.setSubscriptionEnabled(subscriptionEnabled);
             cpf.setSubscriptionRedundancy(redundancy);
             for (int i=0; i < servers.length; i++){
-              getLogWriter().info("### Adding to Pool. ### Server : " + servers[i] + " Port : " + ports[i]);
+              com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Adding to Pool. ### Server : " + servers[i] + " Port : " + ports[i]);
               cpf.addServer(servers[i], ports[i]);
             }
             cpf.create(poolName);
@@ -151,18 +152,18 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
           remoteQueryService = (PoolManager.find(poolName)).getQueryService();
           localQueryService = getCache().getQueryService();
         } catch (Exception e) {
-          fail("Failed to get QueryService.", e);
+          Assert.fail("Failed to get QueryService.", e);
         }          
   
         try {
-          getLogWriter().info("### Executing Query on server:" + queryStr);
+          com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Executing Query on server:" + queryStr);
           Query query = remoteQueryService.newQuery(queryStr);
           rs[0][0] = (SelectResults)query.execute();
           //printResults (rs[0][0], " ### Remote Query Results : ####");
-          getLogWriter().info("### Executing Query locally:" + queryStr);
+          com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Executing Query locally:" + queryStr);
           query = localQueryService.newQuery(queryStr);
           rs[0][1] = (SelectResults)query.execute();
-          getLogWriter().info("### Remote Query rs size: " + (rs[0][0]).size() + 
+          com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Remote Query rs size: " + (rs[0][0]).size() + 
               "Local Query rs size: " + (rs[0][1]).size());
           //printResults (rs[0][1], " ### Local Query Results : ####");
           // Compare local and remote query results.
@@ -171,7 +172,7 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
              fail("Local and Remote Query Results are not matching for query :" + queryStr);  
           }
         } catch (Exception e) {
-          fail("Failed executing " + queryStr, e);
+          Assert.fail("Failed executing " + queryStr, e);
         }
       }
     });
@@ -235,7 +236,7 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
         try {
           startBridgeServer(0, false);
         } catch (Exception ex) {
-          fail("While starting CacheServer", ex);
+          Assert.fail("While starting CacheServer", ex);
         }
       }
 
@@ -248,16 +249,16 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
     try {
       qService = (PoolManager.find(poolName)).getQueryService();
     } catch (Exception e) {
-      fail("Failed to get QueryService.", e);
+      Assert.fail("Failed to get QueryService.", e);
     }          
   
     for (int i=0; i < queryString.length; i++){
       try {
-        getLogWriter().info("### Executing Query :" + queryString[i]);
+        com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Executing Query :" + queryString[i]);
         Query query = qService.newQuery(queryString[i]);
         results = (SelectResults)query.execute(params[i]);
       } catch (Exception e) {
-        fail("Failed executing " + queryString[i], e);
+        Assert.fail("Failed executing " + queryString[i], e);
       }
     }        
   }
@@ -292,12 +293,12 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
     SerializableRunnable closeCache =
       new CacheSerializableRunnable("Close Client") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Close Client. ###");
+        com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Close Client. ###");
         try {
           closeCache();
           disconnectFromDS();
         } catch (Exception ex) {
-          getLogWriter().info("### Failed to get close client. ###");
+          com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("### Failed to get close client. ###");
         }
       }
     };
@@ -332,13 +333,13 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
     
     @Override
     public boolean equals(Object o){
-      getLogWriter().info("In TestObject2.equals() this: " + this + " other :" + o);
+      com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("In TestObject2.equals() this: " + this + " other :" + o);
       GemFireCacheImpl.getInstance().getLoggerI18n().fine("In TestObject2.equals() this: " + this + " other :" + o);
       TestObject2 other = (TestObject2)o;
       if (_id == other._id) {
         return true;
       } else {
-        getLogWriter().info("NOT EQUALS");  
+        com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("NOT EQUALS");  
         return false;
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
index a39f5e8..e1208da 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
@@ -40,9 +40,13 @@ import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
 import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
@@ -94,7 +98,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     // Init values at server. 
     final int size = 10;
@@ -112,7 +116,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.registerInterestList(client, cqDUnitTest.regions[0], 4, KEYS);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -140,7 +144,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     String poolName = "testClientIndexUpdateWithRegisterInterest";
     cqDUnitTest.createPool(client, poolName, host0, port);
@@ -155,7 +159,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.createValues(client, cqDUnitTest.regions[0], size, 1);
 
     //wait for index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
     //this.validateQueryOnIndex(client, incompleteQ+"p.getID() > 0", 10);
     
     this.validateQueryOnIndex(client, incompleteQ+"p.ID > 0", 10);
@@ -167,7 +171,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.registerInterestList(client, cqDUnitTest.regions[0], size, KEYS, 4 /*start index*/);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -191,7 +195,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     //Init values at server. 
     final int size = 10;
@@ -209,7 +213,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     cqDUnitTest.registerInterestListCQ(client, cqDUnitTest.regions[0], size, true);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -232,7 +236,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     //Init values at server. 
     final int size = 10;
@@ -250,7 +254,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.registerInterestList(client, cqDUnitTest.regions[0], 2, REGEX);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -279,7 +283,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     //Init values at server. 
     final int size = 1000;
@@ -336,7 +340,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     // Init values at server. 
     final int size = 10;
@@ -354,7 +358,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.registerInterestList(client, ROOT, size, 0);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -377,7 +381,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     // Init values at server. 
     final int size = 10;
@@ -395,7 +399,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.registerInterestList(client, ROOT, 4, KEYS);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -418,7 +422,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
     final int port = server.invokeInt(QueryIndexUpdateRIDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkSupport.getServerHostName(server.getHost());
 
     // Init values at server. 
     final int size = 10;
@@ -436,7 +440,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     this.registerInterestList(client, "root", 2, REGEX);
 
     //Wait for Index to get updated.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
 
     //This query execution should fail as it will run on client index and index are not updated just by registerInterest.
     //Validate query results.
@@ -465,7 +469,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           } else {
             region = getRootRegion().getSubregion(regionName);
           }
-          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(getLogWriter()));
+          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterSupport.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);
@@ -508,7 +512,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           } else {
             region = getRootRegion().getSubregion(regionName);
           }
-          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(getLogWriter()));
+          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterSupport.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);
@@ -544,7 +548,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
         "Create Cache Server") {
       public void run2() throws CacheException
       {
-        getLogWriter().info("### Create Cache Server. ###");
+        LogWriterSupport.getLogWriter().info("### Create Cache Server. ###");
         AttributesFactory factory = new AttributesFactory();
         factory.setMirrorType(MirrorType.KEYS_VALUES);
 
@@ -559,16 +563,16 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 
         
         
-        pause(2000);
+        Wait.pause(2000);
 
         try {
           startBridgeServer(thePort, true);
         }
 
         catch (Exception ex) {
-          fail("While starting CacheServer", ex);
+          Assert.fail("While starting CacheServer", ex);
         }
-        pause(2000);
+        Wait.pause(2000);
         
       }
     };
@@ -620,7 +624,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
 //          getLogWriter().info("### puting '"+KEY+i+"' in region " + region1);
           region1.put(KEY+i, new Portfolio((start != 0 ? start : 1) * i, i));
         }
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
   }
@@ -642,13 +646,13 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
     SerializableRunnable createQService =
       new CacheSerializableRunnable("Create Client") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create Client. ###");
+        LogWriterSupport.getLogWriter().info("### Create Client. ###");
         //Region region1 = null;
         // Initialize CQ Service.
         try {
           getCache().getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         
         AttributesFactory regionFactory = new AttributesFactory();
@@ -665,7 +669,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
         }
                
           createRootRegion(regionFactory.createRegionAttributes());
-          getLogWriter().info("### Successfully Created Root Region on Client");
+          LogWriterSupport.getLogWriter().info("### Successfully Created Root Region on Client");
       }
     };
     
@@ -686,7 +690,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
   public void validateQueryOnIndexWithRegion(VM vm, final String query, final int resultSize, final String region) {
     vm.invoke(new CacheSerializableRunnable("Validate Query") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating Query. ###");
+        LogWriterSupport.getLogWriter().info("### Validating Query. ###");
         QueryService qs = getCache().getQueryService();
         
         Query q = qs.newQuery(query);
@@ -697,7 +701,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           Object r = q.execute();
           if(r instanceof SelectResults){
             int rSize = ((SelectResults)r).asSet().size();
-            getLogWriter().info("### Result Size is :" + rSize);
+            LogWriterSupport.getLogWriter().info("### Result Size is :" + rSize);
             
             if(region == null) {
               assertEquals(resultSize, rSize);
@@ -715,7 +719,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           }
         }
         catch (Exception e) {
-          fail("Failed to execute the query.", e);
+          Assert.fail("Failed to execute the query.", e);
         }
         if(!observer.isIndexesUsed) {
           fail("Index not used for query");
@@ -727,7 +731,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
   public void asyncClearRegion(VM vm, final String regionName){
     vm.invokeAsync(new CacheSerializableRunnable("Destroy entries") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Clearing Region. ###");
+        LogWriterSupport.getLogWriter().info("### Clearing Region. ###");
         Region region1;
         if(!"root".equals(regionName)){
           region1 = getRootRegion().getSubregion(regionName);
@@ -735,7 +739,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           region1 = getRootRegion();
         }
         region1.clear();
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     });
   }
@@ -743,7 +747,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
   private SerializableRunnable getSRClearRegion(final String regionName) {
     SerializableRunnable sr = new CacheSerializableRunnable("Destroy entries") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Clearing Region. ###");
+        LogWriterSupport.getLogWriter().info("### Clearing Region. ###");
         Region region1;
         if(!"root".equals(regionName)){
           region1 = getRootRegion().getSubregion(regionName);
@@ -751,7 +755,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           region1 = getRootRegion();
         }
         region1.clear();
-        getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
+        LogWriterSupport.getLogWriter().info("### Number of Entries in Region :" + region1.keys().size());
       }
     };
     return sr;
@@ -770,7 +774,7 @@ public class QueryIndexUpdateRIDUnitTest extends CacheTestCase{
           } else {
             region = getRootRegion().getSubregion(regionName);
           }
-          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(getLogWriter()));
+          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterSupport.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);


Mime
View raw message