geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [18/44] incubator-geode git commit: GEODE-589: CI Failure: ClientMembershipDUnitTest.testGetConnectedClients
Date Tue, 15 Mar 2016 00:24:01 GMT
GEODE-589: CI Failure: ClientMembershipDUnitTest.testGetConnectedClients

Gester will be reverting his change that caused this failure but I've
reworked the test to have it not be dependent on getSystem() or the
string representation of DistributedMember objects.


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

Branch: refs/heads/feature/GEODE-949-2
Commit: aaa586a495326d4729632669c48efdc9f4c36af5
Parents: c394bf0
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Thu Mar 10 09:06:28 2016 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Thu Mar 10 09:06:28 2016 -0800

----------------------------------------------------------------------
 .../cache30/ClientMembershipDUnitTest.java      | 63 +++++++++------
 .../gemfire/cache30/ClientServerTestCase.java   | 12 +--
 ...ersalMembershipListenerAdapterDUnitTest.java | 85 +++++++++-----------
 .../test/dunit/DistributedTestUtils.java        |  1 +
 4 files changed, 84 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aaa586a4/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
index 23386a7..a8ea590 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
@@ -58,6 +58,7 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
@@ -77,6 +78,8 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
   protected static final int JOINED = 0;
   protected static final int LEFT = 1;
   protected static final int CRASHED = 2;
+  
+  private static Properties properties;
     
   public ClientMembershipDUnitTest(String name) {
     super(name);
@@ -798,7 +801,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
 
     DistributedMember serverMember = (DistributedMember) vm0.invoke(() -> ClientMembershipDUnitTest.getDistributedMember());
 
-    String serverMemberId = (String) vm0.invoke(() -> ClientMembershipDUnitTest.getMemberId());
+    String serverMemberId = serverMember.toString();
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testClientMembershipEventsInClient]
ports[0]=" + ports[0]);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testClientMembershipEventsInClient]
serverMember=" + serverMember);
@@ -1013,9 +1016,9 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
-    String serverMemberId = getMemberId();
-    DistributedMember serverMember = getDistributedMember();
-
+    DistributedMember serverMember = getMemberId();
+    String serverMemberId = serverMember.toString();
+    
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testClientMembershipEventsInServer]
ports[0]=" + ports[0]);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testClientMembershipEventsInServer]
serverMemberId=" + serverMemberId);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testClientMembershipEventsInServer]
serverMember=" + serverMember);
@@ -1057,9 +1060,9 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     resetArraysForTesting(fired, member, memberId, isClient);
     
     final Host host = Host.getHost(0);
