geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [10/61] [abbrv] [partial] incubator-geode git commit: GEODE-773: Extract static methods from DistributedTestCase
Date Thu, 11 Feb 2016 00:38:44 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
index 5feb1b5..82d6279 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
@@ -57,10 +57,17 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 import com.gemstone.gemfire.test.dunit.Host;
+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.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * This class tests the ContiunousQuery mechanism in GemFire.
@@ -81,7 +88,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // avoid IllegalStateException from HandShake by connecting all vms tor
     // system before creating ConnectionPools
     getSystem();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         getSystem();
       }
@@ -107,7 +114,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
 
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testClientWithFeederAndCQ";
     cqDUnitTest.createPool(client, poolName, host0, port);
@@ -154,7 +161,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server1);
     
     final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
     
@@ -177,7 +184,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       cqDUnitTest.executeCQ(client, "testCQHAWithState_" + i, false, null);
     }
     
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     int size = 10;
     
@@ -199,7 +206,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // Close server1.
     // To maintain the redundancy; it will make connection to endpoint-3.
     cqDUnitTest.closeServer(server1);
-    pause(3 * 1000);
+    Wait.pause(3 * 1000);
     
     
     // UPDATE-1.
@@ -217,12 +224,12 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     //Stop cq.
     cqDUnitTest.stopCQ(client, "testCQHAWithState_0");
     
-    pause(2 * 1000);
+    Wait.pause(2 * 1000);
     
     // UPDATE with stop.
     cqDUnitTest.createServer(server3, ports[1]);
     server3.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    pause(2 * 1000);
+    Wait.pause(2 * 1000);
     
     cqDUnitTest.clearCQListenerEvents(client, "testCQHAWithState_0");
     
@@ -273,7 +280,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server, 0, true);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
         "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName = "testCQWithDestroysAndInvalidates";
     cqDUnitTest.createPool(client, poolName, host0, port);
