geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [20/22] geode git commit: Create ClientCachePutBench
Date Thu, 13 Apr 2017 17:18:41 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/407afd93/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/ExperimentTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/ExperimentTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/ExperimentTest.java
new file mode 100644
index 0000000..b52e81d
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/ExperimentTest.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information
regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain
a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
+ * or implied. See the License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package org.apache.geode.internal.cache.tier.sockets.command;
+
+import static org.apache.geode.internal.cache.TXManagerImpl.NOTX;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.*;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.internal.Version;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.TXManagerImpl;
+import org.apache.geode.internal.cache.tier.Command;
+import org.apache.geode.internal.cache.tier.sockets.CacheServerStats;
+import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
+import org.apache.geode.internal.cache.tier.sockets.Message;
+import org.apache.geode.internal.cache.tier.sockets.Part;
+import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
+import org.apache.geode.test.junit.categories.UnitTest;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+
+@Category(UnitTest.class)
+public class ExperimentTest {
+
+  private ServerConnection mockServerConnection;
+
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void before() throws Exception {
+    this.mockServerConnection = mock(ServerConnection.class);
+    when(this.mockServerConnection.getClientVersion()).thenReturn(Version.CURRENT);
+
+    TXManagerImpl txManager = mock(TXManagerImpl.class);
+    GemFireCacheImpl cache = mock(GemFireCacheImpl.class);
+    when(cache.getTxManager()).thenReturn(txManager);
+
+    when(this.mockServerConnection.getCache()).thenReturn(cache);
+
+    CacheServerStats cacheServerStats = mock(CacheServerStats.class);
+    when(this.mockServerConnection.getCacheServerStats()).thenReturn(cacheServerStats);
+
+    // .getDistributedMember()
+    ClientProxyMembershipID mockProxyId = mock(ClientProxyMembershipID.class);
+    when(this.mockServerConnection.getProxyID()).thenReturn(mockProxyId);
+
+    Message errorResponseMessage = mock(Message.class);
+    when(this.mockServerConnection.getErrorResponseMessage()).thenReturn(errorResponseMessage);
+  }
+
+  @Test
+  public void handlePutFromFakeClient() throws Exception {
+    Part regionNamePart = mock(Part.class);
+    when(regionNamePart.getString()).thenReturn("regionNamePart");
+
+    Part operationPart = mock(Part.class);
+    when(operationPart.getObject()).thenReturn(Operation.UPDATE);
+
+    Part flagsPart = mock(Part.class);
+    when(flagsPart.getInt()).thenReturn(0);
+
+    Part keyPart = mock(Part.class);
+    when(keyPart.getObject()).thenReturn("keyPart");
+    when(keyPart.getStringOrObject()).thenReturn("keyPart");
+
+    Part isDeltaPart = mock(Part.class);
+    when(isDeltaPart.getObject()).thenReturn(Boolean.FALSE);
+
+    Part valuePart = mock(Part.class);
+    when(valuePart.getObject()).thenReturn("valuePart");
+
+    Part eventPart = mock(Part.class);
+    when(eventPart.getObject()).thenReturn("eventPart");
+
+    Part callbackArgPart = mock(Part.class);
+    when(callbackArgPart.getObject()).thenReturn("callbackArgPart");
+
+    Message message = mock(Message.class);
+
+    when(message.getTransactionId()).thenReturn(NOTX);
+
+    when(message.getPart(0)).thenReturn(regionNamePart);
+    when(message.getPart(1)).thenReturn(operationPart);
+    when(message.getPart(2)).thenReturn(flagsPart);
+    when(message.getPart(3)).thenReturn(keyPart);
+    when(message.getPart(4)).thenReturn(isDeltaPart);
+    when(message.getPart(5)).thenReturn(valuePart);
+    when(message.getPart(6)).thenReturn(eventPart);
+    when(message.getPart(7)).thenReturn(callbackArgPart);
+
+    assertThat(message.getPart(0)).isSameAs(regionNamePart);
+    assertThat(message.getPart(1)).isSameAs(operationPart);
+    assertThat(message.getPart(2)).isSameAs(flagsPart);
+    assertThat(message.getPart(3)).isSameAs(keyPart);
+    assertThat(message.getPart(4)).isSameAs(isDeltaPart);
+    assertThat(message.getPart(5)).isSameAs(valuePart);
+    assertThat(message.getPart(6)).isSameAs(eventPart);
+    assertThat(message.getPart(7)).isSameAs(callbackArgPart);
+
+    Command command = Put65.getCommand();
+    command.execute(message, this.mockServerConnection);
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/407afd93/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
new file mode 100644
index 0000000..94a2e8b
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information
regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain
a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
+ * or implied. See the License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package org.apache.geode.internal.cache.tier.sockets.command;
+
+import static org.apache.geode.SystemFailure.loadEmergencyClasses;
+import static org.apache.geode.internal.cache.TXManagerImpl.NOTX;
+import static org.mockito.Mockito.*;
+
+import org.apache.geode.cache.Operation;
+import org.apache.geode.internal.Version;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.TXManagerImpl;
+import org.apache.geode.internal.cache.tier.Command;
+import org.apache.geode.internal.cache.tier.sockets.CacheServerStats;
+import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
+import org.apache.geode.internal.cache.tier.sockets.Message;
+import org.apache.geode.internal.cache.tier.sockets.Part;
+import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
+import org.apache.geode.test.junit.categories.UnitTest;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category(UnitTest.class)
+public class Put65BenchTest {
+
+  public Command put65Command;
+  public ServerConnection mockServerConnection;
+  public Message mockMessage;
+
+  @Before
+  public void setup() throws Exception {
+    loadEmergencyClasses();
+
+    this.put65Command = Put65.getCommand();
+
+    this.mockServerConnection =
+        mock(ServerConnection.class, withSettings().name("mockServerConnection"));
+    when(this.mockServerConnection.getClientVersion()).thenReturn(Version.CURRENT);
+
+    GemFireCacheImpl mockCache = mock(GemFireCacheImpl.class, withSettings().name("mockCache"));
+    when(this.mockServerConnection.getCache()).thenReturn(mockCache);
+
+    TXManagerImpl mockTxManager = mock(TXManagerImpl.class, withSettings().name("mockTxManager"));
+    when(mockCache.getTxManager()).thenReturn(mockTxManager);
+
+    CacheServerStats mockCacheServerStats =
+        mock(CacheServerStats.class, withSettings().name("mockCacheServerStats"));
+    when(this.mockServerConnection.getCacheServerStats()).thenReturn(mockCacheServerStats);
+
+    ClientProxyMembershipID mockProxyId =
+        mock(ClientProxyMembershipID.class, withSettings().name("mockProxyId"));
+    when(this.mockServerConnection.getProxyID()).thenReturn(mockProxyId);
+
+    Message mockErrorResponseMessage =
+        mock(Message.class, withSettings().name("mockErrorResponseMessage"));
+    when(this.mockServerConnection.getErrorResponseMessage()).thenReturn(mockErrorResponseMessage);
+
+    Part mockRegionNamePart = mock(Part.class, withSettings().name("mockRegionNamePart"));
+    when(mockRegionNamePart.getString()).thenReturn("mockRegionNamePart");
+
+    Part mockOperationPart = mock(Part.class, withSettings().name("mockOperationPart"));
+    when(mockOperationPart.getObject()).thenReturn(Operation.UPDATE);
+
+    Part mockFlagsPart = mock(Part.class, withSettings().name("mockFlagsPart"));
+    when(mockFlagsPart.getInt()).thenReturn(0);
+
+    Part mockKeyPart = mock(Part.class, withSettings().name("mockKeyPart"));
+    when(mockKeyPart.getObject()).thenReturn("mockKeyPart");
+    when(mockKeyPart.getStringOrObject()).thenReturn("mockKeyPart");
+
+    Part mockIsDeltaPart = mock(Part.class, withSettings().name("mockIsDeltaPart"));
+    when(mockIsDeltaPart.getObject()).thenReturn(Boolean.FALSE);
+
+    Part mockValuePart = mock(Part.class, withSettings().name("mockValuePart"));
+    when(mockValuePart.getObject()).thenReturn("mockValuePart");
+
+    Part mockEventPart = mock(Part.class, withSettings().name("mockEventPart"));
+    when(mockEventPart.getObject()).thenReturn("mockEventPart");
+
+    Part mockCallbackArgPart = mock(Part.class, withSettings().name("mockCallbackArgPart"));
+    when(mockCallbackArgPart.getObject()).thenReturn("mockCallbackArgPart");
+
+    this.mockMessage = mock(Message.class, withSettings().name("mockMessage"));
+
+    when(this.mockMessage.getTransactionId()).thenReturn(NOTX);
+
+    when(this.mockMessage.getPart(0)).thenReturn(mockRegionNamePart);
+    when(this.mockMessage.getPart(1)).thenReturn(mockOperationPart);
+    when(this.mockMessage.getPart(2)).thenReturn(mockFlagsPart);
+    when(this.mockMessage.getPart(3)).thenReturn(mockKeyPart);
+    when(this.mockMessage.getPart(4)).thenReturn(mockIsDeltaPart);
+    when(this.mockMessage.getPart(5)).thenReturn(mockValuePart);
+    when(this.mockMessage.getPart(6)).thenReturn(mockEventPart);
+    when(this.mockMessage.getPart(7)).thenReturn(mockCallbackArgPart);
+  }
+
+  @Test
+  public void benchmark() {
+    this.put65Command.execute(this.mockMessage, this.mockServerConnection);
+    // Message replyMessage = state.mockServerConnection.getReplyMessage();
+    // blackhole.consume(replyMessage);
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/407afd93/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
new file mode 100644
index 0000000..036f6af
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information
regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain
a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
+ * or implied. See the License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package org.apache.geode.internal.cache.tier.sockets.command;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.distributed.ServerLauncherUtils.*;
+import static org.apache.geode.internal.AvailablePort.*;
+import static org.apache.geode.internal.cache.TXManagerImpl.NOTX;
+import static org.apache.geode.internal.cache.tier.sockets.CacheServerUtils.*;
+import static org.mockito.Mockito.*;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.cache.server.CacheServer;
+import org.apache.geode.distributed.ServerLauncher;
+import org.apache.geode.distributed.ServerLauncher.Builder;
+import org.apache.geode.internal.AvailablePort;
+import org.apache.geode.internal.Version;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.TXManagerImpl;
+import org.apache.geode.internal.cache.tier.Command;
+import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
+import org.apache.geode.internal.cache.tier.sockets.CacheServerStats;
+import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
+import org.apache.geode.internal.cache.tier.sockets.Message;
+import org.apache.geode.internal.cache.tier.sockets.Part;
+import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.File;
+
+@Category(IntegrationTest.class)
+public class Put65RealBenchTest {
+
+  private ServerConnection realServerConnection;
+
+  public Command put65Command;
+  public ServerConnection mockServerConnection;
+  public Message mockMessage;
+
+  private File workingDir;
+  private int serverPort;
+
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  @Before
+  public void setup() throws Exception {
+    this.workingDir = temporaryFolder.getRoot();
+
+    this.serverPort = getRandomAvailablePort(SOCKET);
+
+    ServerLauncher serverLauncher = new ServerLauncher.Builder().setMemberName("server1")
+        .setRedirectOutput(true).setWorkingDirectory(this.workingDir.getAbsolutePath())
+        .set(MCAST_PORT, "0").set(LOCATORS, "").build();
+
+    serverLauncher.start();
+
+    Cache cache = getCache(serverLauncher);
+    CacheServer cacheServer = getCacheServer(cache);
+    AcceptorImpl acceptor = getAcceptorImpl(cacheServer);
+
+    this.realServerConnection = null;
+
+    this.mockServerConnection = mock(ServerConnection.class,
+        withSettings().name("mockServerConnection").spiedInstance(this.realServerConnection));
+    when(this.mockServerConnection.getClientVersion()).thenReturn(Version.CURRENT);
+
+    ClientProxyMembershipID mockProxyId =
+        mock(ClientProxyMembershipID.class, withSettings().name("mockProxyId"));
+    when(this.mockServerConnection.getProxyID()).thenReturn(mockProxyId);
+
+    // Message mockErrorResponseMessage =
+    // mock(Message.class, withSettings().name("mockErrorResponseMessage"));
+    // when(this.mockServerConnection.getErrorResponseMessage()).thenReturn(mockErrorResponseMessage);
+
+    Part mockRegionNamePart = mock(Part.class, withSettings().name("mockRegionNamePart"));
+    when(mockRegionNamePart.getString()).thenReturn("mockRegionNamePart");
+
+    Part mockOperationPart = mock(Part.class, withSettings().name("mockOperationPart"));
+    when(mockOperationPart.getObject()).thenReturn(Operation.UPDATE);
+
+    Part mockFlagsPart = mock(Part.class, withSettings().name("mockFlagsPart"));
+    when(mockFlagsPart.getInt()).thenReturn(0);
+
+    Part mockKeyPart = mock(Part.class, withSettings().name("mockKeyPart"));
+    when(mockKeyPart.getObject()).thenReturn("mockKeyPart");
+    when(mockKeyPart.getStringOrObject()).thenReturn("mockKeyPart");
+
+    Part mockIsDeltaPart = mock(Part.class, withSettings().name("mockIsDeltaPart"));
+    when(mockIsDeltaPart.getObject()).thenReturn(Boolean.FALSE);
+
+    Part mockValuePart = mock(Part.class, withSettings().name("mockValuePart"));
+    when(mockValuePart.getObject()).thenReturn("mockValuePart");
+
+    Part mockEventPart = mock(Part.class, withSettings().name("mockEventPart"));
+    when(mockEventPart.getObject()).thenReturn("mockEventPart");
+
+    Part mockCallbackArgPart = mock(Part.class, withSettings().name("mockCallbackArgPart"));
+    when(mockCallbackArgPart.getObject()).thenReturn("mockCallbackArgPart");
+
+    this.mockMessage = mock(Message.class, withSettings().name("mockMessage"));
+
+    when(this.mockMessage.getTransactionId()).thenReturn(NOTX);
+
+    when(this.mockMessage.getPart(0)).thenReturn(mockRegionNamePart);
+    when(this.mockMessage.getPart(1)).thenReturn(mockOperationPart);
+    when(this.mockMessage.getPart(2)).thenReturn(mockFlagsPart);
+    when(this.mockMessage.getPart(3)).thenReturn(mockKeyPart);
+    when(this.mockMessage.getPart(4)).thenReturn(mockIsDeltaPart);
+    when(this.mockMessage.getPart(5)).thenReturn(mockValuePart);
+    when(this.mockMessage.getPart(6)).thenReturn(mockEventPart);
+    when(this.mockMessage.getPart(7)).thenReturn(mockCallbackArgPart);
+
+    this.put65Command = Put65.getCommand();
+  }
+
+  @Test
+  public void benchmark() {
+    this.put65Command.execute(this.mockMessage, this.mockServerConnection);
+    // Message replyMessage = state.mockServerConnection.getReplyMessage();
+    // blackhole.consume(replyMessage);
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/407afd93/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
index 0a45494..a0b41b1 100644
--- a/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientSimpleDUnitTest.java
@@ -2880,7 +2880,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase
{
         public void run2() throws CacheException {
           // Set the Test Hook!
           // This test hook will pause during the drain process
-          CacheClientProxy.testHook = new RejectClientReconnectTestHook();
+          CacheClientProxy.setTestHook(new RejectClientReconnectTestHook());
         }
       });
 
@@ -2909,8 +2909,8 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase
{
           WaitCriterion ev = new WaitCriterion() {
             @Override
             public boolean done() {
-              return CacheClientProxy.testHook != null
-                  && (((RejectClientReconnectTestHook) CacheClientProxy.testHook)
+              return CacheClientProxy.getTestHook() != null
+                  && (((RejectClientReconnectTestHook) CacheClientProxy.getTestHook())
                       .wasClientRejected());
             }
 
@@ -2921,7 +2921,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase
{
           };
           Wait.waitForCriterion(ev, 10 * 1000, 200, true);
           assertTrue(
-              ((RejectClientReconnectTestHook) CacheClientProxy.testHook).wasClientRejected());
+              ((RejectClientReconnectTestHook) CacheClientProxy.getTestHook()).wasClientRejected());
         }
       });
 
@@ -2958,7 +2958,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase
{
       this.server1VM.invoke(new CacheSerializableRunnable("unset test hook") {
         @Override
         public void run2() throws CacheException {
-          CacheClientProxy.testHook = null;
+          CacheClientProxy.unsetTestHook();
         }
       });
     }
@@ -3012,7 +3012,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase
{
 
               // Set the Test Hook!
               // This test hook will pause during the drain process
-              CacheClientProxy.testHook = new CqExceptionDueToActivatingClientTestHook();
+              CacheClientProxy.setTestHook(new CqExceptionDueToActivatingClientTestHook());
 
               final CacheClientNotifier ccnInstance = CacheClientNotifier.getInstance();
               final CacheClientProxy clientProxy = ccnInstance.getClientProxy(durableClientId);
@@ -3072,7 +3072,7 @@ public class DurableClientSimpleDUnitTest extends DurableClientTestCase
{
       this.server1VM.invoke(new CacheSerializableRunnable("unset test hook") {
         @Override
         public void run2() throws CacheException {
-          CacheClientProxy.testHook = null;
+          CacheClientProxy.unsetTestHook();
         }
       });
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/407afd93/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
b/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
index 5533376..5c2620f 100755
--- a/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
+++ b/geode-cq/src/test/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
@@ -439,15 +439,15 @@ public class DurableClientTestCase extends JUnit4DistributedTestCase
{
         // Find the proxy
         CacheClientProxy proxy = getClientProxy();
         assertNotNull(proxy);
-        assertNotNull(proxy._socket);
+        assertNotNull(proxy.getSocketForTesting());
         long end = System.currentTimeMillis() + 60000;
 
-        while (!proxy._socket.isClosed()) {
+        while (!proxy.getSocketForTesting().isClosed()) {
           if (System.currentTimeMillis() > end) {
             break;
           }
         }
-        assertTrue(proxy._socket.isClosed());
+        assertTrue(proxy.getSocketForTesting().isClosed());
       }
     });
 

http://git-wip-us.apache.org/repos/asf/geode/blob/407afd93/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/Simple2CacheServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/Simple2CacheServerDUnitTest.java
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/Simple2CacheServerDUnitTest.java
index d548613..53995df 100755
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/Simple2CacheServerDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/Simple2CacheServerDUnitTest.java
@@ -151,19 +151,19 @@ public class Simple2CacheServerDUnitTest extends WANTestBase {
   }
 
   public static void setCacheClientProxyTestHook() {
-    CacheClientProxy.testHook = new CacheClientProxy.TestHook() {
+    CacheClientProxy.setTestHook(new CacheClientProxy.TestHook() {
       @Override
       public void doTestHook(String spot) {
         if (spot.equals("CLIENT_RECONNECTED")) {
           afterProxyReinitialized++;
         }
       }
-    };
+    });
   }
 
   public static void checkResultAndUnsetCacheClientProxyTestHook() {
     // Reinitialize only happened once
-    CacheClientProxy.testHook = null;
+    CacheClientProxy.unsetTestHook();
     assertEquals(1, afterProxyReinitialized);
     afterProxyReinitialized = 0;
   }


Mime
View raw message