geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject geode git commit: GEODE-2751 UniversalMembershipListenerAdapterDUnitTest.testSystemClientEventsInServer
Date Wed, 05 Apr 2017 16:33:49 GMT
Repository: geode
Updated Branches:
  refs/heads/develop edd018b97 -> 02a31e22a


GEODE-2751 UniversalMembershipListenerAdapterDUnitTest.testSystemClientEventsInServer

This forces the test to always use numeric host addresses


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

Branch: refs/heads/develop
Commit: 02a31e22ad350a84ea2797562d13c6b16262481b
Parents: edd018b
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Apr 5 09:22:19 2017 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Wed Apr 5 09:29:43 2017 -0700

----------------------------------------------------------------------
 ...UniversalMembershipListenerAdapterDUnitTest.java | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/02a31e22/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
index 66c6f7c..6b952e0 100644
--- a/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
@@ -18,6 +18,8 @@ import static org.apache.geode.distributed.ConfigurationProperties.*;
 import static org.apache.geode.test.dunit.Assert.*;
 import static org.apache.geode.test.dunit.LogWriterUtils.*;
 
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.test.dunit.Invoke;
 import org.awaitility.Awaitility;
 
 import java.io.IOException;
@@ -29,6 +31,7 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.geode.distributed.internal.ServerLocation;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -93,6 +96,16 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /** Millis to wait for all three event listeners to be notified */
   private static final int ASYNC_EVENT_WAIT_MILLIS = 30000; // use Integer.MAX_VALUE for
debugging
 
+  @Before
+  public void setTestToUseIpAddresses() {
+    SocketCreator.resolve_dns = false;
+    SocketCreator.use_client_host_name = false;
+    Invoke.invokeInEveryVM(() -> {
+      SocketCreator.resolve_dns = false;
+      SocketCreator.use_client_host_name = false;
+    });
+  }
+
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     InternalClientMembership.unregisterAllListeners();
@@ -503,6 +516,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     assertTrue(firedAdapter[JOINED]);
     assertEquals(clientMember, memberAdapter[JOINED]);
+    assertFalse(SocketCreator.resolve_dns);
     assertEquals(clientMemberId, memberIdAdapter[JOINED]);
     assertTrue(isClientAdapter[JOINED]);
     assertFalse(firedAdapter[LEFT]);
@@ -1852,7 +1866,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     config.put(MCAST_PORT, "0");
     config.put(LOCATORS, "");
     // config.put(LOG_LEVEL, "fine");
-    // config.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "false");
+    config.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "false");
     getSystem(config);
 
     System.out.println("[testServerEventsInLonerClient] create system bridge client");


Mime
View raw message