geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [03/27] incubator-geode git commit: GEODE 773 rough draft
Date Tue, 26 Jan 2016 00:49:13 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
index 894d2ec..6d6b937 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
@@ -49,11 +49,12 @@ import com.gemstone.gemfire.management.internal.configuration.domain.XmlEntity.X
 import com.gemstone.gemfire.management.internal.configuration.handlers.ConfigurationRequestHandler;
 import com.gemstone.gemfire.management.internal.configuration.messages.ConfigurationRequest;
 import com.gemstone.gemfire.management.internal.configuration.messages.ConfigurationResponse;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /***
  * Tests the starting up of shared configuration, installation of {@link ConfigurationRequestHandler}
@@ -118,7 +119,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
           final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator1Port, locatorLogFile, null,
               locatorProps);
 
-          DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
+          WaitCriterion wc = new WaitCriterion() {
             @Override
             public boolean done() {
               return locator.isSharedConfigurationRunning();
@@ -129,7 +130,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
               return "Waiting for shared configuration to be started";
             }
           };
-          DistributedTestCase.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
+          Wait.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
         } catch (IOException ioex) {
           fail("Unable to create a locator with a shared configuration");
         }
@@ -256,7 +257,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
         try {
           final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator1Port, locatorLogFile, null,
               locatorProps);
-          DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
+          WaitCriterion wc = new WaitCriterion() {
             @Override
             public boolean done() {
               return locator.isSharedConfigurationRunning();
@@ -267,7 +268,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
               return "Waiting for shared configuration to be started";
             }
           };
-          DistributedTestCase.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
+          Wait.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
         } catch (IOException ioex) {
           fail("Unable to create a locator with a shared configuration");
         }
@@ -347,7 +348,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
           final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator2Port, locatorLogFile, null,
               locatorProps);
 
-          DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
+          WaitCriterion wc = new WaitCriterion() {
             @Override
             public boolean done() {
               return locator.isSharedConfigurationRunning();
@@ -358,7 +359,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
               return "Waiting for shared configuration to be started";
             }
           };
-          DistributedTestCase.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
+          Wait.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
         } catch (IOException ioex) {
           fail("Unable to create a locator with a shared configuration");
         }
@@ -435,8 +436,8 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
   
   
   @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
     for (int i=0; i<4; i++) {
       Host.getHost(0).getVM(i).invoke(SharedConfigurationDUnitTest.locatorCleanup);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
index b096bd8..282d078 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
@@ -37,12 +37,15 @@ import com.gemstone.gemfire.management.CacheServerMXBean;
 import com.gemstone.gemfire.management.MBeanUtil;
 import com.gemstone.gemfire.management.ManagementTestBase;
 import com.gemstone.gemfire.management.internal.cli.CliUtil;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * This is for testing client IDs
@@ -86,8 +89,8 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
     client2 = host.getVM(3);
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
 
     helper.closeCache(managingNode);
     helper.closeCache(server);
@@ -106,8 +109,8 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
     helper.startManagingNode(managingNode);
     int port = (Integer) createServerCache(server);
     DistributedMember serverMember = helper.getMember(server);
-    createClientCache(client, getServerHostName(server.getHost()), port);
-    createClientCache(client2, getServerHostName(server.getHost()), port);
+    createClientCache(client, NetworkSupport.getServerHostName(server.getHost()), port);
+    createClientCache(client2, NetworkSupport.getServerHostName(server.getHost()), port);
     put(client);
     put(client2);
     verifyClientIds(managingNode, serverMember, port);
@@ -240,7 +243,7 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
               return "wait for getNumOfClients bean to complete and get results";
             }
           };
-          waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);          
+          Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);          
           
           //Now it is sure that bean would be available
           CacheServerMXBean bean = MBeanUtil.getCacheServerMbeanProxy(
@@ -291,7 +294,7 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
           }
           r1.clear();
         } catch (Exception ex) {
-          fail("failed while put", ex);
+          Assert.fail("failed while put", ex);
         }
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
index 1ebbab7..9d19b7f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
@@ -26,6 +26,8 @@ import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
 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 is for testing running functions
@@ -46,8 +48,8 @@ public class TestFunctionsDUnitTest extends ManagementTestBase {
 
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
   }
 
   public static Integer getNumOfRunningFunction() {
@@ -74,7 +76,7 @@ public class TestFunctionsDUnitTest extends ManagementTestBase {
       }
     };
 
-    waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
+    Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
     final DistributedSystemMXBean bean = getManagementService()
         .getDistributedSystemMXBean();
     assertNotNull(bean);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
index 4a8783a..27f8783 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
@@ -20,6 +20,8 @@ import com.gemstone.gemfire.management.DistributedSystemMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * This is for testing heap size from Mbean  
@@ -40,8 +42,8 @@ public class TestHeapDUnitTest extends ManagementTestBase {
 
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
   }
 
   public static long getHeapSizeOfClient() {    
@@ -68,7 +70,7 @@ public class TestHeapDUnitTest extends ManagementTestBase {
       }
     };
 
-    waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
+    Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
     final DistributedSystemMXBean bean = getManagementService()
         .getDistributedSystemMXBean();
     assertNotNull(bean);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
index 2e9a239..5b3f596 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
@@ -19,6 +19,8 @@ package com.gemstone.gemfire.management.internal.pulse;
 import com.gemstone.gemfire.management.DistributedSystemMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * This is for testing locators from MBean
@@ -39,8 +41,8 @@ public class TestLocatorsDUnitTest extends ManagementTestBase {
 
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
   }
 
   public static int getNumOfLocatorFromMBean() {
@@ -63,7 +65,7 @@ public class TestLocatorsDUnitTest extends ManagementTestBase {
         return "wait for getNumOfLocatorFromMBean to complete and get results";
       }
     };
-    waitForCriterion(waitCriteria, 2 * 60 * 1000, 2000, true);    
+    Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 2000, true);    
     final DistributedSystemMXBean bean = getManagementService().getDistributedSystemMXBean();
     assertNotNull(bean);    
     return bean.getLocatorCount();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
index 56fcbb1..1e524a2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
@@ -37,11 +37,15 @@ import com.gemstone.gemfire.management.DistributedRegionMXBean;
 import com.gemstone.gemfire.management.DistributedSystemMXBean;
 import com.gemstone.gemfire.management.ManagementService;
 import com.gemstone.gemfire.management.ManagementTestBase;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 /**
  * This is for testing subscriptions
@@ -78,8 +82,8 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
     client2 = host.getVM(3);
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
     helper.closeCache(managingNode);
     helper.closeCache(server);
     helper.closeCache(client);
@@ -97,8 +101,8 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
 
     int port = (Integer) createServerCache(server);
     DistributedMember serverMember = helper.getMember(server);
-    createClientCache(client, getServerHostName(server.getHost()), port);
-    createClientCache(client2, getServerHostName(server.getHost()), port);
+    createClientCache(client, NetworkSupport.getServerHostName(server.getHost()), port);
+    createClientCache(client2, NetworkSupport.getServerHostName(server.getHost()), port);
     put(client);
     put(client2);
     registerInterest(client);
@@ -237,7 +241,7 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
               return "TestSubscriptionsDUnitTest wait for getDistributedSystemMXBean to complete and get results";
             }
           };
-          waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
+          Wait.waitForCriterion(waitCriteria, 2 * 60 * 1000, 3000, true);
           final DistributedSystemMXBean dsBean = ManagementService
               .getExistingManagementService(cache).getDistributedSystemMXBean();
           assertNotNull(dsBean);
@@ -273,7 +277,7 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
           r1.registerInterest(k1);
           r1.registerInterest(k2);
         } catch (Exception ex) {
-          fail("TestSubscriptionsDUnitTest failed while register Interest", ex);
+          Assert.fail("TestSubscriptionsDUnitTest failed while register Interest", ex);
         }
       }
 
@@ -294,7 +298,7 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
           r1.put(k2, client_k2);
           assertEquals(r1.getEntry(k2).getValue(), client_k2);
         } catch (Exception ex) {
-          fail("failed while put", ex);
+          Assert.fail("failed while put", ex);
         }
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
index 0704121..a6a0999 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
@@ -56,10 +56,14 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.cache.tier.sockets.command.Put70;
 import com.gemstone.gemfire.internal.cache.versions.VMVersionTag;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * @author dsmith
@@ -67,7 +71,7 @@ import com.gemstone.gemfire.test.dunit.VM;
  */
 public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
   // list of expected exceptions to remove in tearDown2()