@@ -352,7 +359,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     /* Create Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
 
     String poolName1 = "testCQWithMultipleClients1";
     String poolName2 = "testCQWithMultipleClients2";
@@ -428,7 +435,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server2, 0, false, MirrorType.KEYS);
         
     final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     
     String poolName = "testCQWithLoad";
     cqDUnitTest.createPool(client, poolName, host0, port1);
@@ -439,7 +446,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createCQ(client, poolName, "testCQWithLoad_0", cqDUnitTest.cqs[0]);  
     cqDUnitTest.executeCQ(client, "testCQWithLoad_0", false, null); 
     
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     final int size = 10;
     
@@ -483,7 +490,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     final int evictionThreshold = 5;
     server1.invoke(new CacheSerializableRunnable("Create Cache Server") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create Cache Server. ###");
+        LogWriterUtils.getLogWriter().info("### Create Cache Server. ###");
         AttributesFactory factory = new AttributesFactory();
         factory.setScope(Scope.DISTRIBUTED_ACK);
         factory.setMirrorType(MirrorType.NONE);
@@ -493,16 +500,16 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         for (int i = 0; i < cqDUnitTest.regions.length; i++) { 
           Region region = createRegion(cqDUnitTest.regions[i], factory.createRegionAttributes());
           // Set CacheListener.
-          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(getLogWriter()));  
+          region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));  
         } 
-        pause(2000);
+        Wait.pause(2000);
         
         try {
           cqDUnitTest.startBridgeServer(0, true);
         } catch (Exception ex) {
-          fail("While starting CacheServer", ex);
+          Assert.fail("While starting CacheServer", ex);
         }
-        pause(2000);
+        Wait.pause(2000);
 
       }
     });
@@ -510,7 +517,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server2, 0, false, MirrorType.NONE);
         
     final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
       
     String poolName = "testCQWithEviction";
     cqDUnitTest.createPool(client, poolName, host0, port1);
@@ -529,7 +536,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       // Ignore  expected.
     }
     
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     final int size = 10;
     
@@ -549,7 +556,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     //  cqDUnitTest.waitForCreated(client, "testCQWithEviction_0", cqDUnitTest.KEY + i);
     //}
         
-    pause(2 * 1000);
+    Wait.pause(2 * 1000);
     
     server1.invoke(new CacheSerializableRunnable("validate destroy") {
       public void run2() throws CacheException {
@@ -591,7 +598,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server1, 0, false, MirrorType.KEYS_VALUES);
 
     final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String serverHost = getServerHostName(server1.getHost());
+    final String serverHost = NetworkUtils.getServerHostName(server1.getHost());
 
 //    final String[] regions = cqDUnitTest.regions;
 //    final int[] serverPorts = new int[] {port1};
@@ -641,7 +648,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     String poolName = "testRegionEvents";
     cqDUnitTest.createPool(client, poolName, host0, port);
@@ -659,7 +666,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // Test for Event on Region Clear.
     server.invoke(new CacheSerializableRunnable("testRegionEvents"){
       public void run2()throws CacheException {
-        getLogWriter().info("### Clearing the region on the server ###");
+        LogWriterUtils.getLogWriter().info("### Clearing the region on the server ###");
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
         for (int i = 1; i <=5; i++) {
           region.put(CqQueryUsingPoolDUnitTest.KEY+i, new Portfolio(i));
@@ -673,7 +680,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // Test for Event on Region invalidate.
     server.invoke(new CacheSerializableRunnable("testRegionEvents"){
       public void run2()throws CacheException {
-        getLogWriter().info("### Invalidate the region on the server ###");
+        LogWriterUtils.getLogWriter().info("### Invalidate the region on the server ###");
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[0]);
         for (int i = 1; i <=5; i++) {
           region.put(CqQueryUsingPoolDUnitTest.KEY+i, new Portfolio(i));
@@ -687,7 +694,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // Test for Event on Region destroy.
     server.invoke(new CacheSerializableRunnable("testRegionEvents"){
       public void run2()throws CacheException {
-        getLogWriter().info("### Destroying the region on the server ###");
+        LogWriterUtils.getLogWriter().info("### Destroying the region on the server ###");
         Region region = getCache().getRegion("/root/" + cqDUnitTest.regions[1]);
         for (int i = 1; i <=5; i++) {
           region.put(CqQueryUsingPoolDUnitTest.KEY+i, new Portfolio(i));
@@ -697,7 +704,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
       }
     });
 
-    pause(1000); // wait for cq to close becuse of region destroy on server.
+    Wait.pause(1000); // wait for cq to close becuse of region destroy on server.
     //cqDUnitTest.waitForClose(client,"testRegionEvents_1");
     cqDUnitTest.validateCQCount(client,1);
 
@@ -725,7 +732,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.createServer(server);
     
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
  
     String poolName = "testEventsDuringQueryExecution";
     cqDUnitTest.createPool(client, poolName, host0, port);
@@ -764,12 +771,12 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqResults = cq1.executeWithInitialResults();
         } catch (Exception ex){
-          fail("CQ execution failed", ex);
+          Assert.fail("CQ execution failed", ex);
         }
 
         // Check num of events received during executeWithInitialResults.
         final TestHook testHook = CqQueryImpl.testHook;
-        waitForCriterion(new WaitCriterion() {
+        Wait.waitForCriterion(new WaitCriterion() {
 
           @Override
           public boolean done() {
@@ -828,7 +835,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     // Keep updating region (async invocation).
     server.invoke(new CacheSerializableRunnable("Update Region"){
       public void run2()throws CacheException {
-        pause(200);
+        Wait.pause(200);
         client.invoke(new CacheSerializableRunnable("Releasing the latch") {
           public void run2()throws CacheException {
             // Now release the testhook so that CQListener can proceed.
@@ -853,7 +860,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   public void testCqStatInitializationTimingIssue() {
     
     //The async close can cause this exception on the server
-    addExpectedException("java.net.SocketException: Broken pipe");
+    IgnoredException.addIgnoredException("java.net.SocketException: Broken pipe");
     final String regionName = "testCqStatInitializationTimingIssue";
     final String cq1Name = "testCq1";
     final Host host = Host.getHost(0);
@@ -868,11 +875,11 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     // Start a  client
     client.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(client.getHost()), server1Port), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client.getHost()), server1Port), regionName});
     
     // Start a pub client
     client2.invoke(CacheServerTestUtil.class, "createCacheClient", 
-        new Object[] {getClientPool(getServerHostName(client2.getHost()), server1Port), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client2.getHost()), server1Port), regionName});
     
     //client has thread that invokes new and remove cq over and over
     client.invokeAsync(new CacheSerializableRunnable("Register cq") {
@@ -937,7 +944,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     /* Create Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
   
     final String poolName1 = "pool1";
     final String poolName2 = "pool2";
@@ -952,7 +959,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         try {
           queryService = (PoolManager.find(poolName1)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         try {
           CqAttributesFactory cqAf = new CqAttributesFactory();
@@ -987,7 +994,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         try {
           queryService = (PoolManager.find(poolName2)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         try {
           CqAttributesFactory cqAf = new CqAttributesFactory();
@@ -1021,7 +1028,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         try {
           queryService = (PoolManager.find(poolName2)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         List<String> list;
         try {
@@ -1046,7 +1053,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         try {
           queryService = (PoolManager.find(poolName1)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         List<String> list;
         try {
@@ -1076,7 +1083,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     /* Create Server and Client */
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
   
     final String poolName1 = "pool1";
   
