geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [88/98] [abbrv] incubator-geode git commit: GEODE-2000 client should see server-bind-address in event memberId
Date Fri, 28 Oct 2016 21:41:42 GMT
GEODE-2000 client should see server-bind-address in event memberId

The previous fix for this caused confusion as it changed the server
memberId that is used in other places and should remain unchanged.
This change set alters just the listener-invocation code in the client
cache so that client events are based on the ServerLocation information
returned by the Locator or added to the connection pool by applications.

Udo worked with me on this and we found the listener invocation code to
be somewhat convoluted, mixing server-side notification about clients
with client-side notification about servers in the same code.  This
lead to a bit of refactoring in InternalClientMembership to separate the two.

A number of changes had to be made in test code.  Some tests were
requiring that client-side listeners see the server's exact member
ID which is no longer true since the ID being fabricated out of a
ServerLocation doesn't have as much detail as the true member ID and
so is not equal() to it.  Some other test code was creating
ServerLocation objects with non-existent host names.  This is
no longer allowed so we changed these tests to use a numeric IP address.


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

Branch: refs/heads/feature/GEM-983
Commit: 87f2fb5f32f71b0fda74fa61c1237b41f4c7ef11
Parents: a564a69
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Thu Oct 27 09:00:50 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Thu Oct 27 09:03:51 2016 -0700

----------------------------------------------------------------------
 .../internal/DistributionLocatorConfigImpl.java |  23 +-
 .../client/internal/EndpointManagerImpl.java    |   6 +-
 .../membership/InternalDistributedMember.java   |  29 ++-
 .../cache/tier/InternalClientMembership.java    | 139 ++++++-----
 .../cache/tier/sockets/CacheClientUpdater.java  |   2 +-
 .../internal/cache/tier/sockets/HandShake.java  |   4 +-
 .../cache/tier/sockets/ServerConnection.java    |   6 +-
 .../AutoConnectionSourceImplJUnitTest.java      |  55 +++++
 .../pooling/ConnectionManagerJUnitTest.java     |   7 +-
 .../PartitionRegionHelperDUnitTest.java         |   6 -
 .../cache30/ClientMembershipDUnitTest.java      |  77 +++---
 .../internal/DistributionManagerDUnitTest.java  |   2 -
 ...onedRegionQueryEvaluatorIntegrationTest.java |  25 +-
 ...ersalMembershipListenerAdapterDUnitTest.java | 238 +++++++++----------
 .../java/org/apache/geode/test/fake/Fakes.java  |   6 +-
 15 files changed, 334 insertions(+), 291 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
index c3cab6f..851693a 100644
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.admin.internal;
 
+import org.apache.geode.GemFireConfigException;
 import org.apache.geode.admin.DistributionLocator;
 import org.apache.geode.admin.DistributionLocatorConfig;
 import org.apache.geode.distributed.internal.tcpserver.*;