-    SerializableRunnable createConnectionPool =
-    new CacheSerializableRunnable("Create connectionPool") {
-      public void run2() throws CacheException {
+    SerializableCallable createConnectionPool =
+    new SerializableCallable("Create connectionPool") {
+      public Object call() {
         com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testClientMembershipEventsInServer]
create bridge client");
         Properties config = new Properties();
         config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -1070,13 +1073,13 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
         ClientServerTestCase.configureConnectionPool(factory, NetworkUtils.getServerHostName(host),
ports, true, -1, 2, null);
         createRegion(name, factory.create());
         assertNotNull(getRootRegion().getSubregion(name));
+        return getMemberId();
       }
     };
 
     // create bridge client in vm0...
-    vm0.invoke(createConnectionPool);
-    String clientMemberId = (String) vm0.invoke(() -> ClientMembershipDUnitTest.getMemberId());
-    DistributedMember clientMember = (DistributedMember) vm0.invoke(() -> ClientMembershipDUnitTest.getDistributedMember());
+    DistributedMember clientMember = (DistributedMember)vm0.invoke(createConnectionPool);
+    String clientMemberId = clientMember.toString();
                                                 
     synchronized(listener) {
       if (!fired[JOINED] && !fired[LEFT] && !fired[CRASHED]) {
@@ -1138,8 +1141,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     resetArraysForTesting(fired, member, memberId, isClient);
 
     // reconnect bridge client to test for crashed event
-    vm0.invoke(createConnectionPool);
-    clientMemberId = (String) vm0.invoke(() -> ClientMembershipDUnitTest.getMemberId());
+    clientMemberId = vm0.invoke(createConnectionPool).toString();
                                                 
     synchronized(listener) {
       if (!fired[JOINED] && !fired[LEFT] && !fired[CRASHED]) {
@@ -1318,29 +1320,30 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
-    String serverMemberId = getMemberId();
+    String serverMemberId = getSystem().getDistributedMember().toString();
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testGetConnectedClients]
ports[0]=" + ports[0]);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testGetConnectedClients]
serverMemberId=" + serverMemberId);
 
     final Host host = Host.getHost(0);
-    SerializableRunnable createPool =
-    new CacheSerializableRunnable("Create connection pool") {
-      public void run2() throws CacheException {
+    SerializableCallable createPool =
+    new SerializableCallable("Create connection pool") {
+      public Object call() {
         com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testGetConnectedClients]
create bridge client");
-        Properties config = new Properties();
-        config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
-        config.setProperty(DistributionConfig.LOCATORS_NAME, "");
+        properties = new Properties();
+        properties.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
+        properties.setProperty(DistributionConfig.LOCATORS_NAME, "");
         // 11/30/2015 this test is periodically failing during distributedTest runs
         // so we are setting the log-level to fine to figure out what's going on
-        config.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
-        getSystem(config);
+        properties.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
+        getSystem(properties);
         AttributesFactory factory = new AttributesFactory();
         factory.setScope(Scope.LOCAL);
         Pool p = ClientServerTestCase.configureConnectionPool(factory, NetworkUtils.getServerHostName(host),
ports, true, -1, -1, null);
         createRegion(name, factory.create());
         assertNotNull(getRootRegion().getSubregion(name));
         assertTrue(p.getServers().size() > 0);
+        return getMemberId();
       }
     };
 
@@ -1350,8 +1353,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     for (int i = 0; i < host.getVMCount(); i++) { 
       final VM vm = Host.getHost(0).getVM(i);
       System.out.println("creating pool in vm_"+i);
-      vm.invoke(createPool);
-      clientMemberIdArray[i] =  String.valueOf(vm.invoke(() -> ClientMembershipDUnitTest.getMemberId()));
+      clientMemberIdArray[i] = vm.invoke(createPool).toString();
     }
     Collection clientMemberIds = Arrays.asList(clientMemberIdArray);
                                                 
@@ -1378,12 +1380,13 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     Map connectedClients = InternalClientMembership.getConnectedClients(false);
     assertNotNull(connectedClients);
     assertEquals(clientMemberIds.size(), connectedClients.size());
+    System.out.println("connectedClients: " + connectedClients + "; clientMemberIds: " +
clientMemberIds);
     for (Iterator iter = connectedClients.keySet().iterator(); iter.hasNext();) {
       String connectedClient = (String)iter.next();
-      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testGetConnectedClients]
checking for client " + connectedClient);
+      System.out.println("[testGetConnectedClients] checking for client " + connectedClient);
       assertTrue(clientMemberIds.contains(connectedClient));
       Object[] result = (Object[])connectedClients.get(connectedClient);
-      com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testGetConnectedClients]
result: " + 
+      System.out.println("[testGetConnectedClients] result: " + 
                           (result==null? "none"
                               : String.valueOf(result[0])+"; connections="+result[1]));
     }
@@ -1496,6 +1499,14 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     return testGetConnectedServers_port;
   }
 
+  
+  public Properties getDistributedSystemProperties() {
+    if (properties == null) {
+      properties = new Properties();
+    }
+    return properties;
+  }
+
   /**
    * Tests getConnectedClients(boolean onlyClientsNotifiedByThisServer) where
    * onlyClientsNotifiedByThisServer is true.
@@ -1556,7 +1567,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase
{
     region.registerInterest("KEY-1");
     region.get("KEY-1");
 
-    final String clientMemberId = getMemberId();
+    final String clientMemberId = getMemberId().toString();
     
     pauseForClientToJoin();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aaa586a4/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
index 5c2f8a2..d9d8858 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
@@ -34,6 +34,7 @@ import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.distributed.internal.LonerDistributionManager;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.VM;
@@ -287,27 +288,26 @@ public class ClientServerTestCase extends CacheTestCase {
     return dm.getDistributionManagerId();
   }*/
 
-  protected static String getMemberId() {
-    final InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance();
+  protected static DistributedMember getMemberId() {
     WaitCriterion w = new WaitCriterion() {
 
       public String description() {
-        return "bridge never finished connecting: " + system.getMemberId();
+        return "client never finished connecting: " + system.getMemberId();
       }
 
       public boolean done() {
 //        getLogWriter().warning("checking member id " + system.getMemberId() +
 //            " for member " + system.getDistributedMember() + " hash " +
 //            System.identityHashCode(system.getDistributedMember()));
-        return !system.getMemberId().contains("):0:");
+        return system.getDistributedMember().getPort() > 0;
       }
       
     };
-    int waitMillis = 10000;
+    int waitMillis = 20000;
     int interval = 100;
     boolean throwException = true;
     Wait.waitForCriterion(w, waitMillis, interval, throwException);
-    return system.getMemberId();
+    return system.getDistributedMember();
   }
 
   protected static DistributedMember getDistributedMember() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aaa586a4/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
index 394a155..d84415a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
@@ -26,14 +26,12 @@ import java.util.Set;
 import com.gemstone.gemfire.InternalGemFireException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
-import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DurableClientAttributes;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
@@ -49,9 +47,10 @@ import com.gemstone.gemfire.management.membership.ClientMembershipListener;
 import com.gemstone.gemfire.management.membership.MembershipEvent;
 import com.gemstone.gemfire.management.membership.MembershipListener;
 import com.gemstone.gemfire.management.membership.UniversalMembershipListenerAdapter;
+import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.IgnoredException;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
-import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
@@ -388,8 +387,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
-    final String serverMemberId = getMemberId();
-    final DistributedMember serverMember = getDistributedMember();
+    final DistributedMember serverMember = getMemberId();
+    final String serverMemberId = serverMember.toString();
     final Properties serverProperties = getSystem().getProperties();
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer]
ports[0]=" + ports[0]);
@@ -409,10 +408,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     adapter.registerMembershipListener(service);
 
 
-    SerializableRunnable createBridgeClient =
-    new CacheSerializableRunnable("Create bridge client") {
+    SerializableCallable createBridgeClient =
+    new SerializableCallable("Create bridge client") {
       @Override
-      public void run2() throws CacheException {
+      public Object call() {
         com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testLonerClientEventsInServer]
create bridge client");
         Properties config = new Properties();
         config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -423,14 +422,14 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         ClientServerTestCase.configureConnectionPool(factory, NetworkUtils.getServerHostName(host),
ports, false, -1, -1, null);
         createRegion(name, factory.create());
         assertNotNull(getRootRegion().getSubregion(name));
+        return getMemberId();
       }
     };
     
 
     // create bridge client in vm0...
-    vm0.invoke(createBridgeClient);
-    String clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    DistributedMember clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+    DistributedMember clientMember = (DistributedMember)vm0.invoke(createBridgeClient);
+    String clientMemberId = clientMember.toString();
                                                 
     // should trigger both adapter and bridge listener but not system listener
     synchronized(adapter) {
@@ -562,9 +561,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
     
     // reconnect bridge client to test for crashed event
-    vm0.invoke(createBridgeClient);
-    clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+    clientMember = (DistributedMember)vm0.invoke(createBridgeClient);
+    clientMemberId = clientMember.toString();
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -840,8 +838,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
-    final String serverMemberId = getMemberId();
-    final DistributedMember serverMember = getDistributedMember();
+    final DistributedMember serverMember = getMemberId();
+    final String serverMemberId = serverMember.toString();
     final Properties serverProperties = getSystem().getProperties();
 
     //Below removed properties are already got copied as cluster SSL properties 
@@ -867,10 +865,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     adapter.registerMembershipListener(service);
     
     
-    SerializableRunnable createBridgeClient =
-    new CacheSerializableRunnable("Create bridge client") {
+    SerializableCallable createBridgeClient =
+    new SerializableCallable("Create bridge client") {
       @Override
-      public void run2() throws CacheException {
+      public Object call() {
         com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[doTestSystemClientEventsInServer]
create system bridge client");
         assertTrue(getSystem(serverProperties).isConnected());
         assertFalse(getCache().isClosed());
@@ -879,13 +877,13 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         ClientServerTestCase.configureConnectionPool(factory, NetworkUtils.getServerHostName(host),
ports, false, -1, -1, null);
         createRegion(name, factory.create());
         assertNotNull(getRootRegion().getSubregion(name));
+        return getMemberId();
       }
     };
 
     // create bridge client in vm0...
-    vm0.invoke(createBridgeClient);
-    String clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    DistributedMember clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+    DistributedMember clientMember = (DistributedMember)vm0.invoke(createBridgeClient);
+    String clientMemberId = clientMember.toString();
                                                 
     // should trigger both adapter and bridge listener but not system listener
     synchronized(adapter) {
@@ -1029,9 +1027,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
     
     // reconnect bridge client
-    vm0.invoke(createBridgeClient);
-    clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+    clientMember = (DistributedMember)vm0.invoke(createBridgeClient);
+    clientMemberId = clientMember.toString();
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -1174,9 +1171,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
     
     // reconnect bridge client
-    vm0.invoke(createBridgeClient);
-    clientMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    clientMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+    clientMember = (DistributedMember)vm0.invoke(createBridgeClient);
+    clientMemberId = clientMember.toString();
                                                 
     synchronized(adapter) {
       if (!firedAdapter[JOINED]) {
@@ -1535,8 +1531,8 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
-    final String serverMemberId = getMemberId();
-    final DistributedMember serverMember = getDistributedMember();
+    final DistributedMember serverMember = getMemberId();
+    final String serverMemberId = serverMember.toString();
     final Properties serverProperties = getSystem().getProperties();
 
     serverProperties.remove(DistributionConfig.SSL_ENABLED_NAME);
@@ -1558,10 +1554,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     adapter.registerMembershipListener(service);
 
     // create BridgeServer in vm0...
-    SerializableRunnable createPeerCache =
-    new CacheSerializableRunnable("Create Peer Cache") {
+    SerializableCallable createPeerCache =
+    new SerializableCallable("Create Peer Cache") {
       @Override
-      public void run2() throws CacheException {
+      public Object call() {
         com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem]
Create Peer cache");
         getSystem(serverProperties);
         AttributesFactory factory = new AttributesFactory();
@@ -1569,13 +1565,12 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         Region region = createRegion(name, factory.create());
         assertNotNull(region);
         assertNotNull(getRootRegion().getSubregion(name));
+        return system.getDistributedMember();
       }
     };
     
-    vm0.invoke(createPeerCache);
-    
-    String peerMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    DistributedMember peerMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
+    DistributedMember peerMember = (DistributedMember)vm0.invoke(createPeerCache);
+    String peerMemberId = peerMember.toString();
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem]
peerMemberId=" + peerMemberId);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInPeerSystem]
peerMember=" + peerMember);
@@ -1836,10 +1831,10 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 //    DistributedMember clientMember = getDistributedMember();
                                                 
     // create BridgeServer in vm0...
-    SerializableRunnable createBridgeServer =
-    new CacheSerializableRunnable("Create BridgeServer") {
+    SerializableCallable createBridgeServer =
+    new SerializableCallable("Create BridgeServer") {
       @Override
-      public void run2() throws CacheException {
+      public Object call() {
         com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient]
Create BridgeServer");
         getSystem();
         AttributesFactory factory = new AttributesFactory();
@@ -1854,16 +1849,16 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
           com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().error(e);
           fail(e.getMessage());
         }
+        return system.getDistributedMember();
       }
     };
     
-    vm0.invoke(createBridgeServer);
+    DistributedMember serverMember = (DistributedMember)vm0.invoke(createBridgeServer);
+    String serverMemberId = serverMember.toString();
     
     // gather details for later creation of pool...
     assertEquals(ports[0],
                  (int) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
-    String serverMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
-    DistributedMember serverMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient]
ports[0]=" + ports[0]);
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient]
serverMemberId=" + serverMemberId);
@@ -2025,12 +2020,12 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     resetArraysForTesting(firedAdapter, memberAdapter, memberIdAdapter, isClientAdapter);
     
     // reconnect bridge client to test for crashed event
-    vm0.invoke(createBridgeServer);
+    serverMember = (DistributedMember)vm0.invoke(createBridgeServer);
+    serverMemberId = serverMember.toString();
     
     // gather details for later creation of pool...
     assertEquals(ports[0],
         (int) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getTestServerEventsInLonerClient_port()));
-    serverMemberId = (String) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getMemberId());
     serverMember = (DistributedMember) vm0.invoke(() -> UniversalMembershipListenerAdapterDUnitTest.getDistributedMember());
 
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("[testServerEventsInLonerClient]
ports[0]=" + ports[0]);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aaa586a4/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestUtils.java
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestUtils.java
index a040a32..c1850de 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestUtils.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestUtils.java
@@ -135,6 +135,7 @@ public class DistributedTestUtils {
       Object value = entry.getValue();
       dsProperties.put(key, value);
     }
+    System.out.println("distributed system properties: " + dsProperties);
     return dsProperties;
   }
   


Mime
View raw message