-  static List<ExpectedException> expectedExceptions = new LinkedList<ExpectedException>();
+  static List<IgnoredException> expectedExceptions = new LinkedList<IgnoredException>();
 
   public ClientsWithVersioningRetryDUnitTest(String name) {
     super(name);
@@ -76,7 +80,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
   @Override
   public void setUp() throws Exception {
     super.setUp();
-    invokeInEveryVM(new SerializableRunnable() {
+    Invoke.invokeInEveryVM(new SerializableRunnable() {
       @Override
       public void run() {
         //Disable endpoint shuffling, so that the client will always connect
@@ -89,15 +93,15 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
   
 
   @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
-    invokeInEveryVM(new SerializableRunnable() {
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
+    Invoke.invokeInEveryVM(new SerializableRunnable() {
       @Override      public void run() {
         System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false");
       }
       
     });
-    for (ExpectedException ex: expectedExceptions) {
+    for (IgnoredException ex: expectedExceptions) {
       ex.remove();
     }
   }
@@ -298,7 +302,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
     getLogWriter().info("creating region in vm3");
     createRegionInPeer(vm3, RegionShortcut.PARTITION_PROXY);
     
-    expectedExceptions.add(addExpectedException("RuntimeException", vm2));
+    expectedExceptions.add(IgnoredException.addIgnoredException("RuntimeException", vm2));
     vm2.invoke(new SerializableRunnable("install message listener to ignore update") {
       public void run() {
         //Add a listener to close vm2 when we send a distributed put all operation
@@ -311,7 +315,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
               DistributionMessage msg) {
             if(msg instanceof DistributedPutAllOperation.PutAllMessage) {
               DistributionMessageObserver.setInstance(null);
-              pause(5000); // give vm1 time to process the message that we're ignoring
+              Wait.pause(5000); // give vm1 time to process the message that we're ignoring
               disconnectFromDS(vm0);
               // no reply will be sent to vm0 due to this exception, but that's okay
               // because vm0 has been shut down
@@ -494,8 +498,8 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
     SerializableCallable createRegion = new SerializableCallable("create client region in " + vm) {
       public Object call() throws Exception {
         ClientCacheFactory cf = new ClientCacheFactory();
-        cf.addPoolServer(getServerHostName(vm.getHost()), port1);
-        cf.addPoolServer(getServerHostName(vm.getHost()), port2);
+        cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port1);
+        cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port2);
         cf.setPoolPRSingleHopEnabled(false);
         cf.setPoolThreadLocalConnections(threadLocalConnections);
         cf.setPoolReadTimeout(10 * 60 * 1000);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
index 5a355ea..2d20275 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/DistributedSystemIdDUnitTest.java
@@ -26,6 +26,7 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -69,7 +70,7 @@ public class DistributedSystemIdDUnitTest extends DistributedTestCase {
   }
   
   public void testMismatch() {
-    addExpectedException("Rejected new system node");
+    IgnoredException.addIgnoredException("Rejected new system node");
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
index a8b4e8d..90f835c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
@@ -42,6 +42,7 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.pdx.internal.json.PdxToJSON;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.util.test.TestUtil;
@@ -59,7 +60,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
   }
   
   @Override
-  public void tearDown2() {
+  public void tearDownBeforeDisconnect() {
     // this test creates client caches in some VMs and so
     // breaks the contract of CacheTestCase to hold caches in
     // that class's "cache" instance variable
@@ -594,7 +595,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
     SerializableCallable createRegion = new SerializableCallable() {
       public Object call() throws Exception {
         ClientCacheFactory cf = new ClientCacheFactory();
-        cf.addPoolServer(getServerHostName(vm.getHost()), port);
+        cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port);
         cf.setPoolThreadLocalConnections(threadLocalConnections);
         ClientCache cache = getClientCache(cf);
         cache.createClientRegionFactory(ClientRegionShortcut.PROXY)
@@ -610,7 +611,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
     SerializableCallable createRegion = new SerializableCallable() {
       public Object call() throws Exception {
         ClientCacheFactory cf = new ClientCacheFactory();
-        cf.addPoolServer(getServerHostName(vm.getHost()), port);
+        cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port);
         cf.setPoolThreadLocalConnections(threadLocalConnections);
         cf.setPdxReadSerialized(isPdxReadSerialized);
         ClientCache cache = getClientCache(cf);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
index 98da0fc..8506459 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxClientServerDUnitTest.java
@@ -42,6 +42,8 @@ import com.gemstone.gemfire.internal.PdxSerializerObject;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.pdx.internal.AutoSerializableManager;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
@@ -171,7 +173,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
     VM vm2 = host.getVM(2);
 
     System.setProperty("gemfire.auto.serialization.no.hardcoded.excludes", "true");
-    invokeInEveryVM(new SerializableRunnable() {
+    Invoke.invokeInEveryVM(new SerializableRunnable() {
       public void run() {
         System.setProperty("gemfire.auto.serialization.no.hardcoded.excludes", "true");
       }
@@ -239,7 +241,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
     });
     } finally { 
       System.setProperty("gemfire.auto.serialization.no.hardcoded.excludes", "false");
-      invokeInEveryVM(new SerializableRunnable() {
+      Invoke.invokeInEveryVM(new SerializableRunnable() {
         public void run() {
           System.setProperty("gemfire.auto.serialization.no.hardcoded.excludes", "false");
         }
@@ -392,11 +394,11 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
         getSystem(props);
         Cache cache = getCache();
         PoolFactory pf = PoolManager.createFactory();
-        pf.addServer(getServerHostName(vm0.getHost()), port1);
+        pf.addServer(NetworkSupport.getServerHostName(vm0.getHost()), port1);
         pf.create("pool1");
         
         pf = PoolManager.createFactory();
-        pf.addServer(getServerHostName(vm0.getHost()), port2);
+        pf.addServer(NetworkSupport.getServerHostName(vm0.getHost()), port2);
         pf.create("pool2");
         
         AttributesFactory af = new AttributesFactory();
@@ -497,7 +499,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
         getSystem(props);
         Cache cache = getCache();
         PoolFactory pf = PoolManager.createFactory();
-        pf.addServer(getServerHostName(vm0.getHost()), port);
+        pf.addServer(NetworkSupport.getServerHostName(vm0.getHost()), port);
         pf.create("pool");
         
         AttributesFactory af = new AttributesFactory();
@@ -551,7 +553,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
         DataSerializer.writeObject(new SimpleClass(57, (byte) 3), out);
         
         PoolFactory pf = PoolManager.createFactory();
-        pf.addServer(getServerHostName(vm0.getHost()), port);
+        pf.addServer(NetworkSupport.getServerHostName(vm0.getHost()), port);
         try {
           pf.create("pool");
           fail("should have received an exception");
@@ -702,7 +704,7 @@ public class PdxClientServerDUnitTest extends CacheTestCase {
 		  System.setProperty("gemfire.ON_DISCONNECT_CLEAR_PDXTYPEIDS", "true");	
 		}
         ClientCacheFactory cf = new ClientCacheFactory();
-        cf.addPoolServer(getServerHostName(vm.getHost()), port);
+        cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port);
         cf.setPoolThreadLocalConnections(threadLocalConnections);
         if(autoSerializerPatterns != null && autoSerializerPatterns.length != 0) {
           cf.setPdxSerializer(new ReflectionBasedAutoSerializer(autoSerializerPatterns));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
index 3310d95..10b21d0 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxDeserializationDUnitTest.java
@@ -38,10 +38,13 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
 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.SerializableCallable;
 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;
 
 /**
  * A test to ensure that we do not deserialize PDX objects
@@ -268,7 +271,7 @@ public class PdxDeserializationDUnitTest extends CacheTestCase {
   
   protected void checkClientValue(final Region<Object, Object> region) {
     //Because register interest is asynchronous, we need to wait for the value to arrive.
-    waitForCriterion(new WaitCriterion() {
+    Wait.waitForCriterion(new WaitCriterion() {
       
       public boolean done() {
         return region.get("A") != null;
@@ -310,7 +313,7 @@ public class PdxDeserializationDUnitTest extends CacheTestCase {
       }
       
     } catch (Exception e) {
-      fail("got exception from query", e);
+      Assert.fail("got exception from query", e);
     }
     
 
@@ -352,7 +355,7 @@ public class PdxDeserializationDUnitTest extends CacheTestCase {
     try {
       server.start();
     } catch (IOException e) {
-      fail("got exception", e);
+      Assert.fail("got exception", e);
     }
     return server;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
index 001aab4..2ea86d2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.pdx.internal.EnumInfo;
 import com.gemstone.gemfire.pdx.internal.PdxType;
 import com.gemstone.gemfire.pdx.internal.TypeRegistry;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 
 public class PdxTypeExportDUnitTest extends CacheTestCase {
@@ -115,7 +116,7 @@ public class PdxTypeExportDUnitTest extends CacheTestCase {
       public Object call() throws Exception {
         ClientCacheFactory cf = new ClientCacheFactory()
           .setPdxSerializer(new MyPdxSerializer())
-          .addPoolServer(getServerHostName(host), port);
+          .addPoolServer(NetworkSupport.getServerHostName(host), port);
     
         ClientCache cache = getClientCache(cf);
         Region r = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("pdxtest");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
index 28e2940..bd421fe 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
@@ -24,8 +24,10 @@ import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.SocketCreator;
 import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.VM;
 
@@ -70,7 +72,7 @@ public class RedisDistDUnitTest extends DistributedTestCase {
     client1 = host.getVM(2);
     client2 = host.getVM(3);  
     final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int locatorPort = getDUnitLocatorPort();
+    final int locatorPort = DUnitEnv.getDUnitLocatorPort();
     final SerializableCallable<Object> startRedisAdapter = new SerializableCallable<Object>() {
 
       private static final long serialVersionUID = 1978017907725504294L;
@@ -80,7 +82,7 @@ public class RedisDistDUnitTest extends DistributedTestCase {
         int port = ports[VM.getCurrentVMNum()];
         CacheFactory cF = new CacheFactory();
         String locator = SocketCreator.getLocalHost().getHostName() + "[" + locatorPort + "]";
-        cF.set("log-level", getDUnitLogLevel());
+        cF.set("log-level", DUnitEnv.getDUnitLogLevel());
         cF.set("redis-bind-address", localHost);
         cF.set("redis-port", ""+port);
         cF.set("mcast-port", "0");
@@ -99,8 +101,8 @@ public class RedisDistDUnitTest extends DistributedTestCase {
   }
 
   @Override
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
     disconnectAllFromDS();
   }
 
@@ -139,8 +141,8 @@ public class RedisDistDUnitTest extends DistributedTestCase {
   }
 
   public void testConcCreateDestroy() throws Throwable {
-    addExpectedException("RegionDestroyedException");
-    addExpectedException("IndexInvalidException");
+    IgnoredException.addIgnoredException("RegionDestroyedException");
+    IgnoredException.addIgnoredException("IndexInvalidException");
     final int ops = 40;
     final String hKey = TEST_KEY+"hash";
     final String lKey = TEST_KEY+"list";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
index 40acd62..ea61c38 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
@@ -28,6 +28,7 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 public class RestAPITestBase extends DistributedTestCase {
   private static final long serialVersionUID = 1L;
@@ -46,7 +47,7 @@ public class RestAPITestBase extends DistributedTestCase {
   public void setUp() throws Exception {
     super.setUp();
     disconnectAllFromDS();
-    pause(5000);
+    Wait.pause(5000);
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
@@ -58,7 +59,7 @@ public class RestAPITestBase extends DistributedTestCase {
    * close the clients and teh servers
    */
   @Override
-  public void tearDown2() throws Exception
+  public void tearDownBeforeDisconnect() throws Exception
   {
     vm0.invoke(getClass(), "closeCache");
     vm1.invoke(getClass(), "closeCache");
@@ -79,7 +80,7 @@ public class RestAPITestBase extends DistributedTestCase {
   
   protected static String createCache(VM currentVM) {
     
-    RestAPITestBase test = new RestAPITestBase(testName);
+    RestAPITestBase test = new RestAPITestBase(getTestName());
     
     final String hostName = currentVM.getHost().getHostName();
     final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
@@ -98,7 +99,7 @@ public class RestAPITestBase extends DistributedTestCase {
   }
   
   public static String createCacheWithGroups (VM vm, final String groups, final String regionName ) {
-    RestAPITestBase test = new RestAPITestBase(testName);
+    RestAPITestBase test = new RestAPITestBase(getTestName());
     
     final String hostName = vm.getHost().getHostName(); 
     final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
index ccdf782..d563b4d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
@@ -32,7 +32,9 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 import security.DummyCredentialGenerator;
 
@@ -81,7 +83,7 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
     client1 = host.getVM(2);
     client2 = host.getVM(3);
     
-    addExpectedException("Connection refused: connect");
+    IgnoredException.addIgnoredException("Connection refused: connect");
 
     server1.invoke(SecurityTestUtil.class, "registerExpectedExceptions",
         new Object[] { serverExpectedExceptions });
@@ -768,7 +770,7 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
       server1.invoke(SecurityTestUtil.class, "closeCache");
 
       // Wait for failover to complete
-      pause(500);
+      Wait.pause(500);
 
       // Perform some create/update operations from client1
       client1.invoke(SecurityTestUtil.class, "doNPuts",
@@ -953,9 +955,9 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
   //////////////////////////////////////////////////////////////////////////////
   
   @Override
-  public void tearDown2() throws Exception {
+  public void tearDownBeforeDisconnect() throws Exception {
 
-    super.tearDown2();
+    super.tearDownBeforeDisconnect();
     // close the clients first
     client1.invoke(SecurityTestUtil.class, "closeCache");
     client2.invoke(SecurityTestUtil.class, "closeCache");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
index c434a2a..c64c503 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
@@ -34,6 +34,7 @@ import security.XmlAuthzCredentialGenerator;
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.VM;
 
 import templates.security.UserPasswordAuthInit;
@@ -679,7 +680,7 @@ public class ClientAuthorizationDUnitTest extends ClientAuthorizationTestBase {
 
   
   public void testAllOpsWithFailover() {
-    addExpectedException("Read timed out");
+    IgnoredException.addIgnoredException("Read timed out");
 
     OperationWithAction[] allOps = {
         // Test CREATE and verify with a GET
@@ -783,9 +784,9 @@ public class ClientAuthorizationDUnitTest extends ClientAuthorizationTestBase {
   // End Region: Tests
 
   @Override
-  public void tearDown2() throws Exception {
+  public void tearDownBeforeDisconnect() throws Exception {
 
-    super.tearDown2();
+    super.tearDownBeforeDisconnect();
     // close the clients first
     client1.invoke(SecurityTestUtil.class, "closeCache");
     client2.invoke(SecurityTestUtil.class, "closeCache");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
index 4796203..c01161f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
@@ -59,8 +59,11 @@ import com.gemstone.gemfire.internal.AvailablePort.Keeper;
 import com.gemstone.gemfire.internal.cache.AbstractRegionEntry;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.util.Callable;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 
 import security.DummyCredentialGenerator;
 import security.XmlAuthzCredentialGenerator;
@@ -561,7 +564,7 @@ public class ClientAuthorizationTestBase extends DistributedTestCase {
                 return null;
               }
             };
-            DistributedTestCase.waitForCriterion(ev, 3 * 1000, 200, true);
+            Wait.waitForCriterion(ev, 3 * 1000, 200, true);
             if ((flags & OpFlags.CHECK_FAIL) > 0) {
               assertEquals(0, listener.getNumUpdates());
             }
@@ -684,7 +687,7 @@ public class ClientAuthorizationTestBase extends DistributedTestCase {
           continue;
         }
         else {
-          fail("doOp: Got unexpected exception when doing operation. Policy = " 
+          Assert.fail("doOp: Got unexpected exception when doing operation. Policy = " 
               + policy + " flags = " + OpFlags.description(flags), ex);
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
index 9120a1f..aceb233 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
@@ -521,9 +521,9 @@ public class ClientMultiUserAuthzDUnitTest extends ClientAuthorizationTestBase {
 
   // End Region: Tests
 
-  public void tearDown2() throws Exception {
+  public void tearDownBeforeDisconnect() throws Exception {
 
-    super.tearDown2();
+    super.tearDownBeforeDisconnect();
     // close the clients first
     client1.invoke(SecurityTestUtil.class, "closeCache");
     client2.invoke(SecurityTestUtil.class, "closeCache");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
index 42fe897..e5c9779 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
@@ -32,6 +32,7 @@ import com.gemstone.gemfire.cache.client.NoAvailableServersException;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
 import com.gemstone.gemfire.internal.cache.PartitionedRegionLocalMaxMemoryDUnitTest.TestObject1;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 
 /**
@@ -113,8 +114,8 @@ public class DeltaClientAuthorizationDUnitTest extends
     SecurityTestUtil.registerExpectedExceptions(clientExpectedExceptions);
   }
 
-  public void tearDown2() throws Exception {
-    super.tearDown2();
+  public void tearDownBeforeDisconnect() throws Exception {
+    super.tearDownBeforeDisconnect();
     // close the clients first
     client1.invoke(SecurityTestUtil.class, "closeCache");
     client2.invoke(SecurityTestUtil.class, "closeCache");
@@ -199,7 +200,7 @@ public class DeltaClientAuthorizationDUnitTest extends
         getLogWriter().info("Got expected exception when doing puts: " + ex);
       }
       else {
-        fail("Got unexpected exception when doing puts", ex);
+        Assert.fail("Got unexpected exception when doing puts", ex);
       }
     }
     for (int index = 0; index < num.intValue(); ++index) {
@@ -220,7 +221,7 @@ public class DeltaClientAuthorizationDUnitTest extends
           continue;
         }
         else {
-          fail("Got unexpected exception when doing puts", ex);
+          Assert.fail("Got unexpected exception when doing puts", ex);
         }
       }
       catch (ServerConnectivityException ex) {
@@ -249,7 +250,7 @@ public class DeltaClientAuthorizationDUnitTest extends
           getLogWriter().info("Got expected exception when doing puts: " + ex);
         }
         else {
-          fail("Got unexpected exception when doing puts", ex);
+          Assert.fail("Got unexpected exception when doing puts", ex);
         }
       }
       catch (Exception ex) {
@@ -257,7 +258,7 @@ public class DeltaClientAuthorizationDUnitTest extends
           getLogWriter().info("Got expected exception when doing puts: " + ex);
         }
         else {
-          fail("Got unexpected exception when doing puts", ex);
+          Assert.fail("Got unexpected exception when doing puts", ex);
         }
       }
     }
@@ -277,7 +278,7 @@ public class DeltaClientAuthorizationDUnitTest extends
         getLogWriter().info("Got expected exception when doing gets: " + ex);
       }
       else {
-        fail("Got unexpected exception when doing gets", ex);
+        Assert.fail("Got unexpected exception when doing gets", ex);
       }
     }
     for (int index = 0; index < num.intValue(); ++index) {
@@ -301,7 +302,7 @@ public class DeltaClientAuthorizationDUnitTest extends
           continue;
         }
         else {
-          fail("Got unexpected exception when doing puts", ex);
+          Assert.fail("Got unexpected exception when doing puts", ex);
         }
       }
       catch (ServerConnectivityException ex) {
@@ -316,7 +317,7 @@ public class DeltaClientAuthorizationDUnitTest extends
           getLogWriter().info("Got expected exception when doing gets: " + ex);
         }
         else {
-          fail("Got unexpected exception when doing gets", ex);
+          Assert.fail("Got unexpected exception when doing gets", ex);
         }
       }
       catch (Exception ex) {
@@ -324,7 +325,7 @@ public class DeltaClientAuthorizationDUnitTest extends
           getLogWriter().info("Got expected exception when doing gets: " + ex);
         }
         else {
-          fail("Got unexpected exception when doing gets", ex);
+          Assert.fail("Got unexpected exception when doing gets", ex);
         }
       }
       assertNotNull(value);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
index 94b603e..603aca4 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
@@ -40,7 +40,9 @@ import com.gemstone.gemfire.cache.query.CqException;
 import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.util.Callable;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.VM;
 
 /**
@@ -74,9 +76,9 @@ public class DeltaClientPostAuthorizationDUnitTest extends
     SecurityTestUtil.registerExpectedExceptions(clientExpectedExceptions);
   }
 
-  public void tearDown2() throws Exception {
+  public void tearDownBeforeDisconnect() throws Exception {
 
-    super.tearDown2();
+    super.tearDownBeforeDisconnect();
     // close the clients first
     client1.invoke(SecurityTestUtil.class, "closeCache");
     client2.invoke(SecurityTestUtil.class, "closeCache");
@@ -87,8 +89,8 @@ public class DeltaClientPostAuthorizationDUnitTest extends
   }
 
   public void testPutPostOpNotifications() throws Exception {
-    addExpectedException("Unexpected IOException");
-    addExpectedException("SocketException");
+    IgnoredException.addIgnoredException("Unexpected IOException");
+    IgnoredException.addIgnoredException("SocketException");
 
     OperationWithAction[] allOps = {
         // Test CREATE and verify with a GET
@@ -525,7 +527,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
           continue;
         }
         else {
-          fail("doOp: Got unexpected exception when doing operation. Policy = " 
+          Assert.fail("doOp: Got unexpected exception when doing operation. Policy = " 
               + policy + " flags = " + OpFlags.description(flags), ex);
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
index 2ff0b2e..eb9cdc5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
@@ -38,9 +38,13 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.MembershipManager;
 import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper;
 import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
 import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 
 /**
  * Tests peer to peer authentication in Gemfire
@@ -94,7 +98,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "26753");
     props.setProperty(DistributionConfig.LOCATORS_NAME, 
-                      DistributedTestCase.getIPLiteral() + "[" + port + "]");
+                      NetworkSupport.getIPLiteral() + "[" + port + "]");
     props.setProperty(DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
         "templates.security.UserPasswordAuthInit.create");
     props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
@@ -111,7 +115,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
     props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "26753");
     props.setProperty(DistributionConfig.LOCATORS_NAME, 
-                      DistributedTestCase.getIPLiteral() +"[" + port + "]");
+                      NetworkSupport.getIPLiteral() +"[" + port + "]");
     props.setProperty(DistributionConfig.SECURITY_PEER_AUTHENTICATOR_NAME,
         "templates.security.LdapUserAuthenticator.create");
     props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
@@ -162,7 +166,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
     }
     String authInit = " Incorrect_AuthInitialize";
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() + "[" + port + "]";
+    final String locators = NetworkSupport.getIPLiteral() + "[" + port + "]";
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
@@ -173,7 +177,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
             getUniqueName(), new Integer(port), props, javaProps,
             expectedExceptions});
 
-    LogWriter dsLogger = createLogWriter(props);
+    LogWriter dsLogger = DUnitEnv.createLogWriter(props);
     SecurityTestUtil.addExpectedExceptions(expectedExceptions, dsLogger);
     try {
       new SecurityTestUtil("tmp").createSystem(props, null);
@@ -200,7 +204,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
       props = new Properties();
     }
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() +"["+port+"]";
+    final String locators = NetworkSupport.getIPLiteral() +"["+port+"]";
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
@@ -211,7 +215,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
             getUniqueName(), new Integer(port), props, javaProps,
             expectedExceptions });
 
-    LogWriter dsLogger = createLogWriter(props);
+    LogWriter dsLogger = DUnitEnv.createLogWriter(props);
     SecurityTestUtil.addExpectedExceptions(expectedExceptions, dsLogger);
     try {
       new SecurityTestUtil("tmp").createSystem(props, javaProps);
@@ -240,7 +244,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
       props = new Properties();
     }
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() +"["+port+"]";
+    final String locators = NetworkSupport.getIPLiteral() +"["+port+"]";
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
@@ -251,7 +255,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
             getUniqueName(), new Integer(port), props, javaProps,
             expectedExceptions });
 
-    LogWriter dsLogger = createLogWriter(props);
+    LogWriter dsLogger = DUnitEnv.createLogWriter(props);
     SecurityTestUtil.addExpectedExceptions(expectedExceptions, dsLogger);
     try {
       new SecurityTestUtil("tmp").createSystem(props, null);
@@ -278,7 +282,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
       props = new Properties();
     }
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() +"["+port+"]";
+    final String locators = NetworkSupport.getIPLiteral() +"["+port+"]";
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
@@ -306,7 +310,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
       throws Exception {
 
     disconnectAllFromDS();
-    addExpectedException("Authentication failed");
+    IgnoredException.addIgnoredException("Authentication failed");
 
     CredentialGenerator gen = new DummyCredentialGenerator();
     Properties props = gen.getSystemProperties();
@@ -316,7 +320,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
       props = new Properties();
     }
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() +"["+port+"]";
+    final String locators = NetworkSupport.getIPLiteral() +"["+port+"]";
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
@@ -336,7 +340,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
       javaProps = gen.getJavaProperties();
       props.putAll(credentials);
 
-      LogWriter dsLogger = createLogWriter(props);
+      LogWriter dsLogger = DUnitEnv.createLogWriter(props);
       SecurityTestUtil.addExpectedExceptions(expectedExceptions, dsLogger);
       try {
         new SecurityTestUtil("tmp").createSystem(props, javaProps);
@@ -398,7 +402,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
     // Start the locator with the LDAP authenticator
     Properties props = new Properties();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() +"["+port+"]";
+    final String locators = NetworkSupport.getIPLiteral() +"["+port+"]";
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
         authInit);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTHENTICATOR_NAME,
@@ -446,7 +450,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
         props, javaProps });
 
     // wait for view propagation
-    pause(2000);
+    Wait.pause(2000);
     // Verify the number of members on all peers and locator
     locatorVM.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
         new Object[] { new Integer(4) });
@@ -458,7 +462,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
 
     // Disconnect the first peer and check again
     disconnectFromDS();
-    pause(2000);
+    Wait.pause(2000);
     locatorVM.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
         new Object[] { new Integer(3) });
     peer2.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
@@ -468,7 +472,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
 
     // Disconnect the second peer and check again
     peer2.invoke(DistributedTestCase.class, "disconnectFromDS");
-    pause(2000);
+    Wait.pause(2000);
     locatorVM.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
         new Object[] { new Integer(2) });
     peer3.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
@@ -476,7 +480,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
 
     // Same for last peer
     peer3.invoke(DistributedTestCase.class, "disconnectFromDS");
-    pause(2000);
+    Wait.pause(2000);
     locatorVM.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
         new Object[] { new Integer(1) });
 
@@ -514,7 +518,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
     // Start the locator with the Dummy authenticator
     Properties props = new Properties();
     int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final String locators = DistributedTestCase.getIPLiteral() +"["+port+"]";
+    final String locators = NetworkSupport.getIPLiteral() +"["+port+"]";
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME,
         authInit);
     setProperty(props, DistributionConfig.SECURITY_PEER_AUTHENTICATOR_NAME,
@@ -550,7 +554,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
     props.putAll(credentials);
     props.putAll(extraProps);
 
-    LogWriter dsLogger = createLogWriter(props);
+    LogWriter dsLogger = DUnitEnv.createLogWriter(props);
     SecurityTestUtil.addExpectedExceptions(
         new String[] { IllegalArgumentException.class.getName() }, dsLogger);
     try {
@@ -582,7 +586,7 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
         props, javaProps });
 
     // wait for view propagation
-    pause(2000);
+    Wait.pause(2000);
     // Verify the number of members on all peers and locator
     locatorVM.invoke(P2PAuthenticationDUnitTest.class, "verifyMembers",
         new Object[] { new Integer(4) });


Mime
View raw message