@@ -66,14 +67,20 @@ public class DistributionLocatorConfigImpl extends ManagedEntityConfigImpl
    */
   static DistributionLocatorConfig createConfigFor(String host, int port, InetAddress bindAddress) {
     TcpClient client = new TcpClient();
-    String[] info = null;
-    if (bindAddress != null) {
-      info = client.getInfo(bindAddress, port);
-    } else {
-      info = client.getInfo(InetAddressUtil.toInetAddress(host), port);
-    }
-    if (info == null) {
-      return null;
+    String[] info = new String[] {"unknown", "unknown"};
+
+    try {
+      client = new TcpClient();
+      if (bindAddress != null) {
+        info = client.getInfo(bindAddress, port);
+      } else {
+        info = client.getInfo(InetAddressUtil.toInetAddress(host), port);
+      }
+      if (info == null) {
+        return null;
+      }
+    } catch (GemFireConfigException e) {
+      // communications are not initialized at this point
     }
 
     DistributionLocatorConfigImpl config = new DistributionLocatorConfigImpl();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
index ec8a818..6d5d9d6 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java
@@ -318,7 +318,7 @@ public class EndpointManagerImpl implements EndpointManager {
         return;
       }
       // logger.warn("EMANFIRE:CRASH:"+endpoint.getLocation());
-      InternalClientMembership.notifyCrashed(endpoint.getMemberId(), false);
+      InternalClientMembership.notifyServerCrashed(endpoint.getLocation());
     }
 
     public void endpointNoLongerInUse(Endpoint endpoint) {
@@ -326,7 +326,7 @@ public class EndpointManagerImpl implements EndpointManager {
         return;
       }
       // logger.warn("EMANFIRE:LEFT:"+endpoint.getLocation());
-      InternalClientMembership.notifyLeft(endpoint.getMemberId(), false);
+      InternalClientMembership.notifyServerLeft(endpoint.getLocation());
     }
 
     public void endpointNowInUse(Endpoint endpoint) {
@@ -335,7 +335,7 @@ public class EndpointManagerImpl implements EndpointManager {
       }
       // logger.warn("EMANFIRE:JOIN:"+endpoint.getLocation()+" mid:"+endpoint.getMemberId(),new
       // Exception());
-      InternalClientMembership.notifyJoined(endpoint.getMemberId(), false);
+      InternalClientMembership.notifyServerJoined(endpoint.getLocation());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
index 82dd055..0d4fd9e 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
@@ -15,6 +15,7 @@
 package org.apache.geode.distributed.internal.membership;
 
 import org.apache.geode.DataSerializer;
+import org.apache.geode.GemFireConfigException;
 import org.apache.geode.InternalGemFireError;
 import org.apache.geode.cache.UnsupportedVersionException;
 import org.apache.geode.distributed.DistributedMember;
@@ -23,6 +24,7 @@ import org.apache.geode.distributed.Role;
 import org.apache.geode.distributed.internal.DistributionAdvisor.ProfileId;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.internal.*;
 import org.apache.geode.internal.cache.versions.VersionSource;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -242,11 +244,31 @@ public class InternalDistributedMember implements DistributedMember, Externaliza
    * @param p the membership listening port
    * @throws UnknownHostException if the given hostname cannot be resolved
    */
-  public InternalDistributedMember(String i, int p) throws UnknownHostException {
+  public InternalDistributedMember(String i, int p) {
     this(i, p, Version.CURRENT);
   }
 
   /**
+   * Creates a new InternalDistributedMember for use in notifying membership listeners. The version
+   * information in the ID is set to Version.CURRENT.
+   * 
+   * @param location the coordinates of the server
+   */
+
+  public InternalDistributedMember(ServerLocation location) {
+    this.hostName = location.getHostName();
+    InetAddress addr = null;
+    try {
+      addr = InetAddress.getByName(this.hostName);
+    } catch (UnknownHostException e) {
+      throw new GemFireConfigException("Unable to resolve server location " + location, e);
+    }
+    this.netMbr = MemberFactory.newNetMember(addr, location.getPort());
+    this.vmKind = DistributionManager.NORMAL_DM_TYPE;
+    this.versionObj = Version.CURRENT;
+  }
+
+  /**
    * Create a InternalDistributedMember referring to the current host (as defined by the given
    * string).
    * <p>
@@ -260,7 +282,7 @@ public class InternalDistributedMember implements DistributedMember, Externaliza
    * @param version the version of this member
    * @throws UnknownHostException if the given hostname cannot be resolved
    */
-  public InternalDistributedMember(String i, int p, Version version) throws UnknownHostException {
+  public InternalDistributedMember(String i, int p, Version version) {
     this(i, p, version, MemberFactory.newNetMember(i, p));
   }
 
@@ -272,8 +294,7 @@ public class InternalDistributedMember implements DistributedMember, Externaliza
    * <b> THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE IN THE PRODUCT. IT
    * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. </b>
    **/
-  public InternalDistributedMember(String i, int p, Version version, NetMember netMember)
-      throws UnknownHostException {
+  public InternalDistributedMember(String i, int p, Version version, NetMember netMember) {
     netMbr = netMember;
     defaultToCurrentHost();
     this.vmKind = DistributionManager.NORMAL_DM_TYPE;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
index 656f7de..aeabc86 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
@@ -27,6 +27,8 @@ import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.net.SocketCreator;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelException;
@@ -349,77 +351,77 @@ public final class InternalClientMembership {
 
 
   /**
-   * Notifies registered listeners that a Client member has joined. The new member may be a client
-   * connecting to this process or a server that this process has just connected to.
+   * Notifies registered listeners that a Client member has connected
    *
-   * @param member the <code>DistributedMember</code>
-   * @param client true if the member is a client; false if server
+   * @param clientId the representing the client
    */
-  public static void notifyJoined(final DistributedMember member, final boolean client) {
-    startMonitoring();
-    ThreadPoolExecutor queuedExecutor = executor;
-    if (queuedExecutor == null) {
-      return;
-    }
+  public static void notifyClientJoined(final DistributedMember clientId) {
+    notifyListeners(clientId, true, EventType.JOINED);
+  }
 
-    final ClientMembershipEvent event = new InternalClientMembershipEvent(member, client);
-    if (forceSynchronous) {
-      doNotifyClientMembershipListener(member, client, event, EventType.CLIENT_JOINED);
-    } else {
-      try {
-        queuedExecutor.execute(new Runnable() {
-          public void run() {
-            doNotifyClientMembershipListener(member, client, event, EventType.CLIENT_JOINED);
-          }
-        });
-      } catch (RejectedExecutionException e) {
-        // executor must have been shutdown
-      }
-    }
+  /**
+   * Notifies registered listeners that a Client member has left
+   *
+   * @param clientId the representing the client
+   */
+  public static void notifyClientLeft(final DistributedMember clientId) {
+    notifyListeners(clientId, true, EventType.LEFT);
+  }
+
+  /**
+   * Notifies registered listeners that a Client member has crashed
+   *
+   * @param clientId the representing the client
+   */
+  public static void notifyClientCrashed(final DistributedMember clientId) {
+    notifyListeners(clientId, true, EventType.CRASHED);
   }
 
 
 
   /**
-   * Notifies registered listeners that a member has left. The departed member may be a client
-   * previously connected to this process or a server that this process was connected to.
+   * Notifies registered listeners that a Client member has connected
    *
-   * @param member the <code>DistributedMember</code>
-   * @param client true if the member is a client; false if server
+   * @param location the address of the server
    */
-  public static void notifyLeft(final DistributedMember member, final boolean client) {
-    startMonitoring();
-    ThreadPoolExecutor queuedExecutor = executor;
-    if (queuedExecutor == null) {
-      return;
-    }
+  public static void notifyServerJoined(final ServerLocation location) {
+    DistributedMember id = new InternalDistributedMember(location);
+    notifyListeners(id, false, EventType.JOINED);
+  }
 
+  /**
+   * Notifies registered listeners that a Client member has left
+   *
+   * @param location the address of the server
+   */
+  public static void notifyServerLeft(final ServerLocation location) {
+    DistributedMember id = new InternalDistributedMember(location);
+    notifyListeners(id, false, EventType.LEFT);
+  }
 
-    final ClientMembershipEvent event = new InternalClientMembershipEvent(member, client);
-    if (forceSynchronous) {
-      doNotifyClientMembershipListener(member, client, event, EventType.CLIENT_LEFT);
-    } else {
-      try {
-        queuedExecutor.execute(new Runnable() {
-          public void run() {
-            doNotifyClientMembershipListener(member, client, event, EventType.CLIENT_LEFT);
-          }
-        });
-      } catch (RejectedExecutionException e) {
-        // executor must have been shutdown
-      }
-    }
+  /**
+   * Notifies registered listeners that a Client member has crashed
+   *
+   * @param location the address of the server
+   */
+  public static void notifyServerCrashed(final ServerLocation location) {
+    DistributedMember id = new InternalDistributedMember(location);
+    notifyListeners(id, false, EventType.CRASHED);
   }
 
 
+
   /**
-   * Notifies registered listeners that a member has crashed. The departed member may be a client
-   * previously connected to this process or a server that this process was connected to.
-   *
+   * Notifies registered listeners that a Client member has joined. The new member may be a client
+   * connecting to this process or a server that this process has just connected to.
+   * 
    * @param member the <code>DistributedMember</code>
    * @param client true if the member is a client; false if server
+   * @param typeOfEvent joined/left/crashed
    */
-  public static void notifyCrashed(final DistributedMember member, final boolean client) {
+  private static void notifyListeners(final DistributedMember member, final boolean client,
+      final EventType typeOfEvent) {
+    startMonitoring();
     ThreadPoolExecutor queuedExecutor = executor;
     if (queuedExecutor == null) {
       return;
@@ -427,14 +429,11 @@ public final class InternalClientMembership {
 
     final ClientMembershipEvent event = new InternalClientMembershipEvent(member, client);
     if (forceSynchronous) {
-      doNotifyClientMembershipListener(member, client, event, EventType.CLIENT_CRASHED);
+      doNotifyClientMembershipListener(member, client, event, typeOfEvent);
     } else {
-
       try {
-        queuedExecutor.execute(new Runnable() {
-          public void run() {
-            doNotifyClientMembershipListener(member, client, event, EventType.CLIENT_CRASHED);
-          }
+        queuedExecutor.execute(() -> {
+          doNotifyClientMembershipListener(member, client, event, typeOfEvent);
         });
       } catch (RejectedExecutionException e) {
         // executor must have been shutdown
@@ -442,6 +441,7 @@ public final class InternalClientMembership {
     }
   }
 
+
   private static void doNotifyClientMembershipListener(DistributedMember member, boolean client,
       ClientMembershipEvent clientMembershipEvent, EventType eventType) {
 
@@ -450,9 +450,9 @@ public final class InternalClientMembership {
 
       ClientMembershipListener listener = iter.next();
       try {
-        if (eventType.equals(EventType.CLIENT_JOINED)) {
+        if (eventType.equals(EventType.JOINED)) {
           listener.memberJoined(clientMembershipEvent);
-        } else if (eventType.equals(EventType.CLIENT_LEFT)) {
+        } else if (eventType.equals(EventType.LEFT)) {
           listener.memberLeft(clientMembershipEvent);
         } else {
           listener.memberCrashed(clientMembershipEvent);
@@ -549,17 +549,26 @@ public final class InternalClientMembership {
   }
 
   /**
-   * Internal implementation of ClientMembershipEvent.
+   * Internal implementation of ClientMembershipEvent. This class is used in both clients and
+   * servers to notify listeners about events concerning client/server communications. In servers
+   * listeners are notified about clients connecting/disconnecting. In clients listeners notified
+   * about new connections being formed to servers. The instance variable "client" is used to
+   * distinguish between the two.
    */
   protected static class InternalClientMembershipEvent implements ClientMembershipEvent {
 
     private final DistributedMember member;
+
+    /**
+     * If true this means that a client has joined/left/crashed.
+     * <p>
+     * If false this means that a server has joined/left/crashed
+     */
     private final boolean client;
 
-    /** Constructs new instance of event */
-    protected InternalClientMembershipEvent(DistributedMember member, boolean client) {
+    protected InternalClientMembershipEvent(DistributedMember member, boolean isClient) {
       this.member = member;
-      this.client = client;
+      this.client = isClient;
     }
 
     public DistributedMember getMember() {
@@ -593,7 +602,7 @@ public final class InternalClientMembership {
   }
 
   private static enum EventType {
-    CLIENT_JOINED, CLIENT_LEFT, CLIENT_CRASHED
+    JOINED, LEFT, CRASHED
   }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
index 90cdeda..b4a6bed 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
@@ -300,7 +300,7 @@ public class CacheClientUpdater extends Thread implements ClientUpdater, Disconn
             mySock.getInetAddress().getHostAddress(), mySock.getLocalPort(), mySock.getPort());
       }
 
-      ServerQueueStatus sqs = handshake.greetNotifier(mySock, this.isPrimary, location);
+      ServerQueueStatus sqs = handshake.greetNotifier(mySock, this.isPrimary);
       if (sqs.isPrimary() || sqs.isNonRedundant()) {
         PoolImpl pool = (PoolImpl) this.qManager.getPool();
         if (!pool.getReadyForEventsCalled()) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
index 95e531d..c0db945 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
@@ -1297,7 +1297,7 @@ public class HandShake implements ClientHandShake {
     }
   }
 
-  public ServerQueueStatus greetNotifier(Socket sock, boolean isPrimary, ServerLocation location)
+  public ServerQueueStatus greetNotifier(Socket sock, boolean isPrimary)
       throws IOException, AuthenticationRequiredException, AuthenticationFailedException,
       ServerRefusedConnectionException, ClassNotFoundException {
     ServerQueueStatus sqs = null;
@@ -1378,7 +1378,7 @@ public class HandShake implements ClientHandShake {
       dis = new VersionedDataInputStream(dis, v);
     }
     try {
-      return (DistributedMember) DataSerializer.readObject(dis);
+      return DataSerializer.readObject(dis);
     } catch (EOFException e) {
       throw e;
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
index 47932d0..7e915f2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java
@@ -552,7 +552,7 @@ public class ServerConnection implements Runnable {
       this.crHelper.checkCancelInProgress(null);
       if (clientJoined && isFiringMembershipEvents()) {
         // This is a new client. Notify bridge membership and heartbeat monitor.
-        InternalClientMembership.notifyJoined(this.proxyId.getDistributedMember(), true);
+        InternalClientMembership.notifyClientJoined(this.proxyId.getDistributedMember());
       }
 
       ClientHealthMonitor chm = this.acceptor.getClientHealthMonitor();
@@ -862,9 +862,9 @@ public class ServerConnection implements Runnable {
       // the heartbeat monitor; other wise just remove the connection.
       if (clientDeparted && isFiringMembershipEvents()) {
         if (this.clientDisconnectedCleanly && !forceClientCrashEvent) {
-          InternalClientMembership.notifyLeft(proxyId.getDistributedMember(), true);
+          InternalClientMembership.notifyClientLeft(proxyId.getDistributedMember());
         } else {
-          InternalClientMembership.notifyCrashed(this.proxyId.getDistributedMember(), true);
+          InternalClientMembership.notifyClientCrashed(this.proxyId.getDistributedMember());
         }
         // The client has departed. Remove this last connection and unregister it.
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
index 913edf2..fdde35c 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
@@ -32,6 +32,11 @@ import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.internal.cache.PoolStats;
+import org.apache.geode.internal.cache.tier.InternalClientMembership;
+import org.apache.geode.internal.cache.tier.sockets.HandShake;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.management.membership.ClientMembershipEvent;
+import org.apache.geode.management.membership.ClientMembershipListener;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
@@ -49,12 +54,16 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
+import com.jayway.awaitility.Awaitility;
+
 /**
  *
  */
@@ -138,6 +147,52 @@ public class AutoConnectionSourceImplJUnitTest {
   }
 
   @Test
+  public void testServerLocationUsedInListenerNotification() throws Exception {
+    final ClientMembershipEvent[] listenerEvents = new ClientMembershipEvent[1];
+
+    ClientMembershipListener listener = new ClientMembershipListener() {
+
+      @Override
+      public void memberJoined(final ClientMembershipEvent event) {
+        synchronized (listenerEvents) {
+          listenerEvents[0] = event;
+        }
+      }
+
+      @Override
+      public void memberLeft(final ClientMembershipEvent event) {}
+
+      @Override
+      public void memberCrashed(final ClientMembershipEvent event) {}
+    };
+    InternalClientMembership.registerClientMembershipListener(listener);
+
+    ServerLocation location = new ServerLocation("1.1.1.1", 0);
+
+    InternalClientMembership.notifyServerJoined(location);
+    Awaitility.await("wait for listener notification").atMost(10, TimeUnit.SECONDS).until(() -> {
+      synchronized (listenerEvents) {
+        return listenerEvents[0] != null;
+      }
+    });
+
+    assertEquals("1.1.1.1", listenerEvents[0].getMember().getHost());
+
+    InetAddress addr = InetAddress.getLocalHost();
+    location = new ServerLocation(addr.getHostAddress(), 0);
+
+    listenerEvents[0] = null;
+    InternalClientMembership.notifyServerJoined(location);
+    Awaitility.await("wait for listener notification").atMost(10, TimeUnit.SECONDS).until(() -> {
+      synchronized (listenerEvents) {
+        return listenerEvents[0] != null;
+      }
+    });
+
+    assertEquals(addr.getCanonicalHostName(), listenerEvents[0].getMember().getHost());
+  }
+
+  @Test
   public void testNoServers() throws Exception {
     startFakeLocator();
     handler.nextConnectionResponse = new ClientConnectionResponse(null);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java
index 1017db2..0f632b8 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java
@@ -799,12 +799,7 @@ public class ConnectionManagerJUnitTest {
         this.notifyAll();
       }
       DistributedMember fakeMember = null;
-      try {
-        fakeMember = new InternalDistributedMember("localhost", 555);
-      } catch (UnknownHostException e) {
-        // TODO Auto-generated catch block
-        e.printStackTrace();
-      }
+      fakeMember = new InternalDistributedMember("localhost", 555);
       final DistributedMember member = fakeMember;
 
       return new Connection() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java
index a4494ca..4236799 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java
@@ -612,8 +612,6 @@ public class PartitionRegionHelperDUnitTest extends JUnit4CacheTestCase {
           fail("Should have received an exception");
         } catch (IllegalStateException expected) {
           System.err.println(expected);
-        } catch (UnknownHostException e) {
-          Assert.fail("Unknown host", e);
         }
         assertHasMembers(PartitionRegionHelper.getAllMembersForKey(region, 1), member0, member1);
 
@@ -693,8 +691,6 @@ public class PartitionRegionHelperDUnitTest extends JUnit4CacheTestCase {
           fail("Should have received an exception");
         } catch (IllegalStateException expected) {
           System.err.println(expected);
-        } catch (UnknownHostException e) {
-          Assert.fail("Unknown host", e);
         }
         assertHasMembers(PartitionRegionHelper.getAllMembersForKey(region, 1), member0, member1);
 
@@ -705,8 +701,6 @@ public class PartitionRegionHelperDUnitTest extends JUnit4CacheTestCase {
           fail("Should have received an exception");
         } catch (IllegalStateException expected) {
           System.err.println(expected);
-        } catch (UnknownHostException e) {
-          Assert.fail("Unknown host", e);
         }
         assertHasMembers(PartitionRegionHelper.getAllMembersForKey(region, 1), member0, member1);
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/cache30/ClientMembershipDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/ClientMembershipDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/ClientMembershipDUnitTest.java
index 83b75d5..67b1e9e 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/ClientMembershipDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/ClientMembershipDUnitTest.java
@@ -33,6 +33,8 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import com.jayway.awaitility.Awaitility;
+import org.apache.geode.distributed.internal.ServerLocation;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -82,6 +84,8 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
   private static Properties properties;
 
+  ServerLocation serverLocation = new ServerLocation("127.0.0.1", 0);
+
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     Invoke.invokeInEveryVM((() -> cleanup()));
@@ -270,8 +274,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     ClientMembership.registerClientMembershipListener(listener);
 
     // test JOIN for server
-    DistributedMember serverJoined = new TestDistributedMember("serverJoined");
-    InternalClientMembership.notifyJoined(serverJoined, SERVER);
+    InternalClientMembership.notifyServerJoined(serverLocation);
 
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
@@ -279,8 +282,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
         });
 
     assertTrue(fired[JOINED]);
-    assertEquals(serverJoined, member[JOINED]);
-    assertEquals(serverJoined.getId(), memberId[JOINED]);
+    assertNotNull(member[JOINED]);
     assertFalse(isClient[JOINED]);
     assertFalse(fired[LEFT]);
     assertNull(memberId[LEFT]);
@@ -292,7 +294,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
     // test JOIN for client
     DistributedMember clientJoined = new TestDistributedMember("clientJoined");
-    InternalClientMembership.notifyJoined(clientJoined, CLIENT);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[JOINED];
@@ -311,8 +313,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     resetArraysForTesting(fired, member, memberId, isClient);
 
     // test LEFT for server
-    DistributedMember serverLeft = new TestDistributedMember("serverLeft");
-    InternalClientMembership.notifyLeft(serverLeft, SERVER);
+    InternalClientMembership.notifyServerLeft(serverLocation);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[LEFT];
@@ -322,8 +323,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertNull(memberId[JOINED]);
     assertFalse(isClient[JOINED]);
     assertTrue(fired[LEFT]);
-    assertEquals(serverLeft, member[LEFT]);
-    assertEquals(serverLeft.getId(), memberId[LEFT]);
+    assertNotNull(member[LEFT]);
     assertFalse(isClient[LEFT]);
     assertFalse(fired[CRASHED]);
     assertNull(memberId[CRASHED]);
@@ -332,7 +332,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
     // test LEFT for client
     DistributedMember clientLeft = new TestDistributedMember("clientLeft");
-    InternalClientMembership.notifyLeft(clientLeft, CLIENT);
+    InternalClientMembership.notifyClientLeft(clientLeft);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[LEFT];
@@ -351,8 +351,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     resetArraysForTesting(fired, member, memberId, isClient);
 
     // test CRASHED for server
-    DistributedMember serverCrashed = new TestDistributedMember("serverCrashed");
-    InternalClientMembership.notifyCrashed(serverCrashed, SERVER);
+    InternalClientMembership.notifyServerCrashed(serverLocation);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[CRASHED];
@@ -365,14 +364,13 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertNull(memberId[LEFT]);
     assertFalse(isClient[LEFT]);
     assertTrue(fired[CRASHED]);
-    assertEquals(serverCrashed, member[CRASHED]);
-    assertEquals(serverCrashed.getId(), memberId[CRASHED]);
+    assertNotNull(member[CRASHED]);
     assertFalse(isClient[CRASHED]);
     resetArraysForTesting(fired, member, memberId, isClient);
 
     // test CRASHED for client
     DistributedMember clientCrashed = new TestDistributedMember("clientCrashed");
-    InternalClientMembership.notifyCrashed(clientCrashed, CLIENT);
+    InternalClientMembership.notifyClientCrashed(clientCrashed);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[CRASHED];
@@ -434,7 +432,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
     // fire event to make sure listener is registered
     DistributedMember clientJoined = new TestDistributedMember("clientJoined");
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[JOINED];
@@ -452,7 +450,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
     // unregister and verify listener is not notified
     ClientMembership.unregisterClientMembershipListener(listener);
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).until(() -> {
           return true;
@@ -496,7 +494,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     }
 
     final DistributedMember clientJoined = new TestDistributedMember("clientJoined");
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     for (int i = 0; i < NUM_LISTENERS; i++) {
       synchronized (listeners[i]) {
         listeners[i].wait(20);
@@ -523,7 +521,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(listeners[0], registeredListeners[0]);
     assertEquals(listeners[1], registeredListeners[1]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[1]) {
       if (!fired[1]) {
         listeners[1].wait(2000);
@@ -549,7 +547,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(1, registeredListeners.length);
     assertEquals(listeners[1], registeredListeners[0]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[1]) {
       if (!fired[1]) {
         listeners[1].wait(2000);
@@ -578,7 +576,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(listeners[2], registeredListeners[1]);
     assertEquals(listeners[3], registeredListeners[2]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[3]) {
       if (!fired[3]) {
         listeners[3].wait(2000);
@@ -607,7 +605,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(listeners[3], registeredListeners[2]);
     assertEquals(listeners[0], registeredListeners[3]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[0]) {
       if (!fired[0]) {
         listeners[0].wait(2000);
@@ -628,7 +626,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(listeners[2], registeredListeners[1]);
     assertEquals(listeners[0], registeredListeners[2]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[0]) {
       if (!fired[0]) {
         listeners[0].wait(2000);
@@ -655,7 +653,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(listeners[1], registeredListeners[0]);
     assertEquals(listeners[0], registeredListeners[1]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[0]) {
       if (!fired[0]) {
         listeners[0].wait(2000);
@@ -681,7 +679,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     registeredListeners = ClientMembership.getClientMembershipListeners();
     assertEquals(0, registeredListeners.length);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     for (int i = 0; i < NUM_LISTENERS; i++) {
       synchronized (listeners[i]) {
         listeners[i].wait(20);
@@ -698,7 +696,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertEquals(1, registeredListeners.length);
     assertEquals(listeners[1], registeredListeners[0]);
 
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listeners[1]) {
       if (!fired[1]) {
         listeners[1].wait(2000);
@@ -814,15 +812,13 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
     // sanity check...
     System.out.println("[testClientMembershipEventsInClient] sanity check");
-    DistributedMember test = new TestDistributedMember("test");
-    InternalClientMembership.notifyJoined(test, SERVER);
+    InternalClientMembership.notifyServerJoined(serverLocation);
 
     Awaitility.await().pollInterval(50, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS)
         .pollDelay(50, TimeUnit.MILLISECONDS).until(() -> fired[JOINED] || fired[CRASHED]);
 
     assertTrue(fired[JOINED]);
-    assertEquals(test, member[JOINED]);
-    assertEquals(test.getId(), memberId[JOINED]);
+    assertNotNull(member[JOINED]);
     assertFalse(isClient[JOINED]);
     assertFalse(fired[LEFT]);
     assertNull(member[LEFT]);
@@ -871,8 +867,6 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertTrue(fired[JOINED]);
     assertNotNull(member[JOINED]);
     assertNotNull(memberId[JOINED]);
-    assertEquals(serverMember, member[JOINED]);
-    assertEquals(serverMemberId, memberId[JOINED]);
     assertFalse(isClient[JOINED]);
     assertFalse(fired[LEFT]);
     assertNull(member[LEFT]);
@@ -902,8 +896,6 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertTrue(fired[CRASHED]);
     assertNotNull(member[CRASHED]);
     assertNotNull(memberId[CRASHED]);
-    assertEquals(serverMember, member[CRASHED]);
-    assertEquals(serverMemberId, memberId[CRASHED]);
     assertFalse(isClient[CRASHED]);
     resetArraysForTesting(fired, member, memberId, isClient);
 
@@ -927,8 +919,6 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     assertNotNull(member[JOINED]);
     assertNotNull(memberId[JOINED]);
     assertFalse(isClient[JOINED]);
-    assertEquals(serverMember, member[JOINED]);
-    assertEquals(serverMemberId, memberId[JOINED]);
     assertFalse(fired[LEFT]);
     assertNull(member[LEFT]);
     assertNull(memberId[LEFT]);
@@ -1018,7 +1008,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     // sanity check...
     System.out.println("[testClientMembershipEventsInServer] sanity check");
     DistributedMember test = new TestDistributedMember("test");
-    InternalClientMembership.notifyJoined(test, CLIENT);
+    InternalClientMembership.notifyClientJoined(test);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[JOINED] || fired[LEFT] || fired[CRASHED];
@@ -1232,22 +1222,20 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     getSystem(config);
 
     // assert that event is fired while connected
-    DistributedMember serverJoined = new TestDistributedMember("serverJoined");
-    InternalClientMembership.notifyJoined(serverJoined, SERVER);
+    InternalClientMembership.notifyServerJoined(serverLocation);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[JOINED];
         });
     assertTrue(fired[JOINED]);
-    assertEquals(serverJoined, member[JOINED]);
-    assertEquals(serverJoined.getId(), memberId[JOINED]);
+    assertNotNull(member[JOINED]);
     assertFalse(isClient[JOINED]);
     resetArraysForTesting(fired, member, memberId, isClient);
 
     // assert that event is NOT fired while disconnected
     disconnectFromDS();
 
-    InternalClientMembership.notifyJoined(serverJoined, SERVER);
+    InternalClientMembership.notifyServerJoined(serverLocation);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).until(() -> {
           return true;
@@ -1264,15 +1252,14 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
     InternalDistributedSystem sys = getSystem(config);
     assertTrue(sys.isConnected());
 
-    InternalClientMembership.notifyJoined(serverJoined, SERVER);
+    InternalClientMembership.notifyServerJoined(serverLocation);
     Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
         .pollDelay(100, TimeUnit.MILLISECONDS).timeout(300, TimeUnit.SECONDS).until(() -> {
           return fired[JOINED];
         });
 
     assertTrue(fired[JOINED]);
-    assertEquals(serverJoined, member[JOINED]);
-    assertEquals(serverJoined.getId(), memberId[JOINED]);
+    assertNotNull(member[JOINED]);
     assertFalse(isClient[JOINED]);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
index 1329c24..b1478e2 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
@@ -234,8 +234,6 @@ public class DistributionManagerDUnitTest extends JUnit4DistributedTestCase {
       vm0.invoke(connectDisconnect);
       assertTrue("Member was not removed from surprise member set", !mgr.isSurpriseMember(mbr));
 
-    } catch (UnknownHostException e) {
-      fail("unable to resolve localhost - test needs some attention", e);
     } finally {
       if (sys != null && sys.isConnected()) {
         sys.disconnect();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
index 4e8408c..f19ba1c 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluatorIntegrationTest.java
@@ -235,20 +235,7 @@ public class PartitionedRegionQueryEvaluatorIntegrationTest {
   }
 
   private InternalDistributedMember createDataStoreMember(int i) {
-    String hostname = null;
-    InternalDistributedMember mem = null;
-    try {
-      mem = new InternalDistributedMember("host" + i, 3033);
-    } catch (java.net.UnknownHostException uhe) {
-      logger.severe(
-          "PartitionedRegion: initalizeNode() Unknown host = " + hostname + " servicePort = " + 0,
-          uhe);
-      throw new PartitionedRegionException(
-          "PartitionedRegionDataStore: initalizeNode() Unknown host = " + hostname
-              + " servicePort = " + 0,
-          uhe);
-    }
-    return mem;
+    return new InternalDistributedMember("host" + i, 3033);
   }
 
   /**
@@ -257,14 +244,8 @@ public class PartitionedRegionQueryEvaluatorIntegrationTest {
    * @return
    */
   public Node createNode(int i) {
-    Node node = null;
-    try {
-      node = new Node(new InternalDistributedMember("host" + i, 3033), i);
-      node.setPRType(Node.DATASTORE);
-    } catch (java.net.UnknownHostException uhe) {
-      logger.severe("PartitionedRegion: initalizeNode() threw exception", uhe);
-      throw new PartitionedRegionException("", uhe);
-    }
+    Node node = new Node(new InternalDistributedMember("host" + i, 3033), i);
+    node.setPRType(Node.DATASTORE);
     return node;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/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 019bd0f..eb2e662 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,13 +18,17 @@ import static org.apache.geode.distributed.ConfigurationProperties.*;
 import static org.apache.geode.test.dunit.Assert.*;
 import static org.apache.geode.test.dunit.LogWriterUtils.*;
 
+import com.jayway.awaitility.Awaitility;
+
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
+import org.apache.geode.distributed.internal.ServerLocation;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -78,7 +82,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /** Brief pause for basic testing of asynchronous event notification */
   private static final int BRIEF_PAUSE_MILLIS = 2000;
   /** Maximum millis allowed for bridge client to fully connect before test fails */
-  private static final int JOIN_FAIL_MILLIS = 120000;
+  private static final int JOIN_FAIL_MILLIS = 30000;
 
   // the following wait millis are max wait time until notify occurs
 
@@ -87,7 +91,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   /** Millis to wait for basic synchronous listener to be notified */
   private static final int SYNC_ASYNC_EVENT_WAIT_MILLIS = 2000;
   /** Millis to wait for all three event listeners to be notified */
-  private static final int ASYNC_EVENT_WAIT_MILLIS = 120000; // use Integer.MAX_VALUE for debugging
+  private static final int ASYNC_EVENT_WAIT_MILLIS = 30000; // use Integer.MAX_VALUE for debugging
 
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
@@ -132,7 +136,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     };
 
     DistributedMember clientJoined = new TestDistributedMember("clientJoined");
-    InternalClientMembership.notifyJoined(clientJoined, true);
+    InternalClientMembership.notifyClientJoined(clientJoined);
     synchronized (listener) {
       if (!fired[0]) {
         listener.wait(SYNC_ASYNC_EVENT_WAIT_MILLIS);
@@ -190,9 +194,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     };
 
     DistributedMember memberA = new TestDistributedMember("memberA");
+    ServerLocation serverA = new ServerLocation("serverA", 0);
 
     // first join
-    InternalClientMembership.notifyJoined(memberA, true);
+    InternalClientMembership.notifyClientJoined(memberA);
     synchronized (listener) {
       if (!fired[JOINED]) {
         listener.wait(SYNC_ASYNC_EVENT_WAIT_MILLIS);
@@ -206,14 +211,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     memberId[JOINED] = null;
 
     // duplicate join
-    InternalClientMembership.notifyJoined(memberA, true);
+    InternalClientMembership.notifyClientJoined(memberA);
     Wait.pause(BRIEF_PAUSE_MILLIS);
     assertFalse(fired[JOINED]);
     assertNull(member[JOINED]);
     assertNull(memberId[JOINED]);
 
     // first left
-    InternalClientMembership.notifyLeft(memberA, true);
+    InternalClientMembership.notifyClientLeft(memberA);
     synchronized (listener) {
       if (!fired[LEFT]) {
         listener.wait(SYNC_ASYNC_EVENT_WAIT_MILLIS);
@@ -227,14 +232,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     memberId[LEFT] = null;
 
     // duplicate left
-    InternalClientMembership.notifyLeft(memberA, true);
+    InternalClientMembership.notifyClientLeft(memberA);
     Wait.pause(BRIEF_PAUSE_MILLIS);
     assertFalse(fired[LEFT]);
     assertNull(member[LEFT]);
     assertNull(memberId[LEFT]);
 
     // rejoin
-    InternalClientMembership.notifyJoined(memberA, true);
+    InternalClientMembership.notifyClientJoined(memberA);
     synchronized (listener) {
       if (!fired[JOINED]) {
         listener.wait(SYNC_ASYNC_EVENT_WAIT_MILLIS);
@@ -399,7 +404,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final int[] ports = new int[1];
 
     // create BridgeServer in controller vm...
-    getLogWriter().info("[testLonerClientEventsInServer] Create BridgeServer");
+    System.out.println("[testLonerClientEventsInServer] Create BridgeServer");
     getSystem();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -413,9 +418,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final String serverMemberId = serverMember.toString();
     final Properties serverProperties = getSystem().getProperties();
 
-    getLogWriter().info("[testLonerClientEventsInServer] ports[0]=" + ports[0]);
-    getLogWriter().info("[testLonerClientEventsInServer] serverMemberId=" + serverMemberId);
-    getLogWriter().info("[testLonerClientEventsInServer] serverMember=" + serverMember);
+    System.out.println("[testLonerClientEventsInServer] ports[0]=" + ports[0]);
+    System.out.println("[testLonerClientEventsInServer] serverMemberId=" + serverMemberId);
+    System.out.println("[testLonerClientEventsInServer] serverMember=" + serverMember);
 
     // register the bridge listener
     ClientMembership.registerClientMembershipListener(bridgeListener);
@@ -433,7 +438,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     SerializableCallable createBridgeClient = new SerializableCallable("Create bridge client") {
       @Override
       public Object call() {
-        getLogWriter().info("[testLonerClientEventsInServer] create bridge client");
+        System.out.println("[testLonerClientEventsInServer] create bridge client");
         Properties config = new Properties();
         config.setProperty(MCAST_PORT, "0");
         config.setProperty(LOCATORS, "");
@@ -466,7 +471,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client join");
+    System.out.println("[testLonerClientEventsInServer] assert server detected client join");
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
     // as of 6.1 the id can change when a bridge is created or a connection pool is created
@@ -512,7 +517,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect");
+        System.out.println("[testLonerClientEventsInServer] wait for client to fully connect");
         final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl) PoolManager.find(pl);
         waitForClientToFullyConnect(pi);
@@ -521,7 +526,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Close bridge client region") {
       public void run() {
-        getLogWriter().info("[testLonerClientEventsInServer] close bridge client region");
+        System.out.println("[testLonerClientEventsInServer] close bridge client region");
         getRootRegion().getSubregion(name).close();
         PoolManager.close();
       }
@@ -538,7 +543,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client left");
+    System.out.println("[testLonerClientEventsInServer] assert server detected client left");
 
     assertFalse(firedBridge[JOINED]);
     assertNull(memberIdBridge[JOINED]);
@@ -597,7 +602,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[testLonerClientEventsInServer] assert server detected client re-join");
+    System.out.println("[testLonerClientEventsInServer] assert server detected client re-join");
     assertTrue(firedBridge[JOINED]);
     assertEquals(clientMember, memberBridge[JOINED]);
     assertEquals(clientMemberId, memberIdBridge[JOINED]);
@@ -642,7 +647,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect");
+        System.out.println("[testLonerClientEventsInServer] wait for client to fully connect");
         final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl) PoolManager.find(pl);
         waitForClientToFullyConnect(pi);
@@ -653,7 +658,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Stop bridge client") {
         public void run() {
-          getLogWriter().info("[testLonerClientEventsInServer] Stop bridge client");
+          System.out.println("[testLonerClientEventsInServer] Stop bridge client");
           getRootRegion().getSubregion(name).close();
           PoolManager.close();
         }
@@ -670,7 +675,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         }
       }
 
-      getLogWriter().info("[testLonerClientEventsInServer] assert server detected client crashed");
+      System.out.println("[testLonerClientEventsInServer] assert server detected client crashed");
       assertFalse(firedBridge[JOINED]);
       assertNull(memberIdBridge[JOINED]);
       assertNull(memberBridge[JOINED]);
@@ -857,7 +862,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final int[] ports = new int[1];
 
     // create BridgeServer in controller vm...
-    getLogWriter().info("[doTestSystemClientEventsInServer] Create BridgeServer");
+    System.out.println("[doTestSystemClientEventsInServer] Create BridgeServer");
     getSystem();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -877,9 +882,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     serverProperties.remove(CLUSTER_SSL_PROTOCOLS);
     serverProperties.remove(CLUSTER_SSL_REQUIRE_AUTHENTICATION);
 
-    getLogWriter().info("[doTestSystemClientEventsInServer] ports[0]=" + ports[0]);
-    getLogWriter().info("[doTestSystemClientEventsInServer] serverMemberId=" + serverMemberId);
-    getLogWriter().info("[doTestSystemClientEventsInServer] serverMember=" + serverMember);
+    System.out.println("[doTestSystemClientEventsInServer] ports[0]=" + ports[0]);
+    System.out.println("[doTestSystemClientEventsInServer] serverMemberId=" + serverMemberId);
+    System.out.println("[doTestSystemClientEventsInServer] serverMember=" + serverMember);
 
     // register the bridge listener
     ClientMembership.registerClientMembershipListener(bridgeListener);
@@ -897,7 +902,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     SerializableCallable createBridgeClient = new SerializableCallable("Create bridge client") {
       @Override
       public Object call() {
-        getLogWriter().info("[doTestSystemClientEventsInServer] create system bridge client");
+        System.out.println("[doTestSystemClientEventsInServer] create system bridge client");
         assertTrue(getSystem(serverProperties).isConnected());
         assertFalse(getCache().isClosed());
         AttributesFactory factory = new AttributesFactory();
@@ -931,7 +936,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client join");
+    System.out.println("[doTestSystemClientEventsInServer] assert server detected client join");
     assertArrayFalse(firedSystemDuplicate);
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
@@ -980,7 +985,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
+        System.out.println("[doTestSystemClientEventsInServer] wait for client to fully connect");
         final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl) PoolManager.find(pl);
         waitForClientToFullyConnect(pi);
@@ -990,7 +995,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     // close bridge client region
     vm0.invoke(new SerializableRunnable("Close bridge client region") {
       public void run() {
-        getLogWriter().info("[doTestSystemClientEventsInServer] close bridge client region");
+        System.out.println("[doTestSystemClientEventsInServer] close bridge client region");
         getRootRegion().getSubregion(name).close();
         PoolManager.close();
       }
@@ -1007,7 +1012,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client left");
+    System.out.println("[doTestSystemClientEventsInServer] assert server detected client left");
     assertArrayFalse(firedSystemDuplicate);
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
@@ -1069,7 +1074,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client re-join");
+    System.out.println("[doTestSystemClientEventsInServer] assert server detected client re-join");
     assertArrayFalse(firedSystemDuplicate);
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
@@ -1118,7 +1123,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
+        System.out.println("[doTestSystemClientEventsInServer] wait for client to fully connect");
         final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl) PoolManager.find(pl);
         waitForClientToFullyConnect(pi);
@@ -1128,7 +1133,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     // have bridge client disconnect from system
     vm0.invoke(new SerializableRunnable("Disconnect bridge client") {
       public void run() {
-        getLogWriter().info("[doTestSystemClientEventsInServer] disconnect bridge client");
+        System.out.println("[doTestSystemClientEventsInServer] disconnect bridge client");
         closeCache();
         disconnectFromDS();
       }
@@ -1150,7 +1155,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client left");
+    System.out.println("[doTestSystemClientEventsInServer] assert server detected client left");
     assertArrayFalse(firedSystemDuplicate);
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
@@ -1217,7 +1222,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[doTestSystemClientEventsInServer] assert server detected client re-join");
+    System.out.println("[doTestSystemClientEventsInServer] assert server detected client re-join");
     assertArrayFalse(firedSystemDuplicate);
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
@@ -1266,7 +1271,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     vm0.invoke(new SerializableRunnable("Wait for client to fully connect") {
       public void run() {
-        getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect");
+        System.out.println("[doTestSystemClientEventsInServer] wait for client to fully connect");
         final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName();
         PoolImpl pi = (PoolImpl) PoolManager.find(pl);
         waitForClientToFullyConnect(pi);
@@ -1278,7 +1283,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Close bridge client region") {
         public void run() {
-          getLogWriter().info("[doTestSystemClientEventsInServer] close bridge client region");
+          System.out.println("[doTestSystemClientEventsInServer] close bridge client region");
           getRootRegion().getSubregion(name).close();
           PoolManager.close();
         }
@@ -1349,7 +1354,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
    * the pool has more than one Endpoint.
    */
   protected void waitForClientToFullyConnect(final PoolImpl pool) {
-    getLogWriter().info("[waitForClientToFullyConnect]");
+    System.out.println("[waitForClientToFullyConnect]");
     final long failMillis = System.currentTimeMillis() + JOIN_FAIL_MILLIS;
     boolean fullyConnected = false;
     while (!fullyConnected) {
@@ -1359,7 +1364,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
           + JOIN_FAIL_MILLIS + " milliseconds. Only " + pool.getConnectionCount()
           + " connections were created.", System.currentTimeMillis() < failMillis);
     }
-    getLogWriter().info("[waitForClientToFullyConnect] fullyConnected=" + fullyConnected);
+    System.out.println("[waitForClientToFullyConnect] fullyConnected=" + fullyConnected);
   }
 
   /**
@@ -1556,7 +1561,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertTrue(ports[0] != 0);
 
     // create BridgeServer in controller vm...
-    getLogWriter().info("[doTestSystemClientEventsInServer] Create BridgeServer");
+    System.out.println("[doTestSystemClientEventsInServer] Create BridgeServer");
     getSystem();
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
@@ -1575,9 +1580,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     serverProperties.remove(CLUSTER_SSL_PROTOCOLS);
     serverProperties.remove(CLUSTER_SSL_REQUIRE_AUTHENTICATION);
 
-    getLogWriter().info("[testServerEventsInPeerSystem] ports[0]=" + ports[0]);
-    getLogWriter().info("[testServerEventsInPeerSystem] serverMemberId=" + serverMemberId);
-    getLogWriter().info("[testServerEventsInPeerSystem] serverMember=" + serverMember);
+    System.out.println("[testServerEventsInPeerSystem] ports[0]=" + ports[0]);
+    System.out.println("[testServerEventsInPeerSystem] serverMemberId=" + serverMemberId);
+    System.out.println("[testServerEventsInPeerSystem] serverMember=" + serverMember);
 
     GemFireCacheImpl cache = GemFireCacheImpl.getExisting();
     assertNotNull(cache);
@@ -1592,7 +1597,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     SerializableCallable createPeerCache = new SerializableCallable("Create Peer Cache") {
       @Override
       public Object call() {
-        getLogWriter().info("[testServerEventsInPeerSystem] Create Peer cache");
+        System.out.println("[testServerEventsInPeerSystem] Create Peer cache");
         getSystem(serverProperties);
         AttributesFactory factory = new AttributesFactory();
         factory.setScope(Scope.LOCAL);
@@ -1606,8 +1611,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     DistributedMember peerMember = (DistributedMember) vm0.invoke(createPeerCache);
     String peerMemberId = peerMember.toString();
 
-    getLogWriter().info("[testServerEventsInPeerSystem] peerMemberId=" + peerMemberId);
-    getLogWriter().info("[testServerEventsInPeerSystem] peerMember=" + peerMember);
+    System.out.println("[testServerEventsInPeerSystem] peerMemberId=" + peerMemberId);
+    System.out.println("[testServerEventsInPeerSystem] peerMember=" + peerMember);
 
 
 
@@ -1622,7 +1627,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
     }
 
-    getLogWriter().info("[testServerEventsInPeerSystem] assert server detected peer join");
+    System.out.println("[testServerEventsInPeerSystem] assert server detected peer join");
     assertArrayFalse(firedSystemDuplicate);
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint
     // initial impl uses Endpoint.toString() for memberId of server; final
@@ -1669,7 +1674,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Disconnect Peer server") {
         public void run() {
-          getLogWriter().info("[testServerEventsInPeerSystem] disconnect peer server");
+          System.out.println("[testServerEventsInPeerSystem] disconnect peer server");
           closeCache();
           disconnectFromDS();
         }
@@ -1692,7 +1697,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       ex.remove();
     }
 
-    getLogWriter().info("[testServerEventsInPeerSystem] assert server detected peer crashed");
+    System.out.println("[testServerEventsInPeerSystem] assert server detected peer crashed");
     assertArrayFalse(firedSystemDuplicate);
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint
     // initial impl uses Endpoint.toString() for memberId of server; final
@@ -1775,8 +1780,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     UniversalMembershipListenerAdapter adapter = new UniversalMembershipListenerAdapter() {
       @Override
       public synchronized void memberJoined(MembershipEvent event) {
-        getLogWriter()
-            .info("[testServerEventsInLonerClient] memberJoined >" + event.getMemberId() + "<");
+        System.out
+            .println("[testServerEventsInLonerClient] memberJoined >" + event.getMemberId() + "<");
         firedAdapterDuplicate[JOINED] = firedAdapter[JOINED];
         firedAdapter[JOINED] = true;
         memberAdapter[JOINED] = event.getDistributedMember();
@@ -1790,8 +1795,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
       @Override
       public synchronized void memberLeft(MembershipEvent event) {
-        getLogWriter()
-            .info("[testServerEventsInLonerClient] memberLeft >" + event.getMemberId() + "<");
+        System.out
+            .println("[testServerEventsInLonerClient] memberLeft >" + event.getMemberId() + "<");
         firedAdapterDuplicate[LEFT] = firedAdapter[LEFT];
         firedAdapter[LEFT] = true;
         memberAdapter[LEFT] = event.getDistributedMember();
@@ -1805,8 +1810,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
       @Override
       public synchronized void memberCrashed(MembershipEvent event) {
-        getLogWriter()
-            .info("[testServerEventsInLonerClient] memberCrashed >" + event.getMemberId() + "<");
+        System.out
+            .println("[testServerEventsInLonerClient] memberCrashed >" + event.getMemberId() + "<");
         firedAdapterDuplicate[CRASHED] = firedAdapter[CRASHED];
         firedAdapter[CRASHED] = true;
         memberAdapter[CRASHED] = event.getDistributedMember();
@@ -1854,14 +1859,15 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     final int[] ports = new int[] {AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET)};
     assertTrue(ports[0] != 0);
 
-    getLogWriter().info("[testServerEventsInLonerClient] create loner bridge client");
+    System.out.println("[testServerEventsInLonerClient] create loner bridge client");
     Properties config = new Properties();
-    config.setProperty(MCAST_PORT, "0");
-    config.setProperty(LOCATORS, "");
+    config.put(MCAST_PORT, "0");
+    config.put(LOCATORS, "");
+    // config.put(LOG_LEVEL, "fine");
     // config.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "false");
     getSystem(config);
 
-    getLogWriter().info("[testServerEventsInLonerClient] create system bridge client");
+    System.out.println("[testServerEventsInLonerClient] create system bridge client");
     getSystem();
 
     // register the bridge listener
@@ -1876,7 +1882,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     SerializableCallable createBridgeServer = new SerializableCallable("Create BridgeServer") {
       @Override
       public Object call() {
-        getLogWriter().info("[testServerEventsInLonerClient] Create BridgeServer");
+        System.out.println("[testServerEventsInLonerClient] Create BridgeServer");
         getSystem();
         AttributesFactory factory = new AttributesFactory();
         factory.setScope(Scope.LOCAL);
@@ -1900,9 +1906,9 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertEquals(ports[0], (int) vm0.invoke("getServerPort",
         () -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
 
-    getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
-    getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
-    getLogWriter().info("[testServerEventsInLonerClient] serverMember=" + serverMember);
+    System.out.println("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
+    System.out.println("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
+    System.out.println("[testServerEventsInLonerClient] serverMember=" + serverMember);
 
     // create region which connects to bridge server
     AttributesFactory factory = new AttributesFactory();
@@ -1912,18 +1918,20 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     createRegion(name, factory.create());
     assertNotNull(getRootRegion().getSubregion(name));
 
-    synchronized (adapter) {
-      if (!firedAdapter[JOINED]) {
-        adapter.wait(ASYNC_EVENT_WAIT_MILLIS);
-      }
-    }
-    synchronized (bridgeListener) {
-      if (!firedBridge[JOINED]) {
-        bridgeListener.wait(ASYNC_EVENT_WAIT_MILLIS);
-      }
-    }
-
-    getLogWriter().info("[testServerEventsInLonerClient] assert client detected server join");
+    Awaitility.await("wait for join").atMost(ASYNC_EVENT_WAIT_MILLIS, TimeUnit.MILLISECONDS)
+        .until(() -> {
+          synchronized (adapter) {
+            return firedAdapter[JOINED];
+          }
+        });
+    Awaitility.await("wait for join").atMost(ASYNC_EVENT_WAIT_MILLIS, TimeUnit.MILLISECONDS)
+        .until(() -> {
+          synchronized (bridgeListener) {
+            return firedBridge[JOINED];
+          }
+        });
+
+    System.out.println("[testServerEventsInLonerClient] assert client detected server join");
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
@@ -1933,8 +1941,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertArrayFalse(firedBridgeDuplicate);
 
     assertTrue(firedBridge[JOINED]);
-    assertEquals(serverMember, memberBridge[JOINED]);
-    assertEquals(serverMemberId, memberIdBridge[JOINED]);
     assertNotNull(memberBridge[JOINED]);
     assertNotNull(memberIdBridge[JOINED]);
     assertFalse(isClientBridge[JOINED]);
@@ -1949,8 +1955,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     resetArraysForTesting(firedBridge, memberBridge, memberIdBridge, isClientBridge);
 
     assertTrue(firedAdapter[JOINED]);
-    assertEquals(serverMember, memberAdapter[JOINED]);
-    assertEquals(serverMemberId, memberIdAdapter[JOINED]);
     assertNotNull(memberIdAdapter[JOINED]);
     assertFalse(isClientAdapter[JOINED]);
     assertFalse(firedAdapter[LEFT]);
@@ -1963,7 +1967,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertFalse(isClientAdapter[CRASHED]);
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
 
-    getLogWriter().info("[testServerEventsInLonerClient] wait for client to fully connect");
+    System.out.println("[testServerEventsInLonerClient] wait for client to fully connect");
     final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName();
     PoolImpl pi = (PoolImpl) PoolManager.find(pl);
     waitForClientToFullyConnect(pi);
@@ -1988,22 +1992,24 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     try {
       vm0.invoke(new SerializableRunnable("Disconnect bridge server") {
         public void run() {
-          getLogWriter().info("[testServerEventsInLonerClient] disconnect bridge server");
+          System.out.println("[testServerEventsInLonerClient] disconnect bridge server");
           closeCache();
         }
       });
 
-      synchronized (adapter) {
-        if (!firedAdapter[LEFT]) {
-          adapter.wait(ASYNC_EVENT_WAIT_MILLIS);
-        }
-      }
+      Awaitility.await("wait for server to leave")
+          .atMost(ASYNC_EVENT_WAIT_MILLIS, TimeUnit.MILLISECONDS).until(() -> {
+            synchronized (adapter) {
+              return firedAdapter[LEFT] || firedAdapter[CRASHED];
+            }
+          });
+      Awaitility.await("wait for server to leave")
+          .atMost(ASYNC_EVENT_WAIT_MILLIS, TimeUnit.MILLISECONDS).until(() -> {
+            synchronized (bridgeListener) {
+              return firedBridge[LEFT] || firedBridge[CRASHED];
+            }
+          });
 
-      synchronized (bridgeListener) {
-        if (!firedBridge[LEFT] && !firedBridge[CRASHED]) {
-          bridgeListener.wait(ASYNC_EVENT_WAIT_MILLIS);
-        }
-      }
     } finally {
       // bgexecLogger.info(removeExpected);
       // bgexecLogger.info(removeExpected2);
@@ -2011,7 +2017,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       lw.info(removeExpected2);
     }
 
-    getLogWriter().info("[testServerEventsInLonerClient] assert client detected server crashed");
+    System.out.println("[testServerEventsInLonerClient] assert client detected server crashed");
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
@@ -2033,8 +2039,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertTrue(firedBridge[CRASHED]);
     assertNotNull(memberBridge[CRASHED]);
     assertNotNull(memberIdBridge[CRASHED]);
-    assertEquals(serverMember, memberAdapter[CRASHED]);
-    assertEquals(serverMemberId, memberIdAdapter[CRASHED]);
     assertFalse(isClientBridge[CRASHED]);
     resetArraysForTesting(firedBridge, memberBridge, memberIdBridge, isClientBridge);
 
@@ -2051,8 +2055,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertTrue(firedAdapter[CRASHED]);
     assertNotNull(memberAdapter[CRASHED]);
     assertNotNull(memberIdAdapter[CRASHED]);
-    assertEquals(serverMember, memberAdapter[CRASHED]);
-    assertEquals(serverMemberId, memberIdAdapter[CRASHED]);
     assertFalse(isClientAdapter[CRASHED]);
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
 
@@ -2063,25 +2065,27 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     // gather details for later creation of pool...
     assertEquals(ports[0], (int) vm0.invoke(
         () -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
-    serverMember = (DistributedMember) vm0
-        .invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
-
-    getLogWriter().info("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
-    getLogWriter().info("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
-    getLogWriter().info("[testServerEventsInLonerClient] serverMember=" + serverMember);
-
-    synchronized (adapter) {
-      if (!firedAdapter[JOINED]) {
-        adapter.wait(ASYNC_EVENT_WAIT_MILLIS);
-      }
-    }
-    synchronized (bridgeListener) {
-      if (!firedBridge[JOINED]) {
-        bridgeListener.wait(ASYNC_EVENT_WAIT_MILLIS);
-      }
-    }
-
-    getLogWriter().info("[testServerEventsInLonerClient] assert client detected server re-join");
+    serverMember =
+        vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+
+    System.out.println("[testServerEventsInLonerClient] ports[0]=" + ports[0]);
+    System.out.println("[testServerEventsInLonerClient] serverMemberId=" + serverMemberId);
+    System.out.println("[testServerEventsInLonerClient] serverMember=" + serverMember);
+
+    Awaitility.await("wait for join").atMost(ASYNC_EVENT_WAIT_MILLIS, TimeUnit.MILLISECONDS)
+        .until(() -> {
+          synchronized (adapter) {
+            return firedAdapter[JOINED];
+          }
+        });
+    Awaitility.await("wait for join").atMost(ASYNC_EVENT_WAIT_MILLIS, TimeUnit.MILLISECONDS)
+        .until(() -> {
+          synchronized (bridgeListener) {
+            return firedBridge[JOINED];
+          }
+        });
+
+    System.out.println("[testServerEventsInLonerClient] assert client detected server re-join");
     // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
     // initial impl uses Endpoint.toString() for memberId of server; final
     // impl should have server send its real memberId to client via HandShake
@@ -2093,8 +2097,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertTrue(firedBridge[JOINED]);
     assertNotNull(memberBridge[JOINED]);
     assertNotNull(memberIdBridge[JOINED]);
-    assertEquals(serverMember, memberBridge[JOINED]);
-    assertEquals(serverMemberId, memberIdBridge[JOINED]);
     assertFalse(isClientBridge[JOINED]);
     assertFalse(firedBridge[LEFT]);
     assertNull(memberBridge[LEFT]);
@@ -2107,8 +2109,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     resetArraysForTesting(firedBridge, memberBridge, memberIdBridge, isClientBridge);
 
     assertTrue(firedAdapter[JOINED]);
-    assertEquals(serverMember, memberAdapter[JOINED]);
-    assertEquals(serverMemberId, memberIdAdapter[JOINED]);
     assertNotNull(memberAdapter[JOINED]);
     assertNotNull(memberIdAdapter[JOINED]);
     assertFalse(isClientAdapter[JOINED]);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87f2fb5f/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java b/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
index aaf3e28..93195c1 100644
--- a/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
+++ b/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
@@ -68,11 +68,7 @@ public class Fakes {
     Statistics stats = mock(Statistics.class);
 
     InternalDistributedMember member;
-    try {
-      member = new InternalDistributedMember("localhost", 5555);
-    } catch (UnknownHostException e) {
-      throw new RuntimeException(e);
-    }
+    member = new InternalDistributedMember("localhost", 5555);
 
     when(config.getCacheXmlFile()).thenReturn(new File(""));
     when(config.getDeployWorkingDir()).thenReturn(new File("."));


Mime
View raw message