@@ -1088,7 +1095,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
         try {
           queryService = (PoolManager.find(poolName1)).getQueryService();
         } catch (Exception cqe) {
-          fail("Failed to getCQService.", cqe);
+          Assert.fail("Failed to getCQService.", cqe);
         }
         List<String> list;
         try {
@@ -1124,11 +1131,11 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     // Start client 1
     client1.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client1.getHost()), server1Port), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client1.getHost()), server1Port), regionName});
     
     // Start client 2
     client2.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client2.getHost()), server1Port), regionName});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client2.getHost()), server1Port), regionName});
     
     createClient1CqsAndDurableCqs(client1, regionName);
     createClient2CqsAndDurableCqs(client2, regionName);
@@ -1186,11 +1193,11 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     // Start client 1
     client1.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client1.getHost()), server1Port), regionName, getDurableClientProperties("client1_dc", timeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client1.getHost()), server1Port), regionName, getDurableClientProperties("client1_dc", timeout)});
     
     // Start client 2
     client2.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client2.getHost()), server1Port), regionName, getDurableClientProperties("client2_dc", timeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client2.getHost()), server1Port), regionName, getDurableClientProperties("client2_dc", timeout)});
     
     createClient1CqsAndDurableCqs(client1, regionName);
     createClient2CqsAndDurableCqs(client2, regionName);
@@ -1251,11 +1258,11 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     
     // Start client 1
     client1.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client1.getHost()), server1Port), regionName, getDurableClientProperties("client1_dc", timeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client1.getHost()), server1Port), regionName, getDurableClientProperties("client1_dc", timeout)});
     
     // Start client 2
     client2.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client2.getHost()), server1Port), regionName, getDurableClientProperties("client2_dc", timeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client2.getHost()), server1Port), regionName, getDurableClientProperties("client2_dc", timeout)});
     
     //create the test cqs
     createClient1CqsAndDurableCqs(client1, regionName);
