You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/03/04 23:20:35 UTC

[1/2] incubator-geode git commit: Intial experimentation

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1050 23950e80f -> 30796b075


Intial experimentation


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/216194bf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/216194bf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/216194bf

Branch: refs/heads/feature/GEODE-1050
Commit: 216194bf8c800e9689be3099cc5a5f54adfbc0ba
Parents: 23950e8
Author: Kirk Lund <kl...@apache.org>
Authored: Fri Mar 4 14:13:03 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
Committed: Fri Mar 4 14:13:03 2016 -0800

----------------------------------------------------------------------
 .../distributed/DistributedMemberDUnitTest.java |  26 +-
 .../distributed/DistributedSystemDUnitTest.java |  34 +-
 .../test/dunit/internal/DistributedTest.java    |  61 +++
 .../internal/junit3/DistributedTestCase.java    | 288 ++++++++++
 .../internal/junit4/DistributedTestCase.java    | 548 +++++++++++++++++++
 5 files changed, 937 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/216194bf/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
index 3dc6d75..9b04796 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.distributed;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Arrays;
@@ -31,14 +33,14 @@ import com.gemstone.gemfire.distributed.internal.DM;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.internal.junit4.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 junit.framework.AssertionFailedError;
+import org.junit.Test;
 
 /**
  * Tests the functionality of the {@link DistributedMember} class.
@@ -48,10 +50,6 @@ import junit.framework.AssertionFailedError;
  */
 public class DistributedMemberDUnitTest extends DistributedTestCase {
 
-  public DistributedMemberDUnitTest(String name) {
-    super(name);
-  }
-  
   protected void sleep(long millis) {
     try {
       Thread.sleep(millis);
@@ -64,6 +62,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
   /**
    * Tests default settings.
    */
+  @Test
   public void testDefaults() {
     Properties config = new Properties();
     config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); 
@@ -94,6 +93,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testNonDefaultName() {
     Properties config = new Properties();
     config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); 
@@ -118,6 +118,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
    * Tests the configuration of many Roles and groups in one vm.
    * Confirms no runtime distinction between roles and groups.
    */
+  @Test
   public void testRolesInOneVM() {
     final String rolesProp = "A,B,C";
     final String groupsProp = "D,E,F,G";
@@ -152,6 +153,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testTwoMembersSameName() {
     disconnectFromDS(); // or assertion on # members fails when run-dunit-tests
     Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
@@ -185,7 +187,8 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
    * Tests the configuration of one unique Role in each of four vms. Verifies 
    * that each vm is aware of the other vms' Roles.
    */
-  public void testRolesInAllVMs() {  
+  @Test
+  public void testRolesInAllVMs() {
     disconnectAllFromDS(); // or assertion on # members fails when run-dunit-tests
 
     // connect all four vms...
@@ -268,7 +271,8 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
    * Tests the configuration of one unique group in each of four vms. Verifies 
    * that each vm is aware of the other vms' groups.
    */
-  public void testGroupsInAllVMs() {  
+  @Test
+  public void testGroupsInAllVMs() {
     disconnectFromDS(); // or assertion on # members fails when run-dunit-tests
 
     // connect all four vms...
@@ -359,6 +363,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
    * Changing the id can result in bad keys in JMX and can result in numerous
    * errors in Admin/JMX tests.
    */
+  @Test
   public void testGetId() {
     Properties config = new Properties();
     config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -378,7 +383,8 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
       system.disconnect();
     }
   }
-  
+
+  @Test
   public void testFindMemberByName() {
     disconnectAllFromDS(); // or assertion on # members fails when run-dunit-tests
     VM vm0 = Host.getHost(0).getVM(0);
@@ -408,7 +414,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
           assertTrue("Expected" + expected + " got " + members, members.containsAll(expected));
           assertEquals(4, members.size());
         } catch (UnknownHostException e) {
-          Assert.fail("Unable to get IpAddress", e);
+          fail("Unable to get IpAddress", e);
         }
       }
     });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/216194bf/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
index fcaaa2d..2c39329 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.distributed;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
@@ -44,11 +46,12 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershi
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import org.junit.Test;
 
 /**
  * Tests the functionality of the {@link DistributedSystem} class.
@@ -59,12 +62,11 @@ import com.gemstone.gemfire.test.dunit.VM;
  */
 public class DistributedSystemDUnitTest extends DistributedTestCase {
 
-  public DistributedSystemDUnitTest(String name) {
-    super(name);
-  }
+//  public DistributedSystemDUnitTest(String name) {
+//    super(name);
+//  }
   
-  public void setUp() throws Exception {
-    super.setUp();
+  public void postSetUp() throws Exception {
     disconnectAllFromDS();
   }
   
@@ -74,6 +76,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
    * ensure that waitForMemberDeparture correctly flushes the serial message queue for
    * the given member
    */
+  @Test
   public void testWaitForDeparture() throws Exception {
     disconnectAllFromDS();
     int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -143,6 +146,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
    * Tests that we can get a DistributedSystem with the same
    * configuration twice.
    */
+  @Test
   public void testGetSameSystemTwice() {
     Properties config = new Properties();
 
@@ -165,6 +169,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
    * different configuration after one has already been obtained
    * throws an exception.
    */
+  @Test
   public void testGetDifferentSystem() {
     Properties config = new Properties();
 
@@ -196,6 +201,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
    * Tests getting a system with a different configuration after
    * another system has been closed.
    */
+  @Test
   public void testGetDifferentSystemAfterClose() {
     Properties config = new Properties();
 
@@ -213,8 +219,9 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
     DistributedSystem system2 = DistributedSystem.connect(config);
     system2.disconnect();
   }
-  
-  
+
+
+  @Test
   public void testGetProperties() {
     Properties config = new Properties();
 
@@ -235,8 +242,9 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
     assertTrue(config != system1.getProperties());
     assertEquals(unusedPort, Integer.parseInt(system1.getProperties().getProperty("mcast-port")));
   }
-  
-  
+
+
+  @Test
   public void testIsolatedDistributedSystem() throws Exception {
     Properties config = new Properties();
     config.setProperty("mcast-port", "0");
@@ -255,6 +263,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
 
 
   /** test the ability to set the port used to listen for tcp/ip connections */
+  @Test
   public void testSpecificTcpPort() throws Exception {
     Properties config = new Properties();
     int tcpPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -269,6 +278,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
   }
 
   /** test that loopback cannot be used as a bind address when a locator w/o a bind address is being used */
+  @Test
   public void testLoopbackNotAllowed() throws Exception {
 	  // DISABLED for bug #49926
     InetAddress loopback = null;
@@ -302,6 +312,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
     }
   }
 
+  @Test
   public void testUDPPortRange() throws Exception {
     Properties config = new Properties();
     int unicastPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -317,6 +328,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
     assertTrue(unicastPort <= idm.getPort() && idm.getDirectChannelPort() <= unicastPort+2);
   }
 
+  @Test
   public void testMembershipPortRangeWithExactThreeValues() throws Exception {
     Properties config = new Properties();
     config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
@@ -335,6 +347,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
     assertTrue(idm.getDirectChannelPort() >= DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[0]);
   }
 
+  @Test
   public void testConflictingUDPPort() throws Exception {
     final Properties config = new Properties();
     final int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.MULTICAST);
@@ -373,6 +386,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
    *
    * @since 4.0
    */
+  @Test
   public void testEmptyCacheXmlFile() throws Exception {
     Properties config = new Properties();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/216194bf/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTest.java
new file mode 100755
index 0000000..62caad0
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.gemstone.gemfire.test.dunit.internal;
+
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+
+import java.util.Properties;
+
+/**
+ * Created by klund on 2/25/2016.
+ */
+public interface DistributedTest {
+
+  /**
+   * <code>preSetUp()</code> is invoked before DistributedTestCase#setUp().
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void preSetUp() throws Exception;
+
+  /**
+   * <code>postSetUp()</code> is invoked after DistributedTestCase#setUp().
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void postSetUp() throws Exception;
+
+  /**
+   * <code>preTearDown()</code> is invoked before DistributedTestCase#tearDown().
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void preTearDown() throws Exception;
+
+  /**
+   * <code>postTearDown()</code> is invoked after DistributedTestCase#tearDown().
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void postTearDown() throws Exception;
+
+  public Properties getDistributedSystemProperties();
+
+  public InternalDistributedSystem getSystem(final Properties props); // TODO: remove and make final in DistributedTestCase
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/216194bf/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit3/DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit3/DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit3/DistributedTestCase.java
new file mode 100755
index 0000000..2ebf144
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit3/DistributedTestCase.java
@@ -0,0 +1,288 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.gemstone.gemfire.test.dunit.internal.junit3;
+
+import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.hdfs.internal.hoplog.HoplogConfig;
+import com.gemstone.gemfire.cache.query.QueryTestUtils;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.cache30.GlobalLockingDUnitTest;
+import com.gemstone.gemfire.cache30.MultiVMRegionTestCase;
+import com.gemstone.gemfire.cache30.RegionTestCase;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.SocketCreator;
+import com.gemstone.gemfire.internal.admin.ClientStatsManager;
+import com.gemstone.gemfire.internal.cache.DiskStoreObserver;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
+import com.gemstone.gemfire.internal.cache.InitialImageOperation;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.tier.InternalClientMembership;
+import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.management.internal.cli.LogWrapper;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.internal.DistributedTest;
+import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
+import junit.framework.TestCase;
+import org.apache.logging.log4j.Logger;
+import org.junit.experimental.categories.Category;
+
+import java.io.Serializable;
+import java.text.DecimalFormat;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * This class is the superclass of all distributed unit tests.
+ *
+ * tests/hydra/JUnitTestTask is the main DUnit driver. It supports two
+ * additional public static methods if they are defined in the test case:
+ *
+ * public static void caseSetUp() -- comparable to JUnit's BeforeClass annotation
+ *
+ * public static void caseTearDown() -- comparable to JUnit's AfterClass annotation
+ *
+ * @author David Whitlock
+ */
+@Category(com.gemstone.gemfire.test.junit.categories.DistributedTest.class)
+public abstract class DistributedTestCase extends TestCase implements DistributedTest, Serializable {
+
+  private final com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase delegate = new com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase(this);
+
+  private static final Logger logger = LogService.getLogger();
+
+  private static final Set<String> testHistory = new LinkedHashSet<String>();
+
+  /** This VM's connection to the distributed system */
+  public static InternalDistributedSystem system;
+  private static Class lastSystemCreatedInTest;
+  private static Properties lastSystemProperties;
+  private static volatile String testMethodName;
+
+  /** For formatting timing info */
+  private static final DecimalFormat format = new DecimalFormat("###.###");
+
+  public static boolean reconnect = false;
+
+  public static final boolean logPerTest = Boolean.getBoolean("dunitLogPerTest");
+
+  static {
+    com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase.initializeDistributedTestCase();
+  }
+
+  /**
+   * Creates a new <code>DistributedTestCase</code> test with the
+   * given name.
+   */
+  public DistributedTestCase(final String name) {
+    super(name);
+  }
+
+  //---------------------------------------------------------------------------
+  // methods for tests
+  //---------------------------------------------------------------------------
+
+  public final void setSystem(final Properties props, final DistributedSystem ds) { // TODO: override getDistributedSystemProperties and then delete
+    delegate.setSystem(props, ds);
+  }
+
+  /**
+   * Returns this VM's connection to the distributed system.  If
+   * necessary, the connection will be lazily created using the given
+   * <code>Properties</code>.  Note that this method uses hydra's
+   * configuration to determine the location of log files, etc.
+   * Note: "final" was removed so that WANTestBase can override this method.
+   * This was part of the xd offheap merge.
+   *
+   * see hydra.DistributedConnectionMgr#connect
+   * @since 3.0
+   */
+  public /*final*/ InternalDistributedSystem getSystem(final Properties props) { // TODO: make final
+    return delegate.getSystem(props);
+  }
+
+  /**
+   * Returns this VM's connection to the distributed system.  If
+   * necessary, the connection will be lazily created using the
+   * <code>Properties</code> returned by {@link
+   * #getDistributedSystemProperties}.
+   *
+   * @see #getSystem(Properties)
+   *
+   * @since 3.0
+   */
+  public final InternalDistributedSystem getSystem() {
+    return delegate.getSystem();
+  }
+
+  /**
+   * Returns a loner distributed system that isn't connected to other
+   * vms
+   *
+   * @since 6.5
+   */
+  public final InternalDistributedSystem getLonerSystem() {
+    return delegate.getLonerSystem();
+  }
+
+  /**
+   * Returns a loner distributed system in combination with enforceUniqueHost
+   * and redundancyZone properties.
+   * Added specifically to test scenario of defect #47181.
+   */
+  public final InternalDistributedSystem getLonerSystemWithEnforceUniqueHost() {
+    return delegate.getLonerSystemWithEnforceUniqueHost();
+  }
+
+  /**
+   * Returns whether or this VM is connected to a {@link
+   * DistributedSystem}.
+   */
+  public final boolean isConnectedToDS() {
+    return delegate.isConnectedToDS();
+  }
+
+  /**
+   * Returns a <code>Properties</code> object used to configure a
+   * connection to a {@link
+   * com.gemstone.gemfire.distributed.DistributedSystem}.
+   * Unless overridden, this method will return an empty
+   * <code>Properties</code> object.
+   *
+   * @since 3.0
+   */
+  public Properties getDistributedSystemProperties() {
+    return delegate.getDistributedSystemProperties();
+  }
+
+  public static void disconnectAllFromDS() {
+    com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase.disconnectAllFromDS();
+  }
+
+  /**
+   * Disconnects this VM from the distributed system
+   */
+  public static void disconnectFromDS() {
+    com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase.disconnectFromDS();
+  }
+
+  //---------------------------------------------------------------------------
+  // name methods
+  //---------------------------------------------------------------------------
+
+  public static String getTestMethodName() {
+    return com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase.getTestMethodName();
+  }
+
+  public static void setTestMethodName(final String testMethodName) { // TODO: delete
+    com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase.setTestMethodName(testMethodName);
+  }
+
+  /**
+   * Returns a unique name for this test method.  It is based on the
+   * name of the class as well as the name of the method.
+   */
+  public String getUniqueName() {
+    return delegate.getUniqueName();
+  }
+
+  //---------------------------------------------------------------------------
+  // setup methods
+  //---------------------------------------------------------------------------
+
+  /**
+   * Sets up the DistributedTestCase.
+   * <p>
+   * Do not override this method. Override {@link #preSetUp()} with work that
+   * needs to occur before setUp() or override {@link #postSetUp()} with work
+   * that needs to occur after setUp().
+   */
+  @Override
+  public void setUp() throws Exception {
+    delegate.setUp();
+  }
+
+  /**
+   * <code>preSetUp()</code> is invoked before #setUpDistributedTestCase().
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void preSetUp() throws Exception {
+  }
+
+  /**
+   * <code>postSetUp()</code> is invoked after #setUpDistributedTestCase().
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void postSetUp() throws Exception {
+  }
+
+  //---------------------------------------------------------------------------
+  // teardown methods
+  //---------------------------------------------------------------------------
+
+  /**
+   * Tears down the DistributedTestCase.
+   * <p>
+   * Do not override this method. Override {@link #preTearDown()} with work that
+   * needs to occur before tearDown() or override {@link #postTearDown()} with work
+   * that needs to occur after tearDown().
+   */
+  @Override
+  public final void tearDown() throws Exception {
+    delegate.tearDown();
+  }
+
+  /**
+   * <code>preTearDown()</code> is invoked before {@link com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase#tearDownDistributedTestCase()}.
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void preTearDown() throws Exception {
+  }
+
+  /**
+   * <code>postTearDown()</code> is invoked after {@link com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase#tearDownDistributedTestCase()}.
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void postTearDown() throws Exception {
+  }
+
+  public static void cleanupAllVms() { // TODO: make private
+    com.gemstone.gemfire.test.dunit.internal.junit4.DistributedTestCase.cleanupAllVms();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/216194bf/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit4/DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit4/DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit4/DistributedTestCase.java
new file mode 100755
index 0000000..2b0755d
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/junit4/DistributedTestCase.java
@@ -0,0 +1,548 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.gemstone.gemfire.test.dunit.internal.junit4;
+
+import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.hdfs.internal.hoplog.HoplogConfig;
+import com.gemstone.gemfire.cache.query.QueryTestUtils;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.cache30.GlobalLockingDUnitTest;
+import com.gemstone.gemfire.cache30.MultiVMRegionTestCase;
+import com.gemstone.gemfire.cache30.RegionTestCase;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.SocketCreator;
+import com.gemstone.gemfire.internal.admin.ClientStatsManager;
+import com.gemstone.gemfire.internal.cache.DiskStoreObserver;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
+import com.gemstone.gemfire.internal.cache.InitialImageOperation;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.tier.InternalClientMembership;
+import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.management.internal.cli.LogWrapper;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.internal.DistributedTest;
+import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
+import com.gemstone.gemfire.test.junit.rules.serializable.SerializableTestName;
+import org.apache.logging.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+
+import java.io.Serializable;
+import java.text.DecimalFormat;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * This class is the base class for all distributed unit tests.
+ */
+public class DistributedTestCase implements DistributedTest, Serializable {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private static final Set<String> testHistory = new LinkedHashSet<String>();
+
+  /** This VM's connection to the distributed system */
+  public static InternalDistributedSystem system;
+  private static Class lastSystemCreatedInTest;
+  private static Properties lastSystemProperties;
+  private static volatile String testMethodName;
+
+  /** For formatting timing info */
+  private static final DecimalFormat format = new DecimalFormat("###.###");
+
+  public static boolean reconnect = false;
+
+  public static final boolean logPerTest = Boolean.getBoolean("dunitLogPerTest");
+
+  private final Class<?> testClass; // TODO: optimize this into one var
+  private final DistributedTest test;
+
+  public DistributedTestCase() {
+    this.test = this;
+    this.testClass = getClass();
+  }
+
+  public DistributedTestCase(final DistributedTest test) {
+    this.test = test;
+    this.testClass = test.getClass();
+  }
+
+  @Rule
+  public SerializableTestName testName = new SerializableTestName();
+
+  @BeforeClass
+  public static void initializeDistributedTestCase() {
+    DUnitLauncher.launchIfNeeded();
+  }
+
+  public final String getName() {
+    return this.testName.getMethodName();
+  }
+
+  public final Class<?> getTestClass() {
+    return this.testClass;
+  }
+
+  //---------------------------------------------------------------------------
+  // methods for tests
+  //---------------------------------------------------------------------------
+
+  public final void setSystem(final Properties props, final DistributedSystem ds) { // TODO: override getDistributedSystemProperties and then delete
+    system = (InternalDistributedSystem)ds;
+    lastSystemProperties = props;
+    lastSystemCreatedInTest = getTestClass(); // used to be getDeclaringClass()
+  }
+
+  /**
+   * Returns this VM's connection to the distributed system.  If
+   * necessary, the connection will be lazily created using the given
+   * <code>Properties</code>.  Note that this method uses hydra's
+   * configuration to determine the location of log files, etc.
+   * Note: "final" was removed so that WANTestBase can override this method.
+   * This was part of the xd offheap merge.
+   *
+   * see hydra.DistributedConnectionMgr#connect
+   * @since 3.0
+   */
+  public /*final*/ InternalDistributedSystem getSystem(final Properties props) { // TODO: make final
+    // Setting the default disk store name is now done in setUp
+    if (system == null) {
+      system = InternalDistributedSystem.getAnyInstance();
+    }
+    if (system == null || !system.isConnected()) {
+      // Figure out our distributed system properties
+      Properties p = DistributedTestUtils.getAllDistributedSystemProperties(props);
+      lastSystemCreatedInTest = getTestClass(); // used to be getDeclaringClass()
+      if (logPerTest) {
+        String testMethod = getTestMethodName();
+        String testName = lastSystemCreatedInTest.getName() + '-' + testMethod;
+        String oldLogFile = p.getProperty(DistributionConfig.LOG_FILE_NAME);
+        p.put(DistributionConfig.LOG_FILE_NAME,
+            oldLogFile.replace("system.log", testName+".log"));
+        String oldStatFile = p.getProperty(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME);
+        p.put(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME,
+            oldStatFile.replace("statArchive.gfs", testName+".gfs"));
+      }
+      system = (InternalDistributedSystem)DistributedSystem.connect(p);
+      lastSystemProperties = p;
+    } else {
+      boolean needNewSystem = false;
+      if(!getTestClass().equals(lastSystemCreatedInTest)) { // used to be getDeclaringClass()
+        Properties newProps = DistributedTestUtils.getAllDistributedSystemProperties(props);
+        needNewSystem = !newProps.equals(lastSystemProperties);
+        if(needNewSystem) {
+          LogWriterUtils.getLogWriter().info(
+              "Test class has changed and the new DS properties are not an exact match. "
+                  + "Forcing DS disconnect. Old props = "
+                  + lastSystemProperties + "new props=" + newProps);
+        }
+      } else {
+        Properties activeProps = system.getProperties();
+        for (Iterator iter = props.entrySet().iterator();
+             iter.hasNext(); ) {
+          Map.Entry entry = (Map.Entry) iter.next();
+          String key = (String) entry.getKey();
+          String value = (String) entry.getValue();
+          if (!value.equals(activeProps.getProperty(key))) {
+            needNewSystem = true;
+            LogWriterUtils.getLogWriter().info("Forcing DS disconnect. For property " + key
+                + " old value = " + activeProps.getProperty(key)
+                + " new value = " + value);
+            break;
+          }
+        }
+      }
+      if(needNewSystem) {
+        // the current system does not meet our needs to disconnect and
+        // call recursively to get a new system.
+        LogWriterUtils.getLogWriter().info("Disconnecting from current DS in order to make a new one");
+        disconnectFromDS();
+        getSystem(props);
+      }
+    }
+    return system;
+  }
+
+  /**
+   * Returns this VM's connection to the distributed system.  If
+   * necessary, the connection will be lazily created using the
+   * <code>Properties</code> returned by {@link
+   * #getDistributedSystemProperties}.
+   *
+   * @see #getSystem(Properties)
+   *
+   * @since 3.0
+   */
+  public final InternalDistributedSystem getSystem() {
+    return getSystem(getDistributedSystemProperties());
+  }
+
+  /**
+   * Returns a loner distributed system that isn't connected to other
+   * vms
+   *
+   * @since 6.5
+   */
+  public final InternalDistributedSystem getLonerSystem() {
+    Properties props = getDistributedSystemProperties();
+    props.put(DistributionConfig.MCAST_PORT_NAME, "0");
+    props.put(DistributionConfig.LOCATORS_NAME, "");
+    return getSystem(props);
+  }
+
+  /**
+   * Returns a loner distributed system in combination with enforceUniqueHost
+   * and redundancyZone properties.
+   * Added specifically to test scenario of defect #47181.
+   */
+  public final InternalDistributedSystem getLonerSystemWithEnforceUniqueHost() {
+    Properties props = getDistributedSystemProperties();
+    props.put(DistributionConfig.MCAST_PORT_NAME, "0");
+    props.put(DistributionConfig.LOCATORS_NAME, "");
+    props.put(DistributionConfig.ENFORCE_UNIQUE_HOST_NAME, "true");
+    props.put(DistributionConfig.REDUNDANCY_ZONE_NAME, "zone1");
+    return getSystem(props);
+  }
+
+  /**
+   * Returns whether or this VM is connected to a {@link
+   * DistributedSystem}.
+   */
+  public final boolean isConnectedToDS() {
+    return system != null && system.isConnected();
+  }
+
+  /**
+   * Returns a <code>Properties</code> object used to configure a
+   * connection to a {@link
+   * com.gemstone.gemfire.distributed.DistributedSystem}.
+   * Unless overridden, this method will return an empty
+   * <code>Properties</code> object.
+   *
+   * @since 3.0
+   */
+  public Properties getDistributedSystemProperties() {
+    return new Properties();
+  }
+
+  public static void disconnectAllFromDS() {
+    disconnectFromDS();
+    Invoke.invokeInEveryVM(()->disconnectFromDS());
+  }
+
+  /**
+   * Disconnects this VM from the distributed system
+   */
+  public static void disconnectFromDS() {
+    setTestMethodName(null);
+    GemFireCacheImpl.testCacheXml = null;
+    if (system != null) {
+      system.disconnect();
+      system = null;
+    }
+
+    for (;;) {
+      DistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
+      if (ds == null) {
+        break;
+      }
+      try {
+        ds.disconnect();
+      } catch (Exception e) {
+        // ignore
+      }
+    }
+
+    AdminDistributedSystemImpl ads = AdminDistributedSystemImpl.getConnectedInstance();
+    if (ads != null) {// && ads.isConnected()) {
+      ads.disconnect();
+    }
+  }
+
+  //---------------------------------------------------------------------------
+  // name methods
+  //---------------------------------------------------------------------------
+
+  public static String getTestMethodName() {
+    return testMethodName;
+  }
+
+  public static void setTestMethodName(final String testMethodName) { // TODO: delete
+    DistributedTestCase.testMethodName = testMethodName;
+  }
+
+  /**
+   * Returns a unique name for this test method.  It is based on the
+   * name of the class as well as the name of the method.
+   */
+  public String getUniqueName() {
+    return getTestClass().getSimpleName() + "_" + getName();
+  }
+
+  //---------------------------------------------------------------------------
+  // setup methods
+  //---------------------------------------------------------------------------
+
+  /**
+   * Sets up the DistributedTestCase.
+   * <p>
+   * Do not override this method. Override {@link #preSetUp()} with work that
+   * needs to occur before setUp() or override {@link #postSetUp()} with work
+   * that needs to occur after setUp().
+   */
+  @Before
+  public final void setUp() throws Exception {
+    preSetUp();
+    setUpDistributedTestCase();
+    postSetUp();
+  }
+
+  /**
+   * Sets up DistributedTest in controller and remote VMs. This includes the
+   * defining the test name, setting the default disk store name, logging the
+   * test history, and capturing a creation stack for detecting the source of
+   * incompatible DistributedSystem connections.
+   * <p>
+   * Do not override this method.
+   */
+  private final void setUpDistributedTestCase() {
+    final String className = getTestClass().getCanonicalName();
+    final String methodName = getName();
+
+    logTestHistory();
+
+    setUpVM(methodName, getDefaultDiskStoreName(0, -1, className, methodName));
+
+    for (int hostIndex = 0; hostIndex < Host.getHostCount(); hostIndex++) {
+      Host host = Host.getHost(hostIndex);
+      for (int vmIndex = 0; vmIndex < host.getVMCount(); vmIndex++) {
+        final String vmDefaultDiskStoreName = getDefaultDiskStoreName(hostIndex, vmIndex, className, methodName);
+        host.getVM(vmIndex).invoke(()->setUpVM(methodName, vmDefaultDiskStoreName));
+      }
+    }
+
+    logTestStart();
+  }
+
+  /**
+   * <code>preSetUp()</code> is invoked before {@link #setUpDistributedTestCase()}.
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void preSetUp() throws Exception {
+  }
+
+  /**
+   * <code>postSetUp()</code> is invoked after {@link #setUpDistributedTestCase()}.
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void postSetUp() throws Exception {
+  }
+
+  private static String getDefaultDiskStoreName(final int hostIndex, final int vmIndex, final String className, final String methodName) {
+    return "DiskStore-" + String.valueOf(hostIndex) + "-" + String.valueOf(vmIndex) + "-" + className + "." + methodName; // used to be getDeclaringClass()
+  }
+
+  private static void setUpVM(final String methodName, final String defaultDiskStoreName) {
+    setTestMethodName(methodName);
+    GemFireCacheImpl.setDefaultDiskStoreName(defaultDiskStoreName);
+    System.setProperty(HoplogConfig.ALLOW_LOCAL_HDFS_PROP, "true");
+    setUpCreationStackGenerator();
+  }
+
+  private void logTestStart() {
+    System.out.println("\n\n[setup] START TEST " + getTestClass().getSimpleName()+"."+testMethodName+"\n\n");
+  }
+
+  private static void setUpCreationStackGenerator() {
+    // the following is moved from InternalDistributedSystem to fix #51058
+    InternalDistributedSystem.TEST_CREATION_STACK_GENERATOR.set(
+        new InternalDistributedSystem.CreationStackGenerator() {
+          @Override
+          public Throwable generateCreationStack(final DistributionConfig config) {
+            final StringBuilder sb = new StringBuilder();
+            final String[] validAttributeNames = config.getAttributeNames();
+            for (int i = 0; i < validAttributeNames.length; i++) {
+              final String attName = validAttributeNames[i];
+              final Object actualAtt = config.getAttributeObject(attName);
+              String actualAttStr = actualAtt.toString();
+              sb.append("  ");
+              sb.append(attName);
+              sb.append("=\"");
+              if (actualAtt.getClass().isArray()) {
+                actualAttStr = InternalDistributedSystem.arrayToString(actualAtt);
+              }
+              sb.append(actualAttStr);
+              sb.append("\"");
+              sb.append("\n");
+            }
+            return new Throwable("Creating distributed system with the following configuration:\n" + sb.toString());
+          }
+        });
+  }
+
+  /**
+   * Write a message to the log about what tests have ran previously. This
+   * makes it easier to figure out if a previous test may have caused problems
+   */
+  private void logTestHistory() {
+    String classname = getTestClass().getSimpleName();
+    testHistory.add(classname);
+    System.out.println("Previously run tests: " + testHistory);
+  }
+
+  //---------------------------------------------------------------------------
+  // teardown methods
+  //---------------------------------------------------------------------------
+
+  /**
+   * Tears down the DistributedTestCase.
+   * <p>
+   * Do not override this method. Override {@link #preTearDown()} with work that
+   * needs to occur before tearDown() or override {@link #postTearDown()} with work
+   * that needs to occur after tearDown().
+   */
+  @After
+  public final void tearDown() throws Exception {
+    preTearDown();
+    tearDownDistributedTestCase();
+    postTearDown();
+  }
+
+  private final void tearDownDistributedTestCase() throws Exception {
+    Invoke.invokeInEveryVM(()->tearDownCreationStackGenerator());
+    if (logPerTest) {
+      disconnectFromDS();
+      Invoke.invokeInEveryVM(()->disconnectFromDS());
+    }
+    cleanupAllVms();
+  }
+
+  /**
+   * <code>preTearDown()</code> is invoked before {@link #tearDownDistributedTestCase()}.
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void preTearDown() throws Exception {
+  }
+
+  /**
+   * <code>postTearDown()</code> is invoked after {@link #tearDownDistributedTestCase()}.
+   * <p>
+   * Override this as needed. Default implementation is empty.
+   */
+  public void postTearDown() throws Exception {
+  }
+
+  public static void cleanupAllVms() { // TODO: make private
+    tearDownVM();
+    Invoke.invokeInEveryVM(()->tearDownVM());
+    Invoke.invokeInLocator(()->{
+      DistributionMessageObserver.setInstance(null);
+      DistributedTestUtils.unregisterInstantiatorsInThisVM();
+    });
+    DUnitLauncher.closeAndCheckForSuspects();
+  }
+
+  private static void tearDownVM() {
+    closeCache();
+
+    // keep alphabetized to detect duplicate lines
+    CacheCreation.clearThreadLocals();
+    CacheServerTestUtil.clearCacheReference();
+    ClientProxyMembershipID.system = null;
+    ClientServerTestCase.AUTO_LOAD_BALANCE = false;
+    ClientStatsManager.cleanupForTests();
+    DiskStoreObserver.setInstance(null);
+    DistributedTestUtils.unregisterInstantiatorsInThisVM();
+    DistributionMessageObserver.setInstance(null);
+    GlobalLockingDUnitTest.region_testBug32356 = null;
+    InitialImageOperation.slowImageProcessing = 0;
+    InternalClientMembership.unregisterAllListeners();
+    LogWrapper.close();
+    MultiVMRegionTestCase.CCRegion = null;
+    QueryObserverHolder.reset();
+    QueryTestUtils.setCache(null);
+    RegionTestCase.preSnapshotRegion = null;
+    SocketCreator.resetHostNameCache();
+    SocketCreator.resolve_dns = true;
+
+    // clear system properties -- keep alphabetized
+    System.clearProperty("gemfire.log-level");
+    System.clearProperty(HoplogConfig.ALLOW_LOCAL_HDFS_PROP);
+    System.clearProperty("jgroups.resolve_dns");
+
+    if (InternalDistributedSystem.systemAttemptingReconnect != null) {
+      InternalDistributedSystem.systemAttemptingReconnect.stopReconnecting();
+    }
+
+    IgnoredException.removeAllExpectedExceptions();
+  }
+
+  private static void closeCache() {
+    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    if (cache != null && !cache.isClosed()) {
+      destroyRegions(cache);
+      cache.close();
+    }
+  }
+
+  protected static final void destroyRegions(final Cache cache) { // TODO: make private
+    if (cache != null && !cache.isClosed()) {
+      // try to destroy the root regions first so that we clean up any persistent files.
+      for (Iterator itr = cache.rootRegions().iterator(); itr.hasNext();) {
+        Region root = (Region)itr.next();
+        String regionFullPath = root == null ? null : root.getFullPath();
+        // for colocated regions you can't locally destroy a partitioned region.
+        if(root.isDestroyed() || root instanceof HARegion || root instanceof PartitionedRegion) {
+          continue;
+        }
+        try {
+          root.localDestroyRegion("teardown");
+        } catch (Throwable t) {
+          logger.error("Failure during tearDown destroyRegions for " + regionFullPath, t);
+        }
+      }
+    }
+  }
+
+  private static void tearDownCreationStackGenerator() {
+    InternalDistributedSystem.TEST_CREATION_STACK_GENERATOR.set(InternalDistributedSystem.DEFAULT_CREATION_STACK_GENERATOR);
+  }
+}



[2/2] incubator-geode git commit: Add junit categories

Posted by kl...@apache.org.
Add junit categories


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/30796b07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/30796b07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/30796b07

Branch: refs/heads/feature/GEODE-1050
Commit: 30796b075f122b3ff5a35e00a71ee0373db59f8b
Parents: 216194b
Author: Kirk Lund <kl...@apache.org>
Authored: Fri Mar 4 14:20:27 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
Committed: Fri Mar 4 14:20:27 2016 -0800

----------------------------------------------------------------------
 .../gemstone/gemfire/distributed/DistributedMemberDUnitTest.java  | 3 +++
 .../gemstone/gemfire/distributed/DistributedSystemDUnitTest.java  | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/30796b07/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
index 9b04796..c184440 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
@@ -39,8 +39,10 @@ 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.junit.categories.DistributedTest;
 import junit.framework.AssertionFailedError;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests the functionality of the {@link DistributedMember} class.
@@ -48,6 +50,7 @@ import org.junit.Test;
  * @author Kirk Lund
  * @since 5.0
  */
+@Category(DistributedTest.class)
 public class DistributedMemberDUnitTest extends DistributedTestCase {
 
   protected void sleep(long millis) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/30796b07/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
index 2c39329..488238c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
@@ -51,7 +51,9 @@ import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests the functionality of the {@link DistributedSystem} class.
@@ -60,6 +62,7 @@ import org.junit.Test;
  *
  * @author David Whitlock
  */
+@Category(DistributedTest.class)
 public class DistributedSystemDUnitTest extends DistributedTestCase {
 
 //  public DistributedSystemDUnitTest(String name) {