@@ -1456,7 +1463,7 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
     });
     
     client.invoke(CacheServerTestUtil.class, "createClientCache", 
-        new Object[] {getClientPool(getServerHostName(client.getHost()), serverPort), regionName, getDurableClientProperties(dcName, durableClientTimeout)});
+        new Object[] {getClientPool(NetworkUtils.getServerHostName(client.getHost()), serverPort), regionName, getDurableClientProperties(dcName, durableClientTimeout)});
   }
   
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
index e157fb0..47b9a89 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
@@ -18,6 +18,8 @@ package com.gemstone.gemfire.cache.query.cq.dunit;
 
 
 import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 
 /**
@@ -31,10 +33,10 @@ public class CqDataUsingPoolOptimizedExecuteDUnitTest extends CqDataUsingPoolDUn
   }
 
   public void setUp() throws Exception {
-    addExpectedException("Read timed out");
-    addExpectedException("java.net.SocketException");
+    IgnoredException.addIgnoredException("Read timed out");
+    IgnoredException.addIgnoredException("java.net.SocketException");
     super.setUp();
-    invokeInEveryVM(new SerializableRunnable("set test hook") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("set test hook") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
       }
@@ -42,12 +44,11 @@ public class CqDataUsingPoolOptimizedExecuteDUnitTest extends CqDataUsingPoolDUn
   }
   
   @Override
-  public void tearDown2() throws Exception {
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+  protected final void preTearDownCacheTestCase() throws Exception {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
       }
     });
-    super.tearDown2();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
index cdc11f2..a9747f2 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
@@ -35,9 +35,14 @@ import com.gemstone.gemfire.cache.query.internal.cq.CqServiceImpl;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * This class tests the ContiunousQuery mechanism in GemFire.
@@ -59,7 +64,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     // avoid IllegalStateException from HandShake by connecting all vms tor
     // system before creating connection pools
     getSystem();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         getSystem();
       }
@@ -82,7 +87,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     final int port = server.invokeInt(CqQueryDUnitTest.class,
     "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
     cqDUnitTest.createClient(client, port, host0);
@@ -90,7 +95,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     client.invoke(new CacheSerializableRunnable("Create CQ :" + cqName) {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterUtils.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {
@@ -101,7 +106,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
         }
         // Create CQ Attributes.
         CqAttributesFactory cqf = new CqAttributesFactory();
-        CqListener[] cqListeners = {new CqTimeTestListener(getLogWriter())};
+        CqListener[] cqListeners = {new CqTimeTestListener(LogWriterUtils.getLogWriter())};
         ((CqTimeTestListener)cqListeners[0]).cqName = cqName;
         
         cqf.initCqListeners(cqListeners);
@@ -113,7 +118,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
           assertTrue("newCq() state mismatch", cq1.getState().isStopped());
           cq1.execute();
         } catch (Exception ex){
-          getLogWriter().info("CqService is :" + cqService);
+          LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
           ex.printStackTrace();
           AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
           err.initCause(ex);
@@ -126,14 +131,14 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     // Create values.
     cqDUnitTest.createValuesWithTime(client, cqDUnitTest.regions[0], size);
-    pause(5000);
+    Wait.pause(5000);
     
     // Update values
     cqDUnitTest.createValuesWithTime(client, cqDUnitTest.regions[0], size);
     
     client.invoke(new CacheSerializableRunnable("Validate CQs") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ. ### " + cqName);
+        LogWriterUtils.getLogWriter().info("### Validating CQ. ### " + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {          
@@ -167,7 +172,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
       }
     });
     
-    pause( 10 * 60 * 1000);
+    Wait.pause( 10 * 60 * 1000);
     
     // Close.
     cqDUnitTest.closeClient(client);
@@ -187,7 +192,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client, port, host0);
     
 
@@ -213,8 +218,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
@@ -244,8 +249,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
         for (InternalCqQuery cq: cqs){
@@ -275,8 +280,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
@@ -307,8 +312,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
         for (InternalCqQuery cq: cqs){
@@ -337,8 +342,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
@@ -369,8 +374,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
         for (InternalCqQuery cq: cqs){
@@ -407,7 +412,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     cqDUnitTest.createClient(client, port, host0);
     
     // Create and Execute same kind of CQs.
@@ -522,7 +527,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
         
     for (int clientIndex=0; clientIndex < 3; clientIndex++){
       cqDUnitTest.createClient(clients[clientIndex], port, host0);
@@ -681,7 +686,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     VM clients[] = new VM[]{client1, client2};
     
     final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     // Create client.
     
     // Create client with redundancyLevel -1
@@ -706,7 +711,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     validateMatchingCqs(server1, numCQs, cqDUnitTest.cqs[0], 1 * clients.length);
     validateMatchingCqs(server1, numCQs, cqDUnitTest.cqs[1], 1 * clients.length);
     
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     // CREATE.
     cqDUnitTest.createValues(server1, cqDUnitTest.regions[0], 10);
@@ -716,7 +721,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
       cqDUnitTest.waitForCreated(client1, "testMatchingCQsWithMultipleServers_0", CqQueryDUnitTest.KEY+i);
     }
 
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     cqDUnitTest.createServer(server2, ports[0]);
     
@@ -725,7 +730,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + port2);
 
-    pause(3 * 1000);
+    Wait.pause(3 * 1000);
     
 
     // UPDATE - 1.
@@ -767,7 +772,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     cqDUnitTest.closeServer(server1);
     
     // Fail over should happen.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
     
     validateMatchingCqs(server2, numCQs, cqDUnitTest.cqs[0], 1 * clients.length);
 
@@ -844,7 +849,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     VM clients[] = new VM[]{client1, client2};
     
     final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
     
     cqDUnitTest.createLocalRegion(client1, new int[] {port1, ports[0]}, host0, "-1", cqDUnitTest.regions);
@@ -893,7 +898,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
     
     final int port1 = server1.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
     final int port2 = server2.invokeInt(CqQueryDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     // Create client.
 //    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
@@ -922,7 +927,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
           false, null);
     }
 
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     // CREATE.
     int size = 1000;
@@ -949,7 +954,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
           "testPerformanceForMatchingCQs_0", CqQueryDUnitTest.KEY+k);
     }
  
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     printCqQueryExecutionTime(server1);
     printCqQueryExecutionTime(server2);
     
@@ -968,8 +973,8 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = (CqServiceImpl) ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         HashMap matchedCqMap = cqService.getMatchingCqMap();
@@ -994,12 +999,12 @@ public class CqPerfDUnitTest extends CacheTestCase {
         try {
           cqService = (CqServiceImpl) ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         long timeTaken = cqService.getCqServiceVsdStats().getCqQueryExecutionTime();
-        getLogWriter().info("Total Time taken to Execute CQ Query :" + timeTaken);
+        LogWriterUtils.getLogWriter().info("Total Time taken to Execute CQ Query :" + timeTaken);
         //System.out.println("Total Time taken to Execute CQ Query :" + timeTaken);
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
index 059c8a0..3c7e3b5 100644
--- a/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
+++ b/gemfire-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
@@ -35,9 +35,14 @@ 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.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
 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.
@@ -59,7 +64,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     // avoid IllegalStateException from HandShake by connecting all vms tor
     // system before creating connection pools
     getSystem();
-    invokeInEveryVM(new SerializableRunnable("getSystem") {
+    Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
       public void run() {
         getSystem();
       }
@@ -82,7 +87,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class,
     "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     
     // Create client.
     cqDUnitTest.createClient(client, port, host0);
@@ -90,7 +95,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     client.invoke(new CacheSerializableRunnable("Create CQ :" + cqName) {
       public void run2() throws CacheException {
-        getLogWriter().info("### Create CQ. ###" + cqName);
+        LogWriterUtils.getLogWriter().info("### Create CQ. ###" + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {
@@ -101,7 +106,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         }
         // Create CQ Attributes.
         CqAttributesFactory cqf = new CqAttributesFactory();
-        CqListener[] cqListeners = {new CqTimeTestListener(getLogWriter())};
+        CqListener[] cqListeners = {new CqTimeTestListener(LogWriterUtils.getLogWriter())};
         ((CqTimeTestListener)cqListeners[0]).cqName = cqName;
         
         cqf.initCqListeners(cqListeners);
@@ -113,7 +118,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
           assertTrue("newCq() state mismatch", cq1.getState().isStopped());
           cq1.execute();
         } catch (Exception ex){
-          getLogWriter().info("CqService is :" + cqService);
+          LogWriterUtils.getLogWriter().info("CqService is :" + cqService);
           ex.printStackTrace();
           AssertionError err = new AssertionError("Failed to create CQ " + cqName + " . ");
           err.initCause(ex);
@@ -126,14 +131,14 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     // Create values.
     cqDUnitTest.createValuesWithTime(client, cqDUnitTest.regions[0], size);
-    pause(5000);
+    Wait.pause(5000);
     
     // Update values
     cqDUnitTest.createValuesWithTime(client, cqDUnitTest.regions[0], size);
     
     client.invoke(new CacheSerializableRunnable("Validate CQs") {
       public void run2() throws CacheException {
-        getLogWriter().info("### Validating CQ. ### " + cqName);
+        LogWriterUtils.getLogWriter().info("### Validating CQ. ### " + cqName);
         // Get CQ Service.
         QueryService cqService = null;
         try {          
@@ -167,7 +172,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
       }
     });
     
-    pause( 10 * 60 * 1000);
+    Wait.pause( 10 * 60 * 1000);
     
     // Close.
     cqDUnitTest.closeClient(client);
@@ -187,7 +192,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     // cqDUnitTest.createClient(client, port, host0);
 
     String poolName = "testKeyMaintainance";
@@ -215,8 +220,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
@@ -247,8 +252,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
         for (InternalCqQuery cq: cqs){
@@ -278,8 +283,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
@@ -311,8 +316,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
         for (InternalCqQuery cq: cqs){
@@ -340,8 +345,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
@@ -371,8 +376,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
         Collection<? extends InternalCqQuery> cqs = cqService.getAllCqs();
         for (InternalCqQuery cq: cqs){
@@ -407,7 +412,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     //cqDUnitTest.createClient(client, port, host0);
     
     String poolName = "testMatchingCqs";
@@ -525,7 +530,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     cqDUnitTest.createServer(server);
     final int port = server.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server.getHost());
     String poolName = "testMatchingCQWithMultipleClients";     
     for (int clientIndex=0; clientIndex < 3; clientIndex++){
       String cPoolName = "testMatchingCQWithMultipleClients" + clientIndex;
@@ -688,7 +693,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     VM clients[] = new VM[]{client1, client2};
     
     final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
     // Create client.
     
     // Create client with redundancyLevel -1
@@ -718,7 +723,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     validateMatchingCqs(server1, numCQs, cqDUnitTest.cqs[0], 1 * clients.length);
     validateMatchingCqs(server1, numCQs, cqDUnitTest.cqs[1], 1 * clients.length);
     
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     // CREATE.
     cqDUnitTest.createValues(server1, cqDUnitTest.regions[0], 10);
@@ -729,7 +734,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
           "testMatchingCQsWithMultipleServers_0", CqQueryUsingPoolDUnitTest.KEY+i);
     }
 
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     cqDUnitTest.createServer(server2, ports[0]);
     
@@ -738,7 +743,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     System.out.println("### Port on which server1 running : " + port1 + 
         " Server2 running : " + port2);
 
-    pause(3 * 1000);
+    Wait.pause(3 * 1000);
     
 
     // UPDATE - 1.
@@ -778,7 +783,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     cqDUnitTest.closeServer(server1);
     
     // Fail over should happen.
-    pause(5 * 1000);
+    Wait.pause(5 * 1000);
     
     validateMatchingCqs(server2, numCQs, cqDUnitTest.cqs[0], 1 * clients.length);
 
@@ -853,7 +858,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
     
     final int port1 = server1.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
     final int port2 = server2.invokeInt(CqQueryUsingPoolDUnitTest.class, "getCacheServerPort");
-    final String host0 = getServerHostName(server1.getHost());
+    final String host0 = NetworkUtils.getServerHostName(server1.getHost());
 
     // Create client.
 //    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1);
@@ -882,7 +887,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
           false, null);
     }
 
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     
     // CREATE.
     int size = 1000;
@@ -909,7 +914,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
           "testPerformanceForMatchingCQs_0", CqQueryUsingPoolDUnitTest.KEY+k);
     }
  
-    pause(1 * 1000);
+    Wait.pause(1 * 1000);
     printCqQueryExecutionTime(server1);
     printCqQueryExecutionTime(server2);
     
@@ -928,8 +933,8 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = (CqServiceImpl) ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         HashMap matchedCqMap = cqService.getMatchingCqMap();
@@ -954,12 +959,12 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
         try {
           cqService = (CqServiceImpl) ((DefaultQueryService)getCache().getQueryService()).getCqService();
         } catch (Exception ex) {
-          getLogWriter().info("Failed to get the internal CqService.", ex);
-          fail ("Failed to get the internal CqService.", ex);
+          LogWriterUtils.getLogWriter().info("Failed to get the internal CqService.", ex);
+          Assert.fail ("Failed to get the internal CqService.", ex);
         }
 
         long timeTaken = cqService.getCqServiceVsdStats().getCqQueryExecutionTime();
-        getLogWriter().info("Total Time taken to Execute CQ Query :" + timeTaken);
+        LogWriterUtils.getLogWriter().info("Total Time taken to Execute CQ Query :" + timeTaken);
         System.out.println("Total Time taken to Execute CQ Query :" + timeTaken);
       }
     });


Mime
View raw message